@strapi/core 0.0.0-experimental.aa680be2574ebd6a8ca7675ce7ba57512d0df8cf → 0.0.0-experimental.aa8f064c5e2c0138b780746dc4455c060da87829

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 (83) hide show
  1. package/dist/Strapi.d.ts.map +1 -1
  2. package/dist/Strapi.js +2 -0
  3. package/dist/Strapi.js.map +1 -1
  4. package/dist/Strapi.mjs +2 -0
  5. package/dist/Strapi.mjs.map +1 -1
  6. package/dist/configuration/index.d.ts +1 -0
  7. package/dist/configuration/index.d.ts.map +1 -1
  8. package/dist/configuration/index.js +1 -0
  9. package/dist/configuration/index.js.map +1 -1
  10. package/dist/configuration/index.mjs +1 -0
  11. package/dist/configuration/index.mjs.map +1 -1
  12. package/dist/ee/index.d.ts +6 -0
  13. package/dist/ee/index.d.ts.map +1 -1
  14. package/dist/ee/index.js +29 -3
  15. package/dist/ee/index.js.map +1 -1
  16. package/dist/ee/index.mjs +30 -4
  17. package/dist/ee/index.mjs.map +1 -1
  18. package/dist/ee/license.d.ts +3 -1
  19. package/dist/ee/license.d.ts.map +1 -1
  20. package/dist/ee/license.js +8 -2
  21. package/dist/ee/license.js.map +1 -1
  22. package/dist/ee/license.mjs +9 -4
  23. package/dist/ee/license.mjs.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.mjs +1 -1
  26. package/dist/package.json.js +15 -13
  27. package/dist/package.json.js.map +1 -1
  28. package/dist/package.json.mjs +15 -13
  29. package/dist/package.json.mjs.map +1 -1
  30. package/dist/services/core-store.d.ts +2 -2
  31. package/dist/services/core-store.d.ts.map +1 -1
  32. package/dist/services/core-store.js.map +1 -1
  33. package/dist/services/core-store.mjs.map +1 -1
  34. package/dist/services/document-service/entries.d.ts.map +1 -1
  35. package/dist/services/document-service/entries.js +42 -0
  36. package/dist/services/document-service/entries.js.map +1 -1
  37. package/dist/services/document-service/entries.mjs +43 -1
  38. package/dist/services/document-service/entries.mjs.map +1 -1
  39. package/dist/services/document-service/internationalization.d.ts +6 -1
  40. package/dist/services/document-service/internationalization.d.ts.map +1 -1
  41. package/dist/services/document-service/internationalization.js +32 -0
  42. package/dist/services/document-service/internationalization.js.map +1 -1
  43. package/dist/services/document-service/internationalization.mjs +32 -1
  44. package/dist/services/document-service/internationalization.mjs.map +1 -1
  45. package/dist/services/document-service/repository.d.ts.map +1 -1
  46. package/dist/services/document-service/repository.js +5 -4
  47. package/dist/services/document-service/repository.js.map +1 -1
  48. package/dist/services/document-service/repository.mjs +6 -5
  49. package/dist/services/document-service/repository.mjs.map +1 -1
  50. package/dist/services/entity-validator/index.d.ts.map +1 -1
  51. package/dist/services/entity-validator/index.js +9 -0
  52. package/dist/services/entity-validator/index.js.map +1 -1
  53. package/dist/services/entity-validator/index.mjs +9 -0
  54. package/dist/services/entity-validator/index.mjs.map +1 -1
  55. package/dist/services/entity-validator/validators.d.ts +1 -0
  56. package/dist/services/entity-validator/validators.d.ts.map +1 -1
  57. package/dist/services/entity-validator/validators.js +3 -0
  58. package/dist/services/entity-validator/validators.js.map +1 -1
  59. package/dist/services/entity-validator/validators.mjs +3 -0
  60. package/dist/services/entity-validator/validators.mjs.map +1 -1
  61. package/dist/services/metrics/admin-user-hash.d.ts.map +1 -1
  62. package/dist/services/metrics/admin-user-hash.js.map +1 -1
  63. package/dist/services/metrics/admin-user-hash.mjs.map +1 -1
  64. package/dist/services/metrics/sender.d.ts.map +1 -1
  65. package/dist/services/metrics/sender.js +3 -3
  66. package/dist/services/metrics/sender.js.map +1 -1
  67. package/dist/services/metrics/sender.mjs +4 -4
  68. package/dist/services/metrics/sender.mjs.map +1 -1
  69. package/dist/services/utils/conditional-fields.d.ts +3 -0
  70. package/dist/services/utils/conditional-fields.d.ts.map +1 -0
  71. package/dist/services/utils/conditional-fields.js +22 -0
  72. package/dist/services/utils/conditional-fields.js.map +1 -0
  73. package/dist/services/utils/conditional-fields.mjs +20 -0
  74. package/dist/services/utils/conditional-fields.mjs.map +1 -0
  75. package/dist/utils/fetch.d.ts +5 -1
  76. package/dist/utils/fetch.d.ts.map +1 -1
  77. package/dist/utils/fetch.js +8 -4
  78. package/dist/utils/fetch.js.map +1 -1
  79. package/dist/utils/fetch.mjs +8 -4
  80. package/dist/utils/fetch.mjs.map +1 -1
  81. package/dist/utils/transform-content-types-to-models.d.ts +197 -0
  82. package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
  83. package/package.json +15 -13
