@webiny/api-headless-cms 5.40.5-beta.0 → 5.41.0-dbt.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/constants.d.ts +1 -1
- package/crud/AccessControl/AccessControl.d.ts +2 -2
- package/crud/contentEntry/abstractions/IListEntries.d.ts +2 -2
- package/crud/contentEntry/abstractions/IListEntries.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryData.d.ts +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.d.ts +1 -1
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.d.ts +1 -1
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.d.ts +1 -1
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.d.ts +1 -1
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.d.ts +1 -1
- package/crud/contentEntry/entryDataValidation.d.ts +1 -1
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/validation.d.ts +96 -96
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/validation.d.ts +1 -1
- package/export/types.d.ts +3 -3
- package/graphql/getSchema.js +6 -5
- package/graphql/getSchema.js.map +1 -1
- package/graphql/index.d.ts +2 -2
- package/graphql/schema/createManageResolvers.js +0 -6
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.js +0 -3
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js +0 -5
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js +0 -5
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.js +1 -4
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveGet.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveList.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveListDeleted.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveMove.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveRestoreFromBin.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
- package/graphql/schema/resolvers/manage/resolveValidate.d.ts +1 -1
- package/graphql/schema/resolvers/preview/resolveGet.d.ts +1 -1
- package/graphql/schema/resolvers/preview/resolveList.d.ts +1 -1
- package/graphql/schema/resolvers/read/resolveGet.d.ts +1 -1
- package/graphql/schema/resolvers/read/resolveList.d.ts +1 -1
- package/graphql/schema/schemaPlugins.js +1 -3
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/index.d.ts +3 -3
- package/package.json +24 -23
- package/plugins/CmsGraphQLSchemaPlugin/CmsGraphQLSchemaPlugin.d.ts +2 -2
- package/plugins/CmsModelPlugin.d.ts +1 -1
- package/plugins/CmsParametersPlugin.d.ts +2 -2
- package/types/context.d.ts +7 -7
- package/types/context.js.map +1 -1
- package/types/modelAst.d.ts +4 -4
- package/types/modelField.d.ts +1 -1
- package/types/types.d.ts +12 -14
- package/types/types.js.map +1 -1
|
@@ -3,6 +3,6 @@ interface ResolveDeleteArgs {
|
|
|
3
3
|
revision: string;
|
|
4
4
|
options?: CmsDeleteEntryOptions;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type ResolveDelete = ResolverFactory<any, ResolveDeleteArgs>;
|
|
7
7
|
export declare const resolveDelete: ResolveDelete;
|
|
8
8
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveDeleteArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveDelete = ResolverFactory<any, ResolveDeleteArgs>;
|
|
6
6
|
export declare const resolveDeleteMultiple: ResolveDelete;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveGetArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveGet = ResolverFactory<any, ResolveGetArgs>;
|
|
6
6
|
export declare const resolveGet: ResolveGet;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveGetByIdsArgs {
|
|
3
3
|
revisions: string[];
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveGetByIds = ResolverFactory<any, ResolveGetByIdsArgs>;
|
|
6
6
|
export declare const resolveGetByIds: ResolveGetByIds;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveGetRevisionsArgs {
|
|
3
3
|
id: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveGetRevisions = ResolverFactory<any, ResolveGetRevisionsArgs>;
|
|
6
6
|
export declare const resolveGetRevisions: ResolveGetRevisions;
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryListParams, CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveGetUniqueFieldValuesList = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveGetUniqueFieldValues: ResolveGetUniqueFieldValuesList;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryResolverFactory as ResolverFactory, CmsEntryListParams } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveList = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveList: ResolveList;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryResolverFactory as ResolverFactory, CmsEntryListParams } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveListDeleted = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveListDeleted: ResolveListDeleted;
|
|
4
4
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolvePublishArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolvePublish = ResolverFactory<any, ResolvePublishArgs>;
|
|
6
6
|
export declare const resolvePublish: ResolvePublish;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveRepublishArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveRepublish = ResolverFactory<any, ResolveRepublishArgs>;
|
|
6
6
|
export declare const resolveRepublish: ResolveRepublish;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveRestoreFromBinArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveRestoreFromBin = ResolverFactory<any, ResolveRestoreFromBinArgs>;
|
|
6
6
|
export declare const resolveRestoreFromBin: ResolveRestoreFromBin;
|
|
7
7
|
export {};
|
|
@@ -2,6 +2,6 @@ import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
|
2
2
|
interface ResolveUnpublishArgs {
|
|
3
3
|
revision: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type ResolveUnpublish = ResolverFactory<any, ResolveUnpublishArgs>;
|
|
6
6
|
export declare const resolveUnpublish: ResolveUnpublish;
|
|
7
7
|
export {};
|
|
@@ -4,6 +4,6 @@ interface ResolveUpdateArgs {
|
|
|
4
4
|
data: UpdateCmsEntryInput;
|
|
5
5
|
options?: UpdateCmsEntryOptionsInput;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type ResolveUpdate = ResolverFactory<any, ResolveUpdateArgs>;
|
|
8
8
|
export declare const resolveUpdate: ResolveUpdate;
|
|
9
9
|
export {};
|
|
@@ -3,6 +3,6 @@ interface ResolveUpdateArgs {
|
|
|
3
3
|
revision?: string;
|
|
4
4
|
data: UpdateCmsEntryInput;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type ResolveValidate = ResolverFactory<any, ResolveUpdateArgs>;
|
|
7
7
|
export declare const resolveValidate: ResolveValidate;
|
|
8
8
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryListParams, CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveGet = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveGet: ResolveGet;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryResolverFactory as ResolverFactory, CmsEntryListParams } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveList = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveList: ResolveList;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryListParams, CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveGet = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveGet: ResolveGet;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CmsEntryResolverFactory as ResolverFactory, CmsEntryListParams } from "../../../../types";
|
|
2
|
-
|
|
2
|
+
type ResolveList = ResolverFactory<any, CmsEntryListParams>;
|
|
3
3
|
export declare const resolveList: ResolveList;
|
|
4
4
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_createManageSDL","require","_createReadSDL","_createManageResolvers","_createReadResolvers","_createPreviewResolvers","_getSchemaFromFieldPlugins","_plugins","_createFieldTypePluginRecords","generateSchemaPlugins","params","context","models","plugins","cms","type","fieldTypePlugins","createFieldTypePluginRecords","sorterPlugins","byType","CmsGraphQLSchemaSorterPlugin","schemaPlugins","createGraphQLSchemaPluginFromFieldPlugins","
|
|
1
|
+
{"version":3,"names":["_createManageSDL","require","_createReadSDL","_createManageResolvers","_createReadResolvers","_createPreviewResolvers","_getSchemaFromFieldPlugins","_plugins","_createFieldTypePluginRecords","generateSchemaPlugins","params","context","models","plugins","cms","type","fieldTypePlugins","createFieldTypePluginRecords","sorterPlugins","byType","CmsGraphQLSchemaSorterPlugin","schemaPlugins","createGraphQLSchemaPluginFromFieldPlugins","forEach","model","plugin","createCmsGraphQLSchemaPlugin","typeDefs","createManageSDL","resolvers","createManageResolvers","name","modelId","push","createReadSDL","READ","createReadResolvers","createPreviewResolvers","filter","pl","schema","exports"],"sources":["schemaPlugins.ts"],"sourcesContent":["import { CmsContext, CmsModel } from \"~/types\";\nimport { createManageSDL } from \"./createManageSDL\";\nimport { createReadSDL } from \"./createReadSDL\";\nimport { createManageResolvers } from \"./createManageResolvers\";\nimport { createReadResolvers } from \"./createReadResolvers\";\nimport { createPreviewResolvers } from \"./createPreviewResolvers\";\nimport { createGraphQLSchemaPluginFromFieldPlugins } from \"~/utils/getSchemaFromFieldPlugins\";\nimport {\n CmsGraphQLSchemaSorterPlugin,\n createCmsGraphQLSchemaPlugin,\n ICmsGraphQLSchemaPlugin\n} from \"~/plugins\";\nimport { createFieldTypePluginRecords } from \"~/graphql/schema/createFieldTypePluginRecords\";\n\ninterface GenerateSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n}\n\nexport const generateSchemaPlugins = async (\n params: GenerateSchemaPluginsParams\n): Promise<ICmsGraphQLSchemaPlugin[]> => {\n const { context, models } = params;\n const { plugins, cms } = context;\n\n /**\n * If type does not exist, we are not generating schema plugins for models.\n * It should not come to this point, but we check it anyways.\n */\n const { type } = cms;\n if (!type) {\n return [];\n }\n\n // Structure plugins for faster access\n const fieldTypePlugins = createFieldTypePluginRecords(plugins);\n\n const sorterPlugins = plugins.byType<CmsGraphQLSchemaSorterPlugin>(\n CmsGraphQLSchemaSorterPlugin.type\n );\n\n const schemaPlugins = createGraphQLSchemaPluginFromFieldPlugins({\n models,\n fieldTypePlugins,\n type\n });\n\n models.forEach(model => {\n switch (type) {\n case \"manage\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createManageSDL({\n models,\n model,\n fieldTypePlugins,\n sorterPlugins\n }),\n resolvers: createManageResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n });\n plugin.name = `headless-cms.graphql.schema.manage.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n\n break;\n case \"preview\":\n case \"read\":\n {\n const plugin = createCmsGraphQLSchemaPlugin({\n typeDefs: createReadSDL({\n models,\n model,\n fieldTypePlugins,\n sorterPlugins\n }),\n resolvers: cms.READ\n ? createReadResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n : createPreviewResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n });\n plugin.name = `headless-cms.graphql.schema.${type}.${model.modelId}`;\n schemaPlugins.push(plugin);\n }\n break;\n default:\n return;\n }\n });\n\n return schemaPlugins.filter(pl => !!pl.schema.typeDefs);\n};\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,6BAAA,GAAAP,OAAA;AAOO,MAAMQ,qBAAqB,GAAG,MACjCC,MAAmC,IACE;EACrC,MAAM;IAAEC,OAAO;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAClC,MAAM;IAAEG,OAAO;IAAEC;EAAI,CAAC,GAAGH,OAAO;;EAEhC;AACJ;AACA;AACA;EACI,MAAM;IAAEI;EAAK,CAAC,GAAGD,GAAG;EACpB,IAAI,CAACC,IAAI,EAAE;IACP,OAAO,EAAE;EACb;;EAEA;EACA,MAAMC,gBAAgB,GAAG,IAAAC,0DAA4B,EAACJ,OAAO,CAAC;EAE9D,MAAMK,aAAa,GAAGL,OAAO,CAACM,MAAM,CAChCC,qCAA4B,CAACL,IACjC,CAAC;EAED,MAAMM,aAAa,GAAG,IAAAC,oEAAyC,EAAC;IAC5DV,MAAM;IACNI,gBAAgB;IAChBD;EACJ,CAAC,CAAC;EAEFH,MAAM,CAACW,OAAO,CAACC,KAAK,IAAI;IACpB,QAAQT,IAAI;MACR,KAAK,QAAQ;QACT;UACI,MAAMU,MAAM,GAAG,IAAAC,qCAA4B,EAAC;YACxCC,QAAQ,EAAE,IAAAC,gCAAe,EAAC;cACtBhB,MAAM;cACNY,KAAK;cACLR,gBAAgB;cAChBE;YACJ,CAAC,CAAC;YACFW,SAAS,EAAE,IAAAC,4CAAqB,EAAC;cAC7BlB,MAAM;cACNY,KAAK;cACLR,gBAAgB;cAChBL;YACJ,CAAC;UACL,CAAC,CAAC;UACFc,MAAM,CAACM,IAAI,GAAI,sCAAqCP,KAAK,CAACQ,OAAQ,EAAC;UACnEX,aAAa,CAACY,IAAI,CAACR,MAAM,CAAC;QAC9B;QAEA;MACJ,KAAK,SAAS;MACd,KAAK,MAAM;QACP;UACI,MAAMA,MAAM,GAAG,IAAAC,qCAA4B,EAAC;YACxCC,QAAQ,EAAE,IAAAO,4BAAa,EAAC;cACpBtB,MAAM;cACNY,KAAK;cACLR,gBAAgB;cAChBE;YACJ,CAAC,CAAC;YACFW,SAAS,EAAEf,GAAG,CAACqB,IAAI,GACb,IAAAC,wCAAmB,EAAC;cAChBxB,MAAM;cACNY,KAAK;cACLR,gBAAgB;cAChBL;YACJ,CAAC,CAAC,GACF,IAAA0B,8CAAsB,EAAC;cACnBzB,MAAM;cACNY,KAAK;cACLR,gBAAgB;cAChBL;YACJ,CAAC;UACX,CAAC,CAAC;UACFc,MAAM,CAACM,IAAI,GAAI,+BAA8BhB,IAAK,IAAGS,KAAK,CAACQ,OAAQ,EAAC;UACpEX,aAAa,CAACY,IAAI,CAACR,MAAM,CAAC;QAC9B;QACA;MACJ;QACI;IACR;EACJ,CAAC,CAAC;EAEF,OAAOJ,aAAa,CAACiB,MAAM,CAACC,EAAE,IAAI,CAAC,CAACA,EAAE,CAACC,MAAM,CAACb,QAAQ,CAAC;AAC3D,CAAC;AAACc,OAAA,CAAAhC,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStora
|
|
|
4
4
|
export * from "./utils/isHeadlessCmsReady";
|
|
5
5
|
export * from "./utils/createModelField";
|
|
6
6
|
export * from "./graphql/schema/resolvers/manage/normalizeGraphQlInput";
|
|
7
|
-
export
|
|
8
|
-
export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/
|
|
9
|
-
export
|
|
7
|
+
export type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;
|
|
8
|
+
export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("@webiny/plugins/types").PluginCollection | import("./plugins").CmsParametersPlugin | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context> | import("./plugins").CmsRichTextRendererPlugin<string | undefined>)[];
|
|
9
|
+
export type ContentContextParams = CrudParams;
|
|
10
10
|
export declare const createHeadlessCmsContext: (params: ContentContextParams) => (import("./types").ModelManagerPlugin | import("./plugins").StorageTransformPlugin<any, any, import("./types").CmsModelField> | import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("./types").CmsModelFieldToGraphQLPlugin<any>[] | (import("./types").CmsModelFieldValidatorPlugin | import("./types").CmsModelFieldPatternValidatorPlugin[])[] | (import("./fieldConverters/CmsModelObjectFieldConverterPlugin").CmsModelObjectFieldConverterPlugin | import("./fieldConverters/CmsModelDefaultFieldConverterPlugin").CmsModelDefaultFieldConverterPlugin | import("./fieldConverters/CmsModelDynamicZoneFieldConverterPlugin").CmsModelDynamicZoneFieldConverterPlugin)[])[];
|
|
11
11
|
export * from "./graphqlFields";
|
|
12
12
|
export * from "./plugins";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.41.0-dbt.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -18,23 +18,23 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@babel/code-frame": "7.24.7",
|
|
21
22
|
"@babel/runtime": "7.24.1",
|
|
22
|
-
"@graphql-tools/schema": "
|
|
23
|
-
"@webiny/api": "5.
|
|
24
|
-
"@webiny/api-i18n": "5.
|
|
25
|
-
"@webiny/api-security": "5.
|
|
26
|
-
"@webiny/api-tenancy": "5.
|
|
27
|
-
"@webiny/error": "5.
|
|
28
|
-
"@webiny/handler": "5.
|
|
29
|
-
"@webiny/handler-aws": "5.
|
|
30
|
-
"@webiny/handler-db": "5.
|
|
31
|
-
"@webiny/handler-graphql": "5.
|
|
32
|
-
"@webiny/lexical-converter": "5.
|
|
33
|
-
"@webiny/plugins": "5.
|
|
34
|
-
"@webiny/pubsub": "5.
|
|
35
|
-
"@webiny/utils": "5.
|
|
36
|
-
"@webiny/validation": "5.
|
|
37
|
-
"code-frame": "5.0.0",
|
|
23
|
+
"@graphql-tools/schema": "10.0.6",
|
|
24
|
+
"@webiny/api": "5.41.0-dbt.0",
|
|
25
|
+
"@webiny/api-i18n": "5.41.0-dbt.0",
|
|
26
|
+
"@webiny/api-security": "5.41.0-dbt.0",
|
|
27
|
+
"@webiny/api-tenancy": "5.41.0-dbt.0",
|
|
28
|
+
"@webiny/error": "5.41.0-dbt.0",
|
|
29
|
+
"@webiny/handler": "5.41.0-dbt.0",
|
|
30
|
+
"@webiny/handler-aws": "5.41.0-dbt.0",
|
|
31
|
+
"@webiny/handler-db": "5.41.0-dbt.0",
|
|
32
|
+
"@webiny/handler-graphql": "5.41.0-dbt.0",
|
|
33
|
+
"@webiny/lexical-converter": "5.41.0-dbt.0",
|
|
34
|
+
"@webiny/plugins": "5.41.0-dbt.0",
|
|
35
|
+
"@webiny/pubsub": "5.41.0-dbt.0",
|
|
36
|
+
"@webiny/utils": "5.41.0-dbt.0",
|
|
37
|
+
"@webiny/validation": "5.41.0-dbt.0",
|
|
38
38
|
"dot-prop": "6.0.1",
|
|
39
39
|
"graphql": "15.8.0",
|
|
40
40
|
"graphql-tag": "2.12.6",
|
|
@@ -51,10 +51,11 @@
|
|
|
51
51
|
"@babel/cli": "7.24.1",
|
|
52
52
|
"@babel/core": "7.24.3",
|
|
53
53
|
"@babel/preset-env": "7.24.3",
|
|
54
|
-
"@
|
|
55
|
-
"@webiny/
|
|
56
|
-
"@webiny/
|
|
57
|
-
"@webiny/
|
|
54
|
+
"@types/babel__code-frame": "7.0.6",
|
|
55
|
+
"@webiny/api-wcp": "5.41.0-dbt.0",
|
|
56
|
+
"@webiny/aws-sdk": "5.41.0-dbt.0",
|
|
57
|
+
"@webiny/cli": "5.41.0-dbt.0",
|
|
58
|
+
"@webiny/project-utils": "5.41.0-dbt.0",
|
|
58
59
|
"apollo-graphql": "0.9.7",
|
|
59
60
|
"get-yarn-workspaces": "1.0.2",
|
|
60
61
|
"graphql": "15.8.0",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"rimraf": "5.0.5",
|
|
64
65
|
"sinon": "9.2.4",
|
|
65
66
|
"ttypescript": "1.5.15",
|
|
66
|
-
"typescript": "4.
|
|
67
|
+
"typescript": "4.9.5",
|
|
67
68
|
"write-json-file": "4.3.0"
|
|
68
69
|
},
|
|
69
70
|
"publishConfig": {
|
|
@@ -74,5 +75,5 @@
|
|
|
74
75
|
"build": "yarn webiny run build",
|
|
75
76
|
"watch": "yarn webiny run watch"
|
|
76
77
|
},
|
|
77
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "bbaec4dd1685579548c08bbde386aee5d96b80f8"
|
|
78
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLSchemaPlugin, GraphQLSchemaPluginConfig as BaseGraphQLSchemaPluginConfig, IGraphQLSchemaPlugin } from "@webiny/handler-graphql";
|
|
2
2
|
import { CmsContext } from "../../types";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ICmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext> = IGraphQLSchemaPlugin<T>;
|
|
4
|
+
export type CmsGraphQLSchemaPluginConfig<T extends CmsContext = CmsContext> = BaseGraphQLSchemaPluginConfig<T>;
|
|
5
5
|
export declare class CmsGraphQLSchemaPlugin<T extends CmsContext = CmsContext> extends GraphQLSchemaPlugin<T> implements ICmsGraphQLSchemaPlugin<T> {
|
|
6
6
|
static readonly type = "cms.graphql.schema";
|
|
7
7
|
}
|
|
@@ -41,7 +41,7 @@ interface CmsPrivateModel extends Omit<CmsModelPluginModel, "isPrivate" | "singu
|
|
|
41
41
|
export interface CmsPrivateModelFull extends Omit<CmsPrivateModel, "fields" | "createdBy" | "createdOn" | "savedOn"> {
|
|
42
42
|
fields: CmsModelFieldBase[];
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export type CmsModelInput = CmsApiModel | CmsPrivateModel | CmsApiModelFull | CmsPrivateModelFull;
|
|
45
45
|
export interface CmsModelPluginModel extends Omit<CmsModelBase, "locale" | "tenant" | "webinyVersion"> {
|
|
46
46
|
locale?: string;
|
|
47
47
|
tenant?: string;
|
|
@@ -3,8 +3,8 @@ import { ApiEndpoint, CmsContext } from "../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Type can be null because it might be that Headless CMS context is loaded on a different Lambda where there is no GraphQL Schema generated.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type CmsParametersPluginResponseType = ApiEndpoint | null;
|
|
7
|
+
export type CmsParametersPluginResponseLocale = string;
|
|
8
8
|
export interface CmsParametersPluginResponse {
|
|
9
9
|
type: CmsParametersPluginResponseType;
|
|
10
10
|
locale: CmsParametersPluginResponseLocale;
|
package/types/context.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface CmsEntryContext {
|
|
|
16
16
|
/**
|
|
17
17
|
* Get a single content entry for a model.
|
|
18
18
|
*/
|
|
19
|
-
getEntry: (model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry
|
|
19
|
+
getEntry: <T = CmsEntryValues>(model: CmsModel, params: CmsEntryGetParams) => Promise<CmsEntry<T>>;
|
|
20
20
|
/**
|
|
21
21
|
* Get a list of entries for a model by a given ID (revision).
|
|
22
22
|
*/
|
|
@@ -28,19 +28,19 @@ export interface CmsEntryContext {
|
|
|
28
28
|
/**
|
|
29
29
|
* List entries for a model. Internal method used by get, listLatest and listPublished.
|
|
30
30
|
*/
|
|
31
|
-
listEntries: <T = CmsEntryValues>(model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
31
|
+
listEntries: <T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
32
32
|
/**
|
|
33
33
|
* Lists the latest entries. Used for manage API.
|
|
34
34
|
*/
|
|
35
|
-
listLatestEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
35
|
+
listLatestEntries: <T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
36
36
|
/**
|
|
37
37
|
* List published entries. Used for read API.
|
|
38
38
|
*/
|
|
39
|
-
listPublishedEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
39
|
+
listPublishedEntries: <T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
40
40
|
/**
|
|
41
41
|
* Lists the deleted entries. Used for manage API.
|
|
42
42
|
*/
|
|
43
|
-
listDeletedEntries: <T = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
43
|
+
listDeletedEntries: <T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params?: CmsEntryListParams) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;
|
|
44
44
|
/**
|
|
45
45
|
* List published entries by IDs.
|
|
46
46
|
*/
|
|
@@ -52,7 +52,7 @@ export interface CmsEntryContext {
|
|
|
52
52
|
/**
|
|
53
53
|
* Create a new content entry.
|
|
54
54
|
*/
|
|
55
|
-
createEntry: (model: CmsModel, input: CreateCmsEntryInput
|
|
55
|
+
createEntry: <T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, input: CreateCmsEntryInput<T>, options?: CreateCmsEntryOptionsInput) => Promise<CmsEntry<T>>;
|
|
56
56
|
/**
|
|
57
57
|
* Create a new entry from already existing entry.
|
|
58
58
|
*/
|
|
@@ -60,7 +60,7 @@ export interface CmsEntryContext {
|
|
|
60
60
|
/**
|
|
61
61
|
* Update existing entry.
|
|
62
62
|
*/
|
|
63
|
-
updateEntry: (model: CmsModel, id: string, input: UpdateCmsEntryInput
|
|
63
|
+
updateEntry: <TInput = CmsEntryValues>(model: CmsModel, id: string, input: UpdateCmsEntryInput<TInput>, meta?: Record<string, any>, options?: UpdateCmsEntryOptionsInput) => Promise<CmsEntry>;
|
|
64
64
|
/**
|
|
65
65
|
* Validate the entry - either new one or existing one.
|
|
66
66
|
*/
|
package/types/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["context.ts"],"sourcesContent":["import { ContentEntryTraverser } from \"~/utils/contentEntryTraverser/ContentEntryTraverser\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport {\n CmsDeleteEntryOptions,\n CmsEntry,\n CmsEntryGetParams,\n CmsEntryListParams,\n CmsEntryMeta,\n CmsEntryUniqueValue,\n CmsEntryValidateResponse,\n CmsEntryValues,\n CreateCmsEntryInput,\n CreateCmsEntryOptionsInput,\n CreateFromCmsEntryInput,\n CreateRevisionCmsEntryOptionsInput,\n DeleteMultipleEntriesParams,\n DeleteMultipleEntriesResponse,\n EntryBeforeListTopicParams,\n GetUniqueFieldValuesParams,\n OnEntryAfterCreateTopicParams,\n OnEntryAfterDeleteTopicParams,\n OnEntryAfterMoveTopicParams,\n OnEntryAfterPublishTopicParams,\n OnEntryAfterRepublishTopicParams,\n OnEntryAfterRestoreFromBinTopicParams,\n OnEntryAfterUnpublishTopicParams,\n OnEntryAfterUpdateTopicParams,\n OnEntryBeforeCreateTopicParams,\n OnEntryBeforeDeleteTopicParams,\n OnEntryBeforeGetTopicParams,\n OnEntryBeforeMoveTopicParams,\n OnEntryBeforePublishTopicParams,\n OnEntryBeforeRepublishTopicParams,\n OnEntryBeforeRestoreFromBinTopicParams,\n OnEntryBeforeUnpublishTopicParams,\n OnEntryBeforeUpdateTopicParams,\n OnEntryCreateErrorTopicParams,\n OnEntryCreateRevisionErrorTopicParams,\n OnEntryDeleteErrorTopicParams,\n OnEntryMoveErrorTopicParams,\n OnEntryPublishErrorTopicParams,\n OnEntryRepublishErrorTopicParams,\n OnEntryRestoreFromBinErrorTopicParams,\n OnEntryRevisionAfterCreateTopicParams,\n OnEntryRevisionAfterDeleteTopicParams,\n OnEntryRevisionBeforeCreateTopicParams,\n OnEntryRevisionBeforeDeleteTopicParams,\n OnEntryRevisionDeleteErrorTopicParams,\n OnEntryUnpublishErrorTopicParams,\n OnEntryUpdateErrorTopicParams,\n UpdateCmsEntryInput,\n UpdateCmsEntryOptionsInput\n} from \"./types\";\nimport { CmsModel } from \"./model\";\n\n/**\n * Cms Entry CRUD methods in the context.\n *\n * @category Context\n * @category CmsEntry\n */\nexport interface CmsEntryContext {\n /**\n * Get content entry traverser.\n */\n getEntryTraverser: (modelId: string) => Promise<ContentEntryTraverser>;\n /**\n * Get a single content entry for a model.\n */\n getEntry: (model: CmsModel
|
|
1
|
+
{"version":3,"names":[],"sources":["context.ts"],"sourcesContent":["import { ContentEntryTraverser } from \"~/utils/contentEntryTraverser/ContentEntryTraverser\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport {\n CmsDeleteEntryOptions,\n CmsEntry,\n CmsEntryGetParams,\n CmsEntryListParams,\n CmsEntryMeta,\n CmsEntryUniqueValue,\n CmsEntryValidateResponse,\n CmsEntryValues,\n CreateCmsEntryInput,\n CreateCmsEntryOptionsInput,\n CreateFromCmsEntryInput,\n CreateRevisionCmsEntryOptionsInput,\n DeleteMultipleEntriesParams,\n DeleteMultipleEntriesResponse,\n EntryBeforeListTopicParams,\n GetUniqueFieldValuesParams,\n OnEntryAfterCreateTopicParams,\n OnEntryAfterDeleteTopicParams,\n OnEntryAfterMoveTopicParams,\n OnEntryAfterPublishTopicParams,\n OnEntryAfterRepublishTopicParams,\n OnEntryAfterRestoreFromBinTopicParams,\n OnEntryAfterUnpublishTopicParams,\n OnEntryAfterUpdateTopicParams,\n OnEntryBeforeCreateTopicParams,\n OnEntryBeforeDeleteTopicParams,\n OnEntryBeforeGetTopicParams,\n OnEntryBeforeMoveTopicParams,\n OnEntryBeforePublishTopicParams,\n OnEntryBeforeRepublishTopicParams,\n OnEntryBeforeRestoreFromBinTopicParams,\n OnEntryBeforeUnpublishTopicParams,\n OnEntryBeforeUpdateTopicParams,\n OnEntryCreateErrorTopicParams,\n OnEntryCreateRevisionErrorTopicParams,\n OnEntryDeleteErrorTopicParams,\n OnEntryMoveErrorTopicParams,\n OnEntryPublishErrorTopicParams,\n OnEntryRepublishErrorTopicParams,\n OnEntryRestoreFromBinErrorTopicParams,\n OnEntryRevisionAfterCreateTopicParams,\n OnEntryRevisionAfterDeleteTopicParams,\n OnEntryRevisionBeforeCreateTopicParams,\n OnEntryRevisionBeforeDeleteTopicParams,\n OnEntryRevisionDeleteErrorTopicParams,\n OnEntryUnpublishErrorTopicParams,\n OnEntryUpdateErrorTopicParams,\n UpdateCmsEntryInput,\n UpdateCmsEntryOptionsInput\n} from \"./types\";\nimport { CmsModel } from \"./model\";\n\n/**\n * Cms Entry CRUD methods in the context.\n *\n * @category Context\n * @category CmsEntry\n */\nexport interface CmsEntryContext {\n /**\n * Get content entry traverser.\n */\n getEntryTraverser: (modelId: string) => Promise<ContentEntryTraverser>;\n /**\n * Get a single content entry for a model.\n */\n getEntry: <T = CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryGetParams\n ) => Promise<CmsEntry<T>>;\n /**\n * Get a list of entries for a model by a given ID (revision).\n */\n getEntriesByIds: (model: CmsModel, revisions: string[]) => Promise<CmsEntry[]>;\n /**\n * Get the entry for a model by a given ID.\n */\n getEntryById: (model: CmsModel, revision: string) => Promise<CmsEntry>;\n /**\n * List entries for a model. Internal method used by get, listLatest and listPublished.\n */\n listEntries: <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Lists the latest entries. Used for manage API.\n */\n listLatestEntries: <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List published entries. Used for read API.\n */\n listPublishedEntries: <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * Lists the deleted entries. Used for manage API.\n */\n listDeletedEntries: <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params?: CmsEntryListParams\n ) => Promise<[CmsEntry<T>[], CmsEntryMeta]>;\n /**\n * List published entries by IDs.\n */\n getPublishedEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * List latest entries by IDs.\n */\n getLatestEntriesByIds: (model: CmsModel, ids: string[]) => Promise<CmsEntry[]>;\n /**\n * Create a new content entry.\n */\n createEntry: <T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n input: CreateCmsEntryInput<T>,\n options?: CreateCmsEntryOptionsInput\n ) => Promise<CmsEntry<T>>;\n /**\n * Create a new entry from already existing entry.\n */\n createEntryRevisionFrom: (\n model: CmsModel,\n id: string,\n input: CreateFromCmsEntryInput,\n options?: CreateRevisionCmsEntryOptionsInput\n ) => Promise<CmsEntry>;\n /**\n * Update existing entry.\n */\n updateEntry: <TInput = CmsEntryValues>(\n model: CmsModel,\n id: string,\n input: UpdateCmsEntryInput<TInput>,\n meta?: Record<string, any>,\n options?: UpdateCmsEntryOptionsInput\n ) => Promise<CmsEntry>;\n /**\n * Validate the entry - either new one or existing one.\n */\n validateEntry: (\n model: CmsModel,\n id?: string,\n input?: UpdateCmsEntryInput\n ) => Promise<CmsEntryValidateResponse>;\n /**\n * Move entry, and all its revisions, to a new folder.\n */\n moveEntry: (model: CmsModel, id: string, folderId: string) => Promise<CmsEntry>;\n /**\n * Method that republishes entry with given identifier.\n * @internal\n */\n republishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Delete only a certain revision of the entry.\n */\n deleteEntryRevision: (model: CmsModel, id: string) => Promise<void>;\n /**\n * Delete entry with all its revisions.\n */\n deleteEntry: (model: CmsModel, id: string, options?: CmsDeleteEntryOptions) => Promise<void>;\n /**\n * Restore entry from trash bin with all its revisions.\n */\n restoreEntryFromBin: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Delete multiple entries\n */\n deleteMultipleEntries: (\n model: CmsModel,\n params: DeleteMultipleEntriesParams\n ) => Promise<DeleteMultipleEntriesResponse>;\n /**\n * Publish entry.\n */\n publishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Unpublish entry.\n */\n unpublishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;\n /**\n * Get all entry revisions.\n */\n getEntryRevisions: (model: CmsModel, id: string) => Promise<CmsEntry[]>;\n /**\n * List all unique values for a given field.\n *\n * @internal\n */\n getUniqueFieldValues: (\n model: CmsModel,\n params: GetUniqueFieldValuesParams\n ) => Promise<CmsEntryUniqueValue[]>;\n /**\n * Lifecycle Events\n */\n onEntryBeforeCreate: Topic<OnEntryBeforeCreateTopicParams>;\n onEntryAfterCreate: Topic<OnEntryAfterCreateTopicParams>;\n onEntryCreateError: Topic<OnEntryCreateErrorTopicParams>;\n\n onEntryRevisionBeforeCreate: Topic<OnEntryRevisionBeforeCreateTopicParams>;\n onEntryRevisionAfterCreate: Topic<OnEntryRevisionAfterCreateTopicParams>;\n onEntryRevisionCreateError: Topic<OnEntryCreateRevisionErrorTopicParams>;\n\n onEntryBeforeUpdate: Topic<OnEntryBeforeUpdateTopicParams>;\n onEntryAfterUpdate: Topic<OnEntryAfterUpdateTopicParams>;\n onEntryUpdateError: Topic<OnEntryUpdateErrorTopicParams>;\n\n onEntryBeforeMove: Topic<OnEntryBeforeMoveTopicParams>;\n onEntryAfterMove: Topic<OnEntryAfterMoveTopicParams>;\n onEntryMoveError: Topic<OnEntryMoveErrorTopicParams>;\n\n onEntryBeforeDelete: Topic<OnEntryBeforeDeleteTopicParams>;\n onEntryAfterDelete: Topic<OnEntryAfterDeleteTopicParams>;\n onEntryDeleteError: Topic<OnEntryDeleteErrorTopicParams>;\n\n onEntryBeforeRestoreFromBin: Topic<OnEntryBeforeRestoreFromBinTopicParams>;\n onEntryAfterRestoreFromBin: Topic<OnEntryAfterRestoreFromBinTopicParams>;\n onEntryRestoreFromBinError: Topic<OnEntryRestoreFromBinErrorTopicParams>;\n\n onEntryRevisionBeforeDelete: Topic<OnEntryRevisionBeforeDeleteTopicParams>;\n onEntryRevisionAfterDelete: Topic<OnEntryRevisionAfterDeleteTopicParams>;\n onEntryRevisionDeleteError: Topic<OnEntryRevisionDeleteErrorTopicParams>;\n\n onEntryBeforePublish: Topic<OnEntryBeforePublishTopicParams>;\n onEntryAfterPublish: Topic<OnEntryAfterPublishTopicParams>;\n onEntryPublishError: Topic<OnEntryPublishErrorTopicParams>;\n\n onEntryBeforeRepublish: Topic<OnEntryBeforeRepublishTopicParams>;\n onEntryAfterRepublish: Topic<OnEntryAfterRepublishTopicParams>;\n onEntryRepublishError: Topic<OnEntryRepublishErrorTopicParams>;\n\n onEntryBeforeUnpublish: Topic<OnEntryBeforeUnpublishTopicParams>;\n onEntryAfterUnpublish: Topic<OnEntryAfterUnpublishTopicParams>;\n onEntryUnpublishError: Topic<OnEntryUnpublishErrorTopicParams>;\n\n onEntryBeforeGet: Topic<OnEntryBeforeGetTopicParams>;\n onEntryBeforeList: Topic<EntryBeforeListTopicParams>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/types/modelAst.d.ts
CHANGED
|
@@ -5,23 +5,23 @@ import { CmsModelField } from "./modelField";
|
|
|
5
5
|
export interface ICmsModelFieldToAst {
|
|
6
6
|
toAst(field: CmsModelField): CmsModelFieldAstNode;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type CmsModelAst = {
|
|
9
9
|
type: "root";
|
|
10
10
|
children: CmsModelFieldAstNode[];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type CmsModelFieldAstNodeCollection = {
|
|
13
13
|
type: "collection";
|
|
14
14
|
collection: {
|
|
15
15
|
discriminator: string;
|
|
16
16
|
} & Record<string, any>;
|
|
17
17
|
children: CmsModelFieldAstNode[];
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type CmsModelFieldAstNodeField = {
|
|
20
20
|
type: "field";
|
|
21
21
|
field: CmsModelField;
|
|
22
22
|
children: CmsModelFieldAstNode[];
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type CmsModelFieldAstNode = CmsModelFieldAstNodeCollection | CmsModelFieldAstNodeField;
|
|
25
25
|
export interface GetCmsModelFieldAst<TField> {
|
|
26
26
|
(field: TField, converter: ICmsModelFieldToAst): CmsModelFieldAstNode;
|
|
27
27
|
}
|
package/types/modelField.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CmsModel } from "./model";
|
|
2
2
|
import { GenericRecord } from "@webiny/api/types";
|
|
3
|
-
export
|
|
3
|
+
export type CmsModelFieldType = "boolean" | "datetime" | "file" | "long-text" | "number" | "json" | "object" | "ref" | "rich-text" | "text" | "dynamicZone" | string;
|
|
4
4
|
/**
|
|
5
5
|
* A definition for content model field. This type exists on the app side as well.
|
|
6
6
|
*
|
package/types/types.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface CmsError {
|
|
|
28
28
|
data: GenericRecord;
|
|
29
29
|
stack?: string;
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type ApiEndpoint = "manage" | "preview" | "read";
|
|
32
32
|
export interface HeadlessCms extends CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
|
|
33
33
|
/**
|
|
34
34
|
* API type
|
|
@@ -69,7 +69,7 @@ export interface HeadlessCms extends CmsSystemContext, CmsGroupContext, CmsModel
|
|
|
69
69
|
importing: HeadlessCmsImport;
|
|
70
70
|
getExecutableSchema: GetExecutableSchema;
|
|
71
71
|
}
|
|
72
|
-
export
|
|
72
|
+
export type GetExecutableSchema = (type: ApiEndpoint) => Promise<(<TData = Record<string, any>, TExtensions = Record<string, any>>(input: GraphQLRequestBody | GraphQLRequestBody[]) => ReturnType<typeof processRequestBody<TData, TExtensions>>)>;
|
|
73
73
|
/**
|
|
74
74
|
* @description This combines all contexts used in the CMS into a single one.
|
|
75
75
|
*
|
|
@@ -200,7 +200,7 @@ export interface OnSystemInstallErrorTopicParams {
|
|
|
200
200
|
tenant: string;
|
|
201
201
|
locale: string;
|
|
202
202
|
}
|
|
203
|
-
export
|
|
203
|
+
export type CmsSystemContext = {
|
|
204
204
|
getSystemVersion: () => Promise<string | null>;
|
|
205
205
|
setSystemVersion: (version: string) => Promise<void>;
|
|
206
206
|
installSystem: () => Promise<void>;
|
|
@@ -789,7 +789,7 @@ export interface CmsModelContext {
|
|
|
789
789
|
*
|
|
790
790
|
* @see CmsModelManager
|
|
791
791
|
*/
|
|
792
|
-
getEntryManager<T =
|
|
792
|
+
getEntryManager<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel | string): Promise<CmsModelManager<T>>;
|
|
793
793
|
/**
|
|
794
794
|
* Get all content model managers mapped by modelId.
|
|
795
795
|
* @see CmsModelManager
|
|
@@ -821,7 +821,7 @@ export interface CmsModelContext {
|
|
|
821
821
|
*
|
|
822
822
|
* @category CmsEntry
|
|
823
823
|
*/
|
|
824
|
-
export
|
|
824
|
+
export type CmsEntryStatus = "published" | "unpublished" | "draft";
|
|
825
825
|
export interface CmsEntryListWhereRef {
|
|
826
826
|
id?: string;
|
|
827
827
|
id_in?: string[];
|
|
@@ -951,7 +951,7 @@ export interface CmsEntryListWhere {
|
|
|
951
951
|
* @category CmsEntry
|
|
952
952
|
* @category GraphQL params
|
|
953
953
|
*/
|
|
954
|
-
export
|
|
954
|
+
export type CmsEntryListSort = string[];
|
|
955
955
|
/**
|
|
956
956
|
* Get entry GraphQL resolver params.
|
|
957
957
|
*
|
|
@@ -1223,7 +1223,7 @@ export interface EntryBeforeListTopicParams {
|
|
|
1223
1223
|
* @category Context
|
|
1224
1224
|
* @category CmsEntry
|
|
1225
1225
|
*/
|
|
1226
|
-
export
|
|
1226
|
+
export type CreateCmsEntryInput<TValues = CmsEntryValues> = TValues & {
|
|
1227
1227
|
id?: string;
|
|
1228
1228
|
status?: CmsEntryStatus;
|
|
1229
1229
|
/**
|
|
@@ -1262,8 +1262,7 @@ export interface CreateCmsEntryInput {
|
|
|
1262
1262
|
wbyAco_location?: {
|
|
1263
1263
|
folderId?: string | null;
|
|
1264
1264
|
};
|
|
1265
|
-
|
|
1266
|
-
}
|
|
1265
|
+
};
|
|
1267
1266
|
export interface CreateCmsEntryOptionsInput {
|
|
1268
1267
|
skipValidators?: string[];
|
|
1269
1268
|
}
|
|
@@ -1307,7 +1306,7 @@ export interface CreateRevisionCmsEntryOptionsInput {
|
|
|
1307
1306
|
* @category Context
|
|
1308
1307
|
* @category CmsEntry
|
|
1309
1308
|
*/
|
|
1310
|
-
export
|
|
1309
|
+
export type UpdateCmsEntryInput<TValues = CmsEntryValues> = TValues & {
|
|
1311
1310
|
/**
|
|
1312
1311
|
* Revision-level meta fields. 👇
|
|
1313
1312
|
*/
|
|
@@ -1345,8 +1344,7 @@ export interface UpdateCmsEntryInput {
|
|
|
1345
1344
|
wbyAco_location?: {
|
|
1346
1345
|
folderId?: string | null;
|
|
1347
1346
|
};
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1347
|
+
};
|
|
1350
1348
|
export interface UpdateCmsEntryOptionsInput {
|
|
1351
1349
|
skipValidators?: string[];
|
|
1352
1350
|
}
|
|
@@ -1379,7 +1377,7 @@ export interface CmsDeleteEntryOptions {
|
|
|
1379
1377
|
export interface DeleteMultipleEntriesParams {
|
|
1380
1378
|
entries: string[];
|
|
1381
1379
|
}
|
|
1382
|
-
export
|
|
1380
|
+
export type DeleteMultipleEntriesResponse = {
|
|
1383
1381
|
id: string;
|
|
1384
1382
|
}[];
|
|
1385
1383
|
export interface CmsEntryValidateResponse {
|
|
@@ -1401,7 +1399,7 @@ interface CmsEntryResolverFactoryParams {
|
|
|
1401
1399
|
* @category GraphQL resolver
|
|
1402
1400
|
* @category CmsEntry
|
|
1403
1401
|
*/
|
|
1404
|
-
export
|
|
1402
|
+
export type CmsEntryResolverFactory<TSource = any, TArgs = any, TContext = CmsContext> = {
|
|
1405
1403
|
(params: CmsEntryResolverFactoryParams): GraphQLFieldResolver<TSource, TArgs, TContext>;
|
|
1406
1404
|
};
|
|
1407
1405
|
/**
|