From 3b2b02d6e80c207d8ae73cbcd1bb877df4feab12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Tue, 5 Apr 2022 16:49:15 +0200 Subject: [PATCH 01/11] Change readme --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d702dfda..1b8241f8 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,13 @@ $ yarn migrate 'http://admin:PASSWORD@localhost:8080' ## Scheduler -The app provides a server-side scheduler script that runs synchronization rules in the background. The script requires Node v10+ and can be executed like this: +The app provides a server-side scheduler script that runs synchronization rules in the background. The script requires Node v10+. + +* Unzip metadata-synchronization-server.zip and can be executed like this: ``` -$ node metadata-synchronization-server.js -c app-config.json +$ cd metadata-synchronization-server +$ node index.js -c app-config.json ``` To connect to the destination instance, it requires a configuration file. If no configuration file is supplied the following is used as a placeholder: @@ -121,6 +124,8 @@ To build the scheduler: $ yarn build-scheduler ``` +This script generate a metadata-synchronization-server.zip file. + ## i18n ### Update an existing language From 9a8e392012f135aa1b7d6451163449d76f3555d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Wed, 6 Apr 2022 06:46:10 +0200 Subject: [PATCH 02/11] Replace deprecated @zeit/ncc by @vercel/ncc --- package.json | 4 ++-- yarn.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3864a343..0407ca55 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "craco-start": "craco start", "start-scheduler": "yarn run-ts --files src/scheduler/cli.ts", "build": "yarn run-ts scripts/run.ts build", - "build-scheduler": "ncc build src/scheduler/cli.ts -m && cp dist/index.js $npm_package_name-server.js", + "build-scheduler": "ncc build src/scheduler/cli.ts -m -o $npm_package_name-server && zip -r $npm_package_name-server.zip $npm_package_name-server && npx rimraf $npm_package_name-server/", "run-ts": "ts-node --files -O '{\"module\":\"commonjs\"}'", "migrate": "yarn run-ts src/migrations/cli.ts", "test": "jest", @@ -104,7 +104,7 @@ "@typescript-eslint/eslint-plugin": "5.0.0", "@typescript-eslint/parser": "5.0.0", "@welldone-software/why-did-you-render": "6.2.1", - "@zeit/ncc": "0.22.3", + "@vercel/ncc": "0.33.3", "babel-core": "6.26.3", "babel-eslint": "10.1.0", "craco": "0.0.3", diff --git a/yarn.lock b/yarn.lock index 84cd9554..30073fa6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3573,6 +3573,11 @@ resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== +"@vercel/ncc@0.33.3": + version "0.33.3" + resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.3.tgz#aacc6b3ea9f7b175e0c9a18c9b97e4005a2f4fcc" + integrity sha512-JGZ11QV+/ZcfudW2Cz2JVp54/pJNXbsuWRgSh2ZmmZdQBKXqBtIGrwI1Wyx8nlbzAiEFe7FHi4K1zX4//jxTnQ== + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -3735,11 +3740,6 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -"@zeit/ncc@0.22.3": - version "0.22.3" - resolved "https://registry.yarnpkg.com/@zeit/ncc/-/ncc-0.22.3.tgz#fca6b86b4454ce7a7e1e7e755165ec06457f16cd" - integrity sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ== - abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" From acb86916d4322f45506d324f4c4d5757bd3416bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Fri, 8 Apr 2022 12:52:16 +0200 Subject: [PATCH 03/11] Fix bugs syncing visualizations --- src/data/transformations/PackageTransformations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/transformations/PackageTransformations.ts b/src/data/transformations/PackageTransformations.ts index 3faa4b26..056b74c3 100644 --- a/src/data/transformations/PackageTransformations.ts +++ b/src/data/transformations/PackageTransformations.ts @@ -271,13 +271,13 @@ export const metadataTransformations: Transformation[] = [ const newCharts = charts.map((chart: any) => { return { - series: (chart.columnDimensions || [])[0], category: (chart.rowDimensions || [])[0], seriesItems: (chart.optionalAxes || []).map(({ dimensionalItem, axis }: any) => ({ series: dimensionalItem, axis, })), ...chart, + series: (chart.columnDimensions || [])[0], }; }); @@ -488,7 +488,7 @@ function getPeriodDataFromYearlySeries(object: any) { .fromPairs() .value(), }, - periods: years.map(year => ({ id: year })), + periods: object.periods?.length > 0 ? object.periods : years.map(year => ({ id: year })), }; return periodsData; From a0b6e74b2ccf7a543c2d7b909c385487fb512702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Mon, 18 Apr 2022 17:17:34 +0200 Subject: [PATCH 04/11] Fix duplicate translations in 2.36 --- i18n/en.pot | 4 +- .../transformations/PackageTransformations.ts | 25 +++++++ .../transformations-api-36.spec.ts | 67 +++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 src/data/transformations/__tests__/integration/transformations-api-36.spec.ts diff --git a/i18n/en.pot b/i18n/en.pot index 588428c0..476d7ebd 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2021-12-30T06:26:16.031Z\n" -"PO-Revision-Date: 2021-12-30T06:26:16.031Z\n" +"POT-Creation-Date: 2022-04-17T09:56:22.073Z\n" +"PO-Revision-Date: 2022-04-17T09:56:22.073Z\n" msgid "" "THIS NEW RELEASE INCLUDES SHARING SETTINGS PER INSTANCES. FOR THIS VERSION " diff --git a/src/data/transformations/PackageTransformations.ts b/src/data/transformations/PackageTransformations.ts index 056b74c3..bc2e60d0 100644 --- a/src/data/transformations/PackageTransformations.ts +++ b/src/data/transformations/PackageTransformations.ts @@ -403,6 +403,31 @@ export const metadataTransformations: Transformation[] = [ } }, }, + { + name: "fix duplicate translations error", + apiVersion: 36, + apply: (metadata: any) => { + const fixedMetadata = _.omitBy(metadata, _.isNil); + + const newMetadata = Object.keys(fixedMetadata).reduce((acc, key) => { + const items = metadata[key].map((item: any) => { + return { + ...item, + translations: item.translations + ? _.uniqWith( + item.translations, + (transA: any, transB: any) => + transA.property === transB.property && transA.locale === transB.locale + ) + : item.translations, + }; + }); + return { ...acc, [key]: items }; + }, {}); + + return newMetadata; + }, + }, ]; const itemsMapping = { diff --git a/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts b/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts new file mode 100644 index 00000000..4f8f1cb9 --- /dev/null +++ b/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts @@ -0,0 +1,67 @@ +import _ from "lodash"; +import { sync } from "./helpers"; + +describe("API 36", () => { + beforeAll(() => { + jest.setTimeout(30000); + }); + + describe("Transformation 2.34 -> 2.36", () => { + it("Remove duplicate transformations", async () => { + const metadata = { + dataElements: [ + { + code: "BU_EPI_Gender", + lastUpdated: "2020-10-30T16:12:08.461", + id: "zqv3IsyTYta", + created: "2018-05-09T22:26:29.218", + name: "BU_EPI_Gender", + shortName: "# BU cases (by gender)", + aggregationType: "SUM", + domainType: "AGGREGATE", + displayName: "BU_EPI_Gender", + translations: [ + { + property: "SHORT_NAME", + locale: "fr", + value: "# cas d'UB par sexe", + }, + { + property: "NAME", + locale: "fr", + value: "Nombre de cas d'ulc�re de Buruli (par genre)", + }, + { + property: "SHORT_NAME", + locale: "fr", + value: "Cas d'ulc�re de Buruli (par genre)", + }, + { + property: "FORM_NAME", + locale: "fr", + value: "Nombre de nouveaux cas d'UB par sexe", + }, + ], + }, + ], + }; + + const { dataElements } = await sync({ + from: "2.34", + to: "2.36", + metadata, + models: ["dataElements"], + }); + + const translations = dataElements["zqv3IsyTYta"].translations as any[]; + + const translationsOldDuplicate = translations.filter( + trans => trans.property === "SHORT_NAME" && trans.locale === "fr" + ); + + expect(translationsOldDuplicate.length).toBe(1); + }); + }); +}); + +export {}; From c27d8a0280e5133bbcabc7a419ebf2fc3f7db62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Wed, 20 Apr 2022 08:18:04 +0200 Subject: [PATCH 05/11] Execute a request for every 50 AggregatedDataElements --- .../tasks/08.remove-coc-inner-mappings.ts | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/data/migrations/tasks/08.remove-coc-inner-mappings.ts b/src/data/migrations/tasks/08.remove-coc-inner-mappings.ts index 2577255c..9bac866a 100644 --- a/src/data/migrations/tasks/08.remove-coc-inner-mappings.ts +++ b/src/data/migrations/tasks/08.remove-coc-inner-mappings.ts @@ -14,6 +14,28 @@ interface InstanceDetails { password?: string; } +async function getMetadata(d2Api: D2Api, ids: string[]): Promise { + const promises = []; + const chunkSize = 50; + + for (let i = 0; i < ids.length; i += chunkSize) { + const requestIds = ids.slice(i, i + chunkSize).toString(); + + promises.push( + d2Api + .get("/metadata", { + fields: "id", + filter: "id:in:[" + requestIds + "]", + }) + .getData() + ); + } + const response = await Promise.all(promises); + const results = _.deepMerge({}, ...response); + if (results.system) delete results.system; + return results; +} + function cleanProgramDataElements(oldProgramDataElements: { [id: string]: MetadataMapping }) { return oldProgramDataElements ? Object.keys(oldProgramDataElements).reduce((previous, key) => { @@ -35,12 +57,8 @@ function cleanProgramDataElements(oldProgramDataElements: { [id: string]: Metada async function cleanAggregatedDataElements(d2Api: D2Api, oldAggregatedItems: { [id: string]: MetadataMapping }) { // aggregatedDataElements mappping key can contain dataElements, indicators and programIndicators // We only need remove categoryOptionCombos from the inner mapping for data elements - const aggregatedMetadata = await d2Api - .get("/metadata", { - fields: "id", - filter: "id:in:[" + Object.keys(oldAggregatedItems) + "]", - }) - .getData(); + const oldAggregatedDataElements = Object.keys(oldAggregatedItems); + const aggregatedMetadata = await getMetadata(d2Api, oldAggregatedDataElements); return oldAggregatedItems ? Object.keys(oldAggregatedItems).reduce((previous, key) => { From 4e2c3ce299706c4ef023fc7f2bc377beeffe464e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Wed, 20 Apr 2022 08:18:22 +0200 Subject: [PATCH 06/11] Fix 409 conflict retrieving events --- i18n/en.pot | 4 ++-- .../pages/MSFHomePagePresenter.ts | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 476d7ebd..b4a11a5f 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2022-04-17T09:56:22.073Z\n" -"PO-Revision-Date: 2022-04-17T09:56:22.073Z\n" +"POT-Creation-Date: 2022-04-19T15:24:23.888Z\n" +"PO-Revision-Date: 2022-04-19T15:24:23.888Z\n" msgid "" "THIS NEW RELEASE INCLUDES SHARING SETTINGS PER INSTANCES. FOR THIS VERSION " diff --git a/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts b/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts index 019b3afa..83d2325e 100644 --- a/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts +++ b/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts @@ -18,7 +18,7 @@ import { formatDateLong } from "../../../../utils/date"; import { availablePeriods } from "../../../../utils/synchronization"; import { CompositionRoot } from "../../../CompositionRoot"; import { AdvancedSettings, MSFSettings } from "./MSFEntities"; -import { NamedRef } from "../../../../domain/common/entities/Ref"; +import { NamedRef, Ref } from "../../../../domain/common/entities/Ref"; type LoggerFunction = (event: string, userType?: "user" | "admin") => void; @@ -140,7 +140,7 @@ async function validatePreviousDataValues( if (!rule.dataParams || !rule.dataParams.period) return undefined; const { startDate } = buildPeriodFromParams(rule.dataParams); - const programs = await getRulePrograms(compositionRoot, rule, instance); + const programStageIds = await getRuleProgramStageIds(compositionRoot, rule, instance); const events = await promiseMap(rule.dataSyncOrgUnitPaths, async orgUnit => { const executionKey = `${rule.id}-${cleanOrgUnitPath(orgUnit)}`; @@ -156,7 +156,7 @@ async function validatePreviousDataValues( orgUnitPaths: [orgUnit], allEvents: true, }, - programs + programStageIds ); }); @@ -479,7 +479,7 @@ async function getRuleDataElements( .value(); } -async function getRulePrograms( +async function getRuleProgramStageIds( compositionRoot: CompositionRoot, rule: SynchronizationRule, instance: Instance @@ -487,15 +487,18 @@ async function getRulePrograms( const { objects } = await compositionRoot.metadata.list( { type: "programIndicators", - fields: { id: true, program: true }, + fields: { id: true, program: { id: true, programStages: true } }, filterRows: rule.metadataIds, paging: false, }, instance ); - return _(objects as Partial[]) - .map(({ program }) => program?.id) + debugger; + + return _(objects as Partial<{ id: string; program: { id: string; programStages: Ref[] } }>[]) + .map(({ program }) => program?.programStages.map(({ id }) => id)) + .flatten() .compact() .uniq() .value(); From 6ee0d573976fc02eb0ab7d213c01756dc99886a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Wed, 20 Apr 2022 09:36:34 +0200 Subject: [PATCH 07/11] Fix lint --- i18n/en.pot | 4 ++-- .../__tests__/integration/transformations-api-36.spec.ts | 1 - .../webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index b4a11a5f..eadbd5fd 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2022-04-19T15:24:23.888Z\n" -"PO-Revision-Date: 2022-04-19T15:24:23.888Z\n" +"POT-Creation-Date: 2022-04-20T06:18:50.161Z\n" +"PO-Revision-Date: 2022-04-20T06:18:50.161Z\n" msgid "" "THIS NEW RELEASE INCLUDES SHARING SETTINGS PER INSTANCES. FOR THIS VERSION " diff --git a/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts b/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts index 4f8f1cb9..1465bfb9 100644 --- a/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts +++ b/src/data/transformations/__tests__/integration/transformations-api-36.spec.ts @@ -1,4 +1,3 @@ -import _ from "lodash"; import { sync } from "./helpers"; describe("API 36", () => { diff --git a/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts b/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts index 83d2325e..b5fe7c12 100644 --- a/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts +++ b/src/presentation/webapp/msf-aggregate-data/pages/MSFHomePagePresenter.ts @@ -4,7 +4,6 @@ import { DataSyncAggregation } from "../../../../domain/aggregated/entities/Data import { DataSyncPeriod } from "../../../../domain/aggregated/entities/DataSyncPeriod"; import { buildPeriodFromParams } from "../../../../domain/aggregated/utils"; import { Instance } from "../../../../domain/instance/entities/Instance"; -import { ProgramIndicator } from "../../../../domain/metadata/entities/MetadataEntities"; import { SynchronizationReport } from "../../../../domain/reports/entities/SynchronizationReport"; import { SynchronizationRule } from "../../../../domain/rules/entities/SynchronizationRule"; import { Store } from "../../../../domain/stores/entities/Store"; @@ -494,8 +493,6 @@ async function getRuleProgramStageIds( instance ); - debugger; - return _(objects as Partial<{ id: string; program: { id: string; programStages: Ref[] } }>[]) .map(({ program }) => program?.programStages.map(({ id }) => id)) .flatten() From 4bb14d0a8aaf0f19ac82af4428c1d9e8d4bbf03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sa=CC=81nchez?= Date: Thu, 21 Apr 2022 11:36:51 +0200 Subject: [PATCH 08/11] Avoid send empty events post --- i18n/en.pot | 4 +- src/data/events/EventsD2ApiRepository.ts | 56 +++++++++++++++--------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index eadbd5fd..ac30c8a9 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2022-04-20T06:18:50.161Z\n" -"PO-Revision-Date: 2022-04-20T06:18:50.161Z\n" +"POT-Creation-Date: 2022-04-21T07:57:05.960Z\n" +"PO-Revision-Date: 2022-04-21T07:57:05.960Z\n" msgid "" "THIS NEW RELEASE INCLUDES SHARING SETTINGS PER INSTANCES. FOR THIS VERSION " diff --git a/src/data/events/EventsD2ApiRepository.ts b/src/data/events/EventsD2ApiRepository.ts index 19a9a57a..e753e0b1 100644 --- a/src/data/events/EventsD2ApiRepository.ts +++ b/src/data/events/EventsD2ApiRepository.ts @@ -183,32 +183,48 @@ export class EventsD2ApiRepository implements EventsRepository { public async save(data: EventsPackage, params: DataImportParams = {}): Promise { try { - const { response } = await this.api.events - .postAsync( - { - idScheme: params.idScheme ?? "UID", - dataElementIdScheme: params.dataElementIdScheme ?? "UID", - orgUnitIdScheme: params.orgUnitIdScheme ?? "UID", - dryRun: params.dryRun ?? false, - preheatCache: params.preheatCache ?? false, - skipExistingCheck: params.skipExistingCheck ?? false, - }, - data - ) - .getData(); - - const result = await this.api.system.waitFor(response.jobType, response.id).getData(); - - if (!result) { + if (data.events.length === 0) { return { - status: "ERROR", + status: "SUCCESS", + stats: { + imported: 0, + updated: 0, + deleted: 0, + ignored: 0, + total: 0, + }, instance: this.instance.toPublicObject(), date: new Date(), type: "events", }; - } + } else { + const { response } = await this.api.events + .postAsync( + { + idScheme: params.idScheme ?? "UID", + dataElementIdScheme: params.dataElementIdScheme ?? "UID", + orgUnitIdScheme: params.orgUnitIdScheme ?? "UID", + dryRun: params.dryRun ?? false, + preheatCache: params.preheatCache ?? false, + skipExistingCheck: params.skipExistingCheck ?? false, + }, + data + ) + .getData(); + + const result = await this.api.system.waitFor(response.jobType, response.id).getData(); - return this.cleanEventsImportResponse(result); + if (!result) { + return { + status: "ERROR", + instance: this.instance.toPublicObject(), + date: new Date(), + type: "events", + }; + } + + return this.cleanEventsImportResponse(result); + } } catch (error: any) { if (error?.response?.data) { return this.cleanEventsImportResponse(error.response.data); From 59a9688cb7d363856bc5eb5c91541b2dc547c6b9 Mon Sep 17 00:00:00 2001 From: xurxodev Date: Thu, 19 May 2022 11:15:44 +0200 Subject: [PATCH 09/11] Enable scheduler execution using ts-node --- .../core/components/mapping-table/{utils.tsx => utils.ts} | 0 src/types/{modules.d.ts => global/index.d.ts} | 0 tsconfig.json | 8 ++++++++ 3 files changed, 8 insertions(+) rename src/presentation/react/core/components/mapping-table/{utils.tsx => utils.ts} (100%) rename src/types/{modules.d.ts => global/index.d.ts} (100%) diff --git a/src/presentation/react/core/components/mapping-table/utils.tsx b/src/presentation/react/core/components/mapping-table/utils.ts similarity index 100% rename from src/presentation/react/core/components/mapping-table/utils.tsx rename to src/presentation/react/core/components/mapping-table/utils.ts diff --git a/src/types/modules.d.ts b/src/types/global/index.d.ts similarity index 100% rename from src/types/modules.d.ts rename to src/types/global/index.d.ts diff --git a/tsconfig.json b/tsconfig.json index b914c6b2..27eccc4d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,12 @@ { + "ts-node": { + // these options are overrides used only by ts-node + // same as our --compilerOptions flag and our TS_NODE_COMPILER_OPTIONS environment variable + "compilerOptions": { + "module": "commonjs", + "typeRoots": ["./src/types", "./node_modules/@types"] + } + }, "compilerOptions": { "target": "es2015", "allowJs": true, From b9fde4b2880f2aba44f144b435491c61ce0e7b88 Mon Sep 17 00:00:00 2001 From: xurxodev Date: Thu, 19 May 2022 11:17:51 +0200 Subject: [PATCH 10/11] Fix error to sync from scheduler: - The problem was undefined auth in local instance --- src/data/instance/InstanceD2ApiRepository.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/instance/InstanceD2ApiRepository.ts b/src/data/instance/InstanceD2ApiRepository.ts index 1f1c193c..1f18ba93 100644 --- a/src/data/instance/InstanceD2ApiRepository.ts +++ b/src/data/instance/InstanceD2ApiRepository.ts @@ -193,7 +193,8 @@ export class InstanceD2ApiRepository implements InstanceRepository { ...data, url: data.type === "local" ? this.instance.url : data.url, version: data.type === "local" ? this.instance.version : data.version, - password: this.decryptPassword(data.password), + username: data.type === "local" ? this.instance.username : data.username, + password: data.type === "local" ? this.instance.password : this.decryptPassword(data.password), ...sharing, }); } From 02218a094be004b115a6adc8adf675dceb5a69ef Mon Sep 17 00:00:00 2001 From: Adrian Quintana Date: Thu, 30 Jun 2022 00:31:57 +0100 Subject: [PATCH 11/11] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0407ca55..6e57e277 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "metadata-synchronization", "description": "Advanced metadata & data synchronization utility", - "version": "2.15.0", + "version": "2.16.0", "license": "GPL-3.0", "author": "EyeSeeTea team", "homepage": ".",