@strapi/data-transfer 5.0.0-beta.1 → 5.0.0-beta.10

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.
Files changed (51) hide show
  1. package/dist/engine/diagnostic.d.ts.map +1 -1
  2. package/dist/engine/index.d.ts.map +1 -1
  3. package/dist/engine/validation/provider.d.ts +1 -1
  4. package/dist/engine/validation/provider.d.ts.map +1 -1
  5. package/dist/engine/validation/schemas/index.d.ts.map +1 -1
  6. package/dist/file/providers/destination/utils.d.ts.map +1 -1
  7. package/dist/file/providers/source/index.d.ts +1 -3
  8. package/dist/file/providers/source/index.d.ts.map +1 -1
  9. package/dist/index.js +80 -45
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +81 -46
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/strapi/providers/local-destination/index.d.ts +2 -2
  14. package/dist/strapi/providers/local-destination/index.d.ts.map +1 -1
  15. package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts +2 -2
  16. package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts.map +1 -1
  17. package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts +3 -3
  18. package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts.map +1 -1
  19. package/dist/strapi/providers/local-destination/strategies/restore/index.d.ts +1 -1
  20. package/dist/strapi/providers/local-destination/strategies/restore/index.d.ts.map +1 -1
  21. package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts +1 -1
  22. package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts.map +1 -1
  23. package/dist/strapi/providers/local-source/assets.d.ts +1 -1
  24. package/dist/strapi/providers/local-source/assets.d.ts.map +1 -1
  25. package/dist/strapi/providers/local-source/configuration.d.ts +1 -1
  26. package/dist/strapi/providers/local-source/configuration.d.ts.map +1 -1
  27. package/dist/strapi/providers/local-source/entities.d.ts +1 -1
  28. package/dist/strapi/providers/local-source/entities.d.ts.map +1 -1
  29. package/dist/strapi/providers/local-source/index.d.ts +2 -2
  30. package/dist/strapi/providers/local-source/index.d.ts.map +1 -1
  31. package/dist/strapi/providers/local-source/links.d.ts +1 -1
  32. package/dist/strapi/providers/local-source/links.d.ts.map +1 -1
  33. package/dist/strapi/providers/remote-source/index.d.ts.map +1 -1
  34. package/dist/strapi/providers/utils.d.ts +1 -1
  35. package/dist/strapi/providers/utils.d.ts.map +1 -1
  36. package/dist/strapi/queries/entity.d.ts +1 -1
  37. package/dist/strapi/queries/entity.d.ts.map +1 -1
  38. package/dist/strapi/queries/link.d.ts +2 -1
  39. package/dist/strapi/queries/link.d.ts.map +1 -1
  40. package/dist/strapi/remote/handlers/utils.d.ts.map +1 -1
  41. package/dist/utils/components.d.ts +13 -74
  42. package/dist/utils/components.d.ts.map +1 -1
  43. package/dist/utils/middleware.d.ts.map +1 -1
  44. package/dist/utils/providers.d.ts +1 -1
  45. package/dist/utils/providers.d.ts.map +1 -1
  46. package/dist/utils/schema.d.ts +1 -0
  47. package/dist/utils/schema.d.ts.map +1 -1
  48. package/dist/utils/stream.d.ts.map +1 -1
  49. package/dist/utils/transaction.d.ts +1 -1
  50. package/dist/utils/transaction.d.ts.map +1 -1
  51. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../../src/engine/diagnostic.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,GAAG,OAAO,IAAI;IACrE,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;KACjB,GAAG,CAAC,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,kBAAkB,CAAC,C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,EAAE,MAAM;IAO9C;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO;IAqR5C,eAAe,CAAC,KAAK,EAAE,aAAa;IAwG9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAahC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyCtB,cAAc;IAyDd,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAmD3C,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAwB/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBhC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6CjC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB/B,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAc7C;AAED,eAAO,MAAM,oBAAoB,8EACf,CAAC,uBACI,CAAC,WACb,sBAAsB,KAC9B,eAAe,CAAC,EAAE,CAAC,CAErB,CAAC;AAEF,YAAY,EACV,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,CAAC;AAEF,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { IDestinationProvider, ISourceProvider, ProviderType } from '../../../types';
