@strapi/core 0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be → 0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76

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.

Potentially problematic release.


This version of @strapi/core might be problematic. Click here for more details.

Files changed (49) hide show
  1. package/dist/Strapi.js +1 -2
  2. package/dist/Strapi.js.map +1 -1
  3. package/dist/configuration/config-loader.js +1 -2
  4. package/dist/configuration/config-loader.js.map +1 -1
  5. package/dist/configuration/config-loader.mjs +1 -2
  6. package/dist/configuration/config-loader.mjs.map +1 -1
  7. package/dist/core-api/service/single-type.js +1 -2
  8. package/dist/core-api/service/single-type.js.map +1 -1
  9. package/dist/core-api/service/single-type.mjs +1 -2
  10. package/dist/core-api/service/single-type.mjs.map +1 -1
  11. package/dist/ee/index.d.ts.map +1 -1
  12. package/dist/ee/index.js +6 -1
  13. package/dist/ee/index.js.map +1 -1
  14. package/dist/ee/index.mjs +6 -1
  15. package/dist/ee/index.mjs.map +1 -1
  16. package/dist/loaders/plugins/index.js +1 -2
  17. package/dist/loaders/plugins/index.js.map +1 -1
  18. package/dist/services/document-service/repository.d.ts.map +1 -1
  19. package/dist/services/document-service/repository.js +18 -4
  20. package/dist/services/document-service/repository.js.map +1 -1
  21. package/dist/services/document-service/repository.mjs +18 -4
  22. package/dist/services/document-service/repository.mjs.map +1 -1
  23. package/dist/services/document-service/transform/id-map.js +2 -4
  24. package/dist/services/document-service/transform/id-map.js.map +1 -1
  25. package/dist/services/document-service/transform/id-map.mjs +2 -4
  26. package/dist/services/document-service/transform/id-map.mjs.map +1 -1
  27. package/dist/services/document-service/transform/relations/transform/data-ids.js +1 -2
  28. package/dist/services/document-service/transform/relations/transform/data-ids.js.map +1 -1
  29. package/dist/services/document-service/transform/relations/transform/data-ids.mjs +1 -2
  30. package/dist/services/document-service/transform/relations/transform/data-ids.mjs.map +1 -1
  31. package/dist/services/document-service/transform/relations/utils/map-relation.js +3 -6
  32. package/dist/services/document-service/transform/relations/utils/map-relation.js.map +1 -1
  33. package/dist/services/document-service/transform/relations/utils/map-relation.mjs +3 -6
  34. package/dist/services/document-service/transform/relations/utils/map-relation.mjs.map +1 -1
  35. package/dist/services/document-service/utils/unidirectional-relations.d.ts +11 -8
  36. package/dist/services/document-service/utils/unidirectional-relations.d.ts.map +1 -1
  37. package/dist/services/document-service/utils/unidirectional-relations.js +28 -18
  38. package/dist/services/document-service/utils/unidirectional-relations.js.map +1 -1
  39. package/dist/services/document-service/utils/unidirectional-relations.mjs +29 -19
  40. package/dist/services/document-service/utils/unidirectional-relations.mjs.map +1 -1
  41. package/dist/services/metrics/index.js +1 -2
  42. package/dist/services/metrics/index.js.map +1 -1
  43. package/dist/services/metrics/index.mjs +1 -2
  44. package/dist/services/metrics/index.mjs.map +1 -1
  45. package/dist/utils/load-files.js +1 -2
  46. package/dist/utils/load-files.js.map +1 -1
  47. package/dist/utils/load-files.mjs +1 -2
  48. package/dist/utils/load-files.mjs.map +1 -1
  49. package/package.json +15 -15
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const fp = require("lodash/fp");
4
- const load = async (uid, oldEntries) => {
4
+ const load = async (uid, { oldVersions, newVersions }) => {
5
5
  const updates = [];
6
6
  await strapi.db.transaction(async ({ trx }) => {
7
7
  const contentTypes = Object.values(strapi.contentTypes);
@@ -9,21 +9,33 @@ const load = async (uid, oldEntries) => {
9
9
  for (const model of [...contentTypes, ...components]) {
10
10
  const dbModel = strapi.db.metadata.get(model.uid);
11
11
  for (const attribute of Object.values(dbModel.attributes)) {
12
- if (attribute.type !== "relation")
13
- continue;
14
- if (attribute.target !== uid)
15
- continue;
16
- if (attribute.inversedBy || attribute.mappedBy)
12
+ if (attribute.type !== "relation" || attribute.target !== uid || attribute.inversedBy || attribute.mappedBy) {
17
13
  continue;
14
+ }
18
15
  const joinTable = attribute.joinTable;
19
- if (!joinTable)
20
- continue;
21
- const { name } = joinTable.inverseJoinColumn;
22
- const oldEntriesIds = oldEntries.map((entry) => entry.id);
23
- const relations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(name, oldEntriesIds).transacting(trx);
24
- if (relations.length === 0)
16
+ if (!joinTable) {
25
17
  continue;
26
- updates.push({ joinTable, relations });
18
+ }
19
+ const { name: sourceColumnName } = joinTable.joinColumn;
20
+ const { name: targetColumnName } = joinTable.inverseJoinColumn;
21
+ const ids = oldVersions.map((entry) => entry.id);
22
+ const oldVersionsRelations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(targetColumnName, ids).transacting(trx);
23
+ if (oldVersionsRelations.length > 0) {
24
+ updates.push({ joinTable, relations: oldVersionsRelations });
25
+ }
26
+ if (!model.options?.draftAndPublish) {
27
+ const ids2 = newVersions.map((entry) => entry.id);
28
+ const newVersionsRelations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(targetColumnName, ids2).transacting(trx);
29
+ if (newVersionsRelations.length > 0) {
30
+ const discardToAdd = newVersionsRelations.filter((relation) => {
31
+ const matchingOldVerion = oldVersionsRelations.find((oldRelation) => {
32
+ return oldRelation[sourceColumnName] === relation[sourceColumnName];
33
+ });
34
+ return !matchingOldVerion;
35
+ }).map(fp.omit("id"));
36
+ updates.push({ joinTable, relations: discardToAdd });
37
+ }
38
+ }
27
39
  }
28
40
  }
29
41
  });
@@ -34,22 +46,20 @@ const sync = async (oldEntries, newEntries, oldRelations) => {
34
46
  const oldEntriesMap = oldEntries.reduce(
35
47
  (acc, entry) => {
36
48
  const newEntry = newEntryByLocale[entry.locale];
37
- if (!newEntry)
38
- return acc;
49
+ if (!newEntry) return acc;
39
50
  acc[entry.id] = newEntry.id;
40
51
  return acc;
41
52
  },
42
53
  {}
43
54
  );
44
55
  await strapi.db.transaction(async ({ trx }) => {
45
- const con = strapi.db.getConnection();
46
56
  for (const { joinTable, relations } of oldRelations) {
57
+ const column = joinTable.inverseJoinColumn.name;
47
58
  const newRelations = relations.map((relation) => {
48
- const column = joinTable.inverseJoinColumn.name;
49
59
  const newId = oldEntriesMap[relation[column]];
50
60
  return { ...relation, [column]: newId };
51
61
  });
52
- await con.batchInsert(joinTable.name, newRelations).transacting(trx);
62
+ await trx.batchInsert(joinTable.name, newRelations, 1e3);
53
63
  }
54
64
  });
55
65
  };
@@ -1 +1 @@
1
- {"version":3,"file":"unidirectional-relations.js","sources":["../../../../src/services/document-service/utils/unidirectional-relations.ts"],"sourcesContent":["/* eslint-disable no-continue */\nimport { keyBy } from 'lodash/fp';\n\nimport { UID, Schema } from '@strapi/types';\n\n/**\n * Loads lingering relations that need to be updated when overriding a published or draft entry.\n * This is necessary because the relations are uni-directional and the target entry is not aware of the source entry.\n * This is not the case for bi-directional relations, where the target entry is also linked to the source entry.\n *\n * @param uid The content type uid\n * @param oldEntries The old entries that are being overridden\n * @returns An array of relations that need to be updated with the join table reference.\n */\nconst load = async (uid: UID.ContentType, oldEntries: { id: string; locale: string }[]) => {\n const updates = [] as any;\n\n // Iterate all components and content types to find relations that need to be updated\n await strapi.db.transaction(async ({ trx }) => {\n const contentTypes = Object.values(strapi.contentTypes) as Schema.ContentType[];\n const components = Object.values(strapi.components) as Schema.Component[];\n\n for (const model of [...contentTypes, ...components]) {\n const dbModel = strapi.db.metadata.get(model.uid);\n\n for (const attribute of Object.values(dbModel.attributes) as any) {\n /**\n * Only consider unidirectional relations\n */\n if (attribute.type !== 'relation') continue;\n if (attribute.target !== uid) continue;\n if (attribute.inversedBy || attribute.mappedBy) continue;\n const joinTable = attribute.joinTable;\n // TODO: joinColumn relations\n if (!joinTable) continue;\n\n const { name } = joinTable.inverseJoinColumn;\n\n /**\n * Load all relations that need to be updated\n */\n const oldEntriesIds = oldEntries.map((entry) => entry.id);\n const relations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(name, oldEntriesIds)\n .transacting(trx);\n\n if (relations.length === 0) continue;\n\n updates.push({ joinTable, relations });\n }\n }\n });\n\n return updates;\n};\n\n/**\n * Updates uni directional relations to target the right entries when overriding published or draft entries.\n *\n * @param oldEntries The old entries that are being overridden\n * @param newEntries The new entries that are overriding the old ones\n * @param oldRelations The relations that were previously loaded with `load` @see load\n */\nconst sync = async (\n oldEntries: { id: string; locale: string }[],\n newEntries: { id: string; locale: string }[],\n oldRelations: { joinTable: any; relations: any[] }[]\n) => {\n /**\n * Create a map of old entry ids to new entry ids\n *\n * Will be used to update the relation target ids\n */\n const newEntryByLocale = keyBy('locale', newEntries);\n const oldEntriesMap = oldEntries.reduce(\n (acc, entry) => {\n const newEntry = newEntryByLocale[entry.locale];\n if (!newEntry) return acc;\n acc[entry.id] = newEntry.id;\n return acc;\n },\n {} as Record<string, string>\n );\n\n await strapi.db.transaction(async ({ trx }) => {\n const con = strapi.db.getConnection();\n\n // Iterate old relations that are deleted and insert the new ones\n for (const { joinTable, relations } of oldRelations) {\n // Update old ids with the new ones\n const newRelations = relations.map((relation) => {\n const column = joinTable.inverseJoinColumn.name;\n const newId = oldEntriesMap[relation[column]];\n return { ...relation, [column]: newId };\n });\n\n // Insert those relations into the join table\n await con.batchInsert(joinTable.name, newRelations).transacting(trx);\n }\n });\n};\n\nexport { load, sync };\n"],"names":["keyBy"],"mappings":";;;AAcM,MAAA,OAAO,OAAO,KAAsB,eAAiD;AACzF,QAAM,UAAU,CAAA;AAGhB,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAC7C,UAAM,eAAe,OAAO,OAAO,OAAO,YAAY;AACtD,UAAM,aAAa,OAAO,OAAO,OAAO,UAAU;AAElD,eAAW,SAAS,CAAC,GAAG,cAAc,GAAG,UAAU,GAAG;AACpD,YAAM,UAAU,OAAO,GAAG,SAAS,IAAI,MAAM,GAAG;AAEhD,iBAAW,aAAa,OAAO,OAAO,QAAQ,UAAU,GAAU;AAIhE,YAAI,UAAU,SAAS;AAAY;AACnC,YAAI,UAAU,WAAW;AAAK;AAC1B,YAAA,UAAU,cAAc,UAAU;AAAU;AAChD,cAAM,YAAY,UAAU;AAE5B,YAAI,CAAC;AAAW;AAEV,cAAA,EAAE,KAAK,IAAI,UAAU;AAK3B,cAAM,gBAAgB,WAAW,IAAI,CAAC,UAAU,MAAM,EAAE;AACxD,cAAM,YAAY,MAAM,OAAO,GAC5B,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,MAAM,aAAa,EAC3B,YAAY,GAAG;AAElB,YAAI,UAAU,WAAW;AAAG;AAE5B,gBAAQ,KAAK,EAAE,WAAW,UAAW,CAAA;AAAA,MACvC;AAAA,IACF;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AASA,MAAM,OAAO,OACX,YACA,YACA,iBACG;AAMG,QAAA,mBAAmBA,GAAAA,MAAM,UAAU,UAAU;AACnD,QAAM,gBAAgB,WAAW;AAAA,IAC/B,CAAC,KAAK,UAAU;AACR,YAAA,WAAW,iBAAiB,MAAM,MAAM;AAC9C,UAAI,CAAC;AAAiB,eAAA;AAClB,UAAA,MAAM,EAAE,IAAI,SAAS;AAClB,aAAA;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EAAA;AAGH,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AACvC,UAAA,MAAM,OAAO,GAAG,cAAc;AAGpC,eAAW,EAAE,WAAW,UAAU,KAAK,cAAc;AAEnD,YAAM,eAAe,UAAU,IAAI,CAAC,aAAa;AACzC,cAAA,SAAS,UAAU,kBAAkB;AAC3C,cAAM,QAAQ,cAAc,SAAS,MAAM,CAAC;AAC5C,eAAO,EAAE,GAAG,UAAU,CAAC,MAAM,GAAG,MAAM;AAAA,MAAA,CACvC;AAGD,YAAM,IAAI,YAAY,UAAU,MAAM,YAAY,EAAE,YAAY,GAAG;AAAA,IACrE;AAAA,EAAA,CACD;AACH;;;"}
1
+ {"version":3,"file":"unidirectional-relations.js","sources":["../../../../src/services/document-service/utils/unidirectional-relations.ts"],"sourcesContent":["/* eslint-disable no-continue */\nimport { keyBy, omit } from 'lodash/fp';\n\nimport { UID, Schema } from '@strapi/types';\n\ninterface LoadContext {\n oldVersions: { id: string; locale: string }[];\n newVersions: { id: string; locale: string }[];\n}\n\n/**\n * Loads lingering relations that need to be updated when overriding a published or draft entry.\n * This is necessary because the relations are uni-directional and the target entry is not aware of the source entry.\n * This is not the case for bi-directional relations, where the target entry is also linked to the source entry.\n */\nconst load = async (uid: UID.ContentType, { oldVersions, newVersions }: LoadContext) => {\n const updates = [] as any;\n\n // Iterate all components and content types to find relations that need to be updated\n await strapi.db.transaction(async ({ trx }) => {\n const contentTypes = Object.values(strapi.contentTypes) as Schema.ContentType[];\n const components = Object.values(strapi.components) as Schema.Component[];\n\n for (const model of [...contentTypes, ...components]) {\n const dbModel = strapi.db.metadata.get(model.uid);\n\n for (const attribute of Object.values(dbModel.attributes) as any) {\n /**\n * Only consider unidirectional relations\n */\n if (\n attribute.type !== 'relation' ||\n attribute.target !== uid ||\n attribute.inversedBy ||\n attribute.mappedBy\n ) {\n continue;\n }\n\n // TODO: joinColumn relations\n const joinTable = attribute.joinTable;\n if (!joinTable) {\n continue;\n }\n\n const { name: sourceColumnName } = joinTable.joinColumn;\n const { name: targetColumnName } = joinTable.inverseJoinColumn;\n\n /**\n * Load all relations that need to be updated\n */\n // NOTE: when the model has draft and publish, we can assume relation are only draft to draft & published to published\n const ids = oldVersions.map((entry) => entry.id);\n\n const oldVersionsRelations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(targetColumnName, ids)\n .transacting(trx);\n\n if (oldVersionsRelations.length > 0) {\n updates.push({ joinTable, relations: oldVersionsRelations });\n }\n\n /**\n * if publishing\n * if published version exists\n * updated published versions links\n * else\n * create link to newly published version\n *\n * if discarding\n * if published version link exists & not draft version link\n * create link to new draft version\n */\n\n if (!model.options?.draftAndPublish) {\n const ids = newVersions.map((entry) => entry.id);\n\n const newVersionsRelations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(targetColumnName, ids)\n .transacting(trx);\n\n if (newVersionsRelations.length > 0) {\n // when publishing a draft that doesn't have a published version yet,\n // copy the links to the draft over to the published version\n // when discarding a published version, if no drafts exists\n const discardToAdd = newVersionsRelations\n .filter((relation) => {\n const matchingOldVerion = oldVersionsRelations.find((oldRelation) => {\n return oldRelation[sourceColumnName] === relation[sourceColumnName];\n });\n\n return !matchingOldVerion;\n })\n .map(omit('id'));\n\n updates.push({ joinTable, relations: discardToAdd });\n }\n }\n }\n }\n });\n\n return updates;\n};\n\n/**\n * Updates uni directional relations to target the right entries when overriding published or draft entries.\n *\n * @param oldEntries The old entries that are being overridden\n * @param newEntries The new entries that are overriding the old ones\n * @param oldRelations The relations that were previously loaded with `load` @see load\n */\nconst sync = async (\n oldEntries: { id: string; locale: string }[],\n newEntries: { id: string; locale: string }[],\n oldRelations: { joinTable: any; relations: any[] }[]\n) => {\n /**\n * Create a map of old entry ids to new entry ids\n *\n * Will be used to update the relation target ids\n */\n const newEntryByLocale = keyBy('locale', newEntries);\n const oldEntriesMap = oldEntries.reduce(\n (acc, entry) => {\n const newEntry = newEntryByLocale[entry.locale];\n if (!newEntry) return acc;\n acc[entry.id] = newEntry.id;\n return acc;\n },\n {} as Record<string, string>\n );\n\n await strapi.db.transaction(async ({ trx }) => {\n // Iterate old relations that are deleted and insert the new ones\n for (const { joinTable, relations } of oldRelations) {\n // Update old ids with the new ones\n const column = joinTable.inverseJoinColumn.name;\n\n const newRelations = relations.map((relation) => {\n const newId = oldEntriesMap[relation[column]];\n return { ...relation, [column]: newId };\n });\n\n // Insert those relations into the join table\n await trx.batchInsert(joinTable.name, newRelations, 1000);\n }\n });\n};\n\nexport { load, sync };\n"],"names":["ids","omit","keyBy"],"mappings":";;;AAeA,MAAM,OAAO,OAAO,KAAsB,EAAE,aAAa,kBAA+B;AACtF,QAAM,UAAU,CAAA;AAGhB,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAC7C,UAAM,eAAe,OAAO,OAAO,OAAO,YAAY;AACtD,UAAM,aAAa,OAAO,OAAO,OAAO,UAAU;AAElD,eAAW,SAAS,CAAC,GAAG,cAAc,GAAG,UAAU,GAAG;AACpD,YAAM,UAAU,OAAO,GAAG,SAAS,IAAI,MAAM,GAAG;AAEhD,iBAAW,aAAa,OAAO,OAAO,QAAQ,UAAU,GAAU;AAK9D,YAAA,UAAU,SAAS,cACnB,UAAU,WAAW,OACrB,UAAU,cACV,UAAU,UACV;AACA;AAAA,QACF;AAGA,cAAM,YAAY,UAAU;AAC5B,YAAI,CAAC,WAAW;AACd;AAAA,QACF;AAEA,cAAM,EAAE,MAAM,qBAAqB,UAAU;AAC7C,cAAM,EAAE,MAAM,qBAAqB,UAAU;AAM7C,cAAM,MAAM,YAAY,IAAI,CAAC,UAAU,MAAM,EAAE;AAE/C,cAAM,uBAAuB,MAAM,OAAO,GACvC,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,kBAAkB,GAAG,EAC7B,YAAY,GAAG;AAEd,YAAA,qBAAqB,SAAS,GAAG;AACnC,kBAAQ,KAAK,EAAE,WAAW,WAAW,qBAAsB,CAAA;AAAA,QAC7D;AAcI,YAAA,CAAC,MAAM,SAAS,iBAAiB;AACnC,gBAAMA,OAAM,YAAY,IAAI,CAAC,UAAU,MAAM,EAAE;AAE/C,gBAAM,uBAAuB,MAAM,OAAO,GACvC,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,kBAAkBA,IAAG,EAC7B,YAAY,GAAG;AAEd,cAAA,qBAAqB,SAAS,GAAG;AAInC,kBAAM,eAAe,qBAClB,OAAO,CAAC,aAAa;AACpB,oBAAM,oBAAoB,qBAAqB,KAAK,CAAC,gBAAgB;AACnE,uBAAO,YAAY,gBAAgB,MAAM,SAAS,gBAAgB;AAAA,cAAA,CACnE;AAED,qBAAO,CAAC;AAAA,YACT,CAAA,EACA,IAAIC,QAAK,IAAI,CAAC;AAEjB,oBAAQ,KAAK,EAAE,WAAW,WAAW,aAAc,CAAA;AAAA,UACrD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AASA,MAAM,OAAO,OACX,YACA,YACA,iBACG;AAMG,QAAA,mBAAmBC,GAAAA,MAAM,UAAU,UAAU;AACnD,QAAM,gBAAgB,WAAW;AAAA,IAC/B,CAAC,KAAK,UAAU;AACR,YAAA,WAAW,iBAAiB,MAAM,MAAM;AAC1C,UAAA,CAAC,SAAiB,QAAA;AAClB,UAAA,MAAM,EAAE,IAAI,SAAS;AAClB,aAAA;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EAAA;AAGH,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAE7C,eAAW,EAAE,WAAW,UAAU,KAAK,cAAc;AAE7C,YAAA,SAAS,UAAU,kBAAkB;AAE3C,YAAM,eAAe,UAAU,IAAI,CAAC,aAAa;AAC/C,cAAM,QAAQ,cAAc,SAAS,MAAM,CAAC;AAC5C,eAAO,EAAE,GAAG,UAAU,CAAC,MAAM,GAAG,MAAM;AAAA,MAAA,CACvC;AAGD,YAAM,IAAI,YAAY,UAAU,MAAM,cAAc,GAAI;AAAA,IAC1D;AAAA,EAAA,CACD;AACH;;;"}
@@ -1,5 +1,5 @@
1
- import { keyBy } from "lodash/fp";
2
- const load = async (uid, oldEntries) => {
1
+ import { omit, keyBy } from "lodash/fp";
2
+ const load = async (uid, { oldVersions, newVersions }) => {
3
3
  const updates = [];
4
4
  await strapi.db.transaction(async ({ trx }) => {
5
5
  const contentTypes = Object.values(strapi.contentTypes);
@@ -7,21 +7,33 @@ const load = async (uid, oldEntries) => {
7
7
  for (const model of [...contentTypes, ...components]) {
8
8
  const dbModel = strapi.db.metadata.get(model.uid);
9
9
  for (const attribute of Object.values(dbModel.attributes)) {
10
- if (attribute.type !== "relation")
11
- continue;
12
- if (attribute.target !== uid)
13
- continue;
14
- if (attribute.inversedBy || attribute.mappedBy)
10
+ if (attribute.type !== "relation" || attribute.target !== uid || attribute.inversedBy || attribute.mappedBy) {
15
11
  continue;
12
+ }
16
13
  const joinTable = attribute.joinTable;
17
- if (!joinTable)
18
- continue;
19
- const { name } = joinTable.inverseJoinColumn;
20
- const oldEntriesIds = oldEntries.map((entry) => entry.id);
21
- const relations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(name, oldEntriesIds).transacting(trx);
22
- if (relations.length === 0)
14
+ if (!joinTable) {
23
15
  continue;
24
- updates.push({ joinTable, relations });
16
+ }
17
+ const { name: sourceColumnName } = joinTable.joinColumn;
18
+ const { name: targetColumnName } = joinTable.inverseJoinColumn;
19
+ const ids = oldVersions.map((entry) => entry.id);
20
+ const oldVersionsRelations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(targetColumnName, ids).transacting(trx);
21
+ if (oldVersionsRelations.length > 0) {
22
+ updates.push({ joinTable, relations: oldVersionsRelations });
23
+ }
24
+ if (!model.options?.draftAndPublish) {
25
+ const ids2 = newVersions.map((entry) => entry.id);
26
+ const newVersionsRelations = await strapi.db.getConnection().select("*").from(joinTable.name).whereIn(targetColumnName, ids2).transacting(trx);
27
+ if (newVersionsRelations.length > 0) {
28
+ const discardToAdd = newVersionsRelations.filter((relation) => {
29
+ const matchingOldVerion = oldVersionsRelations.find((oldRelation) => {
30
+ return oldRelation[sourceColumnName] === relation[sourceColumnName];
31
+ });
32
+ return !matchingOldVerion;
33
+ }).map(omit("id"));
34
+ updates.push({ joinTable, relations: discardToAdd });
35
+ }
36
+ }
25
37
  }
26
38
  }
27
39
  });
@@ -32,22 +44,20 @@ const sync = async (oldEntries, newEntries, oldRelations) => {
32
44
  const oldEntriesMap = oldEntries.reduce(
33
45
  (acc, entry) => {
34
46
  const newEntry = newEntryByLocale[entry.locale];
35
- if (!newEntry)
36
- return acc;
47
+ if (!newEntry) return acc;
37
48
  acc[entry.id] = newEntry.id;
38
49
  return acc;
39
50
  },
40
51
  {}
41
52
  );
42
53
  await strapi.db.transaction(async ({ trx }) => {
43
- const con = strapi.db.getConnection();
44
54
  for (const { joinTable, relations } of oldRelations) {
55
+ const column = joinTable.inverseJoinColumn.name;
45
56
  const newRelations = relations.map((relation) => {
46
- const column = joinTable.inverseJoinColumn.name;
47
57
  const newId = oldEntriesMap[relation[column]];
48
58
  return { ...relation, [column]: newId };
49
59
  });
50
- await con.batchInsert(joinTable.name, newRelations).transacting(trx);
60
+ await trx.batchInsert(joinTable.name, newRelations, 1e3);
51
61
  }
52
62
  });
53
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"unidirectional-relations.mjs","sources":["../../../../src/services/document-service/utils/unidirectional-relations.ts"],"sourcesContent":["/* eslint-disable no-continue */\nimport { keyBy } from 'lodash/fp';\n\nimport { UID, Schema } from '@strapi/types';\n\n/**\n * Loads lingering relations that need to be updated when overriding a published or draft entry.\n * This is necessary because the relations are uni-directional and the target entry is not aware of the source entry.\n * This is not the case for bi-directional relations, where the target entry is also linked to the source entry.\n *\n * @param uid The content type uid\n * @param oldEntries The old entries that are being overridden\n * @returns An array of relations that need to be updated with the join table reference.\n */\nconst load = async (uid: UID.ContentType, oldEntries: { id: string; locale: string }[]) => {\n const updates = [] as any;\n\n // Iterate all components and content types to find relations that need to be updated\n await strapi.db.transaction(async ({ trx }) => {\n const contentTypes = Object.values(strapi.contentTypes) as Schema.ContentType[];\n const components = Object.values(strapi.components) as Schema.Component[];\n\n for (const model of [...contentTypes, ...components]) {\n const dbModel = strapi.db.metadata.get(model.uid);\n\n for (const attribute of Object.values(dbModel.attributes) as any) {\n /**\n * Only consider unidirectional relations\n */\n if (attribute.type !== 'relation') continue;\n if (attribute.target !== uid) continue;\n if (attribute.inversedBy || attribute.mappedBy) continue;\n const joinTable = attribute.joinTable;\n // TODO: joinColumn relations\n if (!joinTable) continue;\n\n const { name } = joinTable.inverseJoinColumn;\n\n /**\n * Load all relations that need to be updated\n */\n const oldEntriesIds = oldEntries.map((entry) => entry.id);\n const relations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(name, oldEntriesIds)\n .transacting(trx);\n\n if (relations.length === 0) continue;\n\n updates.push({ joinTable, relations });\n }\n }\n });\n\n return updates;\n};\n\n/**\n * Updates uni directional relations to target the right entries when overriding published or draft entries.\n *\n * @param oldEntries The old entries that are being overridden\n * @param newEntries The new entries that are overriding the old ones\n * @param oldRelations The relations that were previously loaded with `load` @see load\n */\nconst sync = async (\n oldEntries: { id: string; locale: string }[],\n newEntries: { id: string; locale: string }[],\n oldRelations: { joinTable: any; relations: any[] }[]\n) => {\n /**\n * Create a map of old entry ids to new entry ids\n *\n * Will be used to update the relation target ids\n */\n const newEntryByLocale = keyBy('locale', newEntries);\n const oldEntriesMap = oldEntries.reduce(\n (acc, entry) => {\n const newEntry = newEntryByLocale[entry.locale];\n if (!newEntry) return acc;\n acc[entry.id] = newEntry.id;\n return acc;\n },\n {} as Record<string, string>\n );\n\n await strapi.db.transaction(async ({ trx }) => {\n const con = strapi.db.getConnection();\n\n // Iterate old relations that are deleted and insert the new ones\n for (const { joinTable, relations } of oldRelations) {\n // Update old ids with the new ones\n const newRelations = relations.map((relation) => {\n const column = joinTable.inverseJoinColumn.name;\n const newId = oldEntriesMap[relation[column]];\n return { ...relation, [column]: newId };\n });\n\n // Insert those relations into the join table\n await con.batchInsert(joinTable.name, newRelations).transacting(trx);\n }\n });\n};\n\nexport { load, sync };\n"],"names":[],"mappings":";AAcM,MAAA,OAAO,OAAO,KAAsB,eAAiD;AACzF,QAAM,UAAU,CAAA;AAGhB,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAC7C,UAAM,eAAe,OAAO,OAAO,OAAO,YAAY;AACtD,UAAM,aAAa,OAAO,OAAO,OAAO,UAAU;AAElD,eAAW,SAAS,CAAC,GAAG,cAAc,GAAG,UAAU,GAAG;AACpD,YAAM,UAAU,OAAO,GAAG,SAAS,IAAI,MAAM,GAAG;AAEhD,iBAAW,aAAa,OAAO,OAAO,QAAQ,UAAU,GAAU;AAIhE,YAAI,UAAU,SAAS;AAAY;AACnC,YAAI,UAAU,WAAW;AAAK;AAC1B,YAAA,UAAU,cAAc,UAAU;AAAU;AAChD,cAAM,YAAY,UAAU;AAE5B,YAAI,CAAC;AAAW;AAEV,cAAA,EAAE,KAAK,IAAI,UAAU;AAK3B,cAAM,gBAAgB,WAAW,IAAI,CAAC,UAAU,MAAM,EAAE;AACxD,cAAM,YAAY,MAAM,OAAO,GAC5B,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,MAAM,aAAa,EAC3B,YAAY,GAAG;AAElB,YAAI,UAAU,WAAW;AAAG;AAE5B,gBAAQ,KAAK,EAAE,WAAW,UAAW,CAAA;AAAA,MACvC;AAAA,IACF;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AASA,MAAM,OAAO,OACX,YACA,YACA,iBACG;AAMG,QAAA,mBAAmB,MAAM,UAAU,UAAU;AACnD,QAAM,gBAAgB,WAAW;AAAA,IAC/B,CAAC,KAAK,UAAU;AACR,YAAA,WAAW,iBAAiB,MAAM,MAAM;AAC9C,UAAI,CAAC;AAAiB,eAAA;AAClB,UAAA,MAAM,EAAE,IAAI,SAAS;AAClB,aAAA;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EAAA;AAGH,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AACvC,UAAA,MAAM,OAAO,GAAG,cAAc;AAGpC,eAAW,EAAE,WAAW,UAAU,KAAK,cAAc;AAEnD,YAAM,eAAe,UAAU,IAAI,CAAC,aAAa;AACzC,cAAA,SAAS,UAAU,kBAAkB;AAC3C,cAAM,QAAQ,cAAc,SAAS,MAAM,CAAC;AAC5C,eAAO,EAAE,GAAG,UAAU,CAAC,MAAM,GAAG,MAAM;AAAA,MAAA,CACvC;AAGD,YAAM,IAAI,YAAY,UAAU,MAAM,YAAY,EAAE,YAAY,GAAG;AAAA,IACrE;AAAA,EAAA,CACD;AACH;"}
1
+ {"version":3,"file":"unidirectional-relations.mjs","sources":["../../../../src/services/document-service/utils/unidirectional-relations.ts"],"sourcesContent":["/* eslint-disable no-continue */\nimport { keyBy, omit } from 'lodash/fp';\n\nimport { UID, Schema } from '@strapi/types';\n\ninterface LoadContext {\n oldVersions: { id: string; locale: string }[];\n newVersions: { id: string; locale: string }[];\n}\n\n/**\n * Loads lingering relations that need to be updated when overriding a published or draft entry.\n * This is necessary because the relations are uni-directional and the target entry is not aware of the source entry.\n * This is not the case for bi-directional relations, where the target entry is also linked to the source entry.\n */\nconst load = async (uid: UID.ContentType, { oldVersions, newVersions }: LoadContext) => {\n const updates = [] as any;\n\n // Iterate all components and content types to find relations that need to be updated\n await strapi.db.transaction(async ({ trx }) => {\n const contentTypes = Object.values(strapi.contentTypes) as Schema.ContentType[];\n const components = Object.values(strapi.components) as Schema.Component[];\n\n for (const model of [...contentTypes, ...components]) {\n const dbModel = strapi.db.metadata.get(model.uid);\n\n for (const attribute of Object.values(dbModel.attributes) as any) {\n /**\n * Only consider unidirectional relations\n */\n if (\n attribute.type !== 'relation' ||\n attribute.target !== uid ||\n attribute.inversedBy ||\n attribute.mappedBy\n ) {\n continue;\n }\n\n // TODO: joinColumn relations\n const joinTable = attribute.joinTable;\n if (!joinTable) {\n continue;\n }\n\n const { name: sourceColumnName } = joinTable.joinColumn;\n const { name: targetColumnName } = joinTable.inverseJoinColumn;\n\n /**\n * Load all relations that need to be updated\n */\n // NOTE: when the model has draft and publish, we can assume relation are only draft to draft & published to published\n const ids = oldVersions.map((entry) => entry.id);\n\n const oldVersionsRelations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(targetColumnName, ids)\n .transacting(trx);\n\n if (oldVersionsRelations.length > 0) {\n updates.push({ joinTable, relations: oldVersionsRelations });\n }\n\n /**\n * if publishing\n * if published version exists\n * updated published versions links\n * else\n * create link to newly published version\n *\n * if discarding\n * if published version link exists & not draft version link\n * create link to new draft version\n */\n\n if (!model.options?.draftAndPublish) {\n const ids = newVersions.map((entry) => entry.id);\n\n const newVersionsRelations = await strapi.db\n .getConnection()\n .select('*')\n .from(joinTable.name)\n .whereIn(targetColumnName, ids)\n .transacting(trx);\n\n if (newVersionsRelations.length > 0) {\n // when publishing a draft that doesn't have a published version yet,\n // copy the links to the draft over to the published version\n // when discarding a published version, if no drafts exists\n const discardToAdd = newVersionsRelations\n .filter((relation) => {\n const matchingOldVerion = oldVersionsRelations.find((oldRelation) => {\n return oldRelation[sourceColumnName] === relation[sourceColumnName];\n });\n\n return !matchingOldVerion;\n })\n .map(omit('id'));\n\n updates.push({ joinTable, relations: discardToAdd });\n }\n }\n }\n }\n });\n\n return updates;\n};\n\n/**\n * Updates uni directional relations to target the right entries when overriding published or draft entries.\n *\n * @param oldEntries The old entries that are being overridden\n * @param newEntries The new entries that are overriding the old ones\n * @param oldRelations The relations that were previously loaded with `load` @see load\n */\nconst sync = async (\n oldEntries: { id: string; locale: string }[],\n newEntries: { id: string; locale: string }[],\n oldRelations: { joinTable: any; relations: any[] }[]\n) => {\n /**\n * Create a map of old entry ids to new entry ids\n *\n * Will be used to update the relation target ids\n */\n const newEntryByLocale = keyBy('locale', newEntries);\n const oldEntriesMap = oldEntries.reduce(\n (acc, entry) => {\n const newEntry = newEntryByLocale[entry.locale];\n if (!newEntry) return acc;\n acc[entry.id] = newEntry.id;\n return acc;\n },\n {} as Record<string, string>\n );\n\n await strapi.db.transaction(async ({ trx }) => {\n // Iterate old relations that are deleted and insert the new ones\n for (const { joinTable, relations } of oldRelations) {\n // Update old ids with the new ones\n const column = joinTable.inverseJoinColumn.name;\n\n const newRelations = relations.map((relation) => {\n const newId = oldEntriesMap[relation[column]];\n return { ...relation, [column]: newId };\n });\n\n // Insert those relations into the join table\n await trx.batchInsert(joinTable.name, newRelations, 1000);\n }\n });\n};\n\nexport { load, sync };\n"],"names":["ids"],"mappings":";AAeA,MAAM,OAAO,OAAO,KAAsB,EAAE,aAAa,kBAA+B;AACtF,QAAM,UAAU,CAAA;AAGhB,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAC7C,UAAM,eAAe,OAAO,OAAO,OAAO,YAAY;AACtD,UAAM,aAAa,OAAO,OAAO,OAAO,UAAU;AAElD,eAAW,SAAS,CAAC,GAAG,cAAc,GAAG,UAAU,GAAG;AACpD,YAAM,UAAU,OAAO,GAAG,SAAS,IAAI,MAAM,GAAG;AAEhD,iBAAW,aAAa,OAAO,OAAO,QAAQ,UAAU,GAAU;AAK9D,YAAA,UAAU,SAAS,cACnB,UAAU,WAAW,OACrB,UAAU,cACV,UAAU,UACV;AACA;AAAA,QACF;AAGA,cAAM,YAAY,UAAU;AAC5B,YAAI,CAAC,WAAW;AACd;AAAA,QACF;AAEA,cAAM,EAAE,MAAM,qBAAqB,UAAU;AAC7C,cAAM,EAAE,MAAM,qBAAqB,UAAU;AAM7C,cAAM,MAAM,YAAY,IAAI,CAAC,UAAU,MAAM,EAAE;AAE/C,cAAM,uBAAuB,MAAM,OAAO,GACvC,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,kBAAkB,GAAG,EAC7B,YAAY,GAAG;AAEd,YAAA,qBAAqB,SAAS,GAAG;AACnC,kBAAQ,KAAK,EAAE,WAAW,WAAW,qBAAsB,CAAA;AAAA,QAC7D;AAcI,YAAA,CAAC,MAAM,SAAS,iBAAiB;AACnC,gBAAMA,OAAM,YAAY,IAAI,CAAC,UAAU,MAAM,EAAE;AAE/C,gBAAM,uBAAuB,MAAM,OAAO,GACvC,gBACA,OAAO,GAAG,EACV,KAAK,UAAU,IAAI,EACnB,QAAQ,kBAAkBA,IAAG,EAC7B,YAAY,GAAG;AAEd,cAAA,qBAAqB,SAAS,GAAG;AAInC,kBAAM,eAAe,qBAClB,OAAO,CAAC,aAAa;AACpB,oBAAM,oBAAoB,qBAAqB,KAAK,CAAC,gBAAgB;AACnE,uBAAO,YAAY,gBAAgB,MAAM,SAAS,gBAAgB;AAAA,cAAA,CACnE;AAED,qBAAO,CAAC;AAAA,YACT,CAAA,EACA,IAAI,KAAK,IAAI,CAAC;AAEjB,oBAAQ,KAAK,EAAE,WAAW,WAAW,aAAc,CAAA;AAAA,UACrD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EAAA,CACD;AAEM,SAAA;AACT;AASA,MAAM,OAAO,OACX,YACA,YACA,iBACG;AAMG,QAAA,mBAAmB,MAAM,UAAU,UAAU;AACnD,QAAM,gBAAgB,WAAW;AAAA,IAC/B,CAAC,KAAK,UAAU;AACR,YAAA,WAAW,iBAAiB,MAAM,MAAM;AAC1C,UAAA,CAAC,SAAiB,QAAA;AAClB,UAAA,MAAM,EAAE,IAAI,SAAS;AAClB,aAAA;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EAAA;AAGH,QAAM,OAAO,GAAG,YAAY,OAAO,EAAE,UAAU;AAE7C,eAAW,EAAE,WAAW,UAAU,KAAK,cAAc;AAE7C,YAAA,SAAS,UAAU,kBAAkB;AAE3C,YAAM,eAAe,UAAU,IAAI,CAAC,aAAa;AAC/C,cAAM,QAAQ,cAAc,SAAS,MAAM,CAAC;AAC5C,eAAO,EAAE,GAAG,UAAU,CAAC,MAAM,GAAG,MAAM;AAAA,MAAA,CACvC;AAGD,YAAM,IAAI,YAAY,UAAU,MAAM,cAAc,GAAI;AAAA,IAC1D;AAAA,EAAA,CACD;AACH;"}
@@ -35,8 +35,7 @@ const createTelemetryInstance = (strapi) => {
35
35
  crons.forEach((cron) => cron.cancel());
36
36
  },
37
37
  async send(event, payload = {}) {
38
- if (isDisabled)
39
- return true;
38
+ if (isDisabled) return true;
40
39
  return sendEvent(event, payload);
41
40
  }
42
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/services/metrics/index.ts"],"sourcesContent":["/**\n * Strapi telemetry package.\n * You can learn more at https://docs.strapi.io/developer-docs/latest/getting-started/usage-information.html\n */\n\nimport { Job, scheduleJob } from 'node-schedule';\nimport type { Core } from '@strapi/types';\n\nimport wrapWithRateLimit from './rate-limiter';\nimport createSender from './sender';\nimport createMiddleware from './middleware';\nimport isTruthy from './is-truthy';\n\nconst LIMITED_EVENTS = [\n 'didSaveMediaWithAlternativeText',\n 'didSaveMediaWithCaption',\n 'didDisableResponsiveDimensions',\n 'didEnableResponsiveDimensions',\n 'didInitializePluginUpload',\n];\n\nconst createTelemetryInstance = (strapi: Core.Strapi) => {\n const uuid = strapi.config.get('uuid');\n const telemetryDisabled = strapi.config.get('packageJsonStrapi.telemetryDisabled');\n const isDisabled =\n !uuid || isTruthy(process.env.STRAPI_TELEMETRY_DISABLED) || isTruthy(telemetryDisabled);\n\n const crons: Job[] = [];\n const sender = createSender(strapi);\n const sendEvent = wrapWithRateLimit(sender, { limitedEvents: LIMITED_EVENTS });\n\n return {\n get isDisabled() {\n return isDisabled;\n },\n\n register() {\n if (!isDisabled) {\n const pingCron = scheduleJob('0 0 12 * * *', () => sendEvent('ping'));\n crons.push(pingCron);\n\n strapi.server.use(createMiddleware({ sendEvent }));\n }\n },\n\n bootstrap() {},\n\n destroy() {\n // Clear open handles\n crons.forEach((cron) => cron.cancel());\n },\n\n async send(event: string, payload: Record<string, unknown> = {}) {\n if (isDisabled) return true;\n return sendEvent(event, payload);\n },\n };\n};\n\nexport default createTelemetryInstance;\n"],"names":["sender","createSender","wrapWithRateLimit","scheduleJob","createMiddleware"],"mappings":";;;;;;AAaA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEM,MAAA,0BAA0B,CAAC,WAAwB;AACvD,QAAM,OAAO,OAAO,OAAO,IAAI,MAAM;AACrC,QAAM,oBAAoB,OAAO,OAAO,IAAI,qCAAqC;AAC3E,QAAA,aACJ,CAAC,QAAQ,SAAS,QAAQ,IAAI,yBAAyB,KAAK,SAAS,iBAAiB;AAExF,QAAM,QAAe,CAAA;AACf,QAAAA,WAASC,OAAa,MAAM;AAClC,QAAM,YAAYC,YAAkBF,UAAQ,EAAE,eAAe,gBAAgB;AAEtE,SAAA;AAAA,IACL,IAAI,aAAa;AACR,aAAA;AAAA,IACT;AAAA,IAEA,WAAW;AACT,UAAI,CAAC,YAAY;AACf,cAAM,WAAWG,aAAAA,YAAY,gBAAgB,MAAM,UAAU,MAAM,CAAC;AACpE,cAAM,KAAK,QAAQ;AAEnB,eAAO,OAAO,IAAIC,WAAiB,EAAE,UAAW,CAAA,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,IAAC;AAAA,IAEb,UAAU;AAER,YAAM,QAAQ,CAAC,SAAS,KAAK,OAAQ,CAAA;AAAA,IACvC;AAAA,IAEA,MAAM,KAAK,OAAe,UAAmC,IAAI;AAC3D,UAAA;AAAmB,eAAA;AAChB,aAAA,UAAU,OAAO,OAAO;AAAA,IACjC;AAAA,EAAA;AAEJ;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/services/metrics/index.ts"],"sourcesContent":["/**\n * Strapi telemetry package.\n * You can learn more at https://docs.strapi.io/developer-docs/latest/getting-started/usage-information.html\n */\n\nimport { Job, scheduleJob } from 'node-schedule';\nimport type { Core } from '@strapi/types';\n\nimport wrapWithRateLimit from './rate-limiter';\nimport createSender from './sender';\nimport createMiddleware from './middleware';\nimport isTruthy from './is-truthy';\n\nconst LIMITED_EVENTS = [\n 'didSaveMediaWithAlternativeText',\n 'didSaveMediaWithCaption',\n 'didDisableResponsiveDimensions',\n 'didEnableResponsiveDimensions',\n 'didInitializePluginUpload',\n];\n\nconst createTelemetryInstance = (strapi: Core.Strapi) => {\n const uuid = strapi.config.get('uuid');\n const telemetryDisabled = strapi.config.get('packageJsonStrapi.telemetryDisabled');\n const isDisabled =\n !uuid || isTruthy(process.env.STRAPI_TELEMETRY_DISABLED) || isTruthy(telemetryDisabled);\n\n const crons: Job[] = [];\n const sender = createSender(strapi);\n const sendEvent = wrapWithRateLimit(sender, { limitedEvents: LIMITED_EVENTS });\n\n return {\n get isDisabled() {\n return isDisabled;\n },\n\n register() {\n if (!isDisabled) {\n const pingCron = scheduleJob('0 0 12 * * *', () => sendEvent('ping'));\n crons.push(pingCron);\n\n strapi.server.use(createMiddleware({ sendEvent }));\n }\n },\n\n bootstrap() {},\n\n destroy() {\n // Clear open handles\n crons.forEach((cron) => cron.cancel());\n },\n\n async send(event: string, payload: Record<string, unknown> = {}) {\n if (isDisabled) return true;\n return sendEvent(event, payload);\n },\n };\n};\n\nexport default createTelemetryInstance;\n"],"names":["sender","createSender","wrapWithRateLimit","scheduleJob","createMiddleware"],"mappings":";;;;;;AAaA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEM,MAAA,0BAA0B,CAAC,WAAwB;AACvD,QAAM,OAAO,OAAO,OAAO,IAAI,MAAM;AACrC,QAAM,oBAAoB,OAAO,OAAO,IAAI,qCAAqC;AAC3E,QAAA,aACJ,CAAC,QAAQ,SAAS,QAAQ,IAAI,yBAAyB,KAAK,SAAS,iBAAiB;AAExF,QAAM,QAAe,CAAA;AACf,QAAAA,WAASC,OAAa,MAAM;AAClC,QAAM,YAAYC,YAAkBF,UAAQ,EAAE,eAAe,gBAAgB;AAEtE,SAAA;AAAA,IACL,IAAI,aAAa;AACR,aAAA;AAAA,IACT;AAAA,IAEA,WAAW;AACT,UAAI,CAAC,YAAY;AACf,cAAM,WAAWG,aAAAA,YAAY,gBAAgB,MAAM,UAAU,MAAM,CAAC;AACpE,cAAM,KAAK,QAAQ;AAEnB,eAAO,OAAO,IAAIC,WAAiB,EAAE,UAAW,CAAA,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,IAAC;AAAA,IAEb,UAAU;AAER,YAAM,QAAQ,CAAC,SAAS,KAAK,OAAQ,CAAA;AAAA,IACvC;AAAA,IAEA,MAAM,KAAK,OAAe,UAAmC,IAAI;AAC/D,UAAI,WAAmB,QAAA;AAChB,aAAA,UAAU,OAAO,OAAO;AAAA,IACjC;AAAA,EAAA;AAEJ;;"}
@@ -34,8 +34,7 @@ const createTelemetryInstance = (strapi) => {
34
34
  crons.forEach((cron) => cron.cancel());
35
35
  },
36
36
  async send(event, payload = {}) {
37
- if (isDisabled)
38
- return true;
37
+ if (isDisabled) return true;
39
38
  return sendEvent(event, payload);
40
39
  }
41
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/services/metrics/index.ts"],"sourcesContent":["/**\n * Strapi telemetry package.\n * You can learn more at https://docs.strapi.io/developer-docs/latest/getting-started/usage-information.html\n */\n\nimport { Job, scheduleJob } from 'node-schedule';\nimport type { Core } from '@strapi/types';\n\nimport wrapWithRateLimit from './rate-limiter';\nimport createSender from './sender';\nimport createMiddleware from './middleware';\nimport isTruthy from './is-truthy';\n\nconst LIMITED_EVENTS = [\n 'didSaveMediaWithAlternativeText',\n 'didSaveMediaWithCaption',\n 'didDisableResponsiveDimensions',\n 'didEnableResponsiveDimensions',\n 'didInitializePluginUpload',\n];\n\nconst createTelemetryInstance = (strapi: Core.Strapi) => {\n const uuid = strapi.config.get('uuid');\n const telemetryDisabled = strapi.config.get('packageJsonStrapi.telemetryDisabled');\n const isDisabled =\n !uuid || isTruthy(process.env.STRAPI_TELEMETRY_DISABLED) || isTruthy(telemetryDisabled);\n\n const crons: Job[] = [];\n const sender = createSender(strapi);\n const sendEvent = wrapWithRateLimit(sender, { limitedEvents: LIMITED_EVENTS });\n\n return {\n get isDisabled() {\n return isDisabled;\n },\n\n register() {\n if (!isDisabled) {\n const pingCron = scheduleJob('0 0 12 * * *', () => sendEvent('ping'));\n crons.push(pingCron);\n\n strapi.server.use(createMiddleware({ sendEvent }));\n }\n },\n\n bootstrap() {},\n\n destroy() {\n // Clear open handles\n crons.forEach((cron) => cron.cancel());\n },\n\n async send(event: string, payload: Record<string, unknown> = {}) {\n if (isDisabled) return true;\n return sendEvent(event, payload);\n },\n };\n};\n\nexport default createTelemetryInstance;\n"],"names":[],"mappings":";;;;;AAaA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEM,MAAA,0BAA0B,CAAC,WAAwB;AACvD,QAAM,OAAO,OAAO,OAAO,IAAI,MAAM;AACrC,QAAM,oBAAoB,OAAO,OAAO,IAAI,qCAAqC;AAC3E,QAAA,aACJ,CAAC,QAAQ,SAAS,QAAQ,IAAI,yBAAyB,KAAK,SAAS,iBAAiB;AAExF,QAAM,QAAe,CAAA;AACf,QAAA,SAAS,aAAa,MAAM;AAClC,QAAM,YAAY,kBAAkB,QAAQ,EAAE,eAAe,gBAAgB;AAEtE,SAAA;AAAA,IACL,IAAI,aAAa;AACR,aAAA;AAAA,IACT;AAAA,IAEA,WAAW;AACT,UAAI,CAAC,YAAY;AACf,cAAM,WAAW,YAAY,gBAAgB,MAAM,UAAU,MAAM,CAAC;AACpE,cAAM,KAAK,QAAQ;AAEnB,eAAO,OAAO,IAAI,iBAAiB,EAAE,UAAW,CAAA,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,IAAC;AAAA,IAEb,UAAU;AAER,YAAM,QAAQ,CAAC,SAAS,KAAK,OAAQ,CAAA;AAAA,IACvC;AAAA,IAEA,MAAM,KAAK,OAAe,UAAmC,IAAI;AAC3D,UAAA;AAAmB,eAAA;AAChB,aAAA,UAAU,OAAO,OAAO;AAAA,IACjC;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/services/metrics/index.ts"],"sourcesContent":["/**\n * Strapi telemetry package.\n * You can learn more at https://docs.strapi.io/developer-docs/latest/getting-started/usage-information.html\n */\n\nimport { Job, scheduleJob } from 'node-schedule';\nimport type { Core } from '@strapi/types';\n\nimport wrapWithRateLimit from './rate-limiter';\nimport createSender from './sender';\nimport createMiddleware from './middleware';\nimport isTruthy from './is-truthy';\n\nconst LIMITED_EVENTS = [\n 'didSaveMediaWithAlternativeText',\n 'didSaveMediaWithCaption',\n 'didDisableResponsiveDimensions',\n 'didEnableResponsiveDimensions',\n 'didInitializePluginUpload',\n];\n\nconst createTelemetryInstance = (strapi: Core.Strapi) => {\n const uuid = strapi.config.get('uuid');\n const telemetryDisabled = strapi.config.get('packageJsonStrapi.telemetryDisabled');\n const isDisabled =\n !uuid || isTruthy(process.env.STRAPI_TELEMETRY_DISABLED) || isTruthy(telemetryDisabled);\n\n const crons: Job[] = [];\n const sender = createSender(strapi);\n const sendEvent = wrapWithRateLimit(sender, { limitedEvents: LIMITED_EVENTS });\n\n return {\n get isDisabled() {\n return isDisabled;\n },\n\n register() {\n if (!isDisabled) {\n const pingCron = scheduleJob('0 0 12 * * *', () => sendEvent('ping'));\n crons.push(pingCron);\n\n strapi.server.use(createMiddleware({ sendEvent }));\n }\n },\n\n bootstrap() {},\n\n destroy() {\n // Clear open handles\n crons.forEach((cron) => cron.cancel());\n },\n\n async send(event: string, payload: Record<string, unknown> = {}) {\n if (isDisabled) return true;\n return sendEvent(event, payload);\n },\n };\n};\n\nexport default createTelemetryInstance;\n"],"names":[],"mappings":";;;;;AAaA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEM,MAAA,0BAA0B,CAAC,WAAwB;AACvD,QAAM,OAAO,OAAO,OAAO,IAAI,MAAM;AACrC,QAAM,oBAAoB,OAAO,OAAO,IAAI,qCAAqC;AAC3E,QAAA,aACJ,CAAC,QAAQ,SAAS,QAAQ,IAAI,yBAAyB,KAAK,SAAS,iBAAiB;AAExF,QAAM,QAAe,CAAA;AACf,QAAA,SAAS,aAAa,MAAM;AAClC,QAAM,YAAY,kBAAkB,QAAQ,EAAE,eAAe,gBAAgB;AAEtE,SAAA;AAAA,IACL,IAAI,aAAa;AACR,aAAA;AAAA,IACT;AAAA,IAEA,WAAW;AACT,UAAI,CAAC,YAAY;AACf,cAAM,WAAW,YAAY,gBAAgB,MAAM,UAAU,MAAM,CAAC;AACpE,cAAM,KAAK,QAAQ;AAEnB,eAAO,OAAO,IAAI,iBAAiB,EAAE,UAAW,CAAA,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,IAEA,YAAY;AAAA,IAAC;AAAA,IAEb,UAAU;AAER,YAAM,QAAQ,CAAC,SAAS,KAAK,OAAQ,CAAA;AAAA,IACvC;AAAA,IAEA,MAAM,KAAK,OAAe,UAAmC,IAAI;AAC/D,UAAI,WAAmB,QAAA;AAChB,aAAA,UAAU,OAAO,OAAO;AAAA,IACjC;AAAA,EAAA;AAEJ;"}
@@ -29,8 +29,7 @@ const loadFiles = async (dir, pattern, { requireFn = strapiUtils.importDefault,
29
29
  value: path__default.default.basename(file)
30
30
  });
31
31
  const propPath = filepathToPropPath.filePathToPropPath(file, shouldUseFileNameAsKey(file));
32
- if (propPath.length === 0)
33
- ___default.default.merge(root, mod);
32
+ if (propPath.length === 0) ___default.default.merge(root, mod);
34
33
  ___default.default.merge(root, ___default.default.setWith({}, propPath, mod, Object));
35
34
  }
36
35
  return root;
@@ -1 +1 @@
1
- {"version":3,"file":"load-files.js","sources":["../../src/utils/load-files.ts"],"sourcesContent":["import path from 'path';\nimport _ from 'lodash';\nimport fse from 'fs-extra';\n\nimport { importDefault } from '@strapi/utils';\nimport { glob } from 'glob';\nimport { filePathToPropPath } from './filepath-to-prop-path';\n\n/**\n * Returns an Object build from a list of files matching a glob pattern in a directory\n * It builds a tree structure resembling the folder structure in dir\n */\nexport const loadFiles = async <T extends object>(\n dir: string,\n pattern: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n { requireFn = importDefault, shouldUseFileNameAsKey = (_: any) => true, globArgs = {} } = {}\n): Promise<T> => {\n const root = {};\n const files = await glob(pattern, { cwd: dir, ...globArgs });\n\n for (const file of files) {\n const absolutePath = path.resolve(dir, file);\n\n // load module\n delete require.cache[absolutePath];\n let mod;\n\n if (path.extname(absolutePath) === '.json') {\n mod = await fse.readJson(absolutePath);\n } else {\n mod = requireFn(absolutePath);\n }\n\n Object.defineProperty(mod, '__filename__', {\n enumerable: true,\n configurable: false,\n writable: false,\n value: path.basename(file),\n });\n\n const propPath = filePathToPropPath(file, shouldUseFileNameAsKey(file));\n\n if (propPath.length === 0) _.merge(root, mod);\n _.merge(root, _.setWith({}, propPath, mod, Object));\n }\n\n return root as T;\n};\n"],"names":["importDefault","_","glob","path","fse","filePathToPropPath"],"mappings":";;;;;;;;;;;;AAYO,MAAM,YAAY,OACvB,KACA,SAEA,EAAE,YAAYA,YAAe,eAAA,yBAAyB,CAACC,OAAW,MAAM,WAAW,CAAG,EAAA,IAAI,CAAA,MAC3E;AACf,QAAM,OAAO,CAAA;AACP,QAAA,QAAQ,MAAMC,KAAAA,KAAK,SAAS,EAAE,KAAK,KAAK,GAAG,SAAA,CAAU;AAE3D,aAAW,QAAQ,OAAO;AACxB,UAAM,eAAeC,cAAA,QAAK,QAAQ,KAAK,IAAI;AAGpC,WAAA,QAAQ,MAAM,YAAY;AAC7B,QAAA;AAEJ,QAAIA,sBAAK,QAAQ,YAAY,MAAM,SAAS;AACpC,YAAA,MAAMC,aAAAA,QAAI,SAAS,YAAY;AAAA,IAAA,OAChC;AACL,YAAM,UAAU,YAAY;AAAA,IAC9B;AAEO,WAAA,eAAe,KAAK,gBAAgB;AAAA,MACzC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAOD,cAAAA,QAAK,SAAS,IAAI;AAAA,IAAA,CAC1B;AAED,UAAM,WAAWE,mBAAAA,mBAAmB,MAAM,uBAAuB,IAAI,CAAC;AAEtE,QAAI,SAAS,WAAW;AAAKJ,iBAAAA,QAAA,MAAM,MAAM,GAAG;AAC1CA,uBAAA,MAAM,MAAMA,mBAAE,QAAQ,CAAI,GAAA,UAAU,KAAK,MAAM,CAAC;AAAA,EACpD;AAEO,SAAA;AACT;;"}
1
+ {"version":3,"file":"load-files.js","sources":["../../src/utils/load-files.ts"],"sourcesContent":["import path from 'path';\nimport _ from 'lodash';\nimport fse from 'fs-extra';\n\nimport { importDefault } from '@strapi/utils';\nimport { glob } from 'glob';\nimport { filePathToPropPath } from './filepath-to-prop-path';\n\n/**\n * Returns an Object build from a list of files matching a glob pattern in a directory\n * It builds a tree structure resembling the folder structure in dir\n */\nexport const loadFiles = async <T extends object>(\n dir: string,\n pattern: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n { requireFn = importDefault, shouldUseFileNameAsKey = (_: any) => true, globArgs = {} } = {}\n): Promise<T> => {\n const root = {};\n const files = await glob(pattern, { cwd: dir, ...globArgs });\n\n for (const file of files) {\n const absolutePath = path.resolve(dir, file);\n\n // load module\n delete require.cache[absolutePath];\n let mod;\n\n if (path.extname(absolutePath) === '.json') {\n mod = await fse.readJson(absolutePath);\n } else {\n mod = requireFn(absolutePath);\n }\n\n Object.defineProperty(mod, '__filename__', {\n enumerable: true,\n configurable: false,\n writable: false,\n value: path.basename(file),\n });\n\n const propPath = filePathToPropPath(file, shouldUseFileNameAsKey(file));\n\n if (propPath.length === 0) _.merge(root, mod);\n _.merge(root, _.setWith({}, propPath, mod, Object));\n }\n\n return root as T;\n};\n"],"names":["importDefault","_","glob","path","fse","filePathToPropPath"],"mappings":";;;;;;;;;;;;AAYO,MAAM,YAAY,OACvB,KACA,SAEA,EAAE,YAAYA,YAAe,eAAA,yBAAyB,CAACC,OAAW,MAAM,WAAW,CAAG,EAAA,IAAI,CAAA,MAC3E;AACf,QAAM,OAAO,CAAA;AACP,QAAA,QAAQ,MAAMC,KAAAA,KAAK,SAAS,EAAE,KAAK,KAAK,GAAG,SAAA,CAAU;AAE3D,aAAW,QAAQ,OAAO;AACxB,UAAM,eAAeC,cAAA,QAAK,QAAQ,KAAK,IAAI;AAGpC,WAAA,QAAQ,MAAM,YAAY;AAC7B,QAAA;AAEJ,QAAIA,sBAAK,QAAQ,YAAY,MAAM,SAAS;AACpC,YAAA,MAAMC,aAAAA,QAAI,SAAS,YAAY;AAAA,IAAA,OAChC;AACL,YAAM,UAAU,YAAY;AAAA,IAC9B;AAEO,WAAA,eAAe,KAAK,gBAAgB;AAAA,MACzC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAOD,cAAAA,QAAK,SAAS,IAAI;AAAA,IAAA,CAC1B;AAED,UAAM,WAAWE,mBAAAA,mBAAmB,MAAM,uBAAuB,IAAI,CAAC;AAEtE,QAAI,SAAS,WAAW,EAAKJ,YAAA,QAAA,MAAM,MAAM,GAAG;AAC1CA,uBAAA,MAAM,MAAMA,mBAAE,QAAQ,CAAI,GAAA,UAAU,KAAK,MAAM,CAAC;AAAA,EACpD;AAEO,SAAA;AACT;;"}
@@ -23,8 +23,7 @@ const loadFiles = async (dir, pattern, { requireFn = importDefault, shouldUseFil
23
23
  value: path.basename(file)
24
24
  });
25
25
  const propPath = filePathToPropPath(file, shouldUseFileNameAsKey(file));
26
- if (propPath.length === 0)
27
- _.merge(root, mod);
26
+ if (propPath.length === 0) _.merge(root, mod);
28
27
  _.merge(root, _.setWith({}, propPath, mod, Object));
29
28
  }
30
29
  return root;
@@ -1 +1 @@
1
- {"version":3,"file":"load-files.mjs","sources":["../../src/utils/load-files.ts"],"sourcesContent":["import path from 'path';\nimport _ from 'lodash';\nimport fse from 'fs-extra';\n\nimport { importDefault } from '@strapi/utils';\nimport { glob } from 'glob';\nimport { filePathToPropPath } from './filepath-to-prop-path';\n\n/**\n * Returns an Object build from a list of files matching a glob pattern in a directory\n * It builds a tree structure resembling the folder structure in dir\n */\nexport const loadFiles = async <T extends object>(\n dir: string,\n pattern: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n { requireFn = importDefault, shouldUseFileNameAsKey = (_: any) => true, globArgs = {} } = {}\n): Promise<T> => {\n const root = {};\n const files = await glob(pattern, { cwd: dir, ...globArgs });\n\n for (const file of files) {\n const absolutePath = path.resolve(dir, file);\n\n // load module\n delete require.cache[absolutePath];\n let mod;\n\n if (path.extname(absolutePath) === '.json') {\n mod = await fse.readJson(absolutePath);\n } else {\n mod = requireFn(absolutePath);\n }\n\n Object.defineProperty(mod, '__filename__', {\n enumerable: true,\n configurable: false,\n writable: false,\n value: path.basename(file),\n });\n\n const propPath = filePathToPropPath(file, shouldUseFileNameAsKey(file));\n\n if (propPath.length === 0) _.merge(root, mod);\n _.merge(root, _.setWith({}, propPath, mod, Object));\n }\n\n return root as T;\n};\n"],"names":["_"],"mappings":";;;;;;AAYO,MAAM,YAAY,OACvB,KACA,SAEA,EAAE,YAAY,eAAe,yBAAyB,CAACA,OAAW,MAAM,WAAW,CAAG,EAAA,IAAI,CAAA,MAC3E;AACf,QAAM,OAAO,CAAA;AACP,QAAA,QAAQ,MAAM,KAAK,SAAS,EAAE,KAAK,KAAK,GAAG,SAAA,CAAU;AAE3D,aAAW,QAAQ,OAAO;AACxB,UAAM,eAAe,KAAK,QAAQ,KAAK,IAAI;AAGpC,WAAA,QAAQ,MAAM,YAAY;AAC7B,QAAA;AAEJ,QAAI,KAAK,QAAQ,YAAY,MAAM,SAAS;AACpC,YAAA,MAAM,IAAI,SAAS,YAAY;AAAA,IAAA,OAChC;AACL,YAAM,UAAU,YAAY;AAAA,IAC9B;AAEO,WAAA,eAAe,KAAK,gBAAgB;AAAA,MACzC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO,KAAK,SAAS,IAAI;AAAA,IAAA,CAC1B;AAED,UAAM,WAAW,mBAAmB,MAAM,uBAAuB,IAAI,CAAC;AAEtE,QAAI,SAAS,WAAW;AAAK,QAAA,MAAM,MAAM,GAAG;AAC1C,MAAA,MAAM,MAAM,EAAE,QAAQ,CAAI,GAAA,UAAU,KAAK,MAAM,CAAC;AAAA,EACpD;AAEO,SAAA;AACT;"}
1
+ {"version":3,"file":"load-files.mjs","sources":["../../src/utils/load-files.ts"],"sourcesContent":["import path from 'path';\nimport _ from 'lodash';\nimport fse from 'fs-extra';\n\nimport { importDefault } from '@strapi/utils';\nimport { glob } from 'glob';\nimport { filePathToPropPath } from './filepath-to-prop-path';\n\n/**\n * Returns an Object build from a list of files matching a glob pattern in a directory\n * It builds a tree structure resembling the folder structure in dir\n */\nexport const loadFiles = async <T extends object>(\n dir: string,\n pattern: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n { requireFn = importDefault, shouldUseFileNameAsKey = (_: any) => true, globArgs = {} } = {}\n): Promise<T> => {\n const root = {};\n const files = await glob(pattern, { cwd: dir, ...globArgs });\n\n for (const file of files) {\n const absolutePath = path.resolve(dir, file);\n\n // load module\n delete require.cache[absolutePath];\n let mod;\n\n if (path.extname(absolutePath) === '.json') {\n mod = await fse.readJson(absolutePath);\n } else {\n mod = requireFn(absolutePath);\n }\n\n Object.defineProperty(mod, '__filename__', {\n enumerable: true,\n configurable: false,\n writable: false,\n value: path.basename(file),\n });\n\n const propPath = filePathToPropPath(file, shouldUseFileNameAsKey(file));\n\n if (propPath.length === 0) _.merge(root, mod);\n _.merge(root, _.setWith({}, propPath, mod, Object));\n }\n\n return root as T;\n};\n"],"names":["_"],"mappings":";;;;;;AAYO,MAAM,YAAY,OACvB,KACA,SAEA,EAAE,YAAY,eAAe,yBAAyB,CAACA,OAAW,MAAM,WAAW,CAAG,EAAA,IAAI,CAAA,MAC3E;AACf,QAAM,OAAO,CAAA;AACP,QAAA,QAAQ,MAAM,KAAK,SAAS,EAAE,KAAK,KAAK,GAAG,SAAA,CAAU;AAE3D,aAAW,QAAQ,OAAO;AACxB,UAAM,eAAe,KAAK,QAAQ,KAAK,IAAI;AAGpC,WAAA,QAAQ,MAAM,YAAY;AAC7B,QAAA;AAEJ,QAAI,KAAK,QAAQ,YAAY,MAAM,SAAS;AACpC,YAAA,MAAM,IAAI,SAAS,YAAY;AAAA,IAAA,OAChC;AACL,YAAM,UAAU,YAAY;AAAA,IAC9B;AAEO,WAAA,eAAe,KAAK,gBAAgB;AAAA,MACzC,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO,KAAK,SAAS,IAAI;AAAA,IAAA,CAC1B;AAED,UAAM,WAAW,mBAAmB,MAAM,uBAAuB,IAAI,CAAC;AAEtE,QAAI,SAAS,WAAW,EAAK,GAAA,MAAM,MAAM,GAAG;AAC1C,MAAA,MAAM,MAAM,EAAE,QAAQ,CAAI,GAAA,UAAU,KAAK,MAAM,CAAC;AAAA,EACpD;AAEO,SAAA;AACT;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/core",
3
- "version": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
3
+ "version": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
4
4
  "description": "Core of Strapi",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -55,15 +55,15 @@
55
55
  "@koa/cors": "5.0.0",
56
56
  "@koa/router": "12.0.1",
57
57
  "@paralleldrive/cuid2": "2.2.2",
58
- "@strapi/admin": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
59
- "@strapi/database": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
60
- "@strapi/generators": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
61
- "@strapi/logger": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
62
- "@strapi/pack-up": "5.0.0",
63
- "@strapi/permissions": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
64
- "@strapi/types": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
65
- "@strapi/typescript-utils": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
66
- "@strapi/utils": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
58
+ "@strapi/admin": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
59
+ "@strapi/database": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
60
+ "@strapi/generators": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
61
+ "@strapi/logger": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
62
+ "@strapi/pack-up": "5.1.0-beta.0",
63
+ "@strapi/permissions": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
64
+ "@strapi/types": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
65
+ "@strapi/typescript-utils": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
66
+ "@strapi/utils": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
67
67
  "bcryptjs": "2.4.3",
68
68
  "boxen": "5.1.2",
69
69
  "chalk": "4.1.2",
@@ -102,12 +102,12 @@
102
102
  "resolve.exports": "2.0.2",
103
103
  "semver": "7.5.4",
104
104
  "statuses": "2.0.1",
105
- "typescript": "5.2.2",
105
+ "typescript": "5.3.2",
106
106
  "undici": "6.19.2",
107
107
  "yup": "0.32.9"
108
108
  },
109
109
  "devDependencies": {
110
- "@strapi/pack-up": "5.0.0",
110
+ "@strapi/pack-up": "5.1.0-beta.0",
111
111
  "@strapi/ts-zen": "^0.2.0",
112
112
  "@types/bcryptjs": "2.4.3",
113
113
  "@types/configstore": "5.0.1",
@@ -126,13 +126,13 @@
126
126
  "@types/node": "18.19.24",
127
127
  "@types/node-schedule": "2.1.7",
128
128
  "@types/statuses": "2.0.1",
129
- "eslint-config-custom": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be",
129
+ "eslint-config-custom": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76",
130
130
  "supertest": "6.3.3",
131
- "tsconfig": "0.0.0-experimental.117b0ba4c41638592858ef7c29fec09396cf01be"
131
+ "tsconfig": "0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76"
132
132
  },
133
133
  "engines": {
134
134
  "node": ">=18.0.0 <=20.x.x",
135
135
  "npm": ">=6.0.0"
136
136
  },
137
- "gitHead": "117b0ba4c41638592858ef7c29fec09396cf01be"
137
+ "gitHead": "1610404a03d98b65f497f9adda35815021b8fd76"
138
138
  }