@@ -4,7 +4,7 @@ import _ from 'lodash';
4
4
  import isDocker from 'is-docker';
5
5
  import ciEnv from 'ci-info';
6
6
  import tsUtils from '@strapi/typescript-utils';
7
- import { machineID, env } from '@strapi/utils';
7
+ import { generateInstallId, env } from '@strapi/utils';
8
8
  import { generateAdminUserHash } from './admin-user-hash.mjs';
9
9
 
10
10
  const defaultQueryOpts = {
@@ -23,8 +23,8 @@ const ANALYTICS_URI = 'https://analytics.strapi.io';
23
23
  /**
24
24
  * Create a send function for event with all the necessary metadata
25
25
  */ var createSender = ((strapi)=>{
26
- const { uuid } = strapi.config;
27
- const deviceId = machineID();
26
+ const { uuid, installId: installIdFromPackageJson } = strapi.config;
27
+ const installId = generateInstallId(uuid, installIdFromPackageJson);
28
28
  const serverRootPath = strapi.dirs.app.root;
29
29
  const adminRootPath = path.join(strapi.dirs.app.root, 'src', 'admin');
30
30
  const anonymousUserProperties = {
@@ -52,7 +52,7 @@ const ANALYTICS_URI = 'https://analytics.strapi.io';
52
52
  body: JSON.stringify({
53
53
  event,
54
54
  userId,
55
- deviceId,
55
+ installId,
56
56
  eventProperties: payload.eventProperties,
57
57
  userProperties: userId ? {
58
58
  ...anonymousUserProperties,
@@ -1 +1 @@
1
- {"version":3,"file":"sender.mjs","sources":["../../../src/services/metrics/sender.ts"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport _ from 'lodash';\nimport isDocker from 'is-docker';\nimport ciEnv from 'ci-info';\nimport tsUtils from '@strapi/typescript-utils';\nimport { env, machineID } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\nimport { generateAdminUserHash } from './admin-user-hash';\n\nexport interface Payload {\n eventProperties?: Record<string, unknown>;\n userProperties?: Record<string, unknown>;\n groupProperties?: Record<string, unknown>;\n}\n\nexport type Sender = (\n event: string,\n payload?: Payload,\n opts?: Record<string, unknown>\n) => Promise<boolean>;\n\nconst defaultQueryOpts = {\n timeout: 1000,\n headers: { 'Content-Type': 'application/json' },\n};\n\nconst ANALYTICS_URI = 'https://analytics.strapi.io';\n\n/**\n * Add properties from the package.json strapi key in the metadata\n */\nconst addPackageJsonStrapiMetadata = (metadata: Record<string, unknown>, strapi: Core.Strapi) => {\n const { packageJsonStrapi = {} } = strapi.config;\n\n _.defaults(metadata, packageJsonStrapi);\n};\n\n/**\n * Create a send function for event with all the necessary metadata\n */\nexport default (strapi: Core.Strapi): Sender => {\n const { uuid } = strapi.config;\n const deviceId = machineID();\n\n const serverRootPath = strapi.dirs.app.root;\n const adminRootPath = path.join(strapi.dirs.app.root, 'src', 'admin');\n\n const anonymousUserProperties = {\n environment: strapi.config.environment,\n os: os.type(),\n osPlatform: os.platform(),\n osArch: os.arch(),\n osRelease: os.release(),\n nodeVersion: process.versions.node,\n };\n\n const anonymousGroupProperties = {\n docker: process.env.DOCKER || isDocker(),\n isCI: ciEnv.isCI,\n version: strapi.config.get('info.strapi'),\n useTypescriptOnServer: tsUtils.isUsingTypeScriptSync(serverRootPath),\n useTypescriptOnAdmin: tsUtils.isUsingTypeScriptSync(adminRootPath),\n projectId: uuid,\n isHostedOnStrapiCloud: env('STRAPI_HOSTING', null) === 'strapi.cloud',\n };\n\n addPackageJsonStrapiMetadata(anonymousGroupProperties, strapi);\n\n return async (event: string, payload: Payload = {}, opts = {}) => {\n const userId = generateAdminUserHash(strapi);\n\n const reqParams = {\n method: 'POST',\n body: JSON.stringify({\n event,\n userId,\n deviceId,\n eventProperties: payload.eventProperties,\n userProperties: userId ? { ...anonymousUserProperties, ...payload.userProperties } : {},\n groupProperties: {\n ...anonymousGroupProperties,\n projectType: strapi.EE ? 'Enterprise' : 'Community',\n ...payload.groupProperties,\n },\n }),\n ..._.merge({ headers: { 'X-Strapi-Event': event } }, defaultQueryOpts, opts),\n };\n\n try {\n const res = await strapi.fetch(`${ANALYTICS_URI}/api/v2/track`, reqParams);\n return res.ok;\n } catch (err) {\n return false;\n }\n };\n};\n"],"names":["defaultQueryOpts","timeout","headers","ANALYTICS_URI","addPackageJsonStrapiMetadata","metadata","strapi","packageJsonStrapi","config","_","defaults","uuid","deviceId","machineID","serverRootPath","dirs","app","root","adminRootPath","path","join","anonymousUserProperties","environment","os","type","osPlatform","platform","osArch","arch","osRelease","release","nodeVersion","process","versions","node","anonymousGroupProperties","docker","env","DOCKER","isDocker","isCI","ciEnv","version","get","useTypescriptOnServer","tsUtils","isUsingTypeScriptSync","useTypescriptOnAdmin","projectId","isHostedOnStrapiCloud","event","payload","opts","userId","generateAdminUserHash","reqParams","method","body","JSON","stringify","eventProperties","userProperties","groupProperties","projectType","EE","merge","res","fetch","ok","err"],"mappings":";;;;;;;;;AAsBA,MAAMA,gBAAmB,GAAA;IACvBC,OAAS,EAAA,IAAA;IACTC,OAAS,EAAA;QAAE,cAAgB,EAAA;AAAmB;AAChD,CAAA;AAEA,MAAMC,aAAgB,GAAA,6BAAA;AAEtB;;IAGA,MAAMC,4BAA+B,GAAA,CAACC,QAAmCC,EAAAA,MAAAA,GAAAA;AACvE,IAAA,MAAM,EAAEC,iBAAoB,GAAA,EAAE,EAAE,GAAGD,OAAOE,MAAM;IAEhDC,CAAEC,CAAAA,QAAQ,CAACL,QAAUE,EAAAA,iBAAAA,CAAAA;AACvB,CAAA;AAEA;;IAGA,mBAAe,CAAA,CAACD,MAAAA,GAAAA;AACd,IAAA,MAAM,EAAEK,IAAI,EAAE,GAAGL,OAAOE,MAAM;AAC9B,IAAA,MAAMI,QAAWC,GAAAA,SAAAA,EAAAA;AAEjB,IAAA,MAAMC,iBAAiBR,MAAOS,CAAAA,IAAI,CAACC,GAAG,CAACC,IAAI;IAC3C,MAAMC,aAAAA,GAAgBC,IAAKC,CAAAA,IAAI,CAACd,MAAAA,CAAOS,IAAI,CAACC,GAAG,CAACC,IAAI,EAAE,KAAO,EAAA,OAAA,CAAA;AAE7D,IAAA,MAAMI,uBAA0B,GAAA;QAC9BC,WAAahB,EAAAA,MAAAA,CAAOE,MAAM,CAACc,WAAW;AACtCC,QAAAA,EAAAA,EAAIA,GAAGC,IAAI,EAAA;AACXC,QAAAA,UAAAA,EAAYF,GAAGG,QAAQ,EAAA;AACvBC,QAAAA,MAAAA,EAAQJ,GAAGK,IAAI,EAAA;AACfC,QAAAA,SAAAA,EAAWN,GAAGO,OAAO,EAAA;QACrBC,WAAaC,EAAAA,OAAAA,CAAQC,QAAQ,CAACC;AAChC,KAAA;AAEA,IAAA,MAAMC,wBAA2B,GAAA;AAC/BC,QAAAA,MAAAA,EAAQJ,OAAQK,CAAAA,GAAG,CAACC,MAAM,IAAIC,QAAAA,EAAAA;AAC9BC,QAAAA,IAAAA,EAAMC,MAAMD,IAAI;AAChBE,QAAAA,OAAAA,EAASpC,MAAOE,CAAAA,MAAM,CAACmC,GAAG,CAAC,aAAA,CAAA;QAC3BC,qBAAuBC,EAAAA,OAAAA,CAAQC,qBAAqB,CAAChC,cAAAA,CAAAA;QACrDiC,oBAAsBF,EAAAA,OAAAA,CAAQC,qBAAqB,CAAC5B,aAAAA,CAAAA;QACpD8B,SAAWrC,EAAAA,IAAAA;QACXsC,qBAAuBZ,EAAAA,GAAAA,CAAI,kBAAkB,IAAU,CAAA,KAAA;AACzD,KAAA;AAEAjC,IAAAA,4BAAAA,CAA6B+B,wBAA0B7B,EAAAA,MAAAA,CAAAA;IAEvD,OAAO,OAAO4C,OAAeC,OAAmB,GAAA,EAAE,EAAEC,IAAAA,GAAO,EAAE,GAAA;AAC3D,QAAA,MAAMC,SAASC,qBAAsBhD,CAAAA,MAAAA,CAAAA;AAErC,QAAA,MAAMiD,SAAY,GAAA;YAChBC,MAAQ,EAAA,MAAA;YACRC,IAAMC,EAAAA,IAAAA,CAAKC,SAAS,CAAC;AACnBT,gBAAAA,KAAAA;AACAG,gBAAAA,MAAAA;AACAzC,gBAAAA,QAAAA;AACAgD,gBAAAA,eAAAA,EAAiBT,QAAQS,eAAe;AACxCC,gBAAAA,cAAAA,EAAgBR,MAAS,GAAA;AAAE,oBAAA,GAAGhC,uBAAuB;AAAE,oBAAA,GAAG8B,QAAQU;AAAe,iBAAA,GAAI,EAAC;gBACtFC,eAAiB,EAAA;AACf,oBAAA,GAAG3B,wBAAwB;oBAC3B4B,WAAazD,EAAAA,MAAAA,CAAO0D,EAAE,GAAG,YAAe,GAAA,WAAA;AACxC,oBAAA,GAAGb,QAAQW;AACb;AACF,aAAA,CAAA;YACA,GAAGrD,CAAAA,CAAEwD,KAAK,CAAC;gBAAE/D,OAAS,EAAA;oBAAE,gBAAkBgD,EAAAA;AAAM;AAAE,aAAA,EAAGlD,kBAAkBoD,IAAK;AAC9E,SAAA;QAEA,IAAI;YACF,MAAMc,GAAAA,GAAM,MAAM5D,MAAAA,CAAO6D,KAAK,CAAC,CAAC,EAAEhE,aAAAA,CAAc,aAAa,CAAC,EAAEoD,SAAAA,CAAAA;AAChE,YAAA,OAAOW,IAAIE,EAAE;AACf,SAAA,CAAE,OAAOC,GAAK,EAAA;YACZ,OAAO,KAAA;AACT;AACF,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"sender.mjs","sources":["../../../src/services/metrics/sender.ts"],"sourcesContent":["import os from 'os';\nimport path from 'path';\nimport _ from 'lodash';\nimport isDocker from 'is-docker';\nimport ciEnv from 'ci-info';\nimport tsUtils from '@strapi/typescript-utils';\nimport { env, generateInstallId } from '@strapi/utils';\nimport type { Core } from '@strapi/types';\nimport { generateAdminUserHash } from './admin-user-hash';\n\nexport interface Payload {\n eventProperties?: Record<string, unknown>;\n userProperties?: Record<string, unknown>;\n groupProperties?: Record<string, unknown>;\n}\n\nexport type Sender = (\n event: string,\n payload?: Payload,\n opts?: Record<string, unknown>\n) => Promise<boolean>;\n\nconst defaultQueryOpts = {\n timeout: 1000,\n headers: { 'Content-Type': 'application/json' },\n};\n\nconst ANALYTICS_URI = 'https://analytics.strapi.io';\n\n/**\n * Add properties from the package.json strapi key in the metadata\n */\nconst addPackageJsonStrapiMetadata = (metadata: Record<string, unknown>, strapi: Core.Strapi) => {\n const { packageJsonStrapi = {} } = strapi.config;\n\n _.defaults(metadata, packageJsonStrapi);\n};\n\n/**\n * Create a send function for event with all the necessary metadata\n */\nexport default (strapi: Core.Strapi): Sender => {\n const { uuid, installId: installIdFromPackageJson } = strapi.config;\n\n const installId = generateInstallId(uuid, installIdFromPackageJson);\n\n const serverRootPath = strapi.dirs.app.root;\n const adminRootPath = path.join(strapi.dirs.app.root, 'src', 'admin');\n\n const anonymousUserProperties = {\n environment: strapi.config.environment,\n os: os.type(),\n osPlatform: os.platform(),\n osArch: os.arch(),\n osRelease: os.release(),\n nodeVersion: process.versions.node,\n };\n\n const anonymousGroupProperties = {\n docker: process.env.DOCKER || isDocker(),\n isCI: ciEnv.isCI,\n version: strapi.config.get('info.strapi'),\n useTypescriptOnServer: tsUtils.isUsingTypeScriptSync(serverRootPath),\n useTypescriptOnAdmin: tsUtils.isUsingTypeScriptSync(adminRootPath),\n projectId: uuid,\n isHostedOnStrapiCloud: env('STRAPI_HOSTING', null) === 'strapi.cloud',\n };\n\n addPackageJsonStrapiMetadata(anonymousGroupProperties, strapi);\n\n return async (event: string, payload: Payload = {}, opts = {}) => {\n const userId = generateAdminUserHash(strapi);\n\n const reqParams = {\n method: 'POST',\n body: JSON.stringify({\n event,\n userId,\n installId,\n eventProperties: payload.eventProperties,\n userProperties: userId ? { ...anonymousUserProperties, ...payload.userProperties } : {},\n groupProperties: {\n ...anonymousGroupProperties,\n projectType: strapi.EE ? 'Enterprise' : 'Community',\n ...payload.groupProperties,\n },\n }),\n ..._.merge({ headers: { 'X-Strapi-Event': event } }, defaultQueryOpts, opts),\n };\n\n try {\n const res = await strapi.fetch(`${ANALYTICS_URI}/api/v2/track`, reqParams);\n return res.ok;\n } catch (err) {\n return false;\n }\n };\n};\n"],"names":["defaultQueryOpts","timeout","headers","ANALYTICS_URI","addPackageJsonStrapiMetadata","metadata","strapi","packageJsonStrapi","config","_","defaults","uuid","installId","installIdFromPackageJson","generateInstallId","serverRootPath","dirs","app","root","adminRootPath","path","join","anonymousUserProperties","environment","os","type","osPlatform","platform","osArch","arch","osRelease","release","nodeVersion","process","versions","node","anonymousGroupProperties","docker","env","DOCKER","isDocker","isCI","ciEnv","version","get","useTypescriptOnServer","tsUtils","isUsingTypeScriptSync","useTypescriptOnAdmin","projectId","isHostedOnStrapiCloud","event","payload","opts","userId","generateAdminUserHash","reqParams","method","body","JSON","stringify","eventProperties","userProperties","groupProperties","projectType","EE","merge","res","fetch","ok","err"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ declare const getNumberOfConditionalFields: () => any;
2
+ export default getNumberOfConditionalFields;
3
+ //# sourceMappingURL=conditional-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-fields.d.ts","sourceRoot":"","sources":["../../../src/services/utils/conditional-fields.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,4BAA4B,WAuBjC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var fp = require('lodash/fp');
4
+
5
+ const getNumberOfConditionalFields = ()=>{
6
+ const contentTypes = strapi.contentTypes;
7
+ const components = strapi.components;
8
+ const countConditionalFieldsInSchema = (schema)=>{
9
+ return fp.pipe(fp.map('attributes'), fp.flatMap(fp.values), fp.sumBy((attribute)=>{
10
+ if (attribute.conditions && typeof attribute.conditions === 'object') {
11
+ return 1;
12
+ }
13
+ return 0;
14
+ }))(schema);
15
+ };
16
+ const contentTypeCount = countConditionalFieldsInSchema(contentTypes);
17
+ const componentCount = countConditionalFieldsInSchema(components);
18
+ return contentTypeCount + componentCount;
19
+ };
20
+
21
+ module.exports = getNumberOfConditionalFields;
22
+ //# sourceMappingURL=conditional-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-fields.js","sources":["../../../src/services/utils/conditional-fields.ts"],"sourcesContent":["import { map, values, sumBy, pipe, flatMap } from 'lodash/fp';\nimport type { Schema, UID } from '@strapi/types';\n\nconst getNumberOfConditionalFields = () => {\n const contentTypes: Record<UID.ContentType, Schema.ContentType> = strapi.contentTypes;\n const components: Record<UID.Component, Schema.Component> = strapi.components;\n\n const countConditionalFieldsInSchema = (\n schema: Record<string, Schema.ContentType | Schema.Component>\n ) => {\n return pipe(\n map('attributes'),\n flatMap(values),\n sumBy((attribute: Schema.Attribute.AnyAttribute) => {\n if (attribute.conditions && typeof attribute.conditions === 'object') {\n return 1;\n }\n return 0;\n })\n )(schema);\n };\n\n const contentTypeCount = countConditionalFieldsInSchema(contentTypes);\n const componentCount = countConditionalFieldsInSchema(components);\n\n return contentTypeCount + componentCount;\n};\n\nexport default getNumberOfConditionalFields;\n"],"names":["getNumberOfConditionalFields","contentTypes","strapi","components","countConditionalFieldsInSchema","schema","pipe","map","flatMap","values","sumBy","attribute","conditions","contentTypeCount","componentCount"],"mappings":";;;;AAGA,MAAMA,4BAA+B,GAAA,IAAA;IACnC,MAAMC,YAAAA,GAA4DC,OAAOD,YAAY;IACrF,MAAME,UAAAA,GAAsDD,OAAOC,UAAU;AAE7E,IAAA,MAAMC,iCAAiC,CACrCC,MAAAA,GAAAA;AAEA,QAAA,OAAOC,QACLC,MAAI,CAAA,YAAA,CAAA,EACJC,UAAQC,CAAAA,SAAAA,CAAAA,EACRC,SAAM,CAACC,SAAAA,GAAAA;AACL,YAAA,IAAIA,UAAUC,UAAU,IAAI,OAAOD,SAAUC,CAAAA,UAAU,KAAK,QAAU,EAAA;gBACpE,OAAO,CAAA;AACT;YACA,OAAO,CAAA;SAETP,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA;AACJ,KAAA;AAEA,IAAA,MAAMQ,mBAAmBT,8BAA+BH,CAAAA,YAAAA,CAAAA;AACxD,IAAA,MAAMa,iBAAiBV,8BAA+BD,CAAAA,UAAAA,CAAAA;AAEtD,IAAA,OAAOU,gBAAmBC,GAAAA,cAAAA;AAC5B;;;;"}
@@ -0,0 +1,20 @@
1
+ import { pipe, map, flatMap, values, sumBy } from 'lodash/fp';
2
+
3
+ const getNumberOfConditionalFields = ()=>{
4
+ const contentTypes = strapi.contentTypes;
5
+ const components = strapi.components;
6
+ const countConditionalFieldsInSchema = (schema)=>{
7
+ return pipe(map('attributes'), flatMap(values), sumBy((attribute)=>{
8
+ if (attribute.conditions && typeof attribute.conditions === 'object') {
9
+ return 1;
10
+ }
11
+ return 0;
12
+ }))(schema);
13
+ };
14
+ const contentTypeCount = countConditionalFieldsInSchema(contentTypes);
15
+ const componentCount = countConditionalFieldsInSchema(components);
16
+ return contentTypeCount + componentCount;
17
+ };
18
+
19
+ export { getNumberOfConditionalFields as default };
20
+ //# sourceMappingURL=conditional-fields.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-fields.mjs","sources":["../../../src/services/utils/conditional-fields.ts"],"sourcesContent":["import { map, values, sumBy, pipe, flatMap } from 'lodash/fp';\nimport type { Schema, UID } from '@strapi/types';\n\nconst getNumberOfConditionalFields = () => {\n const contentTypes: Record<UID.ContentType, Schema.ContentType> = strapi.contentTypes;\n const components: Record<UID.Component, Schema.Component> = strapi.components;\n\n const countConditionalFieldsInSchema = (\n schema: Record<string, Schema.ContentType | Schema.Component>\n ) => {\n return pipe(\n map('attributes'),\n flatMap(values),\n sumBy((attribute: Schema.Attribute.AnyAttribute) => {\n if (attribute.conditions && typeof attribute.conditions === 'object') {\n return 1;\n }\n return 0;\n })\n )(schema);\n };\n\n const contentTypeCount = countConditionalFieldsInSchema(contentTypes);\n const componentCount = countConditionalFieldsInSchema(components);\n\n return contentTypeCount + componentCount;\n};\n\nexport default getNumberOfConditionalFields;\n"],"names":["getNumberOfConditionalFields","contentTypes","strapi","components","countConditionalFieldsInSchema","schema","pipe","map","flatMap","values","sumBy","attribute","conditions","contentTypeCount","componentCount"],"mappings":";;AAGA,MAAMA,4BAA+B,GAAA,IAAA;IACnC,MAAMC,YAAAA,GAA4DC,OAAOD,YAAY;IACrF,MAAME,UAAAA,GAAsDD,OAAOC,UAAU;AAE7E,IAAA,MAAMC,iCAAiC,CACrCC,MAAAA,GAAAA;AAEA,QAAA,OAAOC,KACLC,GAAI,CAAA,YAAA,CAAA,EACJC,OAAQC,CAAAA,MAAAA,CAAAA,EACRC,MAAM,CAACC,SAAAA,GAAAA;AACL,YAAA,IAAIA,UAAUC,UAAU,IAAI,OAAOD,SAAUC,CAAAA,UAAU,KAAK,QAAU,EAAA;gBACpE,OAAO,CAAA;AACT;YACA,OAAO,CAAA;SAETP,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA;AACJ,KAAA;AAEA,IAAA,MAAMQ,mBAAmBT,8BAA+BH,CAAAA,YAAAA,CAAAA;AACxD,IAAA,MAAMa,iBAAiBV,8BAA+BD,CAAAA,UAAAA,CAAAA;AAEtD,IAAA,OAAOU,gBAAmBC,GAAAA,cAAAA;AAC5B;;;;"}
@@ -1,4 +1,8 @@
1
1
  import type { Core, Modules } from '@strapi/types';
2
- export declare const createStrapiFetch: (strapi: Core.Strapi) => Modules.Fetch.Fetch;
2
+ interface StrapiFetchOptions {
3
+ logs?: boolean;
4
+ }
5
+ export declare const createStrapiFetch: (strapi: Core.Strapi, options?: StrapiFetchOptions) => Modules.Fetch.Fetch;
3
6
  export type Fetch = Modules.Fetch.Fetch;
7
+ export {};
4
8
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAMnD,eAAO,MAAM,iBAAiB,WAAY,KAAK,MAAM,KAAG,aAAa,MAoBpE,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKnD,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,eAAO,MAAM,iBAAiB,WACpB,KAAK,MAAM,YACT,kBAAkB,KAC3B,aAAa,MA4Bf,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC"}
@@ -2,9 +2,9 @@
2
2
 
3
3
  var undici = require('undici');
4
4
 
5
- // TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici
6
5
  // Create a wrapper for Node's Fetch API that applies a global proxy
7
- const createStrapiFetch = (strapi)=>{
6
+ const createStrapiFetch = (strapi, options)=>{
7
+ const { logs = true } = options ?? {};
8
8
  function strapiFetch(url, options) {
9
9
  const fetchOptions = {
10
10
  ...strapiFetch.dispatcher ? {
@@ -12,12 +12,16 @@ const createStrapiFetch = (strapi)=>{
12
12
  } : {},
13
13
  ...options
14
14
  };
15
- strapi.log.debug(`Making request for ${url}`);
15
+ if (logs) {
16
+ strapi.log.debug(`Making request for ${url}`);
17
+ }
16
18
  return fetch(url, fetchOptions);
17
19
  }
18
20
  const proxy = strapi.config.get('server.proxy.fetch') || strapi.config.get('server.proxy.global');
19
21
  if (proxy) {
20
- strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);
22
+ if (logs) {
23
+ strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);
24
+ }
21
25
  strapiFetch.dispatcher = new undici.ProxyAgent(proxy);
22
26
  }
23
27
  return strapiFetch;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (strapi: Core.Strapi): Modules.Fetch.Fetch => {\n function strapiFetch(url: RequestInfo | URL, options?: RequestInit) {\n const fetchOptions = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n strapi.log.debug(`Making request for ${url}`);\n return fetch(url, fetchOptions);\n }\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","strapiFetch","url","options","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;;;AAGA;AAEA;AACO,MAAMA,oBAAoB,CAACC,MAAAA,GAAAA;IAChC,SAASC,WAAAA,CAAYC,GAAsB,EAAEC,OAAqB,EAAA;AAChE,QAAA,MAAMC,YAAe,GAAA;YACnB,GAAIH,WAAAA,CAAYI,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYJ,YAAYI;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGF;AACL,SAAA;QACAH,MAAOM,CAAAA,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEL,IAAI,CAAC,CAAA;AAC5C,QAAA,OAAOM,MAAMN,GAAKE,EAAAA,YAAAA,CAAAA;AACpB;IAEA,MAAMK,KAAAA,GACJT,MAAOU,CAAAA,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DX,MAAOU,CAAAA,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAO,EAAA;QACTT,MAAOM,CAAAA,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,MAAM,CAAC,CAAA;QAC1DR,WAAYI,CAAAA,UAAU,GAAG,IAAIQ,iBAAWJ,CAAAA,KAAAA,CAAAA;AAC1C;IAEA,OAAOR,WAAAA;AACT;;;;"}
1
+ {"version":3,"file":"fetch.js","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (\n strapi: Core.Strapi,\n options?: StrapiFetchOptions\n): Modules.Fetch.Fetch => {\n const { logs = true } = options ?? {};\n\n function strapiFetch(url: RequestInfo | URL, options?: RequestInit) {\n const fetchOptions = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n\n if (logs) {\n strapi.log.debug(`Making request for ${url}`);\n }\n\n return fetch(url, fetchOptions);\n }\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n if (logs) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n }\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","options","logs","strapiFetch","url","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;;;AASA;AACO,MAAMA,iBAAoB,GAAA,CAC/BC,MACAC,EAAAA,OAAAA,GAAAA;AAEA,IAAA,MAAM,EAAEC,IAAO,GAAA,IAAI,EAAE,GAAGD,WAAW,EAAC;IAEpC,SAASE,WAAAA,CAAYC,GAAsB,EAAEH,OAAqB,EAAA;AAChE,QAAA,MAAMI,YAAe,GAAA;YACnB,GAAIF,WAAAA,CAAYG,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYH,YAAYG;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGL;AACL,SAAA;AAEA,QAAA,IAAIC,IAAM,EAAA;YACRF,MAAOO,CAAAA,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEJ,IAAI,CAAC,CAAA;AAC9C;AAEA,QAAA,OAAOK,MAAML,GAAKC,EAAAA,YAAAA,CAAAA;AACpB;IAEA,MAAMK,KAAAA,GACJV,MAAOW,CAAAA,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DZ,MAAOW,CAAAA,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAO,EAAA;AACT,QAAA,IAAIR,IAAM,EAAA;YACRF,MAAOO,CAAAA,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,MAAM,CAAC,CAAA;AAC5D;QACAP,WAAYG,CAAAA,UAAU,GAAG,IAAIQ,iBAAWJ,CAAAA,KAAAA,CAAAA;AAC1C;IAEA,OAAOP,WAAAA;AACT;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { ProxyAgent } from 'undici';
2
2
 
3
- // TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici
4
3
  // Create a wrapper for Node's Fetch API that applies a global proxy
5
- const createStrapiFetch = (strapi)=>{
4
+ const createStrapiFetch = (strapi, options)=>{
5
+ const { logs = true } = options ?? {};
6
6
  function strapiFetch(url, options) {
7
7
  const fetchOptions = {
8
8
  ...strapiFetch.dispatcher ? {
@@ -10,12 +10,16 @@ const createStrapiFetch = (strapi)=>{
10
10
  } : {},
11
11
  ...options
12
12
  };
13
- strapi.log.debug(`Making request for ${url}`);
13
+ if (logs) {
14
+ strapi.log.debug(`Making request for ${url}`);
15
+ }
14
16
  return fetch(url, fetchOptions);
15
17
  }
16
18
  const proxy = strapi.config.get('server.proxy.fetch') || strapi.config.get('server.proxy.global');
17
19
  if (proxy) {
18
- strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);
20
+ if (logs) {
21
+ strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);
22
+ }
19
23
  strapiFetch.dispatcher = new ProxyAgent(proxy);
20
24
  }
21
25
  return strapiFetch;
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.mjs","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (strapi: Core.Strapi): Modules.Fetch.Fetch => {\n function strapiFetch(url: RequestInfo | URL, options?: RequestInit) {\n const fetchOptions = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n strapi.log.debug(`Making request for ${url}`);\n return fetch(url, fetchOptions);\n }\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","strapiFetch","url","options","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;AAGA;AAEA;AACO,MAAMA,oBAAoB,CAACC,MAAAA,GAAAA;IAChC,SAASC,WAAAA,CAAYC,GAAsB,EAAEC,OAAqB,EAAA;AAChE,QAAA,MAAMC,YAAe,GAAA;YACnB,GAAIH,WAAAA,CAAYI,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYJ,YAAYI;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGF;AACL,SAAA;QACAH,MAAOM,CAAAA,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEL,IAAI,CAAC,CAAA;AAC5C,QAAA,OAAOM,MAAMN,GAAKE,EAAAA,YAAAA,CAAAA;AACpB;IAEA,MAAMK,KAAAA,GACJT,MAAOU,CAAAA,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DX,MAAOU,CAAAA,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAO,EAAA;QACTT,MAAOM,CAAAA,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,MAAM,CAAC,CAAA;QAC1DR,WAAYI,CAAAA,UAAU,GAAG,IAAIQ,UAAWJ,CAAAA,KAAAA,CAAAA;AAC1C;IAEA,OAAOR,WAAAA;AACT;;;;"}
1
+ {"version":3,"file":"fetch.mjs","sources":["../../src/utils/fetch.ts"],"sourcesContent":["import type { Core, Modules } from '@strapi/types';\nimport { ProxyAgent } from 'undici';\n\n// TODO: once core Node exposes a stable way to create a ProxyAgent we will use that instead of undici\n\ninterface StrapiFetchOptions {\n logs?: boolean;\n}\n\n// Create a wrapper for Node's Fetch API that applies a global proxy\nexport const createStrapiFetch = (\n strapi: Core.Strapi,\n options?: StrapiFetchOptions\n): Modules.Fetch.Fetch => {\n const { logs = true } = options ?? {};\n\n function strapiFetch(url: RequestInfo | URL, options?: RequestInit) {\n const fetchOptions = {\n ...(strapiFetch.dispatcher ? { dispatcher: strapiFetch.dispatcher } : {}),\n ...options,\n };\n\n if (logs) {\n strapi.log.debug(`Making request for ${url}`);\n }\n\n return fetch(url, fetchOptions);\n }\n\n const proxy =\n strapi.config.get<ConstructorParameters<typeof ProxyAgent>[0]>('server.proxy.fetch') ||\n strapi.config.get<string>('server.proxy.global');\n\n if (proxy) {\n if (logs) {\n strapi.log.info(`Using proxy for Fetch requests: ${proxy}`);\n }\n strapiFetch.dispatcher = new ProxyAgent(proxy);\n }\n\n return strapiFetch;\n};\n\nexport type Fetch = Modules.Fetch.Fetch;\n"],"names":["createStrapiFetch","strapi","options","logs","strapiFetch","url","fetchOptions","dispatcher","log","debug","fetch","proxy","config","get","info","ProxyAgent"],"mappings":";;AASA;AACO,MAAMA,iBAAoB,GAAA,CAC/BC,MACAC,EAAAA,OAAAA,GAAAA;AAEA,IAAA,MAAM,EAAEC,IAAO,GAAA,IAAI,EAAE,GAAGD,WAAW,EAAC;IAEpC,SAASE,WAAAA,CAAYC,GAAsB,EAAEH,OAAqB,EAAA;AAChE,QAAA,MAAMI,YAAe,GAAA;YACnB,GAAIF,WAAAA,CAAYG,UAAU,GAAG;AAAEA,gBAAAA,UAAAA,EAAYH,YAAYG;AAAW,aAAA,GAAI,EAAE;AACxE,YAAA,GAAGL;AACL,SAAA;AAEA,QAAA,IAAIC,IAAM,EAAA;YACRF,MAAOO,CAAAA,GAAG,CAACC,KAAK,CAAC,CAAC,mBAAmB,EAAEJ,IAAI,CAAC,CAAA;AAC9C;AAEA,QAAA,OAAOK,MAAML,GAAKC,EAAAA,YAAAA,CAAAA;AACpB;IAEA,MAAMK,KAAAA,GACJV,MAAOW,CAAAA,MAAM,CAACC,GAAG,CAA8C,oBAAA,CAAA,IAC/DZ,MAAOW,CAAAA,MAAM,CAACC,GAAG,CAAS,qBAAA,CAAA;AAE5B,IAAA,IAAIF,KAAO,EAAA;AACT,QAAA,IAAIR,IAAM,EAAA;YACRF,MAAOO,CAAAA,GAAG,CAACM,IAAI,CAAC,CAAC,gCAAgC,EAAEH,MAAM,CAAC,CAAA;AAC5D;QACAP,WAAYG,CAAAA,UAAU,GAAG,IAAIQ,UAAWJ,CAAAA,KAAAA,CAAAA;AAC1C;IAEA,OAAOP,WAAAA;AACT;;;;"}