2
- declare const validateProvider: <T extends ProviderType>(type: ProviderType, provider?: ([T] extends ["source"] ? ISourceProvider : IDestinationProvider) | null | undefined) => undefined;
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,gBAAgB,CAAC;AAO1F,QAAA,MAAM,gBAAgB,iCACd,YAAY,+GAcnB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
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,gBAAgB,CAAC;AAO1F,QAAA,MAAM,gBAAgB,iCACd,YAAY,aACP,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;AAiChD,QAAA,MAAM,UAAU;iBAED,IAAI,EAAE;kBAOL,IAAI,EAAE;CAGrB,CAAC;AAEF,QAAA,MAAM,cAAc,+BAAgC,MAAM,iBAAiB,WAG1E,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,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,YAAa,CAAC,KAAK,CAAC,YAAY,MAAM,iBAAiB,WAG1E,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1 +1 @@
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,SACzB,MAAM,6BACI,MAQhB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,YACtB,IAAI,IAAI,wBACK,MAAM,KAAK,MAAM,+BAuDxC,CAAC"}
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,SACzB,MAAM,6BACI,MAQhB,CAAC;AAEJ,eAAO,MAAM,oBAAoB,YACtB,IAAI,IAAI,eACJ,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,+BAuDxC,CAAC"}
@@ -1,7 +1,5 @@
1
- /// <reference types="lodash" />
2
1
  /// <reference types="node" />
3
2
  import type { Readable } from 'stream';
4
- import type { Struct } from '@strapi/types';
5
3
  import type { IMetadata, ISourceProvider, ProviderType } from '../../../../types';
6
4
  /**
7
5
  * Provider options
@@ -30,7 +28,7 @@ declare class LocalFileSourceProvider implements ISourceProvider {
30
28
  */
31
29
  bootstrap(): Promise<void>;
32
30
  getMetadata(): Promise<IMetadata | null>;
33
- getSchemas(): Promise<import("lodash").Dictionary<Struct.Schema>>;
31
+ getSchemas(): Promise<any>;
34
32
  createEntitiesReadStream(): Readable;
35
33
  createSchemasReadStream(): Readable;
36
34
  createLinksReadStream(): Readable;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAUvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAU,SAAS,EAAE,eAAe,EAAE,YAAY,EAAS,MAAM,mBAAmB,CAAC;AAcjG;;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,YAAa,+BAA+B,4BAErF,CAAC;AAEF,cAAM,uBAAwB,YAAW,eAAe;;IACtD,IAAI,EAAE,YAAY,CAAY;IAE9B,IAAI,SAAwB;IAE5B,OAAO,EAAE,+BAA+B,CAAC;gBAI7B,OAAO,EAAE,+BAA+B;IAUpD;;OAEG;IACG,SAAS;IA+BT,WAAW;IAQX,UAAU;IAUhB,wBAAwB,IAAI,QAAQ;IAIpC,uBAAuB,IAAI,QAAQ;IAInC,qBAAqB,IAAI,QAAQ;IAIjC,6BAA6B,IAAI,QAAQ;IAKzC,sBAAsB,IAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CA8KvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAYvC,OAAO,KAAK,EAAU,SAAS,EAAE,eAAe,EAAE,YAAY,EAAS,MAAM,mBAAmB,CAAC;AAajG;;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,YAAa,+BAA+B,4BAErF,CAAC;AAEF,cAAM,uBAAwB,YAAW,eAAe;;IACtD,IAAI,EAAE,YAAY,CAAY;IAE9B,IAAI,SAAwB;IAE5B,OAAO,EAAE,+BAA+B,CAAC;gBAI7B,OAAO,EAAE,+BAA+B;IAUpD;;OAEG;IACG,SAAS;IA+BT,WAAW;IAQX,UAAU;IAgBhB,wBAAwB,IAAI,QAAQ;IAIpC,uBAAuB,IAAI,QAAQ;IAInC,qBAAqB,IAAI,QAAQ;IAIjC,6BAA6B,IAAI,QAAQ;IAKzC,sBAAsB,IAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CA8KvD"}
