@strapi/data-transfer 0.0.0-experimental.62ce06180fe9a772eaeb3d43d238b26644f39f7c → 0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282
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/LICENSE +19 -4
- package/dist/directory/index.d.ts +2 -0
- package/dist/directory/index.d.ts.map +1 -0
- package/dist/directory/index.js +8 -0
- package/dist/directory/index.js.map +1 -0
- package/dist/directory/index.mjs +3 -0
- package/dist/directory/index.mjs.map +1 -0
- package/dist/directory/providers/destination/index.d.ts +38 -0
- package/dist/directory/providers/destination/index.d.ts.map +1 -0
- package/dist/directory/providers/destination/index.js +184 -0
- package/dist/directory/providers/destination/index.js.map +1 -0
- package/dist/directory/providers/destination/index.mjs +177 -0
- package/dist/directory/providers/destination/index.mjs.map +1 -0
- package/dist/directory/providers/destination/utils.d.ts +8 -0
- package/dist/directory/providers/destination/utils.d.ts.map +1 -0
- package/dist/directory/providers/destination/utils.js +62 -0
- package/dist/directory/providers/destination/utils.js.map +1 -0
- package/dist/directory/providers/destination/utils.mjs +56 -0
- package/dist/directory/providers/destination/utils.mjs.map +1 -0
- package/dist/directory/providers/index.d.ts +3 -0
- package/dist/directory/providers/index.d.ts.map +1 -0
- package/dist/directory/providers/index.js +10 -0
- package/dist/directory/providers/index.js.map +1 -0
- package/dist/directory/providers/index.mjs +3 -0
- package/dist/directory/providers/index.mjs.map +1 -0
- package/dist/directory/providers/source/index.d.ts +27 -0
- package/dist/directory/providers/source/index.d.ts.map +1 -0
- package/dist/directory/providers/source/index.js +266 -0
- package/dist/directory/providers/source/index.js.map +1 -0
- package/dist/directory/providers/source/index.mjs +259 -0
- package/dist/directory/providers/source/index.mjs.map +1 -0
- package/dist/engine/errors.js +39 -0
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/errors.mjs +34 -0
- package/dist/engine/errors.mjs.map +1 -0
- package/dist/engine/index.d.ts +2 -3
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +922 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/index.mjs +917 -0
- package/dist/engine/index.mjs.map +1 -0
- package/dist/engine/validation/provider.d.ts +2 -2
- package/dist/engine/validation/provider.d.ts.map +1 -1
- package/dist/engine/validation/provider.js +19 -0
- package/dist/engine/validation/provider.js.map +1 -0
- package/dist/engine/validation/provider.mjs +17 -0
- package/dist/engine/validation/provider.mjs.map +1 -0
- package/dist/engine/validation/schemas/index.d.ts.map +1 -1
- package/dist/engine/validation/schemas/index.js +59 -0
- package/dist/engine/validation/schemas/index.js.map +1 -0
- package/dist/engine/validation/schemas/index.mjs +57 -0
- package/dist/engine/validation/schemas/index.mjs.map +1 -0
- package/dist/errors/base.js +13 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/base.mjs +11 -0
- package/dist/errors/base.mjs.map +1 -0
- package/dist/errors/constants.d.ts +1 -1
- package/dist/errors/constants.d.ts.map +1 -1
- package/dist/errors/constants.js +9 -0
- package/dist/errors/constants.js.map +1 -0
- package/dist/errors/constants.mjs +7 -0
- package/dist/errors/constants.mjs.map +1 -0
- package/dist/errors/providers.d.ts +1 -1
- package/dist/errors/providers.d.ts.map +1 -1
- package/dist/errors/providers.js +41 -0
- package/dist/errors/providers.js.map +1 -0
- package/dist/errors/providers.mjs +36 -0
- package/dist/errors/providers.mjs.map +1 -0
- package/dist/file/index.js +8 -0
- package/dist/file/index.js.map +1 -0
- package/dist/file/index.mjs +3 -0
- package/dist/file/index.mjs.map +1 -0
- package/dist/file/providers/destination/index.d.ts +3 -5
- package/dist/file/providers/destination/index.d.ts.map +1 -1
- package/dist/file/providers/destination/index.js +254 -0
- package/dist/file/providers/destination/index.js.map +1 -0
- package/dist/file/providers/destination/index.mjs +246 -0
- package/dist/file/providers/destination/index.mjs.map +1 -0
- 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/destination/utils.js +63 -0
- package/dist/file/providers/destination/utils.js.map +1 -0
- package/dist/file/providers/destination/utils.mjs +60 -0
- package/dist/file/providers/destination/utils.mjs.map +1 -0
- package/dist/file/providers/index.js +10 -0
- package/dist/file/providers/index.js.map +1 -0
- package/dist/file/providers/index.mjs +3 -0
- package/dist/file/providers/index.mjs.map +1 -0
- package/dist/file/providers/source/index.d.ts +3 -3
- package/dist/file/providers/source/index.d.ts.map +1 -1
- package/dist/file/providers/source/index.js +336 -0
- package/dist/file/providers/source/index.js.map +1 -0
- package/dist/file/providers/source/index.mjs +328 -0
- package/dist/file/providers/source/index.mjs.map +1 -0
- package/dist/file/providers/source/utils.d.ts.map +1 -1
- package/dist/file/providers/source/utils.js +60 -0
- package/dist/file/providers/source/utils.js.map +1 -0
- package/dist/file/providers/source/utils.mjs +52 -0
- package/dist/file/providers/source/utils.mjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -4408
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4382
- package/dist/index.mjs.map +1 -1
- package/dist/strapi/index.js +12 -0
- package/dist/strapi/index.js.map +1 -0
- package/dist/strapi/index.mjs +7 -0
- package/dist/strapi/index.mjs.map +1 -0
- package/dist/strapi/providers/index.js +18 -0
- package/dist/strapi/providers/index.js.map +1 -0
- package/dist/strapi/providers/index.mjs +8 -0
- package/dist/strapi/providers/index.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts +26 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts.map +1 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.js +125 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.js.map +1 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.mjs +123 -0
- package/dist/strapi/providers/local-destination/assets-destination-writable.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/index.d.ts +5 -3
- package/dist/strapi/providers/local-destination/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/index.js +362 -0
- package/dist/strapi/providers/local-destination/index.js.map +1 -0
- package/dist/strapi/providers/local-destination/index.mjs +335 -0
- package/dist/strapi/providers/local-destination/index.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts +1 -2
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.js +58 -0
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.js.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.mjs +51 -0
- package/dist/strapi/providers/local-destination/strategies/restore/configuration.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts +1 -2
- package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/entities.js +54 -0
- package/dist/strapi/providers/local-destination/strategies/restore/entities.js.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/entities.mjs +52 -0
- package/dist/strapi/providers/local-destination/strategies/restore/entities.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/index.js +124 -0
- package/dist/strapi/providers/local-destination/strategies/restore/index.js.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/index.mjs +120 -0
- package/dist/strapi/providers/local-destination/strategies/restore/index.mjs.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts +1 -2
- package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts.map +1 -1
- package/dist/strapi/providers/local-destination/strategies/restore/links.js +79 -0
- package/dist/strapi/providers/local-destination/strategies/restore/links.js.map +1 -0
- package/dist/strapi/providers/local-destination/strategies/restore/links.mjs +77 -0
- package/dist/strapi/providers/local-destination/strategies/restore/links.mjs.map +1 -0
- package/dist/strapi/providers/local-source/assets.d.ts +8 -2
- package/dist/strapi/providers/local-source/assets.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/assets.js +151 -0
- package/dist/strapi/providers/local-source/assets.js.map +1 -0
- package/dist/strapi/providers/local-source/assets.mjs +147 -0
- package/dist/strapi/providers/local-source/assets.mjs.map +1 -0
- 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/configuration.js +47 -0
- package/dist/strapi/providers/local-source/configuration.js.map +1 -0
- package/dist/strapi/providers/local-source/configuration.mjs +45 -0
- package/dist/strapi/providers/local-source/configuration.mjs.map +1 -0
- package/dist/strapi/providers/local-source/entities.d.ts +3 -2
- package/dist/strapi/providers/local-source/entities.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/entities.js +66 -0
- package/dist/strapi/providers/local-source/entities.js.map +1 -0
- package/dist/strapi/providers/local-source/entities.mjs +63 -0
- package/dist/strapi/providers/local-source/entities.mjs.map +1 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.d.ts +11 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.d.ts.map +1 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.js +130 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.js.map +1 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.mjs +128 -0
- package/dist/strapi/providers/local-source/estimate-asset-totals.mjs.map +1 -0
- package/dist/strapi/providers/local-source/index.d.ts +6 -4
- package/dist/strapi/providers/local-source/index.d.ts.map +1 -1
- package/dist/strapi/providers/local-source/index.js +186 -0
- package/dist/strapi/providers/local-source/index.js.map +1 -0
- package/dist/strapi/providers/local-source/index.mjs +183 -0
- package/dist/strapi/providers/local-source/index.mjs.map +1 -0
- 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/local-source/links.js +26 -0
- package/dist/strapi/providers/local-source/links.js.map +1 -0
- package/dist/strapi/providers/local-source/links.mjs +24 -0
- package/dist/strapi/providers/local-source/links.mjs.map +1 -0
- package/dist/strapi/providers/remote-destination/index.d.ts +13 -5
- package/dist/strapi/providers/remote-destination/index.d.ts.map +1 -1
- package/dist/strapi/providers/remote-destination/index.js +482 -0
- package/dist/strapi/providers/remote-destination/index.js.map +1 -0
- package/dist/strapi/providers/remote-destination/index.mjs +480 -0
- package/dist/strapi/providers/remote-destination/index.mjs.map +1 -0
- package/dist/strapi/providers/remote-source/index.d.ts +11 -6
- package/dist/strapi/providers/remote-source/index.d.ts.map +1 -1
- package/dist/strapi/providers/remote-source/index.js +538 -0
- package/dist/strapi/providers/remote-source/index.js.map +1 -0
- package/dist/strapi/providers/remote-source/index.mjs +536 -0
- package/dist/strapi/providers/remote-source/index.mjs.map +1 -0
- package/dist/strapi/providers/utils.d.ts +22 -16
- package/dist/strapi/providers/utils.d.ts.map +1 -1
- package/dist/strapi/providers/utils.js +178 -0
- package/dist/strapi/providers/utils.js.map +1 -0
- package/dist/strapi/providers/utils.mjs +174 -0
- package/dist/strapi/providers/utils.mjs.map +1 -0
- package/dist/strapi/queries/entity.d.ts.map +1 -1
- package/dist/strapi/queries/entity.js +125 -0
- package/dist/strapi/queries/entity.js.map +1 -0
- package/dist/strapi/queries/entity.mjs +123 -0
- package/dist/strapi/queries/entity.mjs.map +1 -0
- package/dist/strapi/queries/index.js +10 -0
- package/dist/strapi/queries/index.js.map +1 -0
- package/dist/strapi/queries/index.mjs +5 -0
- package/dist/strapi/queries/index.mjs.map +1 -0
- package/dist/strapi/queries/link.d.ts +1 -1
- package/dist/strapi/queries/link.d.ts.map +1 -1
- package/dist/strapi/queries/link.js +298 -0
- package/dist/strapi/queries/link.js.map +1 -0
- package/dist/strapi/queries/link.mjs +295 -0
- package/dist/strapi/queries/link.mjs.map +1 -0
- package/dist/strapi/remote/constants.d.ts.map +1 -1
- package/dist/strapi/remote/constants.js +11 -0
- package/dist/strapi/remote/constants.js.map +1 -0
- package/dist/strapi/remote/constants.mjs +8 -0
- package/dist/strapi/remote/constants.mjs.map +1 -0
- package/dist/strapi/remote/flows/default.d.ts.map +1 -1
- package/dist/strapi/remote/flows/default.js +43 -0
- package/dist/strapi/remote/flows/default.js.map +1 -0
- package/dist/strapi/remote/flows/default.mjs +41 -0
- package/dist/strapi/remote/flows/default.mjs.map +1 -0
- package/dist/strapi/remote/flows/index.d.ts +1 -1
- package/dist/strapi/remote/flows/index.d.ts.map +1 -1
- package/dist/strapi/remote/flows/index.js +54 -0
- package/dist/strapi/remote/flows/index.js.map +1 -0
- package/dist/strapi/remote/flows/index.mjs +52 -0
- package/dist/strapi/remote/flows/index.mjs.map +1 -0
- package/dist/strapi/remote/handlers/abstract.d.ts +4 -1
- package/dist/strapi/remote/handlers/abstract.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/constants.js +10 -0
- package/dist/strapi/remote/handlers/constants.js.map +1 -0
- package/dist/strapi/remote/handlers/constants.mjs +8 -0
- package/dist/strapi/remote/handlers/constants.mjs.map +1 -0
- package/dist/strapi/remote/handlers/index.js +12 -0
- package/dist/strapi/remote/handlers/index.js.map +1 -0
- package/dist/strapi/remote/handlers/index.mjs +4 -0
- package/dist/strapi/remote/handlers/index.mjs.map +1 -0
- package/dist/strapi/remote/handlers/pull.d.ts +2 -3
- package/dist/strapi/remote/handlers/pull.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/pull.js +369 -0
- package/dist/strapi/remote/handlers/pull.js.map +1 -0
- package/dist/strapi/remote/handlers/pull.mjs +367 -0
- package/dist/strapi/remote/handlers/pull.mjs.map +1 -0
- package/dist/strapi/remote/handlers/push.d.ts +16 -5
- package/dist/strapi/remote/handlers/push.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/push.js +454 -0
- package/dist/strapi/remote/handlers/push.js.map +1 -0
- package/dist/strapi/remote/handlers/push.mjs +452 -0
- package/dist/strapi/remote/handlers/push.mjs.map +1 -0
- package/dist/strapi/remote/handlers/utils.d.ts +1 -2
- package/dist/strapi/remote/handlers/utils.d.ts.map +1 -1
- package/dist/strapi/remote/handlers/utils.js +318 -0
- package/dist/strapi/remote/handlers/utils.js.map +1 -0
- package/dist/strapi/remote/handlers/utils.mjs +312 -0
- package/dist/strapi/remote/handlers/utils.mjs.map +1 -0
- package/dist/strapi/remote/index.js +10 -0
- package/dist/strapi/remote/index.js.map +1 -0
- package/dist/strapi/remote/index.mjs +5 -0
- package/dist/strapi/remote/index.mjs.map +1 -0
- package/dist/strapi/utils/project-settings-logos.d.ts +29 -0
- package/dist/strapi/utils/project-settings-logos.d.ts.map +1 -0
- package/dist/strapi/utils/project-settings-logos.js +174 -0
- package/dist/strapi/utils/project-settings-logos.js.map +1 -0
- package/dist/strapi/utils/project-settings-logos.mjs +169 -0
- package/dist/strapi/utils/project-settings-logos.mjs.map +1 -0
- package/dist/types/common-entities.d.ts +149 -0
- package/dist/types/common-entities.d.ts.map +1 -0
- package/dist/types/encryption.d.ts +13 -0
- package/dist/types/encryption.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/providers.d.ts +49 -0
- package/dist/types/providers.d.ts.map +1 -0
- package/dist/types/remote/index.d.ts +2 -0
- package/dist/types/remote/index.d.ts.map +1 -0
- package/dist/types/remote/protocol/auth.d.ts +5 -0
- package/dist/types/remote/protocol/auth.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/commands.d.ts +37 -0
- package/dist/types/remote/protocol/client/commands.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/index.d.ts +9 -0
- package/dist/types/remote/protocol/client/index.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/transfer/action.d.ts +5 -0
- package/dist/types/remote/protocol/client/transfer/action.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/transfer/index.d.ts +12 -0
- package/dist/types/remote/protocol/client/transfer/index.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/transfer/pull.d.ts +25 -0
- package/dist/types/remote/protocol/client/transfer/pull.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/transfer/push.d.ts +29 -0
- package/dist/types/remote/protocol/client/transfer/push.d.ts.map +1 -0
- package/dist/types/remote/protocol/client/transfer/utils.d.ts +47 -0
- package/dist/types/remote/protocol/client/transfer/utils.d.ts.map +1 -0
- package/dist/types/remote/protocol/index.d.ts +4 -0
- package/dist/types/remote/protocol/index.d.ts.map +1 -0
- package/dist/types/remote/protocol/server/error.d.ts +18 -0
- package/dist/types/remote/protocol/server/error.d.ts.map +1 -0
- package/dist/types/remote/protocol/server/index.d.ts +3 -0
- package/dist/types/remote/protocol/server/index.d.ts.map +1 -0
- package/dist/types/remote/protocol/server/messaging.d.ts +37 -0
- package/dist/types/remote/protocol/server/messaging.d.ts.map +1 -0
- package/dist/types/transfer-engine.d.ts +148 -0
- package/dist/types/transfer-engine.d.ts.map +1 -0
- package/dist/types/utils.d.ts +82 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/utils/components.d.ts +23 -3
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/components.js +230 -0
- package/dist/utils/components.js.map +1 -0
- package/dist/utils/components.mjs +219 -0
- package/dist/utils/components.mjs.map +1 -0
- package/dist/{engine → utils}/diagnostic.d.ts +1 -0
- package/dist/utils/diagnostic.d.ts.map +1 -0
- package/dist/utils/diagnostic.js +51 -0
- package/dist/utils/diagnostic.js.map +1 -0
- package/dist/utils/diagnostic.mjs +49 -0
- package/dist/utils/diagnostic.mjs.map +1 -0
- package/dist/utils/encryption/decrypt.d.ts +6 -5
- package/dist/utils/encryption/decrypt.d.ts.map +1 -1
- package/dist/utils/encryption/decrypt.js +47 -0
- package/dist/utils/encryption/decrypt.js.map +1 -0
- package/dist/utils/encryption/decrypt.mjs +45 -0
- package/dist/utils/encryption/decrypt.mjs.map +1 -0
- package/dist/utils/encryption/encrypt.d.ts +6 -5
- package/dist/utils/encryption/encrypt.d.ts.map +1 -1
- package/dist/utils/encryption/encrypt.js +47 -0
- package/dist/utils/encryption/encrypt.js.map +1 -0
- package/dist/utils/encryption/encrypt.mjs +45 -0
- package/dist/utils/encryption/encrypt.mjs.map +1 -0
- package/dist/utils/encryption/index.js +10 -0
- package/dist/utils/encryption/index.js.map +1 -0
- package/dist/utils/encryption/index.mjs +3 -0
- package/dist/utils/encryption/index.mjs.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +28 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +17 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js +96 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/json.mjs +94 -0
- package/dist/utils/json.mjs.map +1 -0
- package/dist/utils/middleware.d.ts +1 -1
- package/dist/utils/middleware.d.ts.map +1 -1
- package/dist/utils/middleware.js +14 -0
- package/dist/utils/middleware.js.map +1 -0
- package/dist/utils/middleware.mjs +12 -0
- package/dist/utils/middleware.mjs.map +1 -0
- package/dist/utils/providers.js +12 -0
- package/dist/utils/providers.js.map +1 -0
- package/dist/utils/providers.mjs +10 -0
- package/dist/utils/providers.mjs.map +1 -0
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +32 -0
- package/dist/utils/schema.js.map +1 -0
- package/dist/utils/schema.mjs +29 -0
- package/dist/utils/schema.mjs.map +1 -0
- package/dist/utils/stream.d.ts +0 -1
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/stream.js +96 -0
- package/dist/utils/stream.js.map +1 -0
- package/dist/utils/stream.mjs +92 -0
- package/dist/utils/stream.mjs.map +1 -0
- package/dist/utils/transaction.d.ts +1 -1
- package/dist/utils/transaction.d.ts.map +1 -1
- package/dist/utils/transaction.js +93 -0
- package/dist/utils/transaction.js.map +1 -0
- package/dist/utils/transaction.mjs +91 -0
- package/dist/utils/transaction.mjs.map +1 -0
- package/dist/utils/transfer-asset-chunk.d.ts +61 -0
- package/dist/utils/transfer-asset-chunk.d.ts.map +1 -0
- package/dist/utils/transfer-asset-chunk.js +118 -0
- package/dist/utils/transfer-asset-chunk.js.map +1 -0
- package/dist/utils/transfer-asset-chunk.mjs +112 -0
- package/dist/utils/transfer-asset-chunk.mjs.map +1 -0
- package/dist/utils/transfer-websocket-json.d.ts +24 -0
- package/dist/utils/transfer-websocket-json.d.ts.map +1 -0
- package/dist/utils/transfer-websocket-json.js +67 -0
- package/dist/utils/transfer-websocket-json.js.map +1 -0
- package/dist/utils/transfer-websocket-json.mjs +63 -0
- package/dist/utils/transfer-websocket-json.mjs.map +1 -0
- package/dist/utils/writable-async-write.d.ts +16 -0
- package/dist/utils/writable-async-write.d.ts.map +1 -0
- package/dist/utils/writable-async-write.js +61 -0
- package/dist/utils/writable-async-write.js.map +1 -0
- package/dist/utils/writable-async-write.mjs +59 -0
- package/dist/utils/writable-async-write.mjs.map +1 -0
- package/package.json +40 -26
- package/dist/engine/diagnostic.d.ts.map +0 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Readable } from 'stream';
|
|
2
|
+
import { chain } from 'stream-chain';
|
|
3
|
+
import { createEntitiesStream, createEntitiesTransformStream } from './entities.mjs';
|
|
4
|
+
import { createLinksStream } from './links.mjs';
|
|
5
|
+
import { createConfigurationStream } from './configuration.mjs';
|
|
6
|
+
import { createAssetsStream } from './assets.mjs';
|
|
7
|
+
import { estimateAssetTotals } from './estimate-asset-totals.mjs';
|
|
8
|
+
import 'crypto';
|
|
9
|
+
import 'node:events';
|
|
10
|
+
import 'node:stream/promises';
|
|
11
|
+
import 'lodash/fp';
|
|
12
|
+
import { schemasToValidJSON, mapSchemasValues } from '../../../utils/schema.mjs';
|
|
13
|
+
import 'events';
|
|
14
|
+
import { assertValidStrapi } from '../../../utils/providers.mjs';
|
|
15
|
+
|
|
16
|
+
function _class_private_field_loose_base(receiver, privateKey) {
|
|
17
|
+
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
|
|
18
|
+
throw new TypeError("attempted to use private field on non-instance");
|
|
19
|
+
}
|
|
20
|
+
return receiver;
|
|
21
|
+
}
|
|
22
|
+
var id = 0;
|
|
23
|
+
function _class_private_field_loose_key(name) {
|
|
24
|
+
return "__private_" + id++ + "_" + name;
|
|
25
|
+
}
|
|
26
|
+
const createLocalStrapiSourceProvider = (options)=>{
|
|
27
|
+
return new LocalStrapiSourceProvider(options);
|
|
28
|
+
};
|
|
29
|
+
var _diagnostics = /*#__PURE__*/ _class_private_field_loose_key("_diagnostics"), _reportInfo = /*#__PURE__*/ _class_private_field_loose_key("_reportInfo"), _reportWarning = /*#__PURE__*/ _class_private_field_loose_key("_reportWarning"), /**
|
|
30
|
+
* Reports an error to the diagnostic reporter.
|
|
31
|
+
*/ _reportError = /*#__PURE__*/ _class_private_field_loose_key("_reportError"), /**
|
|
32
|
+
* Handles errors that occur in read streams.
|
|
33
|
+
*/ _handleStreamError = /*#__PURE__*/ _class_private_field_loose_key("_handleStreamError");
|
|
34
|
+
class LocalStrapiSourceProvider {
|
|
35
|
+
async bootstrap(diagnostics) {
|
|
36
|
+
_class_private_field_loose_base(this, _diagnostics)[_diagnostics] = diagnostics;
|
|
37
|
+
this.strapi = await this.options.getStrapi();
|
|
38
|
+
this.strapi.db.lifecycles.disable();
|
|
39
|
+
}
|
|
40
|
+
async close() {
|
|
41
|
+
const { autoDestroy } = this.options;
|
|
42
|
+
assertValidStrapi(this.strapi);
|
|
43
|
+
this.strapi.db.lifecycles.enable();
|
|
44
|
+
// Basically `!== false` but more deterministic
|
|
45
|
+
if (autoDestroy === undefined || autoDestroy === true) {
|
|
46
|
+
await this.strapi?.destroy();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
getMetadata() {
|
|
50
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('getting metadata');
|
|
51
|
+
assertValidStrapi(this.strapi);
|
|
52
|
+
const strapiVersion = this.strapi.config.get('info.strapi');
|
|
53
|
+
const createdAt = new Date().toISOString();
|
|
54
|
+
return {
|
|
55
|
+
createdAt,
|
|
56
|
+
strapi: {
|
|
57
|
+
version: strapiVersion
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async createEntitiesReadStream() {
|
|
62
|
+
assertValidStrapi(this.strapi, 'Not able to stream entities');
|
|
63
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating entities read stream');
|
|
64
|
+
return chain([
|
|
65
|
+
// Entities stream
|
|
66
|
+
createEntitiesStream(this.strapi, {
|
|
67
|
+
onWarning: (message)=>{
|
|
68
|
+
this.strapi?.log.warn(message);
|
|
69
|
+
_class_private_field_loose_base(this, _reportWarning)[_reportWarning](message);
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
// Transform stream
|
|
73
|
+
createEntitiesTransformStream()
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
createLinksReadStream() {
|
|
77
|
+
assertValidStrapi(this.strapi, 'Not able to stream links');
|
|
78
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating links read stream');
|
|
79
|
+
return createLinksStream(this.strapi);
|
|
80
|
+
}
|
|
81
|
+
createConfigurationReadStream() {
|
|
82
|
+
assertValidStrapi(this.strapi, 'Not able to stream configuration');
|
|
83
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating configuration read stream');
|
|
84
|
+
return createConfigurationStream(this.strapi);
|
|
85
|
+
}
|
|
86
|
+
getSchemas() {
|
|
87
|
+
assertValidStrapi(this.strapi, 'Not able to get Schemas');
|
|
88
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('getting schemas');
|
|
89
|
+
const schemas = schemasToValidJSON({
|
|
90
|
+
...this.strapi.contentTypes,
|
|
91
|
+
...this.strapi.components
|
|
92
|
+
});
|
|
93
|
+
return mapSchemasValues(schemas);
|
|
94
|
+
}
|
|
95
|
+
createSchemasReadStream() {
|
|
96
|
+
return Readable.from(Object.values(this.getSchemas()));
|
|
97
|
+
}
|
|
98
|
+
createAssetsReadStream() {
|
|
99
|
+
assertValidStrapi(this.strapi, 'Not able to stream assets');
|
|
100
|
+
_class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating assets read stream');
|
|
101
|
+
const stream = createAssetsStream(this.strapi, {
|
|
102
|
+
onWarning: (message)=>_class_private_field_loose_base(this, _reportWarning)[_reportWarning](message)
|
|
103
|
+
});
|
|
104
|
+
stream.on('error', (err)=>{
|
|
105
|
+
_class_private_field_loose_base(this, _handleStreamError)[_handleStreamError]('assets', err);
|
|
106
|
+
});
|
|
107
|
+
return stream;
|
|
108
|
+
}
|
|
109
|
+
async getStageTotals(stage) {
|
|
110
|
+
if (stage !== 'assets') {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
assertValidStrapi(this.strapi, 'Not able to estimate asset totals');
|
|
114
|
+
return estimateAssetTotals(this.strapi);
|
|
115
|
+
}
|
|
116
|
+
constructor(options){
|
|
117
|
+
Object.defineProperty(this, _reportInfo, {
|
|
118
|
+
value: reportInfo
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(this, _reportWarning, {
|
|
121
|
+
value: reportWarning
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(this, _reportError, {
|
|
124
|
+
value: reportError
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(this, _handleStreamError, {
|
|
127
|
+
value: handleStreamError
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(this, _diagnostics, {
|
|
130
|
+
writable: true,
|
|
131
|
+
value: void 0
|
|
132
|
+
});
|
|
133
|
+
this.name = 'source::local-strapi';
|
|
134
|
+
this.type = 'source';
|
|
135
|
+
this.options = options;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function reportInfo(message) {
|
|
139
|
+
_class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
|
|
140
|
+
details: {
|
|
141
|
+
createdAt: new Date(),
|
|
142
|
+
message,
|
|
143
|
+
origin: 'local-source-provider'
|
|
144
|
+
},
|
|
145
|
+
kind: 'info'
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function reportWarning(message) {
|
|
149
|
+
_class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
|
|
150
|
+
details: {
|
|
151
|
+
createdAt: new Date(),
|
|
152
|
+
message,
|
|
153
|
+
origin: 'local-source-provider'
|
|
154
|
+
},
|
|
155
|
+
kind: 'warning'
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function reportError(message, error) {
|
|
159
|
+
_class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
|
|
160
|
+
details: {
|
|
161
|
+
createdAt: new Date(),
|
|
162
|
+
message,
|
|
163
|
+
error,
|
|
164
|
+
severity: 'fatal',
|
|
165
|
+
name: error.name
|
|
166
|
+
},
|
|
167
|
+
kind: 'error'
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function handleStreamError(streamType, err) {
|
|
171
|
+
const { message, stack } = err;
|
|
172
|
+
const errorMessage = `[Data transfer] Error in ${streamType} read stream: ${message}`;
|
|
173
|
+
const formattedError = {
|
|
174
|
+
message: errorMessage,
|
|
175
|
+
stack,
|
|
176
|
+
timestamp: new Date().toISOString()
|
|
177
|
+
};
|
|
178
|
+
this.strapi?.log.error(formattedError);
|
|
179
|
+
_class_private_field_loose_base(this, _reportError)[_reportError](formattedError.message, err);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { createLocalStrapiSourceProvider, estimateAssetTotals };
|
|
183
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/strapi/providers/local-source/index.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport { chain } from 'stream-chain';\nimport type { Core, Struct } from '@strapi/types';\n\nimport type { IMetadata, ISourceProvider, ProviderType, TransferStage } from '../../../types';\nimport type { IDiagnosticReporter } from '../../../utils/diagnostic';\nimport { createEntitiesStream, createEntitiesTransformStream } from './entities';\nimport { createLinksStream } from './links';\nimport { createConfigurationStream } from './configuration';\nimport { createAssetsStream } from './assets';\nimport { estimateAssetTotals } from './estimate-asset-totals';\nimport * as utils from '../../../utils';\nimport { assertValidStrapi } from '../../../utils/providers';\n\nexport interface ILocalStrapiSourceProviderOptions {\n getStrapi(): Core.Strapi | Promise<Core.Strapi>; // return an initialized instance of Strapi\n\n autoDestroy?: boolean; // shut down the instance returned by getStrapi() at the end of the transfer\n}\n\nexport const createLocalStrapiSourceProvider = (options: ILocalStrapiSourceProviderOptions) => {\n return new LocalStrapiSourceProvider(options);\n};\n\nclass LocalStrapiSourceProvider implements ISourceProvider {\n name = 'source::local-strapi';\n\n type: ProviderType = 'source';\n\n options: ILocalStrapiSourceProviderOptions;\n\n strapi?: Core.Strapi;\n\n #diagnostics?: IDiagnosticReporter;\n\n constructor(options: ILocalStrapiSourceProviderOptions) {\n this.options = options;\n }\n\n async bootstrap(diagnostics?: IDiagnosticReporter): Promise<void> {\n this.#diagnostics = diagnostics;\n this.strapi = await this.options.getStrapi();\n this.strapi.db.lifecycles.disable();\n }\n\n #reportInfo(message: string) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n origin: 'local-source-provider',\n },\n kind: 'info',\n });\n }\n\n #reportWarning(message: string) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n origin: 'local-source-provider',\n },\n kind: 'warning',\n });\n }\n\n /**\n * Reports an error to the diagnostic reporter.\n */\n #reportError(message: string, error: Error) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n error,\n severity: 'fatal',\n name: error.name,\n },\n kind: 'error',\n });\n }\n\n /**\n * Handles errors that occur in read streams.\n */\n #handleStreamError(streamType: string, err: Error) {\n const { message, stack } = err;\n const errorMessage = `[Data transfer] Error in ${streamType} read stream: ${message}`;\n const formattedError = {\n message: errorMessage,\n stack,\n timestamp: new Date().toISOString(),\n };\n\n this.strapi?.log.error(formattedError);\n this.#reportError(formattedError.message, err);\n }\n\n async close(): Promise<void> {\n const { autoDestroy } = this.options;\n assertValidStrapi(this.strapi);\n this.strapi.db.lifecycles.enable();\n // Basically `!== false` but more deterministic\n if (autoDestroy === undefined || autoDestroy === true) {\n await this.strapi?.destroy();\n }\n }\n\n getMetadata(): IMetadata {\n this.#reportInfo('getting metadata');\n assertValidStrapi(this.strapi);\n const strapiVersion = this.strapi.config.get<string>('info.strapi');\n const createdAt = new Date().toISOString();\n\n return {\n createdAt,\n strapi: {\n version: strapiVersion,\n },\n };\n }\n\n async createEntitiesReadStream(): Promise<Readable> {\n assertValidStrapi(this.strapi, 'Not able to stream entities');\n this.#reportInfo('creating entities read stream');\n return chain([\n // Entities stream\n createEntitiesStream(this.strapi, {\n onWarning: (message) => {\n this.strapi?.log.warn(message);\n this.#reportWarning(message);\n },\n }),\n\n // Transform stream\n createEntitiesTransformStream(),\n ]);\n }\n\n createLinksReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream links');\n this.#reportInfo('creating links read stream');\n\n return createLinksStream(this.strapi);\n }\n\n createConfigurationReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream configuration');\n this.#reportInfo('creating configuration read stream');\n return createConfigurationStream(this.strapi);\n }\n\n getSchemas(): Record<string, Struct.Schema> {\n assertValidStrapi(this.strapi, 'Not able to get Schemas');\n this.#reportInfo('getting schemas');\n const schemas = utils.schema.schemasToValidJSON({\n ...this.strapi.contentTypes,\n ...this.strapi.components,\n });\n\n return utils.schema.mapSchemasValues(schemas);\n }\n\n createSchemasReadStream(): Readable {\n return Readable.from(Object.values(this.getSchemas()));\n }\n\n createAssetsReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream assets');\n this.#reportInfo('creating assets read stream');\n\n const stream = createAssetsStream(this.strapi, {\n onWarning: (message) => this.#reportWarning(message),\n });\n stream.on('error', (err) => {\n this.#handleStreamError('assets', err);\n });\n\n return stream;\n }\n\n async getStageTotals(stage: TransferStage) {\n if (stage !== 'assets') {\n return null;\n }\n assertValidStrapi(this.strapi, 'Not able to estimate asset totals');\n return estimateAssetTotals(this.strapi);\n }\n}\n\nexport type ILocalStrapiSourceProvider = InstanceType<typeof LocalStrapiSourceProvider>;\n\nexport { estimateAssetTotals } from './estimate-asset-totals';\n"],"names":["createLocalStrapiSourceProvider","options","LocalStrapiSourceProvider","bootstrap","diagnostics","strapi","getStrapi","db","lifecycles","disable","close","autoDestroy","assertValidStrapi","enable","undefined","destroy","getMetadata","strapiVersion","config","get","createdAt","Date","toISOString","version","createEntitiesReadStream","chain","createEntitiesStream","onWarning","message","log","warn","createEntitiesTransformStream","createLinksReadStream","createLinksStream","createConfigurationReadStream","createConfigurationStream","getSchemas","schemas","utils","contentTypes","components","createSchemasReadStream","Readable","from","Object","values","createAssetsReadStream","stream","createAssetsStream","on","err","getStageTotals","stage","estimateAssetTotals","name","type","report","details","origin","kind","error","severity","streamType","stack","errorMessage","formattedError","timestamp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,MAAMA,kCAAkC,CAACC,OAAAA,GAAAA;AAC9C,IAAA,OAAO,IAAIC,yBAAAA,CAA0BD,OAAAA,CAAAA;AACvC;AAWE,IAAA,YAAA,iBAAA,8BAAA,CAAA,cAAA,CAAA,EAYA,2EAWA,cAAA,iBAAA,8BAAA,CAAA,gBAAA,CAAA;;AAaC,MACD,YAAA,iBAAA,8BAAA,CAAA,cAAA,CAAA;;MAgBA,kBAAA,iBAAA,8BAAA,CAAA,oBAAA,CAAA;AA9DF,MAAMC,yBAAAA,CAAAA;IAeJ,MAAMC,SAAAA,CAAUC,WAAiC,EAAiB;QAChE,+BAAA,CAAA,IAAI,EAAC,YAAA,CAAA,CAAA,YAAA,CAAA,GAAeA,WAAAA;QACpB,IAAI,CAACC,MAAM,GAAG,MAAM,IAAI,CAACJ,OAAO,CAACK,SAAS,EAAA;AAC1C,QAAA,IAAI,CAACD,MAAM,CAACE,EAAE,CAACC,UAAU,CAACC,OAAO,EAAA;AACnC,IAAA;AAwDA,IAA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AA,KAAAA;QACAG,SAAAA,EAAW,IAAI7C,OAAOC,WAAW;AACnC,KAAA;AAEA,IAAA,IAAI,CAACjB,MAAM,EAAEwB,GAAAA,CAAI+B,KAAAA,CAAMK,cAAAA,CAAAA;AACvB,IAAA,+BAAA,CAAA,IAAI,EAAC,YAAA,CAAA,CAAA,YAAA,CAAA,CAAaA,cAAAA,CAAerC,OAAO,EAAEsB,GAAAA,CAAAA;AAC5C;;;;"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var stream = require('stream');
|
|
4
|
+
var link = require('../../queries/link.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Create a Readable which will stream all the links from a Strapi instance
|
|
8
|
+
*/ const createLinksStream = (strapi)=>{
|
|
9
|
+
const uids = [
|
|
10
|
+
...Object.keys(strapi.contentTypes),
|
|
11
|
+
...Object.keys(strapi.components)
|
|
12
|
+
];
|
|
13
|
+
// Async generator stream that returns every link from a Strapi instance
|
|
14
|
+
return stream.Readable.from(async function* linkGenerator() {
|
|
15
|
+
const query = link.createLinkQuery(strapi);
|
|
16
|
+
for (const uid of uids){
|
|
17
|
+
const generator = query().generateAll(uid);
|
|
18
|
+
for await (const link of generator){
|
|
19
|
+
yield link;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}());
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.createLinksStream = createLinksStream;
|
|
26
|
+
//# sourceMappingURL=links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.js","sources":["../../../../src/strapi/providers/local-source/links.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../types';\nimport { createLinkQuery } from '../../queries/link';\n\n/**\n * Create a Readable which will stream all the links from a Strapi instance\n */\nexport const createLinksStream = (strapi: Core.Strapi): Readable => {\n const uids = [...Object.keys(strapi.contentTypes), ...Object.keys(strapi.components)] as string[];\n\n // Async generator stream that returns every link from a Strapi instance\n return Readable.from(\n (async function* linkGenerator(): AsyncGenerator<ILink> {\n const query = createLinkQuery(strapi);\n\n for (const uid of uids) {\n const generator = query().generateAll(uid);\n\n for await (const link of generator) {\n yield link;\n }\n }\n })()\n );\n};\n"],"names":["createLinksStream","strapi","uids","Object","keys","contentTypes","components","Readable","from","linkGenerator","query","createLinkQuery","uid","generator","generateAll","link"],"mappings":";;;;;AAMA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,GAAAA;AAChC,IAAA,MAAMC,IAAAA,GAAO;WAAIC,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOI,YAAY,CAAA;WAAMF,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOK,UAAU;AAAE,KAAA;;AAGrF,IAAA,OAAOC,eAAAA,CAASC,IAAI,CACjB,gBAAgBC,aAAAA,GAAAA;AACf,QAAA,MAAMC,QAAQC,oBAAAA,CAAgBV,MAAAA,CAAAA;QAE9B,KAAK,MAAMW,OAAOV,IAAAA,CAAM;YACtB,MAAMW,SAAAA,GAAYH,KAAAA,EAAAA,CAAQI,WAAW,CAACF,GAAAA,CAAAA;YAEtC,WAAW,MAAMG,QAAQF,SAAAA,CAAW;gBAClC,MAAME,IAAAA;AACR,YAAA;AACF,QAAA;AACF,IAAA,CAAA,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Readable } from 'stream';
|
|
2
|
+
import { createLinkQuery } from '../../queries/link.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create a Readable which will stream all the links from a Strapi instance
|
|
6
|
+
*/ const createLinksStream = (strapi)=>{
|
|
7
|
+
const uids = [
|
|
8
|
+
...Object.keys(strapi.contentTypes),
|
|
9
|
+
...Object.keys(strapi.components)
|
|
10
|
+
];
|
|
11
|
+
// Async generator stream that returns every link from a Strapi instance
|
|
12
|
+
return Readable.from(async function* linkGenerator() {
|
|
13
|
+
const query = createLinkQuery(strapi);
|
|
14
|
+
for (const uid of uids){
|
|
15
|
+
const generator = query().generateAll(uid);
|
|
16
|
+
for await (const link of generator){
|
|
17
|
+
yield link;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}());
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { createLinksStream };
|
|
24
|
+
//# sourceMappingURL=links.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.mjs","sources":["../../../../src/strapi/providers/local-source/links.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../types';\nimport { createLinkQuery } from '../../queries/link';\n\n/**\n * Create a Readable which will stream all the links from a Strapi instance\n */\nexport const createLinksStream = (strapi: Core.Strapi): Readable => {\n const uids = [...Object.keys(strapi.contentTypes), ...Object.keys(strapi.components)] as string[];\n\n // Async generator stream that returns every link from a Strapi instance\n return Readable.from(\n (async function* linkGenerator(): AsyncGenerator<ILink> {\n const query = createLinkQuery(strapi);\n\n for (const uid of uids) {\n const generator = query().generateAll(uid);\n\n for await (const link of generator) {\n yield link;\n }\n }\n })()\n );\n};\n"],"names":["createLinksStream","strapi","uids","Object","keys","contentTypes","components","Readable","from","linkGenerator","query","createLinkQuery","uid","generator","generateAll","link"],"mappings":";;;AAMA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,GAAAA;AAChC,IAAA,MAAMC,IAAAA,GAAO;WAAIC,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOI,YAAY,CAAA;WAAMF,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOK,UAAU;AAAE,KAAA;;AAGrF,IAAA,OAAOC,QAAAA,CAASC,IAAI,CACjB,gBAAgBC,aAAAA,GAAAA;AACf,QAAA,MAAMC,QAAQC,eAAAA,CAAgBV,MAAAA,CAAAA;QAE9B,KAAK,MAAMW,OAAOV,IAAAA,CAAM;YACtB,MAAMW,SAAAA,GAAYH,KAAAA,EAAAA,CAAQI,WAAW,CAACF,GAAAA,CAAAA;YAEtC,WAAW,MAAMG,QAAQF,SAAAA,CAAW;gBAClC,MAAME,IAAAA;AACR,YAAA;AACF,QAAA;AACF,IAAA,CAAA,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Writable } from 'stream';
|
|
3
2
|
import { WebSocket } from 'ws';
|
|
4
3
|
import type { Struct, Utils } from '@strapi/types';
|
|
5
4
|
import { createDispatcher } from '../utils';
|
|
6
|
-
import type { IDestinationProvider, IMetadata, ProviderType } from '
|
|
7
|
-
import type {
|
|
5
|
+
import type { IDestinationProvider, IMetadata, ProviderType, TransferStage } from '../../../types';
|
|
6
|
+
import type { IDiagnosticReporter } from '../../../utils/diagnostic';
|
|
7
|
+
import type { Auth } from '../../../types/remote/protocol';
|
|
8
8
|
import type { ILocalStrapiDestinationProviderOptions } from '../local-destination';
|
|
9
|
-
export interface IRemoteStrapiDestinationProviderOptions extends Pick<ILocalStrapiDestinationProviderOptions, 'restore' | 'strategy'> {
|
|
9
|
+
export interface IRemoteStrapiDestinationProviderOptions extends Pick<ILocalStrapiDestinationProviderOptions, 'restore' | 'strategy' | 'onTransferPhase'> {
|
|
10
10
|
url: URL;
|
|
11
11
|
auth?: Auth.ITransferTokenAuth;
|
|
12
12
|
retryMessageOptions?: {
|
|
13
13
|
retryMessageTimeout: number;
|
|
14
14
|
retryMessageMaxRetries: number;
|
|
15
15
|
};
|
|
16
|
+
/** Include per-asset stream checksums and require peers to validate on receive. */
|
|
17
|
+
verifyChecksums?: boolean;
|
|
16
18
|
}
|
|
17
19
|
declare class RemoteStrapiDestinationProvider implements IDestinationProvider {
|
|
18
20
|
#private;
|
|
@@ -22,9 +24,15 @@ declare class RemoteStrapiDestinationProvider implements IDestinationProvider {
|
|
|
22
24
|
ws: WebSocket | null;
|
|
23
25
|
dispatcher: ReturnType<typeof createDispatcher> | null;
|
|
24
26
|
transferID: string | null;
|
|
27
|
+
stats: {
|
|
28
|
+
[TStage in Exclude<TransferStage, 'schemas'>]: {
|
|
29
|
+
count: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
25
32
|
constructor(options: IRemoteStrapiDestinationProviderOptions);
|
|
33
|
+
private resetStats;
|
|
26
34
|
initTransfer(): Promise<string>;
|
|
27
|
-
bootstrap(): Promise<void>;
|
|
35
|
+
bootstrap(diagnostics?: IDiagnosticReporter): Promise<void>;
|
|
28
36
|
close(): Promise<void>;
|
|
29
37
|
getMetadata(): Promise<IMetadata | null> | null;
|
|
30
38
|
beforeTransfer(): Promise<void>;
|
|
@@ -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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