@strapi/core 0.0.0-experimental.ae2010c73ea60e398b726874a9b7b2bf3faada51 → 0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476
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.
- package/dist/Strapi.d.ts.map +1 -1
- package/dist/Strapi.js +4 -1
- package/dist/Strapi.js.map +1 -1
- package/dist/Strapi.mjs +4 -1
- package/dist/Strapi.mjs.map +1 -1
- package/dist/core-api/controller/index.d.ts.map +1 -1
- package/dist/core-api/controller/index.js +2 -1
- package/dist/core-api/controller/index.js.map +1 -1
- package/dist/core-api/controller/index.mjs +2 -1
- package/dist/core-api/controller/index.mjs.map +1 -1
- package/dist/core-api/controller/transform.d.ts +3 -2
- package/dist/core-api/controller/transform.d.ts.map +1 -1
- package/dist/core-api/controller/transform.js +13 -3
- package/dist/core-api/controller/transform.js.map +1 -1
- package/dist/core-api/controller/transform.mjs +13 -3
- package/dist/core-api/controller/transform.mjs.map +1 -1
- package/dist/core-api/routes/index.d.ts +4 -22
- package/dist/core-api/routes/index.d.ts.map +1 -1
- package/dist/core-api/routes/index.js +150 -8
- package/dist/core-api/routes/index.js.map +1 -1
- package/dist/core-api/routes/index.mjs +131 -8
- package/dist/core-api/routes/index.mjs.map +1 -1
- package/dist/core-api/routes/validation/attributes.d.ts +244 -0
- package/dist/core-api/routes/validation/attributes.d.ts.map +1 -0
- package/dist/core-api/routes/validation/attributes.js +560 -0
- package/dist/core-api/routes/validation/attributes.js.map +1 -0
- package/dist/core-api/routes/validation/attributes.mjs +521 -0
- package/dist/core-api/routes/validation/attributes.mjs.map +1 -0
- package/dist/core-api/routes/validation/common.d.ts +105 -0
- package/dist/core-api/routes/validation/common.d.ts.map +1 -0
- package/dist/core-api/routes/validation/common.js +116 -0
- package/dist/core-api/routes/validation/common.js.map +1 -0
- package/dist/core-api/routes/validation/common.mjs +95 -0
- package/dist/core-api/routes/validation/common.mjs.map +1 -0
- package/dist/core-api/routes/validation/component.d.ts +34 -0
- package/dist/core-api/routes/validation/component.d.ts.map +1 -0
- package/dist/core-api/routes/validation/component.js +45 -0
- package/dist/core-api/routes/validation/component.js.map +1 -0
- package/dist/core-api/routes/validation/component.mjs +43 -0
- package/dist/core-api/routes/validation/component.mjs.map +1 -0
- package/dist/core-api/routes/validation/constants.d.ts +8 -0
- package/dist/core-api/routes/validation/constants.d.ts.map +1 -0
- package/dist/core-api/routes/validation/constants.js +18 -0
- package/dist/core-api/routes/validation/constants.js.map +1 -0
- package/dist/core-api/routes/validation/constants.mjs +16 -0
- package/dist/core-api/routes/validation/constants.mjs.map +1 -0
- package/dist/core-api/routes/validation/content-type.d.ts +128 -0
- package/dist/core-api/routes/validation/content-type.d.ts.map +1 -0
- package/dist/core-api/routes/validation/content-type.js +201 -0
- package/dist/core-api/routes/validation/content-type.js.map +1 -0
- package/dist/core-api/routes/validation/content-type.mjs +180 -0
- package/dist/core-api/routes/validation/content-type.mjs.map +1 -0
- package/dist/core-api/routes/validation/index.d.ts +5 -0
- package/dist/core-api/routes/validation/index.d.ts.map +1 -0
- package/dist/core-api/routes/validation/mappers.d.ts +105 -0
- package/dist/core-api/routes/validation/mappers.d.ts.map +1 -0
- package/dist/core-api/routes/validation/mappers.js +238 -0
- package/dist/core-api/routes/validation/mappers.js.map +1 -0
- package/dist/core-api/routes/validation/mappers.mjs +214 -0
- package/dist/core-api/routes/validation/mappers.mjs.map +1 -0
- package/dist/core-api/routes/validation/utils.d.ts +47 -0
- package/dist/core-api/routes/validation/utils.d.ts.map +1 -0
- package/dist/core-api/routes/validation/utils.js +128 -0
- package/dist/core-api/routes/validation/utils.js.map +1 -0
- package/dist/core-api/routes/validation/utils.mjs +106 -0
- package/dist/core-api/routes/validation/utils.mjs.map +1 -0
- package/dist/domain/content-type/index.d.ts.map +1 -1
- package/dist/domain/content-type/index.js +17 -1
- package/dist/domain/content-type/index.js.map +1 -1
- package/dist/domain/content-type/index.mjs +17 -1
- package/dist/domain/content-type/index.mjs.map +1 -1
- package/dist/domain/module/index.d.ts.map +1 -1
- package/dist/domain/module/index.js +3 -0
- package/dist/domain/module/index.js.map +1 -1
- package/dist/domain/module/index.mjs +3 -0
- package/dist/domain/module/index.mjs.map +1 -1
- package/dist/factories.d.ts +3 -1
- package/dist/factories.d.ts.map +1 -1
- package/dist/factories.js +10 -2
- package/dist/factories.js.map +1 -1
- package/dist/factories.mjs +10 -3
- package/dist/factories.mjs.map +1 -1
- package/dist/middlewares/cors.d.ts +9 -1
- package/dist/middlewares/cors.d.ts.map +1 -1
- package/dist/middlewares/cors.js +39 -17
- package/dist/middlewares/cors.js.map +1 -1
- package/dist/middlewares/cors.mjs +39 -18
- package/dist/middlewares/cors.mjs.map +1 -1
- package/dist/migrations/first-published-at.d.ts +4 -0
- package/dist/migrations/first-published-at.d.ts.map +1 -0
- package/dist/migrations/first-published-at.js +51 -0
- package/dist/migrations/first-published-at.js.map +1 -0
- package/dist/migrations/first-published-at.mjs +49 -0
- package/dist/migrations/first-published-at.mjs.map +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +5 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/index.mjs +5 -0
- package/dist/migrations/index.mjs.map +1 -1
- package/dist/package.json.js +16 -12
- package/dist/package.json.js.map +1 -1
- package/dist/package.json.mjs +16 -12
- package/dist/package.json.mjs.map +1 -1
- package/dist/services/content-api/index.d.ts +1 -1
- package/dist/services/content-api/index.d.ts.map +1 -1
- package/dist/services/content-api/index.js +1 -1
- package/dist/services/content-api/index.js.map +1 -1
- package/dist/services/content-api/index.mjs +2 -2
- package/dist/services/content-api/index.mjs.map +1 -1
- package/dist/services/content-source-maps.d.ts +13 -0
- package/dist/services/content-source-maps.d.ts.map +1 -0
- package/dist/services/content-source-maps.js +107 -0
- package/dist/services/content-source-maps.js.map +1 -0
- package/dist/services/content-source-maps.mjs +105 -0
- package/dist/services/content-source-maps.mjs.map +1 -0
- package/dist/services/document-service/entries.d.ts.map +1 -1
- package/dist/services/document-service/entries.js.map +1 -1
- package/dist/services/document-service/entries.mjs.map +1 -1
- package/dist/services/document-service/first-published-at.d.ts +7 -0
- package/dist/services/document-service/first-published-at.d.ts.map +1 -0
- package/dist/services/document-service/first-published-at.js +31 -0
- package/dist/services/document-service/first-published-at.js.map +1 -0
- package/dist/services/document-service/first-published-at.mjs +28 -0
- package/dist/services/document-service/first-published-at.mjs.map +1 -0
- package/dist/services/document-service/internationalization.d.ts +6 -1
- package/dist/services/document-service/internationalization.d.ts.map +1 -1
- package/dist/services/document-service/internationalization.js +32 -0
- package/dist/services/document-service/internationalization.js.map +1 -1
- package/dist/services/document-service/internationalization.mjs +32 -1
- package/dist/services/document-service/internationalization.mjs.map +1 -1
- package/dist/services/document-service/repository.d.ts.map +1 -1
- package/dist/services/document-service/repository.js +12 -8
- package/dist/services/document-service/repository.js.map +1 -1
- package/dist/services/document-service/repository.mjs +13 -9
- package/dist/services/document-service/repository.mjs.map +1 -1
- package/dist/services/entity-validator/index.d.ts.map +1 -1
- package/dist/services/entity-validator/index.js +9 -0
- package/dist/services/entity-validator/index.js.map +1 -1
- package/dist/services/entity-validator/index.mjs +9 -0
- package/dist/services/entity-validator/index.mjs.map +1 -1
- package/dist/services/entity-validator/validators.d.ts +1 -0
- package/dist/services/entity-validator/validators.d.ts.map +1 -1
- package/dist/services/entity-validator/validators.js.map +1 -1
- package/dist/services/entity-validator/validators.mjs.map +1 -1
- package/dist/services/metrics/index.d.ts +1 -1
- package/dist/services/metrics/index.d.ts.map +1 -1
- package/dist/services/metrics/index.js +9 -8
- package/dist/services/metrics/index.js.map +1 -1
- package/dist/services/metrics/index.mjs +9 -8
- package/dist/services/metrics/index.mjs.map +1 -1
- package/dist/services/metrics/sender.d.ts.map +1 -1
- package/dist/services/metrics/sender.js +2 -2
- package/dist/services/metrics/sender.js.map +1 -1
- package/dist/services/metrics/sender.mjs +2 -2
- package/dist/services/metrics/sender.mjs.map +1 -1
- package/dist/services/server/register-routes.js +22 -2
- package/dist/services/server/register-routes.js.map +1 -1
- package/dist/services/server/register-routes.mjs +22 -2
- package/dist/services/server/register-routes.mjs.map +1 -1
- package/dist/services/server/routing.d.ts +10 -0
- package/dist/services/server/routing.d.ts.map +1 -1
- package/dist/services/server/routing.js +7 -1
- package/dist/services/server/routing.js.map +1 -1
- package/dist/services/server/routing.mjs +7 -1
- package/dist/services/server/routing.mjs.map +1 -1
- package/dist/services/utils/conditional-fields.d.ts +3 -0
- package/dist/services/utils/conditional-fields.d.ts.map +1 -0
- package/dist/services/utils/conditional-fields.js +22 -0
- package/dist/services/utils/conditional-fields.js.map +1 -0
- package/dist/services/utils/conditional-fields.mjs +20 -0
- package/dist/services/utils/conditional-fields.mjs.map +1 -0
- package/dist/utils/transform-content-types-to-models.d.ts +196 -0
- package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
- package/package.json +16 -12
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { enable as enableDraftAndPublish, disable as disableDraftAndPublish } from './draft-publish.mjs';
|
|
2
|
+
import { enable as enableFirstPublishedAt } from './first-published-at.mjs';
|
|
2
3
|
import { enable as enableI18n, disable as disableI18n } from './i18n.mjs';
|
|
3
4
|
|
|
4
5
|
const enable = async ({ oldContentTypes, contentTypes })=>{
|
|
@@ -10,6 +11,10 @@ const enable = async ({ oldContentTypes, contentTypes })=>{
|
|
|
10
11
|
oldContentTypes,
|
|
11
12
|
contentTypes
|
|
12
13
|
});
|
|
14
|
+
await enableFirstPublishedAt({
|
|
15
|
+
oldContentTypes,
|
|
16
|
+
contentTypes
|
|
17
|
+
});
|
|
13
18
|
};
|
|
14
19
|
const disable = async ({ oldContentTypes, contentTypes })=>{
|
|
15
20
|
await disableI18n({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","disable"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as firstPublishedAt from './first-published-at';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n await firstPublishedAt.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","firstPublishedAt","disable"],"mappings":";;;;AAKA,MAAMA,SAAS,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC5D,MAAMC,UAAqB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC5D,MAAME,qBAA6B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IACpE,MAAMG,sBAAuB,CAAC;AAAEJ,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AAChE;AAEA,MAAMI,UAAU,OAAO,EAAEL,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC7D,MAAMC,WAAsB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC7D,MAAME,sBAA8B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACvE;;;;"}
|
package/dist/package.json.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var name = "@strapi/core";
|
|
6
|
-
var version = "0.0.0-experimental.
|
|
6
|
+
var version = "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476";
|
|
7
7
|
var description = "Core of Strapi";
|
|
8
8
|
var homepage = "https://strapi.io";
|
|
9
9
|
var bugs = {
|
|
@@ -59,14 +59,15 @@ var dependencies = {
|
|
|
59
59
|
"@koa/cors": "5.0.0",
|
|
60
60
|
"@koa/router": "12.0.2",
|
|
61
61
|
"@paralleldrive/cuid2": "2.2.2",
|
|
62
|
-
"@strapi/admin": "0.0.0-experimental.
|
|
63
|
-
"@strapi/database": "0.0.0-experimental.
|
|
64
|
-
"@strapi/generators": "0.0.0-experimental.
|
|
65
|
-
"@strapi/logger": "0.0.0-experimental.
|
|
66
|
-
"@strapi/permissions": "0.0.0-experimental.
|
|
67
|
-
"@strapi/types": "0.0.0-experimental.
|
|
68
|
-
"@strapi/typescript-utils": "0.0.0-experimental.
|
|
69
|
-
"@strapi/utils": "0.0.0-experimental.
|
|
62
|
+
"@strapi/admin": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
63
|
+
"@strapi/database": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
64
|
+
"@strapi/generators": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
65
|
+
"@strapi/logger": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
66
|
+
"@strapi/permissions": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
67
|
+
"@strapi/types": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
68
|
+
"@strapi/typescript-utils": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
69
|
+
"@strapi/utils": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
70
|
+
"@vercel/stega": "0.1.2",
|
|
70
71
|
bcryptjs: "2.4.3",
|
|
71
72
|
boxen: "5.1.2",
|
|
72
73
|
chalk: "4.1.2",
|
|
@@ -85,6 +86,7 @@ var dependencies = {
|
|
|
85
86
|
"http-errors": "2.0.0",
|
|
86
87
|
inquirer: "8.2.5",
|
|
87
88
|
"is-docker": "2.2.1",
|
|
89
|
+
"json-logic-js": "2.0.5",
|
|
88
90
|
koa: "2.16.1",
|
|
89
91
|
"koa-body": "6.0.1",
|
|
90
92
|
"koa-compose": "4.1.0",
|
|
@@ -107,7 +109,8 @@ var dependencies = {
|
|
|
107
109
|
statuses: "2.0.1",
|
|
108
110
|
typescript: "5.4.4",
|
|
109
111
|
undici: "6.21.2",
|
|
110
|
-
yup: "0.32.9"
|
|
112
|
+
yup: "0.32.9",
|
|
113
|
+
zod: "3.25.67"
|
|
111
114
|
};
|
|
112
115
|
var devDependencies = {
|
|
113
116
|
"@strapi/ts-zen": "^0.2.0",
|
|
@@ -119,6 +122,7 @@ var devDependencies = {
|
|
|
119
122
|
"@types/global-agent": "2.1.3",
|
|
120
123
|
"@types/http-errors": "2.0.4",
|
|
121
124
|
"@types/jest": "29.5.2",
|
|
125
|
+
"@types/json-logic-js": "2.0.8",
|
|
122
126
|
"@types/koa": "2.13.4",
|
|
123
127
|
"@types/koa-compress": "4.0.3",
|
|
124
128
|
"@types/koa-session": "6.4.1",
|
|
@@ -129,9 +133,9 @@ var devDependencies = {
|
|
|
129
133
|
"@types/node": "18.19.24",
|
|
130
134
|
"@types/node-schedule": "2.1.7",
|
|
131
135
|
"@types/statuses": "2.0.1",
|
|
132
|
-
"eslint-config-custom": "0.0.0-experimental.
|
|
136
|
+
"eslint-config-custom": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
133
137
|
supertest: "6.3.3",
|
|
134
|
-
tsconfig: "0.0.0-experimental.
|
|
138
|
+
tsconfig: "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476"
|
|
135
139
|
};
|
|
136
140
|
var engines = {
|
|
137
141
|
node: ">=18.0.0 <=22.x.x",
|
package/dist/package.json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/package.json.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "@strapi/core";
|
|
2
|
-
var version = "0.0.0-experimental.
|
|
2
|
+
var version = "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476";
|
|
3
3
|
var description = "Core of Strapi";
|
|
4
4
|
var homepage = "https://strapi.io";
|
|
5
5
|
var bugs = {
|
|
@@ -55,14 +55,15 @@ var dependencies = {
|
|
|
55
55
|
"@koa/cors": "5.0.0",
|
|
56
56
|
"@koa/router": "12.0.2",
|
|
57
57
|
"@paralleldrive/cuid2": "2.2.2",
|
|
58
|
-
"@strapi/admin": "0.0.0-experimental.
|
|
59
|
-
"@strapi/database": "0.0.0-experimental.
|
|
60
|
-
"@strapi/generators": "0.0.0-experimental.
|
|
61
|
-
"@strapi/logger": "0.0.0-experimental.
|
|
62
|
-
"@strapi/permissions": "0.0.0-experimental.
|
|
63
|
-
"@strapi/types": "0.0.0-experimental.
|
|
64
|
-
"@strapi/typescript-utils": "0.0.0-experimental.
|
|
65
|
-
"@strapi/utils": "0.0.0-experimental.
|
|
58
|
+
"@strapi/admin": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
59
|
+
"@strapi/database": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
60
|
+
"@strapi/generators": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
61
|
+
"@strapi/logger": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
62
|
+
"@strapi/permissions": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
63
|
+
"@strapi/types": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
64
|
+
"@strapi/typescript-utils": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
65
|
+
"@strapi/utils": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
66
|
+
"@vercel/stega": "0.1.2",
|
|
66
67
|
bcryptjs: "2.4.3",
|
|
67
68
|
boxen: "5.1.2",
|
|
68
69
|
chalk: "4.1.2",
|
|
@@ -81,6 +82,7 @@ var dependencies = {
|
|
|
81
82
|
"http-errors": "2.0.0",
|
|
82
83
|
inquirer: "8.2.5",
|
|
83
84
|
"is-docker": "2.2.1",
|
|
85
|
+
"json-logic-js": "2.0.5",
|
|
84
86
|
koa: "2.16.1",
|
|
85
87
|
"koa-body": "6.0.1",
|
|
86
88
|
"koa-compose": "4.1.0",
|
|
@@ -103,7 +105,8 @@ var dependencies = {
|
|
|
103
105
|
statuses: "2.0.1",
|
|
104
106
|
typescript: "5.4.4",
|
|
105
107
|
undici: "6.21.2",
|
|
106
|
-
yup: "0.32.9"
|
|
108
|
+
yup: "0.32.9",
|
|
109
|
+
zod: "3.25.67"
|
|
107
110
|
};
|
|
108
111
|
var devDependencies = {
|
|
109
112
|
"@strapi/ts-zen": "^0.2.0",
|
|
@@ -115,6 +118,7 @@ var devDependencies = {
|
|
|
115
118
|
"@types/global-agent": "2.1.3",
|
|
116
119
|
"@types/http-errors": "2.0.4",
|
|
117
120
|
"@types/jest": "29.5.2",
|
|
121
|
+
"@types/json-logic-js": "2.0.8",
|
|
118
122
|
"@types/koa": "2.13.4",
|
|
119
123
|
"@types/koa-compress": "4.0.3",
|
|
120
124
|
"@types/koa-session": "6.4.1",
|
|
@@ -125,9 +129,9 @@ var devDependencies = {
|
|
|
125
129
|
"@types/node": "18.19.24",
|
|
126
130
|
"@types/node-schedule": "2.1.7",
|
|
127
131
|
"@types/statuses": "2.0.1",
|
|
128
|
-
"eslint-config-custom": "0.0.0-experimental.
|
|
132
|
+
"eslint-config-custom": "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476",
|
|
129
133
|
supertest: "6.3.3",
|
|
130
|
-
tsconfig: "0.0.0-experimental.
|
|
134
|
+
tsconfig: "0.0.0-experimental.ae51b136d065d25740e6d2aa634b3dfec5824476"
|
|
131
135
|
};
|
|
132
136
|
var engines = {
|
|
133
137
|
node: ">=18.0.0 <=22.x.x",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -47,7 +47,7 @@ declare const createContentAPI: (strapi: Core.Strapi) => {
|
|
|
47
47
|
controllers: Record<string, string[]>;
|
|
48
48
|
}>;
|
|
49
49
|
};
|
|
50
|
-
getRoutesMap: () => Promise<Record<string,
|
|
50
|
+
getRoutesMap: () => Promise<Record<string, unknown>>;
|
|
51
51
|
sanitize: {
|
|
52
52
|
input: sanitize.SanitizeFunc;
|
|
53
53
|
output: sanitize.SanitizeFunc;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/content-api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/content-api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAqC,MAAM,eAAe,CAAC;AAEtF,OAAO,KAAK,EAAE,IAAI,EAAO,MAAM,eAAe,CAAC;AAgB/C;;GAEG;AACH,QAAA,MAAM,gBAAgB,WAAY,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgF5C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -49,7 +49,7 @@ const filterContentAPI = (route)=>route.info.type === 'content-api';
|
|
|
49
49
|
path: `${apiPrefix}${route.path}`
|
|
50
50
|
}));
|
|
51
51
|
});
|
|
52
|
-
return routesMap;
|
|
52
|
+
return strapiUtils.sanitizeRoutesMapForSerialization(routesMap);
|
|
53
53
|
};
|
|
54
54
|
const sanitizer = strapiUtils.sanitize.createAPISanitizers({
|
|
55
55
|
getModel (uid) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/services/content-api/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport { sanitize, validate } from '@strapi/utils';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport instantiatePermissionsUtilities from './permissions';\n\nconst transformRoutePrefixFor = (pluginName: string) => (route: Core.Route) => {\n const prefix = route.config && route.config.prefix;\n const path = prefix !== undefined ? `${prefix}${route.path}` : `/${pluginName}${route.path}`;\n\n return {\n ...route,\n path,\n };\n};\n\nconst filterContentAPI = (route: Core.Route) => route.info.type === 'content-api';\n\n/**\n * Create a content API container that holds logic, tools and utils. (eg: permissions, ...)\n */\nconst createContentAPI = (strapi: Core.Strapi) => {\n const getRoutesMap = async () => {\n const routesMap: Record<string, Core.Route[]> = {};\n\n _.forEach(strapi.apis, (api, apiName) => {\n const routes = _.flatMap(api.routes, (route) => {\n if ('routes' in route) {\n return route.routes;\n }\n\n return route;\n }).filter(filterContentAPI);\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`api::${apiName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n _.forEach(strapi.plugins, (plugin, pluginName) => {\n const transformPrefix = transformRoutePrefixFor(pluginName);\n\n if (Array.isArray(plugin.routes)) {\n return plugin.routes.map(transformPrefix).filter(filterContentAPI);\n }\n\n const routes = _.flatMap(plugin.routes, (route) => route.routes.map(transformPrefix)).filter(\n filterContentAPI\n );\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`plugin::${pluginName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n return routesMap;\n };\n\n const sanitizer = sanitize.createAPISanitizers({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of sanitizers after the creation of the container\n get sanitizers() {\n return {\n input: strapi.sanitizers.get('content-api.input'),\n output: strapi.sanitizers.get('content-api.output'),\n };\n },\n });\n\n const validator = validate.createAPIValidators({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of validators after the creation of the container\n get validators() {\n return {\n input: strapi.validators.get('content-api.input'),\n };\n },\n });\n\n return {\n permissions: instantiatePermissionsUtilities(strapi),\n getRoutesMap,\n sanitize: sanitizer,\n validate: validator,\n };\n};\n\nexport default createContentAPI;\n"],"names":["transformRoutePrefixFor","pluginName","route","prefix","config","path","undefined","filterContentAPI","info","type","createContentAPI","strapi","getRoutesMap","routesMap","_","forEach","apis","api","apiName","routes","flatMap","filter","length","apiPrefix","get","map","plugins","plugin","transformPrefix","Array","isArray","sanitizer","sanitize","createAPISanitizers","getModel","uid","sanitizers","input","output","validator","validate","createAPIValidators","validators","permissions","instantiatePermissionsUtilities"],"mappings":";;;;;;AAOA,MAAMA,uBAAAA,GAA0B,CAACC,UAAAA,GAAuB,CAACC,KAAAA,GAAAA;AACvD,QAAA,MAAMC,SAASD,KAAME,CAAAA,MAAM,IAAIF,KAAME,CAAAA,MAAM,CAACD,MAAM;QAClD,MAAME,IAAAA,GAAOF,WAAWG,SAAY,GAAA,CAAC,EAAEH,MAAO,CAAA,EAAED,MAAMG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAEJ,UAAAA,CAAW,EAAEC,KAAMG,CAAAA,IAAI,CAAC,CAAC;QAE5F,OAAO;AACL,YAAA,GAAGH,KAAK;AACRG,YAAAA;AACF,SAAA;AACF,KAAA;AAEA,MAAME,mBAAmB,CAACL,KAAAA,GAAsBA,MAAMM,IAAI,CAACC,IAAI,KAAK,aAAA;AAEpE;;IAGA,MAAMC,mBAAmB,CAACC,MAAAA,GAAAA;AACxB,IAAA,MAAMC,YAAe,GAAA,UAAA;AACnB,QAAA,MAAMC,YAA0C,EAAC;AAEjDC,QAAAA,CAAAA,CAAEC,OAAO,CAACJ,MAAAA,CAAOK,IAAI,EAAE,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AAC3B,YAAA,MAAMC,SAASL,CAAEM,CAAAA,OAAO,CAACH,GAAIE,CAAAA,MAAM,EAAE,CAACjB,KAAAA,GAAAA;AACpC,gBAAA,IAAI,YAAYA,KAAO,EAAA;AACrB,oBAA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AAC,iBAAA,CAAA;AACpCX,YAAAA,SAAS,CAAC,CAAC,QAAQ,EAAEZ,UAAW,CAAA,CAAC,CAAC,GAAGkB,MAAOM,CAAAA,GAAG,CAAC,CAACvB,SAAW;AAC1D,oBAAA,GAAGA,KAAK;AACRG,oBAAAA,IAAAA,EAAM,CAAC,EAAEkB,SAAAA,CAAU,EAAErB,KAAMG,CAAAA,IAAI,CAAC;iBAClC,CAAA,CAAA;AACF,SAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/services/content-api/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport { sanitize, validate, sanitizeRoutesMapForSerialization } from '@strapi/utils';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport instantiatePermissionsUtilities from './permissions';\n\nconst transformRoutePrefixFor = (pluginName: string) => (route: Core.Route) => {\n const prefix = route.config && route.config.prefix;\n const path = prefix !== undefined ? `${prefix}${route.path}` : `/${pluginName}${route.path}`;\n\n return {\n ...route,\n path,\n };\n};\n\nconst filterContentAPI = (route: Core.Route) => route.info.type === 'content-api';\n\n/**\n * Create a content API container that holds logic, tools and utils. (eg: permissions, ...)\n */\nconst createContentAPI = (strapi: Core.Strapi) => {\n const getRoutesMap = async () => {\n const routesMap: Record<string, Core.Route[]> = {};\n\n _.forEach(strapi.apis, (api, apiName) => {\n const routes = _.flatMap(api.routes, (route) => {\n if ('routes' in route) {\n return route.routes;\n }\n\n return route;\n }).filter(filterContentAPI);\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`api::${apiName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n _.forEach(strapi.plugins, (plugin, pluginName) => {\n const transformPrefix = transformRoutePrefixFor(pluginName);\n\n if (Array.isArray(plugin.routes)) {\n return plugin.routes.map(transformPrefix).filter(filterContentAPI);\n }\n\n const routes = _.flatMap(plugin.routes, (route) => route.routes.map(transformPrefix)).filter(\n filterContentAPI\n );\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`plugin::${pluginName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n return sanitizeRoutesMapForSerialization(routesMap);\n };\n\n const sanitizer = sanitize.createAPISanitizers({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of sanitizers after the creation of the container\n get sanitizers() {\n return {\n input: strapi.sanitizers.get('content-api.input'),\n output: strapi.sanitizers.get('content-api.output'),\n };\n },\n });\n\n const validator = validate.createAPIValidators({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of validators after the creation of the container\n get validators() {\n return {\n input: strapi.validators.get('content-api.input'),\n };\n },\n });\n\n return {\n permissions: instantiatePermissionsUtilities(strapi),\n getRoutesMap,\n sanitize: sanitizer,\n validate: validator,\n };\n};\n\nexport default createContentAPI;\n"],"names":["transformRoutePrefixFor","pluginName","route","prefix","config","path","undefined","filterContentAPI","info","type","createContentAPI","strapi","getRoutesMap","routesMap","_","forEach","apis","api","apiName","routes","flatMap","filter","length","apiPrefix","get","map","plugins","plugin","transformPrefix","Array","isArray","sanitizeRoutesMapForSerialization","sanitizer","sanitize","createAPISanitizers","getModel","uid","sanitizers","input","output","validator","validate","createAPIValidators","validators","permissions","instantiatePermissionsUtilities"],"mappings":";;;;;;AAOA,MAAMA,uBAAAA,GAA0B,CAACC,UAAAA,GAAuB,CAACC,KAAAA,GAAAA;AACvD,QAAA,MAAMC,SAASD,KAAME,CAAAA,MAAM,IAAIF,KAAME,CAAAA,MAAM,CAACD,MAAM;QAClD,MAAME,IAAAA,GAAOF,WAAWG,SAAY,GAAA,CAAC,EAAEH,MAAO,CAAA,EAAED,MAAMG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAEJ,UAAAA,CAAW,EAAEC,KAAMG,CAAAA,IAAI,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5B,MAAO0B,CAAAA,UAAU,CAACb,GAAG,CAAC,oBAAA;AAChC,aAAA;AACF;AACF,KAAA,CAAA;IAEA,MAAMgB,SAAAA,GAAYC,oBAASC,CAAAA,mBAAmB,CAAC;AAC7CP,QAAAA,QAAAA,CAAAA,CAASC,GAAW,EAAA;YAClB,OAAOzB,MAAAA,CAAOwB,QAAQ,CAACC,GAAAA,CAAAA;AACzB,SAAA;;AAEA,QAAA,IAAIO,UAAa,CAAA,GAAA;YACf,OAAO;AACLL,gBAAAA,KAAAA,EAAO3B,MAAOgC,CAAAA,UAAU,CAACnB,GAAG,CAAC,mBAAA;AAC/B,aAAA;AACF;AACF,KAAA,CAAA;IAEA,OAAO;AACLoB,QAAAA,WAAAA,EAAaC,KAAgClC,CAAAA,MAAAA,CAAAA;AAC7CC,QAAAA,YAAAA;QACAqB,QAAUD,EAAAA,SAAAA;QACVS,QAAUD,EAAAA;AACZ,KAAA;AACF;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import { sanitize, validate } from '@strapi/utils';
|
|
2
|
+
import { sanitize, validate, sanitizeRoutesMapForSerialization } from '@strapi/utils';
|
|
3
3
|
import instantiatePermissionsUtilities from './permissions/index.mjs';
|
|
4
4
|
|
|
5
5
|
const transformRoutePrefixFor = (pluginName)=>(route)=>{
|
|
@@ -47,7 +47,7 @@ const filterContentAPI = (route)=>route.info.type === 'content-api';
|
|
|
47
47
|
path: `${apiPrefix}${route.path}`
|
|
48
48
|
}));
|
|
49
49
|
});
|
|
50
|
-
return routesMap;
|
|
50
|
+
return sanitizeRoutesMapForSerialization(routesMap);
|
|
51
51
|
};
|
|
52
52
|
const sanitizer = sanitize.createAPISanitizers({
|
|
53
53
|
getModel (uid) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/services/content-api/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport { sanitize, validate } from '@strapi/utils';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport instantiatePermissionsUtilities from './permissions';\n\nconst transformRoutePrefixFor = (pluginName: string) => (route: Core.Route) => {\n const prefix = route.config && route.config.prefix;\n const path = prefix !== undefined ? `${prefix}${route.path}` : `/${pluginName}${route.path}`;\n\n return {\n ...route,\n path,\n };\n};\n\nconst filterContentAPI = (route: Core.Route) => route.info.type === 'content-api';\n\n/**\n * Create a content API container that holds logic, tools and utils. (eg: permissions, ...)\n */\nconst createContentAPI = (strapi: Core.Strapi) => {\n const getRoutesMap = async () => {\n const routesMap: Record<string, Core.Route[]> = {};\n\n _.forEach(strapi.apis, (api, apiName) => {\n const routes = _.flatMap(api.routes, (route) => {\n if ('routes' in route) {\n return route.routes;\n }\n\n return route;\n }).filter(filterContentAPI);\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`api::${apiName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n _.forEach(strapi.plugins, (plugin, pluginName) => {\n const transformPrefix = transformRoutePrefixFor(pluginName);\n\n if (Array.isArray(plugin.routes)) {\n return plugin.routes.map(transformPrefix).filter(filterContentAPI);\n }\n\n const routes = _.flatMap(plugin.routes, (route) => route.routes.map(transformPrefix)).filter(\n filterContentAPI\n );\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`plugin::${pluginName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n return routesMap;\n };\n\n const sanitizer = sanitize.createAPISanitizers({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of sanitizers after the creation of the container\n get sanitizers() {\n return {\n input: strapi.sanitizers.get('content-api.input'),\n output: strapi.sanitizers.get('content-api.output'),\n };\n },\n });\n\n const validator = validate.createAPIValidators({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of validators after the creation of the container\n get validators() {\n return {\n input: strapi.validators.get('content-api.input'),\n };\n },\n });\n\n return {\n permissions: instantiatePermissionsUtilities(strapi),\n getRoutesMap,\n sanitize: sanitizer,\n validate: validator,\n };\n};\n\nexport default createContentAPI;\n"],"names":["transformRoutePrefixFor","pluginName","route","prefix","config","path","undefined","filterContentAPI","info","type","createContentAPI","strapi","getRoutesMap","routesMap","_","forEach","apis","api","apiName","routes","flatMap","filter","length","apiPrefix","get","map","plugins","plugin","transformPrefix","Array","isArray","sanitizer","sanitize","createAPISanitizers","getModel","uid","sanitizers","input","output","validator","validate","createAPIValidators","validators","permissions","instantiatePermissionsUtilities"],"mappings":";;;;AAOA,MAAMA,uBAAAA,GAA0B,CAACC,UAAAA,GAAuB,CAACC,KAAAA,GAAAA;AACvD,QAAA,MAAMC,SAASD,KAAME,CAAAA,MAAM,IAAIF,KAAME,CAAAA,MAAM,CAACD,MAAM;QAClD,MAAME,IAAAA,GAAOF,WAAWG,SAAY,GAAA,CAAC,EAAEH,MAAO,CAAA,EAAED,MAAMG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAEJ,UAAAA,CAAW,EAAEC,KAAMG,CAAAA,IAAI,CAAC,CAAC;QAE5F,OAAO;AACL,YAAA,GAAGH,KAAK;AACRG,YAAAA;AACF,SAAA;AACF,KAAA;AAEA,MAAME,mBAAmB,CAACL,KAAAA,GAAsBA,MAAMM,IAAI,CAACC,IAAI,KAAK,aAAA;AAEpE;;IAGA,MAAMC,mBAAmB,CAACC,MAAAA,GAAAA;AACxB,IAAA,MAAMC,YAAe,GAAA,UAAA;AACnB,QAAA,MAAMC,YAA0C,EAAC;AAEjDC,QAAAA,CAAAA,CAAEC,OAAO,CAACJ,MAAAA,CAAOK,IAAI,EAAE,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AAC3B,YAAA,MAAMC,SAASL,CAAEM,CAAAA,OAAO,CAACH,GAAIE,CAAAA,MAAM,EA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AACF;AAEA,YAAA,MAAMC,SAAYZ,GAAAA,MAAAA,CAAOP,MAAM,CAACoB,GAAG,CAAC,iBAAA,CAAA;AACpCX,YAAAA,SAAS,CAAC,CAAC,QAAQ,EAAEZ,UAAW,CAAA,CAAC,CAAC,GAAGkB,MAAOM,CAAAA,GAAG,CAAC,CAACvB,SAAW;AAC1D,oBAAA,GAAGA,KAAK;AACRG,oBAAAA,IAAAA,EAAM,CAAC,EAAEkB,SAAAA,CAAU,EAAErB,KAAMG,CAAAA,IAAI,CAAC;iBAClC,CAAA,CAAA;AACF,SAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/services/content-api/index.ts"],"sourcesContent":["import _ from 'lodash';\nimport { sanitize, validate, sanitizeRoutesMapForSerialization } from '@strapi/utils';\n\nimport type { Core, UID } from '@strapi/types';\n\nimport instantiatePermissionsUtilities from './permissions';\n\nconst transformRoutePrefixFor = (pluginName: string) => (route: Core.Route) => {\n const prefix = route.config && route.config.prefix;\n const path = prefix !== undefined ? `${prefix}${route.path}` : `/${pluginName}${route.path}`;\n\n return {\n ...route,\n path,\n };\n};\n\nconst filterContentAPI = (route: Core.Route) => route.info.type === 'content-api';\n\n/**\n * Create a content API container that holds logic, tools and utils. (eg: permissions, ...)\n */\nconst createContentAPI = (strapi: Core.Strapi) => {\n const getRoutesMap = async () => {\n const routesMap: Record<string, Core.Route[]> = {};\n\n _.forEach(strapi.apis, (api, apiName) => {\n const routes = _.flatMap(api.routes, (route) => {\n if ('routes' in route) {\n return route.routes;\n }\n\n return route;\n }).filter(filterContentAPI);\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`api::${apiName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n _.forEach(strapi.plugins, (plugin, pluginName) => {\n const transformPrefix = transformRoutePrefixFor(pluginName);\n\n if (Array.isArray(plugin.routes)) {\n return plugin.routes.map(transformPrefix).filter(filterContentAPI);\n }\n\n const routes = _.flatMap(plugin.routes, (route) => route.routes.map(transformPrefix)).filter(\n filterContentAPI\n );\n\n if (routes.length === 0) {\n return;\n }\n\n const apiPrefix = strapi.config.get('api.rest.prefix');\n routesMap[`plugin::${pluginName}`] = routes.map((route) => ({\n ...route,\n path: `${apiPrefix}${route.path}`,\n }));\n });\n\n return sanitizeRoutesMapForSerialization(routesMap);\n };\n\n const sanitizer = sanitize.createAPISanitizers({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of sanitizers after the creation of the container\n get sanitizers() {\n return {\n input: strapi.sanitizers.get('content-api.input'),\n output: strapi.sanitizers.get('content-api.output'),\n };\n },\n });\n\n const validator = validate.createAPIValidators({\n getModel(uid: string) {\n return strapi.getModel(uid as UID.Schema);\n },\n // NOTE: use lazy access to allow registration of validators after the creation of the container\n get validators() {\n return {\n input: strapi.validators.get('content-api.input'),\n };\n },\n });\n\n return {\n permissions: instantiatePermissionsUtilities(strapi),\n getRoutesMap,\n sanitize: sanitizer,\n validate: validator,\n };\n};\n\nexport default createContentAPI;\n"],"names":["transformRoutePrefixFor","pluginName","route","prefix","config","path","undefined","filterContentAPI","info","type","createContentAPI","strapi","getRoutesMap","routesMap","_","forEach","apis","api","apiName","routes","flatMap","filter","length","apiPrefix","get","map","plugins","plugin","transformPrefix","Array","isArray","sanitizeRoutesMapForSerialization","sanitizer","sanitize","createAPISanitizers","getModel","uid","sanitizers","input","output","validator","validate","createAPIValidators","validators","permissions","instantiatePermissionsUtilities"],"mappings":";;;;AAOA,MAAMA,uBAAAA,GAA0B,CAACC,UAAAA,GAAuB,CAACC,KAAAA,GAAAA;AACvD,QAAA,MAAMC,SAASD,KAAME,CAAAA,MAAM,IAAIF,KAAME,CAAAA,MAAM,CAACD,MAAM;QAClD,MAAME,IAAAA,GAAOF,WAAWG,SAAY,GAAA,CAAC,EAAEH,MAAO,CAAA,EAAED,MAAMG,IAAI,CAAC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CAAAA,UAAU,CAACb,GAAG,CAAC,mBAAA,CAAA;AAC7Be,gBAAAA,MAAAA,EAAQ5B,MAAO0B,CAAAA,UAAU,CAACb,GAAG,CAAC,oBAAA;AAChC,aAAA;AACF;AACF,KAAA,CAAA;IAEA,MAAMgB,SAAAA,GAAYC,QAASC,CAAAA,mBAAmB,CAAC;AAC7CP,QAAAA,QAAAA,CAAAA,CAASC,GAAW,EAAA;YAClB,OAAOzB,MAAAA,CAAOwB,QAAQ,CAACC,GAAAA,CAAAA;AACzB,SAAA;;AAEA,QAAA,IAAIO,UAAa,CAAA,GAAA;YACf,OAAO;AACLL,gBAAAA,KAAAA,EAAO3B,MAAOgC,CAAAA,UAAU,CAACnB,GAAG,CAAC,mBAAA;AAC/B,aAAA;AACF;AACF,KAAA,CAAA;IAEA,OAAO;AACLoB,QAAAA,WAAAA,EAAaC,+BAAgClC,CAAAA,MAAAA,CAAAA;AAC7CC,QAAAA,YAAAA;QACAqB,QAAUD,EAAAA,SAAAA;QACVS,QAAUD,EAAAA;AACZ,KAAA;AACF;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Core, Struct } from '@strapi/types';
|
|
2
|
+
import type { FieldContentSourceMap } from '@strapi/admin/strapi-admin';
|
|
3
|
+
interface EncodingInfo {
|
|
4
|
+
data: any;
|
|
5
|
+
schema: Struct.Schema;
|
|
6
|
+
}
|
|
7
|
+
declare const createContentSourceMapsService: (strapi: Core.Strapi) => {
|
|
8
|
+
encodeField(text: string, { kind, model, documentId, type, path, locale }: FieldContentSourceMap): string;
|
|
9
|
+
encodeEntry({ data, schema }: EncodingInfo): Promise<any>;
|
|
10
|
+
encodeSourceMaps({ data, schema }: EncodingInfo): Promise<any>;
|
|
11
|
+
};
|
|
12
|
+
export { createContentSourceMapsService };
|
|
13
|
+
//# sourceMappingURL=content-source-maps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-source-maps.d.ts","sourceRoot":"","sources":["../../src/services/content-source-maps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAO,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAwCxE,UAAU,YAAY;IACpB,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,8BAA8B,WAAY,KAAK,MAAM;sBAK/C,MAAM,mDACqC,qBAAqB;kCA0BpC,YAAY,GAAG,QAAQ,GAAG,CAAC;uCAiCtB,YAAY,GAAG,QAAQ,GAAG,CAAC;CAiBvE,CAAC;AAEF,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var stega = require('@vercel/stega');
|
|
4
|
+
var strapiUtils = require('@strapi/utils');
|
|
5
|
+
|
|
6
|
+
const ENCODABLE_TYPES = [
|
|
7
|
+
'string',
|
|
8
|
+
'text',
|
|
9
|
+
'richtext',
|
|
10
|
+
'biginteger',
|
|
11
|
+
'date',
|
|
12
|
+
'time',
|
|
13
|
+
'datetime',
|
|
14
|
+
'timestamp',
|
|
15
|
+
'boolean',
|
|
16
|
+
'enumeration',
|
|
17
|
+
'json',
|
|
18
|
+
'media',
|
|
19
|
+
'email',
|
|
20
|
+
'password'
|
|
21
|
+
];
|
|
22
|
+
// TODO: use a centralized store for these fields that would be shared with the CM and CTB
|
|
23
|
+
const EXCLUDED_FIELDS = [
|
|
24
|
+
'id',
|
|
25
|
+
'documentId',
|
|
26
|
+
'locale',
|
|
27
|
+
'localizations',
|
|
28
|
+
'created_by',
|
|
29
|
+
'updated_by',
|
|
30
|
+
'created_at',
|
|
31
|
+
'updated_at',
|
|
32
|
+
'publishedAt'
|
|
33
|
+
];
|
|
34
|
+
const createContentSourceMapsService = (strapi)=>{
|
|
35
|
+
const baseUrl = strapi.config.get('server.url');
|
|
36
|
+
return {
|
|
37
|
+
encodeField (text, { kind, model, documentId, type, path, locale }) {
|
|
38
|
+
/**
|
|
39
|
+
* Combine all metadata into into a one string so we only have to deal with one data-atribute
|
|
40
|
+
* on the frontend. Make it human readable because that data-attribute may be set manually by
|
|
41
|
+
* users for fields that don't support sourcemap encoding.
|
|
42
|
+
* The "URL" doesn't need to go anywhere, it's just a way to format the information.
|
|
43
|
+
*/ const strapiSource = new URL(baseUrl);
|
|
44
|
+
strapiSource.searchParams.set('documentId', documentId);
|
|
45
|
+
strapiSource.searchParams.set('type', type);
|
|
46
|
+
strapiSource.searchParams.set('path', path);
|
|
47
|
+
if (model) {
|
|
48
|
+
strapiSource.searchParams.set('model', model);
|
|
49
|
+
}
|
|
50
|
+
if (kind) {
|
|
51
|
+
strapiSource.searchParams.set('kind', kind);
|
|
52
|
+
}
|
|
53
|
+
if (locale) {
|
|
54
|
+
strapiSource.searchParams.set('locale', locale);
|
|
55
|
+
}
|
|
56
|
+
return stega.vercelStegaCombine(text, {
|
|
57
|
+
strapiSource: strapiSource.toString()
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
async encodeEntry ({ data, schema }) {
|
|
61
|
+
if (typeof data !== 'object' || data === null || data === undefined) {
|
|
62
|
+
return data;
|
|
63
|
+
}
|
|
64
|
+
return strapiUtils.traverseEntity(({ key, value, attribute, schema, path }, { set })=>{
|
|
65
|
+
if (!attribute || EXCLUDED_FIELDS.includes(key)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (ENCODABLE_TYPES.includes(attribute.type) && typeof value === 'string') {
|
|
69
|
+
set(key, this.encodeField(value, {
|
|
70
|
+
path: path.rawWithIndices,
|
|
71
|
+
type: attribute.type,
|
|
72
|
+
kind: schema.kind,
|
|
73
|
+
model: schema.uid,
|
|
74
|
+
locale: data.locale,
|
|
75
|
+
documentId: data.documentId
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
schema,
|
|
80
|
+
getModel: (uid)=>strapi.getModel(uid)
|
|
81
|
+
}, data);
|
|
82
|
+
},
|
|
83
|
+
async encodeSourceMaps ({ data, schema }) {
|
|
84
|
+
// try {
|
|
85
|
+
if (Array.isArray(data)) {
|
|
86
|
+
return Promise.all(data.map((item)=>this.encodeSourceMaps({
|
|
87
|
+
data: item,
|
|
88
|
+
schema
|
|
89
|
+
})));
|
|
90
|
+
}
|
|
91
|
+
if (typeof data !== 'object' || data === null) {
|
|
92
|
+
return data;
|
|
93
|
+
}
|
|
94
|
+
return this.encodeEntry({
|
|
95
|
+
data,
|
|
96
|
+
schema
|
|
97
|
+
});
|
|
98
|
+
// } catch (error) {
|
|
99
|
+
// strapi.log.error('Error encoding source maps:', error);
|
|
100
|
+
// return data;
|
|
101
|
+
// }
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
exports.createContentSourceMapsService = createContentSourceMapsService;
|
|
107
|
+
//# sourceMappingURL=content-source-maps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-source-maps.js","sources":["../../src/services/content-source-maps.ts"],"sourcesContent":["import { vercelStegaCombine } from '@vercel/stega';\nimport type { Core, Struct, UID } from '@strapi/types';\nimport { traverseEntity } from '@strapi/utils';\nimport type { FieldContentSourceMap } from '@strapi/admin/strapi-admin';\n\nconst ENCODABLE_TYPES = [\n 'string',\n 'text',\n 'richtext',\n 'biginteger',\n 'date',\n 'time',\n 'datetime',\n 'timestamp',\n 'boolean',\n 'enumeration',\n 'json',\n 'media',\n 'email',\n 'password',\n /**\n * We cannot modify the response shape, so types that aren't based on string cannot be encoded:\n * - json: object\n * - blocks: object, will require a custom implementation in a dedicated PR\n * - integer, float and decimal: number\n * - boolean: boolean (believe it or not)\n * - uid: can be stringified but would mess up URLs\n */\n];\n\n// TODO: use a centralized store for these fields that would be shared with the CM and CTB\nconst EXCLUDED_FIELDS = [\n 'id',\n 'documentId',\n 'locale',\n 'localizations',\n 'created_by',\n 'updated_by',\n 'created_at',\n 'updated_at',\n 'publishedAt',\n];\n\ninterface EncodingInfo {\n data: any;\n schema: Struct.Schema;\n}\n\nconst createContentSourceMapsService = (strapi: Core.Strapi) => {\n const baseUrl = strapi.config.get('server.url') as string;\n\n return {\n encodeField(\n text: string,\n { kind, model, documentId, type, path, locale }: FieldContentSourceMap\n ) {\n /**\n * Combine all metadata into into a one string so we only have to deal with one data-atribute\n * on the frontend. Make it human readable because that data-attribute may be set manually by\n * users for fields that don't support sourcemap encoding.\n * The \"URL\" doesn't need to go anywhere, it's just a way to format the information.\n */\n const strapiSource = new URL(baseUrl);\n strapiSource.searchParams.set('documentId', documentId);\n strapiSource.searchParams.set('type', type);\n strapiSource.searchParams.set('path', path);\n\n if (model) {\n strapiSource.searchParams.set('model', model);\n }\n if (kind) {\n strapiSource.searchParams.set('kind', kind);\n }\n if (locale) {\n strapiSource.searchParams.set('locale', locale);\n }\n\n return vercelStegaCombine(text, { strapiSource: strapiSource.toString() });\n },\n\n async encodeEntry({ data, schema }: EncodingInfo): Promise<any> {\n if (typeof data !== 'object' || data === null || data === undefined) {\n return data;\n }\n\n return traverseEntity(\n ({ key, value, attribute, schema, path }, { set }) => {\n if (!attribute || EXCLUDED_FIELDS.includes(key)) {\n return;\n }\n\n if (ENCODABLE_TYPES.includes(attribute.type) && typeof value === 'string') {\n set(\n key,\n this.encodeField(value, {\n path: path.rawWithIndices!,\n type: attribute.type,\n kind: schema.kind,\n model: schema.uid as UID.Schema,\n locale: data.locale,\n documentId: data.documentId,\n }) as any\n );\n }\n },\n {\n schema,\n getModel: (uid) => strapi.getModel(uid as UID.Schema),\n },\n data\n );\n },\n\n async encodeSourceMaps({ data, schema }: EncodingInfo): Promise<any> {\n // try {\n if (Array.isArray(data)) {\n return Promise.all(data.map((item) => this.encodeSourceMaps({ data: item, schema })));\n }\n\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n return this.encodeEntry({ data, schema });\n // } catch (error) {\n // strapi.log.error('Error encoding source maps:', error);\n // return data;\n // }\n },\n };\n};\n\nexport { createContentSourceMapsService };\n"],"names":["ENCODABLE_TYPES","EXCLUDED_FIELDS","createContentSourceMapsService","strapi","baseUrl","config","get","encodeField","text","kind","model","documentId","type","path","locale","strapiSource","URL","searchParams","set","vercelStegaCombine","toString","encodeEntry","data","schema","undefined","traverseEntity","key","value","attribute","includes","rawWithIndices","uid","getModel","encodeSourceMaps","Array","isArray","Promise","all","map","item"],"mappings":";;;;;AAKA,MAAMA,eAAkB,GAAA;AACtB,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,YAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,WAAA;AACA,IAAA,SAAA;AACA,IAAA,aAAA;AACA,IAAA,MAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA;AASD,CAAA;AAED;AACA,MAAMC,eAAkB,GAAA;AACtB,IAAA,IAAA;AACA,IAAA,YAAA;AACA,IAAA,QAAA;AACA,IAAA,eAAA;AACA,IAAA,YAAA;AACA,IAAA,YAAA;AACA,IAAA,YAAA;AACA,IAAA,YAAA;AACA,IAAA;AACD,CAAA;AAOD,MAAMC,iCAAiC,CAACC,MAAAA,GAAAA;AACtC,IAAA,MAAMC,OAAUD,GAAAA,MAAAA,CAAOE,MAAM,CAACC,GAAG,CAAC,YAAA,CAAA;IAElC,OAAO;AACLC,QAAAA,WAAAA,CAAAA,CACEC,IAAY,EACZ,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAyB,EAAA;AAEtE;;;;;UAMA,MAAMC,YAAe,GAAA,IAAIC,GAAIZ,CAAAA,OAAAA,CAAAA;AAC7BW,YAAAA,YAAAA,CAAaE,YAAY,CAACC,GAAG,CAAC,YAAcP,EAAAA,UAAAA,CAAAA;AAC5CI,YAAAA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
|
+
'richtext',
|
|
8
|
+
'biginteger',
|
|
9
|
+
'date',
|
|
10
|
+
'time',
|
|
11
|
+
'datetime',
|
|
12
|
+
'timestamp',
|
|
13
|
+
'boolean',
|
|
14
|
+
'enumeration',
|
|
15
|
+
'json',
|
|
16
|
+
'media',
|
|
17
|
+
'email',
|
|
18
|
+
'password'
|
|
19
|
+
];
|
|
20
|
+
// TODO: use a centralized store for these fields that would be shared with the CM and CTB
|
|
21
|
+
const EXCLUDED_FIELDS = [
|
|
22
|
+
'id',
|
|
23
|
+
'documentId',
|
|
24
|
+
'locale',
|
|
25
|
+
'localizations',
|
|
26
|
+
'created_by',
|
|
27
|
+
'updated_by',
|
|
28
|
+
'created_at',
|
|
29
|
+
'updated_at',
|
|
30
|
+
'publishedAt'
|
|
31
|
+
];
|
|
32
|
+
const createContentSourceMapsService = (strapi)=>{
|
|
33
|
+
const baseUrl = strapi.config.get('server.url');
|
|
34
|
+
return {
|
|
35
|
+
encodeField (text, { kind, model, documentId, type, path, locale }) {
|
|
36
|
+
/**
|
|
37
|
+
* Combine all metadata into into a one string so we only have to deal with one data-atribute
|
|
38
|
+
* on the frontend. Make it human readable because that data-attribute may be set manually by
|
|
39
|
+
* users for fields that don't support sourcemap encoding.
|
|
40
|
+
* The "URL" doesn't need to go anywhere, it's just a way to format the information.
|
|
41
|
+
*/ const strapiSource = new URL(baseUrl);
|
|
42
|
+
strapiSource.searchParams.set('documentId', documentId);
|
|
43
|
+
strapiSource.searchParams.set('type', type);
|
|
44
|
+
strapiSource.searchParams.set('path', path);
|
|
45
|
+
if (model) {
|
|
46
|
+
strapiSource.searchParams.set('model', model);
|
|
47
|
+
}
|
|
48
|
+
if (kind) {
|
|
49
|
+
strapiSource.searchParams.set('kind', kind);
|
|
50
|
+
}
|
|
51
|
+
if (locale) {
|
|
52
|
+
strapiSource.searchParams.set('locale', locale);
|
|
53
|
+
}
|
|
54
|
+
return vercelStegaCombine(text, {
|
|
55
|
+
strapiSource: strapiSource.toString()
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
async encodeEntry ({ data, schema }) {
|
|
59
|
+
if (typeof data !== 'object' || data === null || data === undefined) {
|
|
60
|
+
return data;
|
|
61
|
+
}
|
|
62
|
+
return traverseEntity(({ key, value, attribute, schema, path }, { set })=>{
|
|
63
|
+
if (!attribute || EXCLUDED_FIELDS.includes(key)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (ENCODABLE_TYPES.includes(attribute.type) && typeof value === 'string') {
|
|
67
|
+
set(key, this.encodeField(value, {
|
|
68
|
+
path: path.rawWithIndices,
|
|
69
|
+
type: attribute.type,
|
|
70
|
+
kind: schema.kind,
|
|
71
|
+
model: schema.uid,
|
|
72
|
+
locale: data.locale,
|
|
73
|
+
documentId: data.documentId
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
schema,
|
|
78
|
+
getModel: (uid)=>strapi.getModel(uid)
|
|
79
|
+
}, data);
|
|
80
|
+
},
|
|
81
|
+
async encodeSourceMaps ({ data, schema }) {
|
|
82
|
+
// try {
|
|
83
|
+
if (Array.isArray(data)) {
|
|
84
|
+
return Promise.all(data.map((item)=>this.encodeSourceMaps({
|
|
85
|
+
data: item,
|
|
86
|
+
schema
|
|
87
|
+
})));
|
|
88
|
+
}
|
|
89
|
+
if (typeof data !== 'object' || data === null) {
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
92
|
+
return this.encodeEntry({
|
|
93
|
+
data,
|
|
94
|
+
schema
|
|
95
|
+
});
|
|
96
|
+
// } catch (error) {
|
|
97
|
+
// strapi.log.error('Error encoding source maps:', error);
|
|
98
|
+
// return data;
|
|
99
|
+
// }
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { createContentSourceMapsService };
|
|
105
|
+
//# sourceMappingURL=content-source-maps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-source-maps.mjs","sources":["../../src/services/content-source-maps.ts"],"sourcesContent":["import { vercelStegaCombine } from '@vercel/stega';\nimport type { Core, Struct, UID } from '@strapi/types';\nimport { traverseEntity } from '@strapi/utils';\nimport type { FieldContentSourceMap } from '@strapi/admin/strapi-admin';\n\nconst ENCODABLE_TYPES = [\n 'string',\n 'text',\n 'richtext',\n 'biginteger',\n 'date',\n 'time',\n 'datetime',\n 'timestamp',\n 'boolean',\n 'enumeration',\n 'json',\n 'media',\n 'email',\n 'password',\n /**\n * We cannot modify the response shape, so types that aren't based on string cannot be encoded:\n * - json: object\n * - blocks: object, will require a custom implementation in a dedicated PR\n * - integer, float and decimal: number\n * - boolean: boolean (believe it or not)\n * - uid: can be stringified but would mess up URLs\n */\n];\n\n// TODO: use a centralized store for these fields that would be shared with the CM and CTB\nconst EXCLUDED_FIELDS = [\n 'id',\n 'documentId',\n 'locale',\n 'localizations',\n 'created_by',\n 'updated_by',\n 'created_at',\n 'updated_at',\n 'publishedAt',\n];\n\ninterface EncodingInfo {\n data: any;\n schema: Struct.Schema;\n}\n\nconst createContentSourceMapsService = (strapi: Core.Strapi) => {\n const baseUrl = strapi.config.get('server.url') as string;\n\n return {\n encodeField(\n text: string,\n { kind, model, documentId, type, path, locale }: FieldContentSourceMap\n ) {\n /**\n * Combine all metadata into into a one string so we only have to deal with one data-atribute\n * on the frontend. Make it human readable because that data-attribute may be set manually by\n * users for fields that don't support sourcemap encoding.\n * The \"URL\" doesn't need to go anywhere, it's just a way to format the information.\n */\n const strapiSource = new URL(baseUrl);\n strapiSource.searchParams.set('documentId', documentId);\n strapiSource.searchParams.set('type', type);\n strapiSource.searchParams.set('path', path);\n\n if (model) {\n strapiSource.searchParams.set('model', model);\n }\n if (kind) {\n strapiSource.searchParams.set('kind', kind);\n }\n if (locale) {\n strapiSource.searchParams.set('locale', locale);\n }\n\n return vercelStegaCombine(text, { strapiSource: strapiSource.toString() });\n },\n\n async encodeEntry({ data, schema }: EncodingInfo): Promise<any> {\n if (typeof data !== 'object' || data === null || data === undefined) {\n return data;\n }\n\n return traverseEntity(\n ({ key, value, attribute, schema, path }, { set }) => {\n if (!attribute || EXCLUDED_FIELDS.includes(key)) {\n return;\n }\n\n if (ENCODABLE_TYPES.includes(attribute.type) && typeof value === 'string') {\n set(\n key,\n this.encodeField(value, {\n path: path.rawWithIndices!,\n type: attribute.type,\n kind: schema.kind,\n model: schema.uid as UID.Schema,\n locale: data.locale,\n documentId: data.documentId,\n }) as any\n );\n }\n },\n {\n schema,\n getModel: (uid) => strapi.getModel(uid as UID.Schema),\n },\n data\n );\n },\n\n async encodeSourceMaps({ data, schema }: EncodingInfo): Promise<any> {\n // try {\n if (Array.isArray(data)) {\n return Promise.all(data.map((item) => this.encodeSourceMaps({ data: item, schema })));\n }\n\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n return this.encodeEntry({ data, schema });\n // } catch (error) {\n // strapi.log.error('Error encoding source maps:', error);\n // return data;\n // }\n },\n };\n};\n\nexport { createContentSourceMapsService };\n"],"names":["ENCODABLE_TYPES","EXCLUDED_FIELDS","createContentSourceMapsService","strapi","baseUrl","config","get","encodeField","text","kind","model","documentId","type","path","locale","strapiSource","URL","searchParams","set","vercelStegaCombine","toString","encodeEntry","data","schema","undefined","traverseEntity","key","value","attribute","includes","rawWithIndices","uid","getModel","encodeSourceMaps","Array","isArray","Promise","all","map","item"],"mappings":";;;AAKA,MAAMA,eAAkB,GAAA;AACtB,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,YAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,WAAA;AACA,IAAA,SAAA;AACA,IAAA,aAAA;AACA,IAAA,MAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA;AASD,CAAA;AAED;AACA,MAAMC,eAAkB,GAAA;AACtB,IAAA,IAAA;AACA,IAAA,YAAA;AACA,IAAA,QAAA;AACA,IAAA,eAAA;AACA,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,IAAI,CAACN,gBAAgB,CAAC;wBAAEX,IAAMiB,EAAAA,IAAAA;AAAMhB,wBAAAA;AAAO,qBAAA,CAAA,CAAA,CAAA;AACnF;AAEA,YAAA,IAAI,OAAOD,IAAAA,KAAS,QAAYA,IAAAA,IAAAA,KAAS,IAAM,EAAA;gBAC7C,OAAOA,IAAAA;AACT;YAEA,OAAO,IAAI,CAACD,WAAW,CAAC;AAAEC,gBAAAA,IAAAA;AAAMC,gBAAAA;AAAO,aAAA,CAAA;;;;;AAKzC;AACF,KAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../../src/services/document-service/entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYlD,QAAA,MAAM,oBAAoB,QACnB,IAAI,WAAW,mBACH,QAAQ,eAAe,CAAC,eAAe;;
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../../src/services/document-service/entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYlD,QAAA,MAAM,oBAAoB,QACnB,IAAI,WAAW,mBACH,QAAQ,eAAe,CAAC,eAAe;;iBA2EzB,MAAM;4BAUK,GAAG;qBA4BV,GAAG;0BAaE,GAAG;CAoB5C,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|