package/dist/index.js CHANGED
@@ -224,9 +224,13 @@ const VALID_SCHEMA_PROPERTIES = [
224
224
  const mapSchemasValues = (schemas) => {
225
225
  return fp.mapValues(fp.pick(VALID_SCHEMA_PROPERTIES), schemas);
226
226
  };
227
+ const schemasToValidJSON = (schemas) => {
228
+ return JSON.parse(JSON.stringify(schemas));
229
+ };
227
230
  const schema = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
228
231
  __proto__: null,
229
- mapSchemasValues
232
+ mapSchemasValues,
233
+ schemasToValidJSON
230
234
  }, Symbol.toStringTag, { value: "Module" }));
231
235
  const createTransaction = (strapi2) => {
232
236
  const fns = [];
@@ -336,7 +340,7 @@ const isAttributeIgnorable = (diff2) => {
336
340
  return diff2.path.length === 3 && // Root property must be attributes
337
341
  diff2.path[0] === "attributes" && // Need a valid string attribute name
338
342
  typeof diff2.path[1] === "string" && // The diff must be on ignorable attribute properties
339
- ["private", "required", "configurable"].includes(diff2.path[2]);
343
+ ["private", "required", "configurable", "default"].includes(diff2.path[2]);
340
344
  };
341
345
  const isOptionalAdminType = (diff2) => {
342
346
  if ("value" in diff2 && fp.isObject(diff2.value)) {
@@ -1068,8 +1072,8 @@ ${formattedDiffs}`,
1068
1072
  }
1069
1073
  const { type, data } = entity2;
1070
1074
  const attributes = schemas[type].attributes;
1071
- const attributesToRemove = fp.difference(Object.keys(data), Object.keys(attributes));
1072
- const updatedEntity = fp.set("data", fp.omit(attributesToRemove, data), entity2);
1075
+ const attributesToKeep = Object.keys(attributes).concat("documentId");
1076
+ const updatedEntity = fp.set("data", fp.pick(attributesToKeep, data), entity2);
1073
1077
  callback(null, updatedEntity);
1074
1078
  }
1075
1079
  })
@@ -1283,6 +1287,34 @@ const deleteComponent = async (uid, componentToDelete) => {
1283
1287
  await deleteComponents(uid, componentToDelete);
1284
1288
  await strapi.db.query(uid).delete({ where: { id: componentToDelete.id } });
1285
1289
  };
1290
+ const resolveComponentUID = ({
1291
+ paths,
1292
+ strapi: strapi2,
1293
+ data,
1294
+ contentType
1295
+ }) => {
1296
+ let value = data;
1297
+ let cType = contentType;
1298
+ for (const path2 of paths) {
1299
+ value = fp.get(path2, value);
1300
+ if (typeof cType === "function") {
1301
+ cType = cType(value);
1302
+ }
1303
+ if (path2 in cType.attributes) {
1304
+ const attribute = cType.attributes[path2];
1305
+ if (attribute.type === "component") {
1306
+ cType = strapi2.getModel(attribute.component);
1307
+ }
1308
+ if (attribute.type === "dynamiczone") {
1309
+ cType = ({ __component }) => strapi2.getModel(__component);
1310
+ }
1311
+ }
1312
+ }
1313
+ if ("uid" in cType) {
1314
+ return cType.uid;
1315
+ }
1316
+ return void 0;
1317
+ };
1286
1318
  const sanitizeComponentLikeAttributes = (model, data) => {
1287
1319
  const { attributes } = model;
1288
1320
  const componentLikeAttributesKey = Object.entries(attributes).filter(([, attribute]) => attribute.type === "component" || attribute.type === "dynamiczone").map(([key]) => key);
@@ -1532,6 +1564,9 @@ const createLinkQuery = (strapi2, trx) => {
1532
1564
  const metadata = strapi2.db.metadata.get(left.type);
1533
1565
  const attribute = metadata.attributes[left.field];
1534
1566
  const payload = {};
1567
+ if (!attribute) {
1568
+ return;
1569
+ }
1535
1570
  if (attribute.type !== "relation") {
1536
1571
  throw new Error(`Attribute ${left.field} is not a relation`);
1537
1572
  }
@@ -1609,9 +1644,7 @@ const filterValidRelationalAttributes = (attributes) => {
1609
1644
  const isOwner = (attribute) => {
1610
1645
  return attribute.owner || !attribute.mappedBy && !attribute.morphBy;
1611
1646
  };
1612
- const isComponentLike = (attribute) => {
1613
- return attribute.component || attribute.components;
1614
- };
1647
+ const isComponentLike = (attribute) => attribute.joinTable?.name.endsWith("_cmps");
1615
1648
  return Object.entries(attributes).filter(([, attribute]) => {
1616
1649
  return attribute.type === "relation" && isOwner(attribute) && !isComponentLike(attribute);
1617
1650
  }).reduce((acc, [key, attribute]) => ({ ...acc, [key]: attribute }), {});
@@ -1627,7 +1660,8 @@ const getLinkKind = (attribute, uid) => {
1627
1660
  };
1628
1661
  const link = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1629
1662
  __proto__: null,
1630
- createLinkQuery
1663
+ createLinkQuery,
1664
+ filterValidRelationalAttributes
1631
1665
  }, Symbol.toStringTag, { value: "Module" }));
1632
1666
  const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1633
1667
  __proto__: null,
@@ -1644,29 +1678,6 @@ const createEntitiesWriteStream = (options) => {
1644
1678
  const { type, id, data } = entity2;
1645
1679
  const { create, getDeepPopulateComponentLikeQuery } = query(type);
1646
1680
  const contentType = strapi2.getModel(type);
1647
- let cType = contentType;
1648
- const resolveType = (paths) => {
1649
- let value = data;
1650
- for (const path2 of paths) {
1651
- value = fp.get(path2, value);
1652
- if (typeof cType === "function") {
1653
- cType = cType(value);
1654
- }
1655
- if (path2 in cType.attributes) {
1656
- const attribute = cType.attributes[path2];
1657
- if (attribute.type === "component") {
1658
- cType = strapi2.getModel(attribute.component);
1659
- }
1660
- if (attribute.type === "dynamiczone") {
1661
- cType = ({ __component }) => strapi2.getModel(__component);
1662
- }
1663
- }
1664
- }
1665
- if ("uid" in cType) {
1666
- return cType.uid;
1667
- }
1668
- return void 0;
1669
- };
1670
1681
  try {
1671
1682
  const created = await create({
1672
1683
  data,
@@ -1676,8 +1687,8 @@ const createEntitiesWriteStream = (options) => {
1676
1687
  const diffs = diff(data, created);
1677
1688
  updateMappingTable(type, id, created.id);
1678
1689
  diffs.forEach((diff2) => {
1679
- if (diff2.kind === "modified" && fp.last(diff2.path) === "id") {
1680
- const target = resolveType(diff2.path);
1690
+ if (diff2.kind === "modified" && fp.last(diff2.path) === "id" && "kind" in contentType) {
1691
+ const target = resolveComponentUID({ paths: diff2.path, data, contentType, strapi: strapi2 });
1681
1692
  if (!target) {
1682
1693
  return;
1683
1694
  }
@@ -1990,10 +2001,10 @@ class LocalStrapiDestinationProvider {
1990
2001
  }
1991
2002
  getSchemas() {
1992
2003
  assertValidStrapi(this.strapi, "Not able to get Schemas");
1993
- const schemas = {
2004
+ const schemas = schemasToValidJSON({
1994
2005
  ...this.strapi.contentTypes,
1995
2006
  ...this.strapi.components
1996
- };
2007
+ });
1997
2008
  return mapSchemasValues(schemas);
1998
2009
  }
1999
2010
  createEntitiesWriteStream() {
@@ -2307,11 +2318,31 @@ function getFileStats(filepath, strapi2, isLocal = false) {
2307
2318
  });
2308
2319
  });
2309
2320
  }
2321
+ async function signFile(file) {
2322
+ const { provider } = strapi.plugins.upload;
2323
+ const { provider: providerName } = strapi.config.get("plugin.upload");
2324
+ const isPrivate = await provider.isPrivate();
2325
+ if (file?.provider === providerName && isPrivate) {
2326
+ const signUrl = async (file2) => {
2327
+ const signedUrl = await provider.getSignedUrl(file2);
2328
+ file2.url = signedUrl.url;
2329
+ };
2330
+ await signUrl(file);
2331
+ if (file.formats) {
2332
+ for (const format of Object.keys(file.formats)) {
2333
+ await signUrl(file.formats[format]);
2334
+ }
2335
+ }
2336
+ }
2337
+ }
2310
2338
  const createAssetsStream = (strapi2) => {
2311
2339
  const generator = async function* () {
2312
2340
  const stream2 = strapi2.db.queryBuilder("plugin::upload.file").select("*").stream();
2313
2341
  for await (const file of stream2) {
2314
2342
  const isLocalProvider = file.provider === "local";
2343
+ if (!isLocalProvider) {
2344
+ await signFile(file);
2345
+ }
2315
2346
  const filepath = isLocalProvider ? path.join(strapi2.dirs.static.public, file.url) : file.url;
2316
2347
  const stats = await getFileStats(filepath, strapi2, isLocalProvider);
2317
2348
  const stream22 = getFileStream(filepath, strapi2, isLocalProvider);
@@ -2391,10 +2422,10 @@ class LocalStrapiSourceProvider {
2391
2422
  }
2392
2423
  getSchemas() {
2393
2424
  assertValidStrapi(this.strapi, "Not able to get Schemas");
2394
- const schemas = {
2425
+ const schemas = schemasToValidJSON({
2395
2426
  ...this.strapi.contentTypes,
2396
2427
  ...this.strapi.components
2397
- };
2428
+ });
2398
2429
  return mapSchemasValues(schemas);
2399
2430
  }
2400
2431
  createSchemasReadStream() {
@@ -2969,9 +3000,7 @@ class RemoteStrapiSourceProvider {
2969
3000
  });
2970
3001
  }
2971
3002
  async getSchemas() {
2972
- const schemas = await this.dispatcher?.dispatchTransferAction(
2973
- "getSchemas"
2974
- );
3003
+ const schemas = await this.dispatcher?.dispatchTransferAction("getSchemas");
2975
3004
  return schemas ?? null;
2976
3005
  }
2977
3006
  async #startStep(step) {
@@ -3110,8 +3139,11 @@ const transformUpgradeHeader = (header = "") => {
3110
3139
  return header.split(",").map((s) => s.trim().toLowerCase());
3111
3140
  };
3112
3141
  let timeouts;
3142
+ const hasHttpServer = () => {
3143
+ return typeof strapi !== "undefined" && !!strapi?.server?.httpServer;
3144
+ };
3113
3145
  const disableTimeouts = () => {
3114
- if (!strapi?.server?.httpServer) {
3146
+ if (!hasHttpServer()) {
3115
3147
  return;
3116
3148
  }
3117
3149
  const { httpServer } = strapi.server;
@@ -3126,7 +3158,7 @@ const disableTimeouts = () => {
3126
3158
  strapi.log.info("[Data transfer] Disabling http timeouts");
3127
3159
  };
3128
3160
  const resetTimeouts = () => {
3129
- if (!strapi?.server?.httpServer || !timeouts) {
3161
+ if (!hasHttpServer() || !timeouts) {
3130
3162
  return;
3131
3163
  }
3132
3164
  const { httpServer } = strapi.server;
@@ -3969,11 +4001,14 @@ class LocalFileSourceProvider {
3969
4001
  return this.#metadata ?? null;
3970
4002
  }
3971
4003
  async getSchemas() {
3972
- const schemas = await collect(this.createSchemasReadStream());
3973
- if (fp.isEmpty(schemas)) {
4004
+ const schemaCollection = await collect(
4005
+ this.createSchemasReadStream()
4006
+ );
4007
+ if (fp.isEmpty(schemaCollection)) {
3974
4008
  throw new ProviderInitializationError("Could not load schemas from Strapi data file.");
3975
4009
  }
3976
- return fp.keyBy("uid", schemas);
4010
+ const schemas = fp.keyBy("uid", schemaCollection);
4011
+ return schemasToValidJSON(schemas);
3977
4012
  }
3978
4013
  createEntitiesReadStream() {
3979
4014
  return this.#streamJsonlDirectory("entities");