@strapi/content-type-builder 5.61.0 → 5.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/AIChat/FeedbackModal.js +3 -3
- package/dist/admin/components/AIChat/FeedbackModal.js.map +1 -1
- package/dist/admin/components/AIChat/FeedbackModal.mjs +5 -5
- package/dist/admin/components/AIChat/FeedbackModal.mjs.map +1 -1
- package/dist/admin/components/AIChat/UploadCodeModal.js +1 -0
- package/dist/admin/components/AIChat/UploadCodeModal.js.map +1 -1
- package/dist/admin/components/AIChat/UploadCodeModal.mjs +1 -0
- package/dist/admin/components/AIChat/UploadCodeModal.mjs.map +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.js +2 -0
- package/dist/admin/components/AIChat/UploadFigmaModal.js.map +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.mjs +2 -0
- package/dist/admin/components/AIChat/UploadFigmaModal.mjs.map +1 -1
- package/dist/admin/components/AIChat/components/StepModal.js +11 -8
- package/dist/admin/components/AIChat/components/StepModal.js.map +1 -1
- package/dist/admin/components/AIChat/components/StepModal.mjs +12 -9
- package/dist/admin/components/AIChat/components/StepModal.mjs.map +1 -1
- package/dist/admin/components/DataManager/useServerRestartWatcher.js +36 -25
- package/dist/admin/components/DataManager/useServerRestartWatcher.js.map +1 -1
- package/dist/admin/components/DataManager/useServerRestartWatcher.mjs +16 -25
- package/dist/admin/components/DataManager/useServerRestartWatcher.mjs.map +1 -1
- package/dist/admin/components/DataManager/watchServerRestart.js +52 -0
- package/dist/admin/components/DataManager/watchServerRestart.js.map +1 -0
- package/dist/admin/components/DataManager/watchServerRestart.mjs +50 -0
- package/dist/admin/components/DataManager/watchServerRestart.mjs.map +1 -0
- package/dist/admin/components/FormModal/FormModal.js +40 -50
- package/dist/admin/components/FormModal/FormModal.js.map +1 -1
- package/dist/admin/components/FormModal/FormModal.mjs +41 -51
- package/dist/admin/components/FormModal/FormModal.mjs.map +1 -1
- package/dist/admin/components/FormModal/reducer.js +18 -6
- package/dist/admin/components/FormModal/reducer.js.map +1 -1
- package/dist/admin/components/FormModal/reducer.mjs +18 -6
- package/dist/admin/components/FormModal/reducer.mjs.map +1 -1
- package/dist/admin/components/GenericInputs.js +26 -1
- package/dist/admin/components/GenericInputs.js.map +1 -1
- package/dist/admin/components/GenericInputs.mjs +26 -2
- package/dist/admin/components/GenericInputs.mjs.map +1 -1
- package/dist/admin/src/components/AIChat/components/StepModal.d.ts +6 -1
- package/dist/admin/src/components/DataManager/useServerRestartWatcher.d.ts +1 -1
- package/dist/admin/src/components/DataManager/watchServerRestart.d.ts +20 -0
- package/dist/admin/src/components/FormModal/reducer.d.ts +53 -1
- package/dist/admin/src/components/GenericInputs.d.ts +12 -2
- package/dist/server/controllers/component-categories.js +24 -11
- package/dist/server/controllers/component-categories.js.map +1 -1
- package/dist/server/controllers/component-categories.mjs +24 -11
- package/dist/server/controllers/component-categories.mjs.map +1 -1
- package/dist/server/controllers/components.js +9 -2
- package/dist/server/controllers/components.js.map +1 -1
- package/dist/server/controllers/components.mjs +9 -2
- package/dist/server/controllers/components.mjs.map +1 -1
- package/dist/server/controllers/content-types.js +10 -3
- package/dist/server/controllers/content-types.js.map +1 -1
- package/dist/server/controllers/content-types.mjs +10 -3
- package/dist/server/controllers/content-types.mjs.map +1 -1
- package/dist/server/controllers/schema.js +4 -0
- package/dist/server/controllers/schema.js.map +1 -1
- package/dist/server/controllers/schema.mjs +4 -0
- package/dist/server/controllers/schema.mjs.map +1 -1
- package/dist/server/services/component-categories.js.map +1 -1
- package/dist/server/services/component-categories.mjs.map +1 -1
- package/dist/server/services/components.js.map +1 -1
- package/dist/server/services/components.mjs.map +1 -1
- package/dist/server/services/content-types.js +17 -5
- package/dist/server/services/content-types.js.map +1 -1
- package/dist/server/services/content-types.mjs +17 -5
- package/dist/server/services/content-types.mjs.map +1 -1
- package/dist/server/services/schema-builder/component-builder.js +3 -1
- package/dist/server/services/schema-builder/component-builder.js.map +1 -1
- package/dist/server/services/schema-builder/component-builder.mjs +3 -1
- package/dist/server/services/schema-builder/component-builder.mjs.map +1 -1
- package/dist/server/services/schema-builder/content-type-builder.js +3 -1
- package/dist/server/services/schema-builder/content-type-builder.js.map +1 -1
- package/dist/server/services/schema-builder/content-type-builder.mjs +3 -1
- package/dist/server/services/schema-builder/content-type-builder.mjs.map +1 -1
- package/dist/server/services/schema-builder/index.js +57 -5
- package/dist/server/services/schema-builder/index.js.map +1 -1
- package/dist/server/services/schema-builder/index.mjs +57 -5
- package/dist/server/services/schema-builder/index.mjs.map +1 -1
- package/dist/server/services/schema-builder/rename-component-uids.js +70 -0
- package/dist/server/services/schema-builder/rename-component-uids.js.map +1 -0
- package/dist/server/services/schema-builder/rename-component-uids.mjs +68 -0
- package/dist/server/services/schema-builder/rename-component-uids.mjs.map +1 -0
- package/dist/server/services/schema-builder/schema-handler.js +10 -3
- package/dist/server/services/schema-builder/schema-handler.js.map +1 -1
- package/dist/server/services/schema-builder/schema-handler.mjs +10 -3
- package/dist/server/services/schema-builder/schema-handler.mjs.map +1 -1
- package/dist/server/services/schema.js +19 -5
- package/dist/server/services/schema.js.map +1 -1
- package/dist/server/services/schema.mjs +19 -5
- package/dist/server/services/schema.mjs.map +1 -1
- package/dist/server/src/controllers/component-categories.d.ts.map +1 -1
- package/dist/server/src/controllers/components.d.ts.map +1 -1
- package/dist/server/src/controllers/content-types.d.ts.map +1 -1
- package/dist/server/src/controllers/schema.d.ts.map +1 -1
- package/dist/server/src/services/component-categories.d.ts.map +1 -1
- package/dist/server/src/services/components.d.ts +2 -2
- package/dist/server/src/services/components.d.ts.map +1 -1
- package/dist/server/src/services/content-types.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/component-builder.d.ts +3 -2
- package/dist/server/src/services/schema-builder/component-builder.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/content-type-builder.d.ts +3 -2
- package/dist/server/src/services/schema-builder/content-type-builder.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/index.d.ts +48 -16
- package/dist/server/src/services/schema-builder/index.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/rename-component-uids.d.ts +34 -0
- package/dist/server/src/services/schema-builder/rename-component-uids.d.ts.map +1 -0
- package/dist/server/src/services/schema-builder/schema-handler.d.ts +21 -6
- package/dist/server/src/services/schema-builder/schema-handler.d.ts.map +1 -1
- package/dist/server/src/services/schema.d.ts.map +1 -1
- package/dist/server/src/utils/errors.d.ts +9 -0
- package/dist/server/src/utils/errors.d.ts.map +1 -0
- package/dist/server/src/utils/uid-target.d.ts.map +1 -1
- package/dist/server/utils/errors.js +26 -0
- package/dist/server/utils/errors.js.map +1 -0
- package/dist/server/utils/errors.mjs +24 -0
- package/dist/server/utils/errors.mjs.map +1 -0
- package/dist/server/utils/uid-target.js +2 -1
- package/dist/server/utils/uid-target.js.map +1 -1
- package/dist/server/utils/uid-target.mjs +2 -1
- package/dist/server/utils/uid-target.mjs.map +1 -1
- package/package.json +11 -13
|
@@ -20,12 +20,12 @@ export declare const formatComponent: (component: any) => {
|
|
|
20
20
|
/**
|
|
21
21
|
* Creates a component and handle the nested components sent with it
|
|
22
22
|
*/
|
|
23
|
-
export declare const createComponent: ({ component, components, }: any) => Promise<SchemaHandler
|
|
23
|
+
export declare const createComponent: ({ component, components, }: any) => Promise<SchemaHandler<Internal.UID.Component>>;
|
|
24
24
|
type ComponentToCreate = {
|
|
25
25
|
component: Struct.ComponentSchema;
|
|
26
26
|
components?: Struct.ComponentSchema[];
|
|
27
27
|
};
|
|
28
|
-
export declare const editComponent: (uid: Internal.UID.Component, { component, components }: ComponentToCreate) => Promise<SchemaHandler
|
|
28
|
+
export declare const editComponent: (uid: Internal.UID.Component, { component, components }: ComponentToCreate) => Promise<SchemaHandler<Internal.UID.Component>>;
|
|
29
29
|
export declare const deleteComponent: (uid: Internal.UID.Component) => Promise<any>;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../server/src/services/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,GAAG;;;;;;;;;;;;;CAiB7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,4BAGnC,GAAG,KAAG,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../server/src/services/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,GAAG;;;;;;;;;;;;;CAiB7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,4BAGnC,GAAG,KAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAqBrD,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,KAAK,QAAQ,CAAC,GAAG,CAAC,SAAS,EAC3B,2BAAgC,iBAAiB,KAChD,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAwB/C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,KAAK,QAAQ,CAAC,GAAG,CAAC,SAAS,iBAUhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/services/content-types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAUjD,eAAO,MAAM,gCAAgC,GAAI,KAAK,GAAG,CAAC,WAAW,KAAG,OAC/C,CAAC;AAE1B,eAAO,MAAM,oCAAoC,GAAI,KAAK,GAAG,CAAC,WAAW,KAAG,IAI3E,CAAC;AAMF,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,CAAC,iBAAiB,YACK,CAAC;AAE1E,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,CAAC,iBAAiB,oBAgB3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAU,cAAc,GAAG,EAAE,mBAyC3D,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,6BAA6B,GAAG,EAChC,UAAS,wBAA6B,
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../../server/src/services/content-types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAUjD,eAAO,MAAM,gCAAgC,GAAI,KAAK,GAAG,CAAC,WAAW,KAAG,OAC/C,CAAC;AAE1B,eAAO,MAAM,oCAAoC,GAAI,KAAK,GAAG,CAAC,WAAW,KAAG,IAI3E,CAAC;AAMF,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,CAAC,iBAAiB,YACK,CAAC;AAE1E,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,CAAC,iBAAiB,oBAgB3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAU,cAAc,GAAG,EAAE,mBAyC3D,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,6BAA6B,GAAG,EAChC,UAAS,wBAA6B,iBAiFvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,kDAKzB,GAAG,QAiBL,CAAC;AA2BF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GAAU,KAAK,GAAG,CAAC,WAAW,kBAMtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,GAAG,CAAC,WAAW,EACpB,6BAAkC,GAAG,iBAqGtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAU,MAAM,GAAG,CAAC,WAAW,EAAE,kBAgD/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAU,KAAK,GAAG,CAAC,WAAW,EAAE,iBAAgB,GAAe,iBA8C5F,CAAC"}
|
|
@@ -11,9 +11,10 @@ export default function createComponentBuilder(): {
|
|
|
11
11
|
readonly plugin: string | undefined;
|
|
12
12
|
readonly category: string | undefined;
|
|
13
13
|
readonly kind: import("@strapi/types/dist/struct/schema.js").ContentTypeKind;
|
|
14
|
-
readonly uid:
|
|
14
|
+
readonly uid: `${string}.${string}`;
|
|
15
|
+
readonly initialUID: `${string}.${string}`;
|
|
15
16
|
readonly writable: boolean;
|
|
16
|
-
setUID(val:
|
|
17
|
+
setUID(val: `${string}.${string}`): /*elided*/ any;
|
|
17
18
|
setDir(val: string): /*elided*/ any;
|
|
18
19
|
readonly schema: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
|
|
19
20
|
setSchema(val: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema): /*elided*/ any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/component-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9C,MAAM,CAAC,OAAO,UAAU,sBAAsB;kDAEI,GAAG;yCAIZ,MAAM,EAAE;oCAOb,GAAG,OAAO,MAAM,cAAc,GAAG;IAQjE;;OAEG;0BACmB,GAAG,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"component-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/component-builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9C,MAAM,CAAC,OAAO,UAAU,sBAAsB;kDAEI,GAAG;yCAIZ,MAAM,EAAE;oCAOb,GAAG,OAAO,MAAM,cAAc,GAAG;IAQjE;;OAEG;0BACmB,GAAG,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;IAmDrC;;OAEG;wBACiB,GAAG,SAAS,GAAG;0BAgDb,GAAG,OAAO,QAAQ,CAAC,GAAG,CAAC,SAAS;EAgBzD"}
|
|
@@ -17,9 +17,10 @@ export default function createComponentBuilder(): {
|
|
|
17
17
|
readonly plugin: string | undefined;
|
|
18
18
|
readonly category: string | undefined;
|
|
19
19
|
readonly kind: import("@strapi/types/dist/struct/schema.js").ContentTypeKind;
|
|
20
|
-
readonly uid: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}
|
|
20
|
+
readonly uid: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`;
|
|
21
|
+
readonly initialUID: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`;
|
|
21
22
|
readonly writable: boolean;
|
|
22
|
-
setUID(val:
|
|
23
|
+
setUID(val: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`): /*elided*/ any;
|
|
23
24
|
setDir(val: string): /*elided*/ any;
|
|
24
25
|
readonly schema: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
|
|
25
26
|
setSchema(val: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema): /*elided*/ any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-type-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/content-type-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAC;AAgD5E,MAAM,CAAC,OAAO,UAAU,sBAAsB;sBAGlC,GAAG,2BACgB;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,yBAAyB,CAAA;KAAE;wBA+BrF,GAAG,aACE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC;sCAkBjE,GAAG,OACJ,MAAM,cACC,sBAAsB,CAAC,YAAY,CAAC;IAsDlD;;OAEG;4BACqB,GAAG,SAAS,sBAAsB
|
|
1
|
+
{"version":3,"file":"content-type-builder.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/content-type-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,SAAS,CAAC;AAgD5E,MAAM,CAAC,OAAO,UAAU,sBAAsB;sBAGlC,GAAG,2BACgB;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,yBAAyB,CAAA;KAAE;wBA+BrF,GAAG,aACE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC;sCAkBjE,GAAG,OACJ,MAAM,cACC,sBAAsB,CAAC,YAAY,CAAC;IAsDlD;;OAEG;4BACqB,GAAG,SAAS,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;0BAmDpC,GAAG,SAAS,GAAG;4BA+Kb,GAAG,OAAO,MAAM;EAgB3C"}
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
+
import type { Internal } from '@strapi/types';
|
|
2
|
+
import { type SchemaHandler } from './schema-handler';
|
|
3
|
+
import { type RenameComponentUIDsOptions } from './rename-component-uids';
|
|
1
4
|
/**
|
|
2
5
|
* Creates a content type schema builder instance
|
|
3
6
|
*/
|
|
4
7
|
export default function createBuilder(): {
|
|
5
8
|
/**
|
|
6
|
-
* Write all type to files
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
+
* Write all type to files, then rewrite the database rows that store a renamed
|
|
10
|
+
* component uid (see `renameComponentRows`).
|
|
11
|
+
*
|
|
12
|
+
* Pass `{ renameComponentRows: false }` to only write the files. The caller must then
|
|
13
|
+
* call `renameComponentRows` itself, before the reload, and roll the files back if it
|
|
14
|
+
* throws. Do that when a later step must succeed together with the rows: run that
|
|
15
|
+
* step through `renameComponentRows({ beforeCommit })`, so that its failure rolls the
|
|
16
|
+
* rows back too.
|
|
17
|
+
*
|
|
18
|
+
* @returns boolean true if all files have been written correctly, false if an error
|
|
19
|
+
* occurred while writing them (the files are rolled back)
|
|
20
|
+
* @throws ApplicationError if the row rewrite failed (the files are rolled back) or if
|
|
21
|
+
* a rollback failed
|
|
9
22
|
*/
|
|
10
|
-
writeFiles(
|
|
23
|
+
writeFiles({ renameComponentRows }?: {
|
|
24
|
+
renameComponentRows?: boolean;
|
|
25
|
+
}): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* A component uid change (category move or rename) is also stored in the database:
|
|
28
|
+
* as `component_type` in the `*_cmps` join tables and as the type column of the
|
|
29
|
+
* polymorphic join tables (e.g. media in `files_related_mph`). Rewrites those rows in
|
|
30
|
+
* one transaction. Must run while the running process still holds the pre-rename
|
|
31
|
+
* metadata that locates them, i.e. before the reload.
|
|
32
|
+
*
|
|
33
|
+
* `beforeCommit` runs inside that transaction, after the rewrite and before the
|
|
34
|
+
* commit (also when no uid changed). If it rejects, the rows are rolled back. It must
|
|
35
|
+
* not use the database (see `renameComponentUIDs`).
|
|
36
|
+
*
|
|
37
|
+
* @throws if the rewrite or `beforeCommit` failed; the transaction has then restored
|
|
38
|
+
* the rows
|
|
39
|
+
*/
|
|
40
|
+
renameComponentRows({ beforeCommit }?: RenameComponentUIDsOptions): Promise<void>;
|
|
11
41
|
/**
|
|
12
42
|
* rollback all files
|
|
13
43
|
*/
|
|
@@ -24,9 +54,10 @@ export default function createBuilder(): {
|
|
|
24
54
|
readonly plugin: string | undefined;
|
|
25
55
|
readonly category: string | undefined;
|
|
26
56
|
readonly kind: import("@strapi/types/dist/struct/schema.js").ContentTypeKind;
|
|
27
|
-
readonly uid: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}
|
|
57
|
+
readonly uid: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`;
|
|
58
|
+
readonly initialUID: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`;
|
|
28
59
|
readonly writable: boolean;
|
|
29
|
-
setUID(val:
|
|
60
|
+
setUID(val: `admin::${string}` | `api::${string}.${string}` | `plugin::${string}.${string}` | `strapi::${string}`): /*elided*/ any;
|
|
30
61
|
setDir(val: string): /*elided*/ any;
|
|
31
62
|
readonly schema: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
|
|
32
63
|
setSchema(val: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema): /*elided*/ any;
|
|
@@ -38,9 +69,9 @@ export default function createBuilder(): {
|
|
|
38
69
|
setAttribute(key: string, attribute: any): /*elided*/ any;
|
|
39
70
|
deleteAttribute(key: string): /*elided*/ any;
|
|
40
71
|
setAttributes(newAttributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): /*elided*/ any;
|
|
41
|
-
removeContentType(uid:
|
|
42
|
-
removeComponent(uid:
|
|
43
|
-
updateComponent(uid:
|
|
72
|
+
removeContentType(uid: Internal.UID.ContentType): /*elided*/ any;
|
|
73
|
+
removeComponent(uid: Internal.UID.Component): /*elided*/ any;
|
|
74
|
+
updateComponent(uid: Internal.UID.Component, newUID: Internal.UID.Component): /*elided*/ any;
|
|
44
75
|
flush(): Promise<void>;
|
|
45
76
|
rollback(): Promise<void>;
|
|
46
77
|
};
|
|
@@ -54,9 +85,10 @@ export default function createBuilder(): {
|
|
|
54
85
|
readonly plugin: string | undefined;
|
|
55
86
|
readonly category: string | undefined;
|
|
56
87
|
readonly kind: import("@strapi/types/dist/struct/schema.js").ContentTypeKind;
|
|
57
|
-
readonly uid:
|
|
88
|
+
readonly uid: `${string}.${string}`;
|
|
89
|
+
readonly initialUID: `${string}.${string}`;
|
|
58
90
|
readonly writable: boolean;
|
|
59
|
-
setUID(val:
|
|
91
|
+
setUID(val: `${string}.${string}`): /*elided*/ any;
|
|
60
92
|
setDir(val: string): /*elided*/ any;
|
|
61
93
|
readonly schema: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
|
|
62
94
|
setSchema(val: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema): /*elided*/ any;
|
|
@@ -68,15 +100,15 @@ export default function createBuilder(): {
|
|
|
68
100
|
setAttribute(key: string, attribute: any): /*elided*/ any;
|
|
69
101
|
deleteAttribute(key: string): /*elided*/ any;
|
|
70
102
|
setAttributes(newAttributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): /*elided*/ any;
|
|
71
|
-
removeContentType(uid:
|
|
72
|
-
removeComponent(uid:
|
|
73
|
-
updateComponent(uid:
|
|
103
|
+
removeContentType(uid: Internal.UID.ContentType): /*elided*/ any;
|
|
104
|
+
removeComponent(uid: Internal.UID.Component): /*elided*/ any;
|
|
105
|
+
updateComponent(uid: Internal.UID.Component, newUID: Internal.UID.Component): /*elided*/ any;
|
|
74
106
|
flush(): Promise<void>;
|
|
75
107
|
rollback(): Promise<void>;
|
|
76
108
|
};
|
|
77
109
|
editComponent(this: any, infos: any): any;
|
|
78
|
-
deleteComponent(this: any, uid:
|
|
79
|
-
components: Map
|
|
110
|
+
deleteComponent(this: any, uid: Internal.UID.Component): any;
|
|
111
|
+
components: Map<`${string}.${string}`, SchemaHandler<`${string}.${string}`>>;
|
|
80
112
|
contentTypes: Map<any, any>;
|
|
81
113
|
/**
|
|
82
114
|
* Convert Attributes received from the API to the right syntax
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,OAA4B,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG3E,OAAO,EAAuB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE/F;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;IA0IjC;;;;;;;;;;;;;;OAcG;yCAC8C;QAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE;IAiDlF;;;;;;;;;;;;;OAaG;2CACyC,0BAA0B;IAQtE;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzJH;;OAEG;kCAC2B,GAAG;gCAUL,GAAG;EA7ClC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
/**
|
|
3
|
+
* The database shapes this module reads, derived from `Core.Strapi` so the
|
|
4
|
+
* Content-Type Builder does not depend on `@strapi/database` directly.
|
|
5
|
+
*/
|
|
6
|
+
type Database = Core.Strapi['db'];
|
|
7
|
+
export interface ComponentUIDRename {
|
|
8
|
+
oldUID: string;
|
|
9
|
+
newUID: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RenameComponentUIDsOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Runs after the rows are rewritten and before the transaction commits. If it
|
|
14
|
+
* rejects, the transaction rolls the rows back and `renameComponentUIDs` rejects
|
|
15
|
+
* with the same error. Use it for a later step that must succeed together with
|
|
16
|
+
* the rows (e.g. the `groups.json` folder commit).
|
|
17
|
+
*
|
|
18
|
+
* It runs while the transaction holds a connection, so it must not use `db`: with
|
|
19
|
+
* a pool of one connection (SQLite) a second query would wait forever. Without
|
|
20
|
+
* renames it still runs, without a transaction.
|
|
21
|
+
*/
|
|
22
|
+
beforeCommit?: () => Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Rewrites every stored reference to a renamed component uid (category move or
|
|
26
|
+
* category rename): the `component_type` of the component join rows and the type
|
|
27
|
+
* column of the polymorphic rows, so the entries and their media keep resolving
|
|
28
|
+
* after the reload. Runs in one transaction, which commits only after `beforeCommit`
|
|
29
|
+
* resolves. Must run while `db.metadata` still describes the pre-rename schema: that
|
|
30
|
+
* is what locates the tables.
|
|
31
|
+
*/
|
|
32
|
+
export declare const renameComponentUIDs: (db: Database, renames: ComponentUIDRename[], { beforeCommit }?: RenameComponentUIDsOptions) => Promise<void>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=rename-component-uids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-component-uids.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/rename-component-uids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQ1C;;;GAGG;AACH,KAAK,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AA2BlC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AA2CD,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,IAAI,QAAQ,EACZ,SAAS,kBAAkB,EAAE,EAC7B,mBAAkB,0BAA+B,kBAuBlD,CAAC"}
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import type { Internal, Struct } from '@strapi/types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The UID a schema handler holds: a content-type UID for a content type, a component UID for a
|
|
4
|
+
* component.
|
|
5
|
+
*/
|
|
6
|
+
export type SchemaHandlerUID = Internal.UID.ContentType | Internal.UID.Component;
|
|
7
|
+
export type Infos<TUID extends SchemaHandlerUID = Internal.UID.ContentType> = {
|
|
3
8
|
category?: string;
|
|
4
9
|
modelName?: string;
|
|
5
10
|
plugin?: string;
|
|
6
|
-
uid
|
|
11
|
+
uid: TUID;
|
|
12
|
+
/**
|
|
13
|
+
* `true` when the handler describes a schema the builder is creating, which has no file on disk
|
|
14
|
+
* yet: rolling it back removes the written file instead of restoring the initial schema.
|
|
15
|
+
*/
|
|
16
|
+
isNew?: boolean;
|
|
7
17
|
dir: string;
|
|
8
18
|
filename: string;
|
|
9
19
|
schema?: Struct.ContentTypeSchema;
|
|
10
20
|
};
|
|
11
|
-
export type SchemaHandler = ReturnType<typeof createSchemaHandler
|
|
12
|
-
|
|
21
|
+
export type SchemaHandler<TUID extends SchemaHandlerUID = Internal.UID.ContentType> = ReturnType<typeof createSchemaHandler<TUID>>;
|
|
22
|
+
/**
|
|
23
|
+
* `TUID` is never inferred from `infos`: a content-type handler keeps the whole content-type UID
|
|
24
|
+
* union, and a component handler is created with an explicit `Internal.UID.Component`.
|
|
25
|
+
*/
|
|
26
|
+
export default function createSchemaHandler<TUID extends SchemaHandlerUID = Internal.UID.ContentType>(infos: Infos<NoInfer<TUID>>): {
|
|
13
27
|
readonly modelName: string | undefined;
|
|
14
28
|
readonly plugin: string | undefined;
|
|
15
29
|
readonly category: string | undefined;
|
|
16
30
|
readonly kind: Struct.ContentTypeKind;
|
|
17
|
-
readonly uid:
|
|
31
|
+
readonly uid: TUID;
|
|
32
|
+
readonly initialUID: TUID;
|
|
18
33
|
readonly writable: boolean;
|
|
19
|
-
setUID(val:
|
|
34
|
+
setUID(val: TUID): /*elided*/ any;
|
|
20
35
|
setDir(val: string): /*elided*/ any;
|
|
21
36
|
readonly schema: Struct.ContentTypeSchema;
|
|
22
37
|
setSchema(val: Struct.ContentTypeSchema): /*elided*/ any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-handler.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/schema-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMtD,MAAM,MAAM,KAAK,GAAG;
|
|
1
|
+
{"version":3,"file":"schema-handler.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/schema-builder/schema-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM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.g. a Yup `ValidationError`) serializes with its name, message
|
|
5
|
+
* and details. A native `Error` (e.g. a `TypeError` thrown by a validator) does not: its
|
|
6
|
+
* properties are not enumerable, so it serializes to `{}` and the message is lost.
|
|
7
|
+
*/
|
|
8
|
+
export declare const formatValidationError: (error: unknown) => unknown;
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/errors.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,YAUnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uid-target.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/uid-target.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,aAAa,KAAG,MAAM,GAAG,SAgBtE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,aAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"uid-target.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/uid-target.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,aAAa,KAAG,MAAM,GAAG,SAgBtE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,aAAa,KAAG,OAK3D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('@strapi/utils');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formats an error caught during input validation for the legacy `{ error }` response body.
|
|
7
|
+
*
|
|
8
|
+
* A Strapi `ApplicationError` (e.g. a Yup `ValidationError`) serializes with its name, message
|
|
9
|
+
* and details. A native `Error` (e.g. a `TypeError` thrown by a validator) does not: its
|
|
10
|
+
* properties are not enumerable, so it serializes to `{}` and the message is lost.
|
|
11
|
+
*/ const formatValidationError = (error)=>{
|
|
12
|
+
if (error instanceof utils.errors.ApplicationError) {
|
|
13
|
+
return error;
|
|
14
|
+
}
|
|
15
|
+
if (error instanceof Error) {
|
|
16
|
+
return {
|
|
17
|
+
name: error.name,
|
|
18
|
+
message: error.message,
|
|
19
|
+
details: {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return error;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.formatValidationError = formatValidationError;
|
|
26
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../server/src/utils/errors.ts"],"sourcesContent":["import { errors } from '@strapi/utils';\n\n/**\n * Formats an error caught during input validation for the legacy `{ error }` response body.\n *\n * A Strapi `ApplicationError` (e.g. a Yup `ValidationError`) serializes with its name, message\n * and details. A native `Error` (e.g. a `TypeError` thrown by a validator) does not: its\n * properties are not enumerable, so it serializes to `{}` and the message is lost.\n */\nexport const formatValidationError = (error: unknown) => {\n if (error instanceof errors.ApplicationError) {\n return error;\n }\n\n if (error instanceof Error) {\n return { name: error.name, message: error.message, details: {} };\n }\n\n return error;\n};\n"],"names":["formatValidationError","error","errors","ApplicationError","Error","name","message","details"],"mappings":";;;;AAEA;;;;;;IAOO,MAAMA,qBAAAA,GAAwB,CAACC,KAAAA,GAAAA;IACpC,IAAIA,KAAAA,YAAiBC,YAAAA,CAAOC,gBAAgB,EAAE;QAC5C,OAAOF,KAAAA;AACT,IAAA;AAEA,IAAA,IAAIA,iBAAiBG,KAAAA,EAAO;QAC1B,OAAO;AAAEC,YAAAA,IAAAA,EAAMJ,MAAMI,IAAI;AAAEC,YAAAA,OAAAA,EAASL,MAAMK,OAAO;AAAEC,YAAAA,OAAAA,EAAS;AAAG,SAAA;AACjE,IAAA;IAEA,OAAON,KAAAA;AACT;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { errors } from '@strapi/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Formats an error caught during input validation for the legacy `{ error }` response body.
|
|
5
|
+
*
|
|
6
|
+
* A Strapi `ApplicationError` (e.g. a Yup `ValidationError`) serializes with its name, message
|
|
7
|
+
* and details. A native `Error` (e.g. a `TypeError` thrown by a validator) does not: its
|
|
8
|
+
* properties are not enumerable, so it serializes to `{}` and the message is lost.
|
|
9
|
+
*/ const formatValidationError = (error)=>{
|
|
10
|
+
if (error instanceof errors.ApplicationError) {
|
|
11
|
+
return error;
|
|
12
|
+
}
|
|
13
|
+
if (error instanceof Error) {
|
|
14
|
+
return {
|
|
15
|
+
name: error.name,
|
|
16
|
+
message: error.message,
|
|
17
|
+
details: {}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return error;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { formatValidationError };
|
|
24
|
+
//# sourceMappingURL=errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.mjs","sources":["../../../server/src/utils/errors.ts"],"sourcesContent":["import { errors } from '@strapi/utils';\n\n/**\n * Formats an error caught during input validation for the legacy `{ error }` response body.\n *\n * A Strapi `ApplicationError` (e.g. a Yup `ValidationError`) serializes with its name, message\n * and details. A native `Error` (e.g. a `TypeError` thrown by a validator) does not: its\n * properties are not enumerable, so it serializes to `{}` and the message is lost.\n */\nexport const formatValidationError = (error: unknown) => {\n if (error instanceof errors.ApplicationError) {\n return error;\n }\n\n if (error instanceof Error) {\n return { name: error.name, message: error.message, details: {} };\n }\n\n return error;\n};\n"],"names":["formatValidationError","error","errors","ApplicationError","Error","name","message","details"],"mappings":";;AAEA;;;;;;IAOO,MAAMA,qBAAAA,GAAwB,CAACC,KAAAA,GAAAA;IACpC,IAAIA,KAAAA,YAAiBC,MAAAA,CAAOC,gBAAgB,EAAE;QAC5C,OAAOF,KAAAA;AACT,IAAA;AAEA,IAAA,IAAIA,iBAAiBG,KAAAA,EAAO;QAC1B,OAAO;AAAEC,YAAAA,IAAAA,EAAMJ,MAAMI,IAAI;AAAEC,YAAAA,OAAAA,EAASL,MAAMK,OAAO;AAAEC,YAAAA,OAAAA,EAAS;AAAG,SAAA;AACjE,IAAA;IAEA,OAAON,KAAAA;AACT;;;;"}
|
|
@@ -26,7 +26,8 @@ var constants = require('../services/constants.js');
|
|
|
26
26
|
* including a custom field stored as one.
|
|
27
27
|
*/ const isValidUidTarget = (attribute)=>{
|
|
28
28
|
const type = resolveStorageType(attribute);
|
|
29
|
-
|
|
29
|
+
const validUidTargets = constants.VALID_UID_TARGETS;
|
|
30
|
+
return type !== undefined && validUidTargets.includes(type);
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
exports.isValidUidTarget = isValidUidTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uid-target.js","sources":["../../../server/src/utils/uid-target.ts"],"sourcesContent":["import { VALID_UID_TARGETS } from '../services/constants';\n\ntype AttributeLike = { type?: unknown; customField?: unknown };\n\n/**\n * The type an attribute is stored as. The admin sends custom fields as\n * `type: 'customField'`; they are resolved through the registry to their\n * underlying type. Returns `undefined` for an unknown custom field (plugin\n * removed, bad name).\n */\nexport const resolveStorageType = (attribute: AttributeLike): string | undefined => {\n if (attribute.type !== 'customField' && typeof attribute.customField !== 'string') {\n return typeof attribute.type === 'string' ? attribute.type : undefined;\n }\n\n if (typeof attribute.customField !== 'string') {\n return undefined;\n }\n\n try {\n const customField = strapi.get('custom-fields').get(attribute.customField) as\n { type?: string } | undefined;\n return customField?.type;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a uid can be attached to this attribute: a string or text field,\n * including a custom field stored as one.\n */\nexport const isValidUidTarget = (attribute: AttributeLike): boolean => {\n const type = resolveStorageType(attribute);\n
|
|
1
|
+
{"version":3,"file":"uid-target.js","sources":["../../../server/src/utils/uid-target.ts"],"sourcesContent":["import { VALID_UID_TARGETS } from '../services/constants';\n\ntype AttributeLike = { type?: unknown; customField?: unknown };\n\n/**\n * The type an attribute is stored as. The admin sends custom fields as\n * `type: 'customField'`; they are resolved through the registry to their\n * underlying type. Returns `undefined` for an unknown custom field (plugin\n * removed, bad name).\n */\nexport const resolveStorageType = (attribute: AttributeLike): string | undefined => {\n if (attribute.type !== 'customField' && typeof attribute.customField !== 'string') {\n return typeof attribute.type === 'string' ? attribute.type : undefined;\n }\n\n if (typeof attribute.customField !== 'string') {\n return undefined;\n }\n\n try {\n const customField = strapi.get('custom-fields').get(attribute.customField) as\n { type?: string } | undefined;\n return customField?.type;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a uid can be attached to this attribute: a string or text field,\n * including a custom field stored as one.\n */\nexport const isValidUidTarget = (attribute: AttributeLike): boolean => {\n const type = resolveStorageType(attribute);\n const validUidTargets: readonly string[] = VALID_UID_TARGETS;\n\n return type !== undefined && validUidTargets.includes(type);\n};\n"],"names":["resolveStorageType","attribute","type","customField","undefined","strapi","get","isValidUidTarget","validUidTargets","VALID_UID_TARGETS","includes"],"mappings":";;;;AAIA;;;;;IAMO,MAAMA,kBAAAA,GAAqB,CAACC,SAAAA,GAAAA;IACjC,IAAIA,SAAAA,CAAUC,IAAI,KAAK,aAAA,IAAiB,OAAOD,SAAAA,CAAUE,WAAW,KAAK,QAAA,EAAU;AACjF,QAAA,OAAO,OAAOF,SAAAA,CAAUC,IAAI,KAAK,QAAA,GAAWD,SAAAA,CAAUC,IAAI,GAAGE,SAAAA;AAC/D,IAAA;AAEA,IAAA,IAAI,OAAOH,SAAAA,CAAUE,WAAW,KAAK,QAAA,EAAU;QAC7C,OAAOC,SAAAA;AACT,IAAA;IAEA,IAAI;QACF,MAAMD,WAAAA,GAAcE,OAAOC,GAAG,CAAC,iBAAiBA,GAAG,CAACL,UAAUE,WAAW,CAAA;AAEzE,QAAA,OAAOA,WAAAA,EAAaD,IAAAA;AACtB,IAAA,CAAA,CAAE,OAAM;QACN,OAAOE,SAAAA;AACT,IAAA;AACF;AAEA;;;IAIO,MAAMG,gBAAAA,GAAmB,CAACN,SAAAA,GAAAA;AAC/B,IAAA,MAAMC,OAAOF,kBAAAA,CAAmBC,SAAAA,CAAAA;AAChC,IAAA,MAAMO,eAAAA,GAAqCC,2BAAAA;AAE3C,IAAA,OAAOP,IAAAA,KAASE,SAAAA,IAAaI,eAAAA,CAAgBE,QAAQ,CAACR,IAAAA,CAAAA;AACxD;;;;;"}
|
|
@@ -24,7 +24,8 @@ import { VALID_UID_TARGETS } from '../services/constants.mjs';
|
|
|
24
24
|
* including a custom field stored as one.
|
|
25
25
|
*/ const isValidUidTarget = (attribute)=>{
|
|
26
26
|
const type = resolveStorageType(attribute);
|
|
27
|
-
|
|
27
|
+
const validUidTargets = VALID_UID_TARGETS;
|
|
28
|
+
return type !== undefined && validUidTargets.includes(type);
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export { isValidUidTarget, resolveStorageType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uid-target.mjs","sources":["../../../server/src/utils/uid-target.ts"],"sourcesContent":["import { VALID_UID_TARGETS } from '../services/constants';\n\ntype AttributeLike = { type?: unknown; customField?: unknown };\n\n/**\n * The type an attribute is stored as. The admin sends custom fields as\n * `type: 'customField'`; they are resolved through the registry to their\n * underlying type. Returns `undefined` for an unknown custom field (plugin\n * removed, bad name).\n */\nexport const resolveStorageType = (attribute: AttributeLike): string | undefined => {\n if (attribute.type !== 'customField' && typeof attribute.customField !== 'string') {\n return typeof attribute.type === 'string' ? attribute.type : undefined;\n }\n\n if (typeof attribute.customField !== 'string') {\n return undefined;\n }\n\n try {\n const customField = strapi.get('custom-fields').get(attribute.customField) as\n { type?: string } | undefined;\n return customField?.type;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a uid can be attached to this attribute: a string or text field,\n * including a custom field stored as one.\n */\nexport const isValidUidTarget = (attribute: AttributeLike): boolean => {\n const type = resolveStorageType(attribute);\n
|
|
1
|
+
{"version":3,"file":"uid-target.mjs","sources":["../../../server/src/utils/uid-target.ts"],"sourcesContent":["import { VALID_UID_TARGETS } from '../services/constants';\n\ntype AttributeLike = { type?: unknown; customField?: unknown };\n\n/**\n * The type an attribute is stored as. The admin sends custom fields as\n * `type: 'customField'`; they are resolved through the registry to their\n * underlying type. Returns `undefined` for an unknown custom field (plugin\n * removed, bad name).\n */\nexport const resolveStorageType = (attribute: AttributeLike): string | undefined => {\n if (attribute.type !== 'customField' && typeof attribute.customField !== 'string') {\n return typeof attribute.type === 'string' ? attribute.type : undefined;\n }\n\n if (typeof attribute.customField !== 'string') {\n return undefined;\n }\n\n try {\n const customField = strapi.get('custom-fields').get(attribute.customField) as\n { type?: string } | undefined;\n return customField?.type;\n } catch {\n return undefined;\n }\n};\n\n/**\n * Whether a uid can be attached to this attribute: a string or text field,\n * including a custom field stored as one.\n */\nexport const isValidUidTarget = (attribute: AttributeLike): boolean => {\n const type = resolveStorageType(attribute);\n const validUidTargets: readonly string[] = VALID_UID_TARGETS;\n\n return type !== undefined && validUidTargets.includes(type);\n};\n"],"names":["resolveStorageType","attribute","type","customField","undefined","strapi","get","isValidUidTarget","validUidTargets","VALID_UID_TARGETS","includes"],"mappings":";;AAIA;;;;;IAMO,MAAMA,kBAAAA,GAAqB,CAACC,SAAAA,GAAAA;IACjC,IAAIA,SAAAA,CAAUC,IAAI,KAAK,aAAA,IAAiB,OAAOD,SAAAA,CAAUE,WAAW,KAAK,QAAA,EAAU;AACjF,QAAA,OAAO,OAAOF,SAAAA,CAAUC,IAAI,KAAK,QAAA,GAAWD,SAAAA,CAAUC,IAAI,GAAGE,SAAAA;AAC/D,IAAA;AAEA,IAAA,IAAI,OAAOH,SAAAA,CAAUE,WAAW,KAAK,QAAA,EAAU;QAC7C,OAAOC,SAAAA;AACT,IAAA;IAEA,IAAI;QACF,MAAMD,WAAAA,GAAcE,OAAOC,GAAG,CAAC,iBAAiBA,GAAG,CAACL,UAAUE,WAAW,CAAA;AAEzE,QAAA,OAAOA,WAAAA,EAAaD,IAAAA;AACtB,IAAA,CAAA,CAAE,OAAM;QACN,OAAOE,SAAAA;AACT,IAAA;AACF;AAEA;;;IAIO,MAAMG,gBAAAA,GAAmB,CAACN,SAAAA,GAAAA;AAC/B,IAAA,MAAMC,OAAOF,kBAAAA,CAAmBC,SAAAA,CAAAA;AAChC,IAAA,MAAMO,eAAAA,GAAqCC,iBAAAA;AAE3C,IAAA,OAAOP,IAAAA,KAASE,SAAAA,IAAaI,eAAAA,CAAgBE,QAAQ,CAACR,IAAAA,CAAAA;AACxD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/content-type-builder",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.62.0",
|
|
4
4
|
"description": "Create and manage content types",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -53,10 +53,8 @@
|
|
|
53
53
|
"build:types:admin": "run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly",
|
|
54
54
|
"clean": "run -T rimraf ./dist",
|
|
55
55
|
"lint": "run -T eslint . --max-warnings=0",
|
|
56
|
-
"test:front": "run -T
|
|
57
|
-
"test:front:
|
|
58
|
-
"test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
|
|
59
|
-
"test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
|
|
56
|
+
"test:front": "run -T jest --config ./jest.config.front.js",
|
|
57
|
+
"test:front:watch": "run -T jest --config ./jest.config.front.js --watchAll",
|
|
60
58
|
"test:ts:back": "run -T tsc -p server/tsconfig.eslint.json",
|
|
61
59
|
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
62
60
|
"test:unit": "run -T jest",
|
|
@@ -73,10 +71,10 @@
|
|
|
73
71
|
"@dnd-kit/utilities": "3.2.2",
|
|
74
72
|
"@reduxjs/toolkit": "1.9.7",
|
|
75
73
|
"@sindresorhus/slugify": "1.1.0",
|
|
76
|
-
"@strapi/design-system": "2.
|
|
77
|
-
"@strapi/generators": "5.
|
|
78
|
-
"@strapi/icons": "2.
|
|
79
|
-
"@strapi/utils": "5.
|
|
74
|
+
"@strapi/design-system": "2.3.1",
|
|
75
|
+
"@strapi/generators": "5.62.0",
|
|
76
|
+
"@strapi/icons": "2.3.1",
|
|
77
|
+
"@strapi/utils": "5.62.0",
|
|
80
78
|
"ai": "6.0.277",
|
|
81
79
|
"date-fns": "2.30.0",
|
|
82
80
|
"fs-extra": "11.3.4",
|
|
@@ -85,7 +83,7 @@
|
|
|
85
83
|
"lodash": "4.18.1",
|
|
86
84
|
"micromatch": "^4.0.8",
|
|
87
85
|
"pluralize": "8.0.0",
|
|
88
|
-
"qs": "6.16.
|
|
86
|
+
"qs": "6.16.2",
|
|
89
87
|
"react-dropzone": "14.3.8",
|
|
90
88
|
"react-intl": "6.6.2",
|
|
91
89
|
"react-markdown": "9.1.0",
|
|
@@ -94,8 +92,8 @@
|
|
|
94
92
|
"zod": "4.4.3"
|
|
95
93
|
},
|
|
96
94
|
"devDependencies": {
|
|
97
|
-
"@strapi/admin": "5.
|
|
98
|
-
"@strapi/types": "5.
|
|
95
|
+
"@strapi/admin": "5.62.0",
|
|
96
|
+
"@strapi/types": "5.62.0",
|
|
99
97
|
"@testing-library/dom": "10.4.1",
|
|
100
98
|
"@testing-library/jest-dom": "6.9.1",
|
|
101
99
|
"@testing-library/react": "16.3.2",
|
|
@@ -116,7 +114,7 @@
|
|
|
116
114
|
"react-router-dom": "6.30.6",
|
|
117
115
|
"styled-components": "6.4.1",
|
|
118
116
|
"vitest": "catalog:",
|
|
119
|
-
"vitest-config": "5.
|
|
117
|
+
"vitest-config": "5.62.0"
|
|
120
118
|
},
|
|
121
119
|
"peerDependencies": {
|
|
122
120
|
"@strapi/admin": "^5.0.0",
|