@strapi/data-transfer 5.49.0 → 5.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/directory/providers/destination/index.d.ts +0 -2
- package/dist/directory/providers/destination/index.d.ts.map +1 -1
- package/dist/directory/providers/destination/utils.d.ts +0 -1
- package/dist/directory/providers/destination/utils.d.ts.map +1 -1
- package/dist/directory/providers/source/index.d.ts +0 -1
- package/dist/directory/providers/source/index.d.ts.map +1 -1
- package/dist/engine/index.d.ts +0 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/validation/provider.d.ts +1 -1
- package/dist/engine/validation/provider.d.ts.map +1 -1
- package/dist/engine/validation/schemas/index.d.ts.map +1 -1
- package/dist/file/providers/destination/index.d.ts +0 -3
- package/dist/file/providers/destination/index.d.ts.map +1 -1
- package/dist/file/providers/destination/utils.d.ts +0 -1
- package/dist/file/providers/destination/utils.d.ts.map +1 -1
- package/dist/file/providers/source/index.d.ts +0 -1
- package/dist/file/providers/source/index.d.ts.map +1 -1
- package/dist/file/providers/source/utils.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts +0 -1
- package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/index.d.ts +0 -1
- package/dist/strapi/providers/local-destination/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts +0 -1
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts +0 -1
- package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts +0 -1
- package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/links.js +3 -2
- package/dist/strapi/providers/local-destination/strategies/restore/links.js.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/links.mjs +3 -2
- package/dist/strapi/providers/local-destination/strategies/restore/links.mjs.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.d.ts +10 -0
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.d.ts.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.js +35 -0
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.js.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.mjs +32 -0
- package/dist/strapi/providers/local-destination/strategies/restore/resolve-link-ref.mjs.map +1 -0
- package/dist/strapi/providers/local-source/assets.d.ts +0 -1
- package/dist/strapi/providers/local-source/assets.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/configuration.d.ts +0 -1
- package/dist/strapi/providers/local-source/configuration.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/entities.d.ts +0 -1
- package/dist/strapi/providers/local-source/entities.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/index.d.ts +0 -1
- package/dist/strapi/providers/local-source/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/links.d.ts +0 -1
- package/dist/strapi/providers/local-source/links.d.ts.map +1 -1
- package/dist/strapi/providers/remote-destination/index.d.ts +0 -1
- package/dist/strapi/providers/remote-destination/index.d.ts.map +1 -1
- package/dist/strapi/providers/remote-source/index.d.ts +0 -1
- package/dist/strapi/providers/remote-source/index.d.ts.map +1 -1
- package/dist/strapi/providers/utils.d.ts +9 -9
- package/dist/strapi/providers/utils.d.ts.map +1 -1
- package/dist/strapi/queries/entity.d.ts.map +1 -1
- package/dist/strapi/queries/link.d.ts.map +1 -1
- package/dist/strapi/remote/constants.d.ts.map +1 -1
- package/dist/strapi/remote/flows/default.d.ts.map +1 -1
- package/dist/strapi/remote/flows/index.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/abstract.d.ts +0 -2
- package/dist/strapi/remote/handlers/abstract.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/pull.d.ts +0 -2
- package/dist/strapi/remote/handlers/pull.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/push.d.ts +0 -3
- package/dist/strapi/remote/handlers/push.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/utils.d.ts +0 -1
- package/dist/strapi/remote/handlers/utils.d.ts.map +1 -1
- package/dist/strapi/utils/project-settings-logos.d.ts.map +1 -1
- package/dist/types/common-entities.d.ts +4 -7
- package/dist/types/common-entities.d.ts.map +1 -1
- package/dist/types/encryption.d.ts +4 -2
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/providers.d.ts +0 -1
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/remote/protocol/client/transfer/utils.d.ts +0 -2
- package/dist/types/remote/protocol/client/transfer/utils.d.ts.map +1 -1
- package/dist/types/remote/protocol/server/error.d.ts +8 -8
- package/dist/types/remote/protocol/server/error.d.ts.map +1 -1
- package/dist/types/transfer-engine.d.ts +0 -1
- package/dist/types/transfer-engine.d.ts.map +1 -1
- package/dist/types/utils.d.ts +0 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/utils/components.d.ts +2 -2
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/diagnostic.d.ts.map +1 -1
- package/dist/utils/encryption/decrypt.d.ts +3 -2
- package/dist/utils/encryption/decrypt.d.ts.map +1 -1
- package/dist/utils/encryption/decrypt.js.map +1 -1
- package/dist/utils/encryption/decrypt.mjs.map +1 -1
- package/dist/utils/encryption/encrypt.d.ts +3 -2
- package/dist/utils/encryption/encrypt.d.ts.map +1 -1
- package/dist/utils/encryption/encrypt.js.map +1 -1
- package/dist/utils/encryption/encrypt.mjs.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/middleware.d.ts.map +1 -1
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/stream.d.ts +0 -1
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/transaction.d.ts.map +1 -1
- package/dist/utils/transfer-asset-chunk.d.ts +0 -2
- package/dist/utils/transfer-asset-chunk.d.ts.map +1 -1
- package/dist/utils/transfer-websocket-json.d.ts.map +1 -1
- package/dist/utils/writable-async-write.d.ts +0 -1
- package/dist/utils/writable-async-write.d.ts.map +1 -1
- package/package.json +12 -8
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="stream-chain" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { Writable } from 'stream';
|
|
4
2
|
import type { IDestinationProvider, IDestinationProviderTransferResults, IMetadata, ProviderType } from '../../../types';
|
|
5
3
|
import type { IDiagnosticReporter } from '../../../utils/diagnostic';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/destination/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/destination/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAY,MAAM,QAAQ,CAAC;AAK5C,OAAO,KAAK,EAEV,oBAAoB,EACpB,mCAAmC,EACnC,SAAS,EACT,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIrE,MAAM,WAAW,yCAAyC;IACxD,SAAS,EAAE;QACT,+EAA+E;QAC/E,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iDACf,SAAQ,mCAAmC;IAC3C,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,eAAO,MAAM,uCAAuC,GAClD,SAAS,yCAAyC,sCAGnD,CAAC;AAEF,cAAM,iCAAkC,YAAW,oBAAoB;;IACrE,IAAI,SAAkC;IAEtC,IAAI,EAAE,YAAY,CAAiB;IAEnC,OAAO,EAAE,yCAAyC,CAAC;IAEnD,OAAO,EAAE,iDAAiD,CAAM;gBAQpD,OAAO,EAAE,yCAAyC;IAgB9D,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAG,oBAAoB;IAKtE,SAAS,CAAC,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1D,KAAK;IAIL,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,WAAW;IAcX,wBAAwB;IAWxB,yBAAyB,IAAI,QAAQ;IAWrC,sBAAsB,IAAI,QAAQ;IAWlC,8BAA8B,IAAI,QAAQ;IAW1C,uBAAuB,IAAI,QAAQ;CAwCpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/destination/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/destination/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,SAAS,MAAM,EACf,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,EACvC,gBAAgB,aAwDjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/source/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/directory/providers/source/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AASvC,OAAO,KAAK,EAAU,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AASrE,MAAM,WAAW,oCAAoC;IACnD,SAAS,EAAE;QACT,uFAAuF;QACvF,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,eAAO,MAAM,kCAAkC,GAC7C,SAAS,oCAAoC,iCAG9C,CAAC;AAOF,cAAM,4BAA6B,YAAW,eAAe;;IAC3D,IAAI,EAAE,YAAY,CAAY;IAE9B,IAAI,SAA6B;IAEjC,OAAO,EAAE,oCAAoC,CAAC;gBAQlC,OAAO,EAAE,oCAAoC;IA2BnD,SAAS,CAAC,WAAW,EAAE,mBAAmB;IAkC1C,WAAW;IAQX,UAAU;IAchB,wBAAwB,IAAI,QAAQ;IAKpC,uBAAuB,IAAI,QAAQ;IAKnC,qBAAqB,IAAI,QAAQ;IAKjC,6BAA6B,IAAI,QAAQ;IAKzC,sBAAsB,IAAI,QAAQ;CA8GnC"}
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { PassThrough } from 'stream';
|
|
3
2
|
import type { IDestinationProvider, ISourceProvider, ITransferEngine, ITransferEngineOptions, TransferProgress, ITransferResults, TransferStage, TransferFilters, TransferFilterPreset, SchemaDiffHandler, SchemaDiffHandlerContext, ErrorHandler, ErrorHandlerContext, ErrorCode } from '../types';
|
|
4
3
|
import { IDiagnosticReporter, ErrorDiagnosticSeverity } from '../utils/diagnostic';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,W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+1,4 @@
|
|
|
1
1
|
import type { IDestinationProvider, ISourceProvider, ProviderType } from '../../types';
|
|
2
|
-
declare const validateProvider: <T extends ProviderType>(type: ProviderType, provider?: ([T] extends [
|
|
2
|
+
declare const validateProvider: <T extends ProviderType>(type: ProviderType, provider?: ([T] extends ["source"] ? ISourceProvider : IDestinationProvider) | null) => undefined;
|
|
3
3
|
export { validateProvider };
|
|
4
4
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/engine/validation/provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOvF,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/engine/validation/provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOvF,QAAA,MAAM,gBAAgB,GAAI,CAAC,SAAS,YAAY,EAC9C,MAAM,YAAY,EAClB,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,eAAe,GAAG,oBAAoB,CAAC,GAAG,IAAI,cAapF,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/validation/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAqChD,QAAA,MAAM,UAAU;iBAED,IAAI,EAAE;kBAOL,IAAI,EAAE;CAGrB,CAAC;AAEF,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/validation/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAqChD,QAAA,MAAM,UAAU;iBAED,IAAI,EAAE;kBAOL,IAAI,EAAE;CAGrB,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,MAAM,OAAO,UAAU,WAG1E,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="stream-chain" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
1
|
import zlib from 'zlib';
|
|
5
2
|
import { Writable } from 'stream';
|
|
6
3
|
import type { IDestinationProvider, IDestinationProviderTransferResults, IMetadata, ProviderType } from '../../../types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/destination/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/destination/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAO5C,OAAO,KAAK,EAEV,oBAAoB,EACpB,mCAAmC,EACnC,SAAS,EACT,YAAY,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIrE,MAAM,WAAW,oCAAoC;IACnD,UAAU,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,WAAW,EAAE;QACX,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAEF,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,4CACf,SAAQ,mCAAmC;IAC3C,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,eAAO,MAAM,kCAAkC,GAC7C,SAAS,oCAAoC,iCAG9C,CAAC;AAEF,cAAM,4BAA6B,YAAW,oBAAoB;;IAChE,IAAI,SAA6B;IAEjC,IAAI,EAAE,YAAY,CAAiB;IAEnC,OAAO,EAAE,oCAAoC,CAAC;IAE9C,OAAO,EAAE,4CAA4C,CAAM;gBAQ/C,OAAO,EAAE,oCAAoC;IA+BzD,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAG,oBAAoB;IAM5E,UAAU,IAAI,IAAI,CAAC,IAAI;IAKvB,SAAS,CAAC,WAAW,EAAE,mBAAmB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC3D,KAAK;IAiBL,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/B,WAAW;IA4BX,wBAAwB;IAgBxB,yBAAyB,IAAI,QAAQ;IAgBrC,sBAAsB,IAAI,QAAQ;IAgBlC,8BAA8B,IAAI,QAAQ;IAgB1C,uBAAuB,IAAI,QAAQ;CA8CpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/destination/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/destination/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAC/B,MAAM,MAAM,MACZ,kBAAa,KAAG,MAQhB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,GAC/B,SAAS,GAAG,CAAC,IAAI,EACjB,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,EACvC,gBAAgB,aAsDjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAYvC,OAAO,KAAK,EAAU,SAAS,EAAE,eAAe,EAAE,YAAY,EAAS,MAAM,gBAAgB,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAcrE;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,UAAU,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,WAAW,EAAE;QACX,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,GAAI,SAAS,+BAA+B,4BAErF,CAAC;AAEF,cAAM,uBAAwB,YAAW,eAAe;;IACtD,IAAI,EAAE,YAAY,CAAY;IAE9B,IAAI,SAAwB;IAE5B,OAAO,EAAE,+BAA+B,CAAC;gBAM7B,OAAO,EAAE,+BAA+B;IA4CpD;;OAEG;IACG,SAAS,CAAC,WAAW,EAAE,mBAAmB;IAgC1C,WAAW;IASX,UAAU;IAiBhB,wBAAwB,IAAI,QAAQ;IAKpC,uBAAuB,IAAI,QAAQ;IAKnC,qBAAqB,IAAI,QAAQ;IAKjC,6BAA6B,IAAI,QAAQ;IAMzC,sBAAsB,IAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CAoMvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;KAUK;AAEL;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;KAUK;AAEL;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,EAAE,UAAU,MAAM,YAGzE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,YAM5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,WAOlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-destination-writable.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-destination/assets-destination-writable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets-destination-writable.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-destination/assets-destination-writable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,sCAAsC;IACrD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,mBAAmB,EAAE,CAAC,QAAQ,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,GAAG,SAAS,CAAC;IACtE,2BAA2B,EAAE,OAAO,CAAC;IACrC,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,QAAQ,CAsHV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-destination/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-destination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,QAAQ,CAAC;AAI5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGrE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AASvC,eAAO,MAAM,yBAAyB,UAAc,CAAC;AACrD,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,MAAM,WAAW,sCAAsC;IACrD,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,cAAM,8BAA+B,YAAW,oBAAoB;;IAClE,IAAI,SAA+B;IAEnC,IAAI,EAAE,YAAY,CAAiB;IAEnC,OAAO,EAAE,sCAAsC,CAAC;IAEhD,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,0BAA0B,EAAE,MAAM,CAAC;IAEnC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;gBASxC,OAAO,EAAE,sCAAsC;IAMrD,SAAS,CAAC,WAAW,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmEtB,QAAQ;IAMR,cAAc;IA2BpB,WAAW,IAAI,SAAS;IAcxB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAY3C,yBAAyB,IAAI,QAAQ;IA2F/B,uBAAuB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAoB5C,8BAA8B,IAAI,OAAO,CAAC,QAAQ,CAAC;IAgBnD,sBAAsB,IAAI,OAAO,CAAC,QAAQ,CAAC;CAmBlD;AAED,eAAO,MAAM,oCAAoC,GAC/C,SAAS,sCAAsC,mCAGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAyBnE,eAAO,MAAM,cAAc,GAAU,QAAQ,IAAI,CAAC,MAAM,EAAE,QAAQ,cAAc,iBAQ/E,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,QAAQ,IAAI,CAAC,MAAM,EACnB,cAAc,WAAW,sBAyB1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/entities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIjE,UAAU,6BAA6B;IACrC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IACpB,kBAAkB,CAAC,UAAU,SAAS,GAAG,CAAC,MAAM,EAC9C,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,IAAI,CAAC;IACR,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,eAAO,MAAM,yBAAyB,GAAI,SAAS,6BAA6B,aAgD/E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvD,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,iBAAiB,KAAK,OAAO,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACrC,CAAC;CACH;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACjD;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvD,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,iBAAiB,KAAK,OAAO,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACrC,CAAC;CACH;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACjD;AAED,eAAO,MAAM,aAAa,GAAU,QAAQ,IAAI,CAAC,MAAM,EAAE,SAAS,eAAe;;;;EAShF,CAAC;AAsIF,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAS,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAwB1D,eAAO,MAAM,sBAAsB,GACjC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EACtD,QAAQ,IAAI,CAAC,MAAM,EACnB,cAAc,WAAW,EACzB,YAAY,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,aA6DtC,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var stream = require('stream');
|
|
4
4
|
var providers = require('../../../../../errors/providers.js');
|
|
5
5
|
var link = require('../../../../queries/link.js');
|
|
6
|
+
var resolveLinkRef = require('./resolve-link-ref.js');
|
|
6
7
|
|
|
7
8
|
const isErrorWithCode = (error)=>{
|
|
8
9
|
return error && typeof error.code === 'string';
|
|
@@ -35,8 +36,8 @@ const createLinksWriteStream = (mapID, strapi, transaction, onWarning)=>{
|
|
|
35
36
|
const query = link.createLinkQuery(strapi, trx);
|
|
36
37
|
const originalLeftRef = left.ref;
|
|
37
38
|
const originalRightRef = right.ref;
|
|
38
|
-
const mappedLeftRef =
|
|
39
|
-
const mappedRightRef =
|
|
39
|
+
const mappedLeftRef = resolveLinkRef.resolveLinkRef(strapi, link$1, 'left', mapID);
|
|
40
|
+
const mappedRightRef = resolveLinkRef.resolveLinkRef(strapi, link$1, 'right', mapID);
|
|
40
41
|
// A missing mapping means the referenced row was never transferred
|
|
41
42
|
// during the entities stage (e.g. an orphaned component or a dangling
|
|
42
43
|
// reference in the source database). Falling back to the original ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport type { Core } from '@strapi/types';\nimport { ProviderTransferError } from '../../../../../errors/providers';\nimport { ILink, Transaction } from '../../../../../types';\nimport { createLinkQuery } from '../../../../queries/link';\n\ninterface ErrorWithCode extends Error {\n code: string;\n}\n\nconst isErrorWithCode = (error: any): error is ErrorWithCode => {\n return error && typeof error.code === 'string';\n};\n\nconst isForeignKeyConstraintError = (e: Error) => {\n const MYSQL_FK_ERROR_CODES = ['1452', '1557', '1216', '1217', '1451'];\n const POSTGRES_FK_ERROR_CODE = '23503';\n const SQLITE_FK_ERROR_CODE = 'SQLITE_CONSTRAINT_FOREIGNKEY';\n\n if (isErrorWithCode(e) && e.code) {\n return [SQLITE_FK_ERROR_CODE, POSTGRES_FK_ERROR_CODE, ...MYSQL_FK_ERROR_CODES].includes(e.code);\n }\n\n return e.message.toLowerCase().includes('foreign key constraint');\n};\n\nexport const createLinksWriteStream = (\n mapID: (uid: string, id: number) => number | undefined,\n strapi: Core.Strapi,\n transaction?: Transaction,\n onWarning?: (message: string) => void\n) => {\n return new Writable({\n objectMode: true,\n async write(link: ILink, _encoding, callback) {\n await transaction?.attach(async (trx) => {\n const { left, right } = link;\n const query = createLinkQuery(strapi, trx);\n\n const originalLeftRef = left.ref;\n const originalRightRef = right.ref;\n\n const mappedLeftRef =
|
|
1
|
+
{"version":3,"file":"links.js","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport type { Core } from '@strapi/types';\nimport { ProviderTransferError } from '../../../../../errors/providers';\nimport { ILink, Transaction } from '../../../../../types';\nimport { createLinkQuery } from '../../../../queries/link';\nimport { resolveLinkRef } from './resolve-link-ref';\n\ninterface ErrorWithCode extends Error {\n code: string;\n}\n\nconst isErrorWithCode = (error: any): error is ErrorWithCode => {\n return error && typeof error.code === 'string';\n};\n\nconst isForeignKeyConstraintError = (e: Error) => {\n const MYSQL_FK_ERROR_CODES = ['1452', '1557', '1216', '1217', '1451'];\n const POSTGRES_FK_ERROR_CODE = '23503';\n const SQLITE_FK_ERROR_CODE = 'SQLITE_CONSTRAINT_FOREIGNKEY';\n\n if (isErrorWithCode(e) && e.code) {\n return [SQLITE_FK_ERROR_CODE, POSTGRES_FK_ERROR_CODE, ...MYSQL_FK_ERROR_CODES].includes(e.code);\n }\n\n return e.message.toLowerCase().includes('foreign key constraint');\n};\n\nexport const createLinksWriteStream = (\n mapID: (uid: string, id: number) => number | undefined,\n strapi: Core.Strapi,\n transaction?: Transaction,\n onWarning?: (message: string) => void\n) => {\n return new Writable({\n objectMode: true,\n async write(link: ILink, _encoding, callback) {\n await transaction?.attach(async (trx) => {\n const { left, right } = link;\n const query = createLinkQuery(strapi, trx);\n\n const originalLeftRef = left.ref;\n const originalRightRef = right.ref;\n\n const mappedLeftRef = resolveLinkRef(strapi, link, 'left', mapID);\n const mappedRightRef = resolveLinkRef(strapi, link, 'right', mapID);\n\n // A missing mapping means the referenced row was never transferred\n // during the entities stage (e.g. an orphaned component or a dangling\n // reference in the source database). Falling back to the original ID\n // would either violate a foreign key constraint — which aborts the\n // whole transaction on PostgreSQL — or silently attach the link to an\n // unrelated row, so the link is skipped instead.\n if (mappedLeftRef === undefined || mappedRightRef === undefined) {\n const missingRefs = [\n ...(mappedLeftRef === undefined ? [`${left.type}:${originalLeftRef}`] : []),\n ...(mappedRightRef === undefined ? [`${right.type}:${originalRightRef}`] : []),\n ].join(' and ');\n\n onWarning?.(\n `Skipping link ${left.type}:${originalLeftRef} -> ${right.type}:${originalRightRef} because ${missingRefs} was not transferred during the entities stage.`\n );\n\n return callback(null);\n }\n\n left.ref = mappedLeftRef;\n right.ref = mappedRightRef;\n\n try {\n await query().insert(link);\n } catch (e) {\n if (e instanceof Error) {\n if (isForeignKeyConstraintError(e)) {\n onWarning?.(\n `Skipping link ${left.type}:${originalLeftRef} -> ${right.type}:${originalRightRef} due to a foreign key constraint.`\n );\n return callback(null);\n }\n return callback(e);\n }\n\n return callback(\n new ProviderTransferError(\n `An error happened while trying to import a ${left.type} link.`\n )\n );\n }\n\n callback(null);\n });\n },\n });\n};\n"],"names":["isErrorWithCode","error","code","isForeignKeyConstraintError","e","MYSQL_FK_ERROR_CODES","POSTGRES_FK_ERROR_CODE","SQLITE_FK_ERROR_CODE","includes","message","toLowerCase","createLinksWriteStream","mapID","strapi","transaction","onWarning","Writable","objectMode","write","link","_encoding","callback","attach","trx","left","right","query","createLinkQuery","originalLeftRef","ref","originalRightRef","mappedLeftRef","resolveLinkRef","mappedRightRef","undefined","missingRefs","type","join","insert","Error","ProviderTransferError"],"mappings":";;;;;;;AAWA,MAAMA,kBAAkB,CAACC,KAAAA,GAAAA;AACvB,IAAA,OAAOA,KAAAA,IAAS,OAAOA,KAAAA,CAAMC,IAAI,KAAK,QAAA;AACxC,CAAA;AAEA,MAAMC,8BAA8B,CAACC,CAAAA,GAAAA;AACnC,IAAA,MAAMC,oBAAAA,GAAuB;AAAC,QAAA,MAAA;AAAQ,QAAA,MAAA;AAAQ,QAAA,MAAA;AAAQ,QAAA,MAAA;AAAQ,QAAA;AAAO,KAAA;AACrE,IAAA,MAAMC,sBAAAA,GAAyB,OAAA;AAC/B,IAAA,MAAMC,oBAAAA,GAAuB,8BAAA;AAE7B,IAAA,IAAIP,eAAAA,CAAgBI,CAAAA,CAAAA,IAAMA,CAAAA,CAAEF,IAAI,EAAE;QAChC,OAAO;AAACK,YAAAA,oBAAAA;AAAsBD,YAAAA,sBAAAA;AAA2BD,YAAAA,GAAAA;SAAqB,CAACG,QAAQ,CAACJ,CAAAA,CAAEF,IAA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} from 'stream';
|
|
2
2
|
import { ProviderTransferError } from '../../../../../errors/providers.mjs';
|
|
3
3
|
import { createLinkQuery } from '../../../../queries/link.mjs';
|
|
4
|
+
import { resolveLinkRef } from './resolve-link-ref.mjs';
|
|
4
5
|
|
|
5
6
|
const isErrorWithCode = (error)=>{
|
|
6
7
|
return error && typeof error.code === 'string';
|
|
@@ -33,8 +34,8 @@ const createLinksWriteStream = (mapID, strapi, transaction, onWarning)=>{
|
|
|
33
34
|
const query = createLinkQuery(strapi, trx);
|
|
34
35
|
const originalLeftRef = left.ref;
|
|
35
36
|
const originalRightRef = right.ref;
|
|
36
|
-
const mappedLeftRef =
|
|
37
|
-
const mappedRightRef =
|
|
37
|
+
const mappedLeftRef = resolveLinkRef(strapi, link, 'left', mapID);
|
|
38
|
+
const mappedRightRef = resolveLinkRef(strapi, link, 'right', mapID);
|
|
38
39
|
// A missing mapping means the referenced row was never transferred
|
|
39
40
|
// during the entities stage (e.g. an orphaned component or a dangling
|
|
40
41
|
// reference in the source database). Falling back to the original ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.mjs","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport type { Core } from '@strapi/types';\nimport { ProviderTransferError } from '../../../../../errors/providers';\nimport { ILink, Transaction } from '../../../../../types';\nimport { createLinkQuery } from '../../../../queries/link';\n\ninterface ErrorWithCode extends Error {\n code: string;\n}\n\nconst isErrorWithCode = (error: any): error is ErrorWithCode => {\n return error && typeof error.code === 'string';\n};\n\nconst isForeignKeyConstraintError = (e: Error) => {\n const MYSQL_FK_ERROR_CODES = ['1452', '1557', '1216', '1217', '1451'];\n const POSTGRES_FK_ERROR_CODE = '23503';\n const SQLITE_FK_ERROR_CODE = 'SQLITE_CONSTRAINT_FOREIGNKEY';\n\n if (isErrorWithCode(e) && e.code) {\n return [SQLITE_FK_ERROR_CODE, POSTGRES_FK_ERROR_CODE, ...MYSQL_FK_ERROR_CODES].includes(e.code);\n }\n\n return e.message.toLowerCase().includes('foreign key constraint');\n};\n\nexport const createLinksWriteStream = (\n mapID: (uid: string, id: number) => number | undefined,\n strapi: Core.Strapi,\n transaction?: Transaction,\n onWarning?: (message: string) => void\n) => {\n return new Writable({\n objectMode: true,\n async write(link: ILink, _encoding, callback) {\n await transaction?.attach(async (trx) => {\n const { left, right } = link;\n const query = createLinkQuery(strapi, trx);\n\n const originalLeftRef = left.ref;\n const originalRightRef = right.ref;\n\n const mappedLeftRef =
|
|
1
|
+
{"version":3,"file":"links.mjs","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/links.ts"],"sourcesContent":["import { Writable } from 'stream';\nimport type { Core } from '@strapi/types';\nimport { ProviderTransferError } from '../../../../../errors/providers';\nimport { ILink, Transaction } from '../../../../../types';\nimport { createLinkQuery } from '../../../../queries/link';\nimport { resolveLinkRef } from './resolve-link-ref';\n\ninterface ErrorWithCode extends Error {\n code: string;\n}\n\nconst isErrorWithCode = (error: any): error is ErrorWithCode => {\n return error && typeof error.code === 'string';\n};\n\nconst isForeignKeyConstraintError = (e: Error) => {\n const MYSQL_FK_ERROR_CODES = ['1452', '1557', '1216', '1217', '1451'];\n const POSTGRES_FK_ERROR_CODE = '23503';\n const SQLITE_FK_ERROR_CODE = 'SQLITE_CONSTRAINT_FOREIGNKEY';\n\n if (isErrorWithCode(e) && e.code) {\n return [SQLITE_FK_ERROR_CODE, POSTGRES_FK_ERROR_CODE, ...MYSQL_FK_ERROR_CODES].includes(e.code);\n }\n\n return e.message.toLowerCase().includes('foreign key constraint');\n};\n\nexport const createLinksWriteStream = (\n mapID: (uid: string, id: number) => number | undefined,\n strapi: Core.Strapi,\n transaction?: Transaction,\n onWarning?: (message: string) => void\n) => {\n return new Writable({\n objectMode: true,\n async write(link: ILink, _encoding, callback) {\n await transaction?.attach(async (trx) => {\n const { left, right } = link;\n const query = createLinkQuery(strapi, trx);\n\n const originalLeftRef = left.ref;\n const originalRightRef = right.ref;\n\n const mappedLeftRef = resolveLinkRef(strapi, link, 'left', mapID);\n const mappedRightRef = resolveLinkRef(strapi, link, 'right', mapID);\n\n // A missing mapping means the referenced row was never transferred\n // during the entities stage (e.g. an orphaned component or a dangling\n // reference in the source database). Falling back to the original ID\n // would either violate a foreign key constraint — which aborts the\n // whole transaction on PostgreSQL — or silently attach the link to an\n // unrelated row, so the link is skipped instead.\n if (mappedLeftRef === undefined || mappedRightRef === undefined) {\n const missingRefs = [\n ...(mappedLeftRef === undefined ? [`${left.type}:${originalLeftRef}`] : []),\n ...(mappedRightRef === undefined ? [`${right.type}:${originalRightRef}`] : []),\n ].join(' and ');\n\n onWarning?.(\n `Skipping link ${left.type}:${originalLeftRef} -> ${right.type}:${originalRightRef} because ${missingRefs} was not transferred during the entities stage.`\n );\n\n return callback(null);\n }\n\n left.ref = mappedLeftRef;\n right.ref = mappedRightRef;\n\n try {\n await query().insert(link);\n } catch (e) {\n if (e instanceof Error) {\n if (isForeignKeyConstraintError(e)) {\n onWarning?.(\n `Skipping link ${left.type}:${originalLeftRef} -> ${right.type}:${originalRightRef} due to a foreign key constraint.`\n );\n return callback(null);\n }\n return callback(e);\n }\n\n return callback(\n new ProviderTransferError(\n `An error happened while trying to import a ${left.type} link.`\n )\n );\n }\n\n callback(null);\n });\n },\n });\n};\n"],"names":["isErrorWithCode","error","code","isForeignKeyConstraintError","e","MYSQL_FK_ERROR_CODES","POSTGRES_FK_ERROR_CODE","SQLITE_FK_ERROR_CODE","includes","message","toLowerCase","createLinksWriteStream","mapID","strapi","transaction","onWarning","Writable","objectMode","write","link","_encoding","callback","attach","trx","left","right","query","createLinkQuery","originalLeftRef","ref","originalRightRef","mappedLeftRef","resolveLinkRef","mappedRightRef","undefined","missingRefs","type","join","insert","Error","ProviderTransferError"],"mappings":";;;;;AAWA,MAAMA,kBAAkB,CAACC,KAAAA,GAAAA;AACvB,IAAA,OAAOA,KAAAA,IAAS,OAAOA,KAAAA,CAAMC,IAAI,KAAK,Q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CAAgB,IAAI,EAAEH,MAAMW,IAAI,CAAC,CAAC,EAAEN,gBAAAA,CAAiB,iCAAiC,CAAC,CAAA;AAEvH,4BAAA,OAAOT,QAAAA,CAAS,IAAA,CAAA;AAClB,wBAAA;AACA,wBAAA,OAAOA,QAAAA,CAASjB,CAAAA,CAAAA;AAClB,oBAAA;oBAEA,OAAOiB,QAAAA,CACL,IAAImB,qBAAAA,CACF,CAAC,2CAA2C,EAAEhB,IAAAA,CAAKY,IAAI,CAAC,MAAM,CAAC,CAAA,CAAA;AAGrE,gBAAA;gBAEAf,QAAAA,CAAS,IAAA,CAAA;AACX,YAAA,CAAA,CAAA;AACF,QAAA;AACF,KAAA,CAAA;AACF;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
import type { ILink } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* joinColumn relations (e.g. i18n `localizations`) store `document_id` on the
|
|
5
|
+
* inverse side. Export emits that value as a string ref; restore must not run it
|
|
6
|
+
* through the numeric id mapper.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isDocumentIdJoinColumnTarget: (strapi: Core.Strapi, link: ILink, side: "left" | "right") => boolean;
|
|
9
|
+
export declare const resolveLinkRef: (strapi: Core.Strapi, link: ILink, side: "left" | "right", mapID: (uid: string, id: number) => number | undefined) => number | string | undefined;
|
|
10
|
+
//# sourceMappingURL=resolve-link-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-link-ref.d.ts","sourceRoot":"","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/resolve-link-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,IAAI,CAAC,MAAM,EACnB,MAAM,KAAK,EACX,MAAM,MAAM,GAAG,OAAO,KACrB,OAiBF,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,QAAQ,IAAI,CAAC,MAAM,EACnB,MAAM,KAAK,EACX,MAAM,MAAM,GAAG,OAAO,EACtB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,KACrD,MAAM,GAAG,MAAM,GAAG,SAcpB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* joinColumn relations (e.g. i18n `localizations`) store `document_id` on the
|
|
5
|
+
* inverse side. Export emits that value as a string ref; restore must not run it
|
|
6
|
+
* through the numeric id mapper.
|
|
7
|
+
*/ const isDocumentIdJoinColumnTarget = (strapi, link, side)=>{
|
|
8
|
+
if (side !== 'right') {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const metadata = strapi.db?.metadata?.get(link.left.type);
|
|
12
|
+
const attribute = metadata?.attributes?.[link.left.field];
|
|
13
|
+
if (!attribute || attribute.type !== 'relation') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (!('joinColumn' in attribute) || !attribute.joinColumn) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return attribute.joinColumn.referencedColumn === 'document_id';
|
|
20
|
+
};
|
|
21
|
+
const resolveLinkRef = (strapi, link, side, mapID)=>{
|
|
22
|
+
const { type, ref } = side === 'left' ? link.left : link.right;
|
|
23
|
+
if (isDocumentIdJoinColumnTarget(strapi, link, side)) {
|
|
24
|
+
return ref;
|
|
25
|
+
}
|
|
26
|
+
const numericRef = typeof ref === 'number' ? ref : Number(ref);
|
|
27
|
+
if (!Number.isFinite(numericRef)) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return mapID(type, numericRef);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.isDocumentIdJoinColumnTarget = isDocumentIdJoinColumnTarget;
|
|
34
|
+
exports.resolveLinkRef = resolveLinkRef;
|
|
35
|
+
//# sourceMappingURL=resolve-link-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-link-ref.js","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/resolve-link-ref.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../../../types';\n\n/**\n * joinColumn relations (e.g. i18n `localizations`) store `document_id` on the\n * inverse side. Export emits that value as a string ref; restore must not run it\n * through the numeric id mapper.\n */\nexport const isDocumentIdJoinColumnTarget = (\n strapi: Core.Strapi,\n link: ILink,\n side: 'left' | 'right'\n): boolean => {\n if (side !== 'right') {\n return false;\n }\n\n const metadata = strapi.db?.metadata?.get(link.left.type);\n const attribute = metadata?.attributes?.[link.left.field];\n\n if (!attribute || attribute.type !== 'relation') {\n return false;\n }\n\n if (!('joinColumn' in attribute) || !attribute.joinColumn) {\n return false;\n }\n\n return attribute.joinColumn.referencedColumn === 'document_id';\n};\n\nexport const resolveLinkRef = (\n strapi: Core.Strapi,\n link: ILink,\n side: 'left' | 'right',\n mapID: (uid: string, id: number) => number | undefined\n): number | string | undefined => {\n const { type, ref } = side === 'left' ? link.left : link.right;\n\n if (isDocumentIdJoinColumnTarget(strapi, link, side)) {\n return ref;\n }\n\n const numericRef = typeof ref === 'number' ? ref : Number(ref);\n\n if (!Number.isFinite(numericRef)) {\n return undefined;\n }\n\n return mapID(type, numericRef);\n};\n"],"names":["isDocumentIdJoinColumnTarget","strapi","link","side","metadata","db","get","left","type","attribute","attributes","field","joinColumn","referencedColumn","resolveLinkRef","mapID","ref","right","numericRef","Number","isFinite","undefined"],"mappings":";;AAIA;;;;AAIC,IACM,MAAMA,4BAAAA,GAA+B,CAC1CC,QACAC,IAAAA,EACAC,IAAAA,GAAAA;AAEA,IAAA,IAAIA,SAAS,OAAA,EAAS;QACpB,OAAO,KAAA;AACT,IAAA;IAEA,MAAMC,QAAAA,GAAWH,OAAOI,EAAE,EAAED,UAAUE,GAAAA,CAAIJ,IAAAA,CAAKK,IAAI,CAACC,IAAI,CAAA;IACxD,MAAMC,SAAAA,GAAYL,UAAUM,UAAAA,GAAaR,KAAKK,IAAI,CAACI,KAAK,CAAC;AAEzD,IAAA,IAAI,CAACF,SAAAA,IAAaA,SAAAA,CAAUD,IAAI,KAAK,UAAA,EAAY;QAC/C,OAAO,KAAA;AACT,IAAA;IAEA,IAAI,EAAE,YAAA,IAAgBC,SAAQ,KAAM,CAACA,SAAAA,CAAUG,UAAU,EAAE;QACzD,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,OAAOH,SAAAA,CAAUG,UAAU,CAACC,gBAAgB,KAAK,aAAA;AACnD;AAEO,MAAMC,cAAAA,GAAiB,CAC5Bb,MAAAA,EACAC,MACAC,IAAAA,EACAY,KAAAA,GAAAA;AAEA,IAAA,MAAM,EAAEP,IAAI,EAAEQ,GAAG,EAAE,GAAGb,IAAAA,KAAS,MAAA,GAASD,IAAAA,CAAKK,IAAI,GAAGL,IAAAA,CAAKe,KAAK;IAE9D,IAAIjB,4BAAAA,CAA6BC,MAAAA,EAAQC,IAAAA,EAAMC,IAAAA,CAAAA,EAAO;QACpD,OAAOa,GAAAA;AACT,IAAA;AAEA,IAAA,MAAME,UAAAA,GAAa,OAAOF,GAAAA,KAAQ,QAAA,GAAWA,MAAMG,MAAAA,CAAOH,GAAAA,CAAAA;AAE1D,IAAA,IAAI,CAACG,MAAAA,CAAOC,QAAQ,CAACF,UAAAA,CAAAA,EAAa;QAChC,OAAOG,SAAAA;AACT,IAAA;AAEA,IAAA,OAAON,MAAMP,IAAAA,EAAMU,UAAAA,CAAAA;AACrB;;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* joinColumn relations (e.g. i18n `localizations`) store `document_id` on the
|
|
3
|
+
* inverse side. Export emits that value as a string ref; restore must not run it
|
|
4
|
+
* through the numeric id mapper.
|
|
5
|
+
*/ const isDocumentIdJoinColumnTarget = (strapi, link, side)=>{
|
|
6
|
+
if (side !== 'right') {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const metadata = strapi.db?.metadata?.get(link.left.type);
|
|
10
|
+
const attribute = metadata?.attributes?.[link.left.field];
|
|
11
|
+
if (!attribute || attribute.type !== 'relation') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (!('joinColumn' in attribute) || !attribute.joinColumn) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return attribute.joinColumn.referencedColumn === 'document_id';
|
|
18
|
+
};
|
|
19
|
+
const resolveLinkRef = (strapi, link, side, mapID)=>{
|
|
20
|
+
const { type, ref } = side === 'left' ? link.left : link.right;
|
|
21
|
+
if (isDocumentIdJoinColumnTarget(strapi, link, side)) {
|
|
22
|
+
return ref;
|
|
23
|
+
}
|
|
24
|
+
const numericRef = typeof ref === 'number' ? ref : Number(ref);
|
|
25
|
+
if (!Number.isFinite(numericRef)) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return mapID(type, numericRef);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { isDocumentIdJoinColumnTarget, resolveLinkRef };
|
|
32
|
+
//# sourceMappingURL=resolve-link-ref.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-link-ref.mjs","sources":["../../../../../../src/strapi/providers/local-destination/strategies/restore/resolve-link-ref.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../../../types';\n\n/**\n * joinColumn relations (e.g. i18n `localizations`) store `document_id` on the\n * inverse side. Export emits that value as a string ref; restore must not run it\n * through the numeric id mapper.\n */\nexport const isDocumentIdJoinColumnTarget = (\n strapi: Core.Strapi,\n link: ILink,\n side: 'left' | 'right'\n): boolean => {\n if (side !== 'right') {\n return false;\n }\n\n const metadata = strapi.db?.metadata?.get(link.left.type);\n const attribute = metadata?.attributes?.[link.left.field];\n\n if (!attribute || attribute.type !== 'relation') {\n return false;\n }\n\n if (!('joinColumn' in attribute) || !attribute.joinColumn) {\n return false;\n }\n\n return attribute.joinColumn.referencedColumn === 'document_id';\n};\n\nexport const resolveLinkRef = (\n strapi: Core.Strapi,\n link: ILink,\n side: 'left' | 'right',\n mapID: (uid: string, id: number) => number | undefined\n): number | string | undefined => {\n const { type, ref } = side === 'left' ? link.left : link.right;\n\n if (isDocumentIdJoinColumnTarget(strapi, link, side)) {\n return ref;\n }\n\n const numericRef = typeof ref === 'number' ? ref : Number(ref);\n\n if (!Number.isFinite(numericRef)) {\n return undefined;\n }\n\n return mapID(type, numericRef);\n};\n"],"names":["isDocumentIdJoinColumnTarget","strapi","link","side","metadata","db","get","left","type","attribute","attributes","field","joinColumn","referencedColumn","resolveLinkRef","mapID","ref","right","numericRef","Number","isFinite","undefined"],"mappings":"AAIA;;;;AAIC,IACM,MAAMA,4BAAAA,GAA+B,CAC1CC,QACAC,IAAAA,EACAC,IAAAA,GAAAA;AAEA,IAAA,IAAIA,SAAS,OAAA,EAAS;QACpB,OAAO,KAAA;AACT,IAAA;IAEA,MAAMC,QAAAA,GAAWH,OAAOI,EAAE,EAAED,UAAUE,GAAAA,CAAIJ,IAAAA,CAAKK,IAAI,CAACC,IAAI,CAAA;IACxD,MAAMC,SAAAA,GAAYL,UAAUM,UAAAA,GAAaR,KAAKK,IAAI,CAACI,KAAK,CAAC;AAEzD,IAAA,IAAI,CAACF,SAAAA,IAAaA,SAAAA,CAAUD,IAAI,KAAK,UAAA,EAAY;QAC/C,OAAO,KAAA;AACT,IAAA;IAEA,IAAI,EAAE,YAAA,IAAgBC,SAAQ,KAAM,CAACA,SAAAA,CAAUG,UAAU,EAAE;QACzD,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,OAAOH,SAAAA,CAAUG,UAAU,CAACC,gBAAgB,KAAK,aAAA;AACnD;AAEO,MAAMC,cAAAA,GAAiB,CAC5Bb,MAAAA,EACAC,MACAC,IAAAA,EACAY,KAAAA,GAAAA;AAEA,IAAA,MAAM,EAAEP,IAAI,EAAEQ,GAAG,EAAE,GAAGb,IAAAA,KAAS,MAAA,GAASD,IAAAA,CAAKK,IAAI,GAAGL,IAAAA,CAAKe,KAAK;IAE9D,IAAIjB,4BAAAA,CAA6BC,MAAAA,EAAQC,IAAAA,EAAMC,IAAAA,CAAAA,EAAO;QACpD,OAAOa,GAAAA;AACT,IAAA;AAEA,IAAA,MAAME,UAAAA,GAAa,OAAOF,GAAAA,KAAQ,QAAA,GAAWA,MAAMG,MAAAA,CAAOH,GAAAA,CAAAA;AAE1D,IAAA,IAAI,CAACG,MAAAA,CAAOC,QAAQ,CAACF,UAAAA,CAAAA,EAAa;QAChC,OAAOG,SAAAA;AACT,IAAA;AAEA,IAAA,OAAON,MAAMP,IAAAA,EAAMU,UAAAA,CAAAA;AACrB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/assets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/assets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAyB,MAAM,QAAQ,CAAC;AAGvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAqCpD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,UAAQ,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB3B;AAED,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,iBAiB/E;AAOD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,IAAI,CAAC,MAAM,EACnB,UAAS;IAAE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,KACtD,MAoFF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,IAAI,CAAC,MAAM,KAAG,QAoC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/entities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAU,MAAM,eAAe,CAAC;AAKlD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,IAAI,CAAC,MAAM,EACnB,UAAS;IAAE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAO,KACtD,QA8CF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,QAAO,SAchD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/index.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AG,YAAY,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,IAAI,CAAC,MAAM,KAAG,QAiBvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/remote-destination/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/remote-destination/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAyC,MAAM,UAAU,CAAC;AAEnF,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,YAAY,EAEZ,aAAa,EAEd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AASnF,MAAM,WAAW,uCACf,SAAQ,IAAI,CA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/strapi/providers/remote-source/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/remote-source/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,QAAQ,EAAY,MAAM,QAAQ,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAG/B,OAAO,KAAK,EAEV,SAAS,EACT,eAAe,EACf,8BAA8B,EAC9B,YAAY,EAEZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAkB,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAKtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAYlB,MAAM,WAAW,kCAAmC,SAAQ,iCAAiC;IAC3F,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC;IAC/B,mBAAmB,CAAC,EAAE;QACpB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,sBAAsB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,yHAAyH;IACzH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAKD,cAAM,0BAA2B,YAAW,eAAe;;IACzD,IAAI,SAA2B;IAE/B,IAAI,EAAE,YAAY,CAAY;IAE9B,OAAO,EAAE,kCAAkC,CAAC;IAE5C,EAAE,EAAE,SAAS,GAAG,IAAI,CAAC;IAErB,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAEvD,cAAc,EAAE,OAAO,CAAC,kCAAkC,CAAC,CAGzD;gBAEU,OAAO,EAAE,kCAAkC;IAWvD,OAAO,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IA2ErD,wBAAwB,IAAI,YAAY,CAAC,QAAQ,CAAC;IAIlD,qBAAqB,IAAI,YAAY,CAAC,QAAQ,CAAC;IAIzC,sBAAsB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAgSjD,6BAA6B,IAAI,YAAY,CAAC,QAAQ,CAAC;IAIjD,WAAW,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAM9C,mBAAmB,CAAC,GAAG,EAAE,GAAG;IActB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IA+C/B,SAAS,CAAC,WAAW,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoD3D,KAAK;IAeL,UAAU;IAOV,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAwDhF;AAED,eAAO,MAAM,gCAAgC,GAAI,SAAS,kCAAkC,+BAE3F,CAAC"}
|
|
@@ -20,20 +20,20 @@ type Dispatch<T> = Omit<T, 'transferID' | 'uuid'>;
|
|
|
20
20
|
export declare const createDispatcher: (ws: WebSocket, retryMessageOptions?: RetryMessageOptions, reportInfo?: (message: string) => void) => {
|
|
21
21
|
readonly transferID: string | undefined;
|
|
22
22
|
readonly transferKind: "push" | "pull" | undefined;
|
|
23
|
-
setTransferProperties: (properties: Exclude<IDispatcherState[
|
|
23
|
+
setTransferProperties: (properties: Exclude<IDispatcherState["transfer"], undefined>) => void;
|
|
24
24
|
dispatch: <U = null>(message: Dispatch<Client.Message>, options?: IDispatchOptions) => Promise<U | null>;
|
|
25
|
-
dispatchCommand: <
|
|
26
|
-
command:
|
|
27
|
-
} & ([Client.GetCommandParams<
|
|
28
|
-
params?: Client.GetCommandParams<
|
|
25
|
+
dispatchCommand: <U extends Client.Command>(payload: {
|
|
26
|
+
command: U;
|
|
27
|
+
} & ([Client.GetCommandParams<U>] extends [never] ? unknown : {
|
|
28
|
+
params?: Client.GetCommandParams<U>;
|
|
29
29
|
})) => Promise<null>;
|
|
30
|
-
dispatchTransferAction: <T>(action: Client.Action[
|
|
31
|
-
dispatchTransferStep: <
|
|
30
|
+
dispatchTransferAction: <T>(action: Client.Action["action"]) => Promise<T | null>;
|
|
31
|
+
dispatchTransferStep: <T, A extends Client.TransferPushMessage["action"] = "end" | "stream" | "start", S extends Client.TransferPushStep = "entities" | "links" | "assets" | "configuration">(payload: {
|
|
32
32
|
step: S;
|
|
33
33
|
action: A;
|
|
34
|
-
} & (A extends
|
|
34
|
+
} & (A extends "stream" ? {
|
|
35
35
|
data: Client.GetTransferPushStreamData<S>;
|
|
36
|
-
} : unknown), dispatchOptions?: Omit<IDispatchOptions,
|
|
36
|
+
} : unknown), dispatchOptions?: Omit<IDispatchOptions, "attachTransfer">) => Promise<T | null>;
|
|
37
37
|
};
|
|
38
38
|
type WebsocketParams = ConstructorParameters<typeof WebSocket>;
|
|
39
39
|
type Address = WebsocketParams[0];
|