@webiny/api-headless-cms 5.38.0 → 5.38.1
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/crud/contentEntry.crud.js +76 -47
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/validation.d.ts +84 -84
- package/crud/contentModelGroup/validation.d.ts +1 -1
- package/graphql/index.d.ts +1 -1
- package/graphql/schema/baseSchema.js +13 -0
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/createManageSDL.js +9 -1
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +18 -18
- package/types.d.ts +36 -2
- package/types.js +3 -0
- package/types.js.map +1 -1
- package/utils/date.d.ts +10 -0
- package/utils/date.js +36 -0
- package/utils/date.js.map +1 -0
- package/utils/renderListFilterFields.js +1 -1
- package/utils/renderListFilterFields.js.map +1 -1
|
@@ -105,6 +105,19 @@ const createSchema = plugins => {
|
|
|
105
105
|
skipValidators: [SkipValidatorEnum!]
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
input CmsPublishEntryOptionsInput {
|
|
109
|
+
# By default, updatePublishedOn is true. User can set it to false to skip the publishedOn field update.
|
|
110
|
+
updatePublishedOn: Boolean
|
|
111
|
+
# By default, updateSavedOn is true. User can set it to false to skip the publishedOn field update.
|
|
112
|
+
updateSavedOn: Boolean
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
input CmsIdentityInput {
|
|
116
|
+
id: String!
|
|
117
|
+
displayName: String!
|
|
118
|
+
type: String!
|
|
119
|
+
}
|
|
120
|
+
|
|
108
121
|
type CmsEntryValidationResponseData {
|
|
109
122
|
error: String!
|
|
110
123
|
id: String!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_api","_camelCase","_interopRequireDefault","createSkipValidatorEnum","plugins","validators","byType","reduce","collection","validator","name","camelCase","includes","push","length","join","createSchema","skipValidatorEnum","cmsPlugin","CmsGraphQLSchemaPlugin","typeDefs","resolvers","corePlugin","GraphQLSchemaPlugin","schema","createBaseSchema","ContextPlugin","context","register","exports"],"sources":["baseSchema.ts"],"sourcesContent":["import { CmsContext, CmsModelFieldValidatorPlugin } from \"~/types\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport camelCase from \"lodash/camelCase\";\n\nconst createSkipValidatorEnum = (plugins: PluginsContainer) => {\n const validators = plugins\n .byType<CmsModelFieldValidatorPlugin>(\"cms-model-field-validator\")\n .reduce<string[]>((collection, validator) => {\n const name = camelCase(validator.validator.name);\n if (collection.includes(name)) {\n return collection;\n }\n collection.push(name);\n return collection;\n }, []);\n\n if (validators.length === 0) {\n validators.push(\"_empty\");\n }\n return /* GraphQL */ `\n enum SkipValidatorEnum {\n ${validators.join(\"\\n\")}\n }\n `;\n};\n\nconst createSchema = (plugins: PluginsContainer): GraphQLSchemaPlugin<CmsContext>[] => {\n const skipValidatorEnum = createSkipValidatorEnum(plugins);\n\n const cmsPlugin = new CmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n ${skipValidatorEnum}\n\n input CreateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n const corePlugin = new GraphQLSchemaPlugin<CmsContext>({\n typeDefs: cmsPlugin.schema.typeDefs,\n resolvers: cmsPlugin.schema.resolvers\n });\n corePlugin.name = \"headless-cms.graphql.core.schema.base\";\n /**\n * Due to splitting of CMS and Core schema plugins, we must have both defined for CMS to work.\n */\n return [cmsPlugin, corePlugin];\n};\n\nexport const createBaseSchema = () => {\n return new ContextPlugin(async context => {\n context.plugins.register(...createSchema(context.plugins));\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,MAAMK,uBAAuB,GAAIC,OAAyB,IAAK;EAC3D,MAAMC,UAAU,GAAGD,OAAO,CACrBE,MAAM,CAA+B,2BAA2B,CAAC,CACjEC,MAAM,CAAW,CAACC,UAAU,EAAEC,SAAS,KAAK;IACzC,MAAMC,IAAI,GAAG,IAAAC,kBAAS,EAACF,SAAS,CAACA,SAAS,CAACC,IAAI,CAAC;IAChD,IAAIF,UAAU,CAACI,QAAQ,CAACF,IAAI,CAAC,EAAE;MAC3B,OAAOF,UAAU;IACrB;IACAA,UAAU,CAACK,IAAI,CAACH,IAAI,CAAC;IACrB,OAAOF,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;EAEV,IAAIH,UAAU,CAACS,MAAM,KAAK,CAAC,EAAE;IACzBT,UAAU,CAACQ,IAAI,CAAC,QAAQ,CAAC;EAC7B;EACA,OAAO,cAAe;AAC1B;AACA,cAAcR,UAAU,CAACU,IAAI,CAAC,IAAI,CAAE;AACpC;AACA;EAAK;AACL,CAAC;AAED,MAAMC,YAAY,GAAIZ,OAAyB,IAAwC;EACnF,MAAMa,iBAAiB,GAAGd,uBAAuB,CAACC,OAAO,CAAC;EAE1D,MAAMc,SAAS,GAAG,IAAIC,+BAAsB,CAAC;IACzCC,QAAQ,EAAE,aAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,iBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDI,SAAS,EAAE,CAAC;EAChB,CAAC,CAAC;EACFH,SAAS,CAACR,IAAI,GAAG,kCAAkC;EACnD,MAAMY,UAAU,GAAG,IAAIC,mCAAmB,CAAa;IACnDH,QAAQ,EAAEF,SAAS,CAACM,MAAM,CAACJ,QAAQ;IACnCC,SAAS,EAAEH,SAAS,CAACM,MAAM,CAACH;EAChC,CAAC,CAAC;EACFC,UAAU,CAACZ,IAAI,GAAG,uCAAuC;EACzD;AACJ;AACA;EACI,OAAO,CAACQ,SAAS,EAAEI,UAAU,CAAC;AAClC,CAAC;AAEM,MAAMG,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,IAAIC,kBAAa,CAAC,MAAMC,OAAO,IAAI;IACtCA,OAAO,CAACvB,OAAO,CAACwB,QAAQ,CAAC,GAAGZ,YAAY,CAACW,OAAO,CAACvB,OAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;AACN,CAAC;AAACyB,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
|
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_api","_camelCase","_interopRequireDefault","createSkipValidatorEnum","plugins","validators","byType","reduce","collection","validator","name","camelCase","includes","push","length","join","createSchema","skipValidatorEnum","cmsPlugin","CmsGraphQLSchemaPlugin","typeDefs","resolvers","corePlugin","GraphQLSchemaPlugin","schema","createBaseSchema","ContextPlugin","context","register","exports"],"sources":["baseSchema.ts"],"sourcesContent":["import { CmsContext, CmsModelFieldValidatorPlugin } from \"~/types\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport camelCase from \"lodash/camelCase\";\n\nconst createSkipValidatorEnum = (plugins: PluginsContainer) => {\n const validators = plugins\n .byType<CmsModelFieldValidatorPlugin>(\"cms-model-field-validator\")\n .reduce<string[]>((collection, validator) => {\n const name = camelCase(validator.validator.name);\n if (collection.includes(name)) {\n return collection;\n }\n collection.push(name);\n return collection;\n }, []);\n\n if (validators.length === 0) {\n validators.push(\"_empty\");\n }\n return /* GraphQL */ `\n enum SkipValidatorEnum {\n ${validators.join(\"\\n\")}\n }\n `;\n};\n\nconst createSchema = (plugins: PluginsContainer): GraphQLSchemaPlugin<CmsContext>[] => {\n const skipValidatorEnum = createSkipValidatorEnum(plugins);\n\n const cmsPlugin = new CmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n ${skipValidatorEnum}\n\n input CreateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CmsPublishEntryOptionsInput {\n # By default, updatePublishedOn is true. User can set it to false to skip the publishedOn field update.\n updatePublishedOn: Boolean\n # By default, updateSavedOn is true. User can set it to false to skip the publishedOn field update.\n updateSavedOn: Boolean\n }\n\n input CmsIdentityInput {\n id: String!\n displayName: String!\n type: String!\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n const corePlugin = new GraphQLSchemaPlugin<CmsContext>({\n typeDefs: cmsPlugin.schema.typeDefs,\n resolvers: cmsPlugin.schema.resolvers\n });\n corePlugin.name = \"headless-cms.graphql.core.schema.base\";\n /**\n * Due to splitting of CMS and Core schema plugins, we must have both defined for CMS to work.\n */\n return [cmsPlugin, corePlugin];\n};\n\nexport const createBaseSchema = () => {\n return new ContextPlugin(async context => {\n context.plugins.register(...createSchema(context.plugins));\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,MAAMK,uBAAuB,GAAIC,OAAyB,IAAK;EAC3D,MAAMC,UAAU,GAAGD,OAAO,CACrBE,MAAM,CAA+B,2BAA2B,CAAC,CACjEC,MAAM,CAAW,CAACC,UAAU,EAAEC,SAAS,KAAK;IACzC,MAAMC,IAAI,GAAG,IAAAC,kBAAS,EAACF,SAAS,CAACA,SAAS,CAACC,IAAI,CAAC;IAChD,IAAIF,UAAU,CAACI,QAAQ,CAACF,IAAI,CAAC,EAAE;MAC3B,OAAOF,UAAU;IACrB;IACAA,UAAU,CAACK,IAAI,CAACH,IAAI,CAAC;IACrB,OAAOF,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;EAEV,IAAIH,UAAU,CAACS,MAAM,KAAK,CAAC,EAAE;IACzBT,UAAU,CAACQ,IAAI,CAAC,QAAQ,CAAC;EAC7B;EACA,OAAO,cAAe;AAC1B;AACA,cAAcR,UAAU,CAACU,IAAI,CAAC,IAAI,CAAE;AACpC;AACA;EAAK;AACL,CAAC;AAED,MAAMC,YAAY,GAAIZ,OAAyB,IAAwC;EACnF,MAAMa,iBAAiB,GAAGd,uBAAuB,CAACC,OAAO,CAAC;EAE1D,MAAMc,SAAS,GAAG,IAAIC,+BAAsB,CAAC;IACzCC,QAAQ,EAAE,aAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,iBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDI,SAAS,EAAE,CAAC;EAChB,CAAC,CAAC;EACFH,SAAS,CAACR,IAAI,GAAG,kCAAkC;EACnD,MAAMY,UAAU,GAAG,IAAIC,mCAAmB,CAAa;IACnDH,QAAQ,EAAEF,SAAS,CAACM,MAAM,CAACJ,QAAQ;IACnCC,SAAS,EAAEH,SAAS,CAACM,MAAM,CAACH;EAChC,CAAC,CAAC;EACFC,UAAU,CAACZ,IAAI,GAAG,uCAAuC;EACzD;AACJ;AACA;EACI,OAAO,CAACQ,SAAS,EAAEI,UAAU,CAAC;AAClC,CAAC;AAEM,MAAMG,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,IAAIC,kBAAa,CAAC,MAAMC,OAAO,IAAI;IACtCA,OAAO,CAACvB,OAAO,CAACwB,QAAQ,CAAC,GAAGZ,YAAY,CAACW,OAAO,CAACvB,OAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;AACN,CAAC;AAACyB,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
|
|
@@ -97,6 +97,14 @@ const createManageSDL = ({
|
|
|
97
97
|
|
|
98
98
|
input ${singularName}Input {
|
|
99
99
|
id: ID
|
|
100
|
+
# User can override the entry dates
|
|
101
|
+
createdOn: DateTime
|
|
102
|
+
savedOn: DateTime
|
|
103
|
+
publishedOn: DateTime
|
|
104
|
+
# User can override the entry related user identities
|
|
105
|
+
createdBy: CmsIdentityInput
|
|
106
|
+
modifiedBy: CmsIdentityInput
|
|
107
|
+
ownedBy: CmsIdentityInput
|
|
100
108
|
wbyAco_location: WbyAcoLocationInput
|
|
101
109
|
${inputGraphQLFields}
|
|
102
110
|
}
|
|
@@ -170,7 +178,7 @@ const createManageSDL = ({
|
|
|
170
178
|
|
|
171
179
|
deleteMultiple${pluralName}(entries: [ID!]!): CmsDeleteMultipleResponse!
|
|
172
180
|
|
|
173
|
-
publish${singularName}(revision: ID
|
|
181
|
+
publish${singularName}(revision: ID!, options: CmsPublishEntryOptionsInput): ${singularName}Response
|
|
174
182
|
|
|
175
183
|
republish${singularName}(revision: ID!): ${singularName}Response
|
|
176
184
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_renderListFilterFields","require","_renderSortEnum","_renderGetFilterFields","_renderInputFields","_renderFields","createManageSDL","models","model","fieldTypePlugins","sorterPlugins","inputFields","renderInputFields","fields","length","listFilterFieldsRender","renderListFilterFields","type","sortEnumRender","renderSortEnum","getFilterFieldsRender","renderGetFilterFields","renderFields","singularApiName","singularName","pluralApiName","pluralName","inputGraphQLFields","map","f","join","description","typeDefs","exports"],"sources":["createManageSDL.ts"],"sourcesContent":["import { CmsFieldTypePlugins, CmsModel } from \"~/types\";\nimport { renderListFilterFields } from \"~/utils/renderListFilterFields\";\nimport { renderSortEnum } from \"~/utils/renderSortEnum\";\nimport { renderGetFilterFields } from \"~/utils/renderGetFilterFields\";\nimport { renderInputFields } from \"~/utils/renderInputFields\";\nimport { renderFields } from \"~/utils/renderFields\";\nimport { CmsGraphQLSchemaSorterPlugin } from \"~/plugins\";\n\ninterface CreateManageSDLParams {\n models: CmsModel[];\n model: CmsModel;\n fieldTypePlugins: CmsFieldTypePlugins;\n sorterPlugins: CmsGraphQLSchemaSorterPlugin[];\n}\n\ninterface CreateManageSDL {\n (params: CreateManageSDLParams): string;\n}\n\nexport const createManageSDL: CreateManageSDL = ({\n models,\n model,\n fieldTypePlugins,\n sorterPlugins\n}): string => {\n const inputFields = renderInputFields({\n models,\n model,\n fields: model.fields,\n fieldTypePlugins\n });\n if (inputFields.length === 0) {\n return \"\";\n }\n const listFilterFieldsRender = renderListFilterFields({\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const sortEnumRender = renderSortEnum({\n model,\n fields: model.fields,\n fieldTypePlugins,\n sorterPlugins\n });\n const getFilterFieldsRender = renderGetFilterFields({\n fields: model.fields,\n fieldTypePlugins\n });\n\n const fields = renderFields({\n models,\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const { singularApiName: singularName, pluralApiName: pluralName } = model;\n\n const inputGraphQLFields = inputFields.map(f => f.fields).join(\"\\n\");\n /**\n * TODO check for 5.38.0\n */\n return /* GraphQL */ `\n \"\"\"${model.description || singularName}\"\"\"\n type ${singularName} {\n id: ID!\n entryId: String!\n createdOn: DateTime!\n savedOn: DateTime!\n createdBy: CmsIdentity!\n ownedBy: CmsIdentity!\n modifiedBy: CmsIdentity\n meta: ${singularName}Meta\n ${fields.map(f => f.fields).join(\"\\n\")}\n # Advanced Content Organization - make required in 5.38.0\n wbyAco_location: WbyAcoLocation\n }\n\n type ${singularName}Meta {\n modelId: String\n version: Int\n locked: Boolean\n publishedOn: DateTime\n status: String\n \"\"\"\n CAUTION: this field is resolved by making an extra query to DB.\n RECOMMENDATION: Use it only with \"get\" queries (avoid in \"list\")\n \"\"\"\n revisions: [${singularName}!]\n title: String\n description: String\n image: String\n \"\"\"\n Custom meta data stored in the root of the entry object.\n \"\"\"\n data: JSON\n }\n\n ${fields.map(f => f.typeDefs).join(\"\\n\")}\n\n ${inputFields.map(f => f.typeDefs).join(\"\\n\")}\n \n input ${singularName}Input {\n id: ID\n wbyAco_location: WbyAcoLocationInput\n ${inputGraphQLFields}\n }\n\n input ${singularName}GetWhereInput {\n ${getFilterFieldsRender}\n }\n\n input ${singularName}ListWhereInput {\n wbyAco_location: WbyAcoLocationWhereInput\n ${listFilterFieldsRender}\n AND: [${singularName}ListWhereInput!]\n OR: [${singularName}ListWhereInput!]\n }\n\n\n type ${singularName}Response {\n data: ${singularName}\n error: CmsError\n }\n \n type ${singularName}MoveResponse {\n data: Boolean\n error: CmsError\n }\n\n type ${singularName}ArrayResponse {\n data: [${singularName}]\n error: CmsError\n }\n\n type ${singularName}ListResponse {\n data: [${singularName}]\n meta: CmsListMeta\n error: CmsError\n }\n\n\n enum ${singularName}ListSorter {\n ${sortEnumRender}\n }\n\n extend type Query {\n get${singularName}(revision: ID, entryId: ID, status: CmsEntryStatusType): ${singularName}Response\n \n get${singularName}Revisions(id: ID!): ${singularName}ArrayResponse\n \n get${pluralName}ByIds(revisions: [ID!]!): ${singularName}ArrayResponse\n \n list${pluralName} (\n where: ${singularName}ListWhereInput\n sort: [${singularName}ListSorter]\n limit: Int\n after: String\n search: String\n ): ${singularName}ListResponse\n }\n\n extend type Mutation {\n create${singularName}(data: ${singularName}Input!, options: CreateCmsEntryOptionsInput): ${singularName}Response\n\n create${singularName}From(revision: ID!, data: ${singularName}Input, options: CreateRevisionCmsEntryOptionsInput): ${singularName}Response\n \n update${singularName}(revision: ID!, data: ${singularName}Input!, options: UpdateCmsEntryOptionsInput): ${singularName}Response\n\n validate${singularName}(revision: ID, data: ${singularName}Input!): CmsEntryValidationResponse!\n \n move${singularName}(revision: ID!, folderId: ID!): ${singularName}MoveResponse\n\n delete${singularName}(revision: ID!, options: CmsDeleteEntryOptions): CmsDeleteResponse\n\n deleteMultiple${pluralName}(entries: [ID!]!): CmsDeleteMultipleResponse!\n \n publish${singularName}(revision: ID
|
|
1
|
+
{"version":3,"names":["_renderListFilterFields","require","_renderSortEnum","_renderGetFilterFields","_renderInputFields","_renderFields","createManageSDL","models","model","fieldTypePlugins","sorterPlugins","inputFields","renderInputFields","fields","length","listFilterFieldsRender","renderListFilterFields","type","sortEnumRender","renderSortEnum","getFilterFieldsRender","renderGetFilterFields","renderFields","singularApiName","singularName","pluralApiName","pluralName","inputGraphQLFields","map","f","join","description","typeDefs","exports"],"sources":["createManageSDL.ts"],"sourcesContent":["import { CmsFieldTypePlugins, CmsModel } from \"~/types\";\nimport { renderListFilterFields } from \"~/utils/renderListFilterFields\";\nimport { renderSortEnum } from \"~/utils/renderSortEnum\";\nimport { renderGetFilterFields } from \"~/utils/renderGetFilterFields\";\nimport { renderInputFields } from \"~/utils/renderInputFields\";\nimport { renderFields } from \"~/utils/renderFields\";\nimport { CmsGraphQLSchemaSorterPlugin } from \"~/plugins\";\n\ninterface CreateManageSDLParams {\n models: CmsModel[];\n model: CmsModel;\n fieldTypePlugins: CmsFieldTypePlugins;\n sorterPlugins: CmsGraphQLSchemaSorterPlugin[];\n}\n\ninterface CreateManageSDL {\n (params: CreateManageSDLParams): string;\n}\n\nexport const createManageSDL: CreateManageSDL = ({\n models,\n model,\n fieldTypePlugins,\n sorterPlugins\n}): string => {\n const inputFields = renderInputFields({\n models,\n model,\n fields: model.fields,\n fieldTypePlugins\n });\n if (inputFields.length === 0) {\n return \"\";\n }\n const listFilterFieldsRender = renderListFilterFields({\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const sortEnumRender = renderSortEnum({\n model,\n fields: model.fields,\n fieldTypePlugins,\n sorterPlugins\n });\n const getFilterFieldsRender = renderGetFilterFields({\n fields: model.fields,\n fieldTypePlugins\n });\n\n const fields = renderFields({\n models,\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const { singularApiName: singularName, pluralApiName: pluralName } = model;\n\n const inputGraphQLFields = inputFields.map(f => f.fields).join(\"\\n\");\n /**\n * TODO check for 5.38.0\n */\n return /* GraphQL */ `\n \"\"\"${model.description || singularName}\"\"\"\n type ${singularName} {\n id: ID!\n entryId: String!\n createdOn: DateTime!\n savedOn: DateTime!\n createdBy: CmsIdentity!\n ownedBy: CmsIdentity!\n modifiedBy: CmsIdentity\n meta: ${singularName}Meta\n ${fields.map(f => f.fields).join(\"\\n\")}\n # Advanced Content Organization - make required in 5.38.0\n wbyAco_location: WbyAcoLocation\n }\n\n type ${singularName}Meta {\n modelId: String\n version: Int\n locked: Boolean\n publishedOn: DateTime\n status: String\n \"\"\"\n CAUTION: this field is resolved by making an extra query to DB.\n RECOMMENDATION: Use it only with \"get\" queries (avoid in \"list\")\n \"\"\"\n revisions: [${singularName}!]\n title: String\n description: String\n image: String\n \"\"\"\n Custom meta data stored in the root of the entry object.\n \"\"\"\n data: JSON\n }\n\n ${fields.map(f => f.typeDefs).join(\"\\n\")}\n\n ${inputFields.map(f => f.typeDefs).join(\"\\n\")}\n \n input ${singularName}Input {\n id: ID\n # User can override the entry dates\n createdOn: DateTime\n savedOn: DateTime\n publishedOn: DateTime\n # User can override the entry related user identities\n createdBy: CmsIdentityInput\n modifiedBy: CmsIdentityInput\n ownedBy: CmsIdentityInput\n wbyAco_location: WbyAcoLocationInput\n ${inputGraphQLFields}\n }\n\n input ${singularName}GetWhereInput {\n ${getFilterFieldsRender}\n }\n\n input ${singularName}ListWhereInput {\n wbyAco_location: WbyAcoLocationWhereInput\n ${listFilterFieldsRender}\n AND: [${singularName}ListWhereInput!]\n OR: [${singularName}ListWhereInput!]\n }\n\n\n type ${singularName}Response {\n data: ${singularName}\n error: CmsError\n }\n \n type ${singularName}MoveResponse {\n data: Boolean\n error: CmsError\n }\n\n type ${singularName}ArrayResponse {\n data: [${singularName}]\n error: CmsError\n }\n\n type ${singularName}ListResponse {\n data: [${singularName}]\n meta: CmsListMeta\n error: CmsError\n }\n\n\n enum ${singularName}ListSorter {\n ${sortEnumRender}\n }\n\n extend type Query {\n get${singularName}(revision: ID, entryId: ID, status: CmsEntryStatusType): ${singularName}Response\n \n get${singularName}Revisions(id: ID!): ${singularName}ArrayResponse\n \n get${pluralName}ByIds(revisions: [ID!]!): ${singularName}ArrayResponse\n \n list${pluralName} (\n where: ${singularName}ListWhereInput\n sort: [${singularName}ListSorter]\n limit: Int\n after: String\n search: String\n ): ${singularName}ListResponse\n }\n\n extend type Mutation {\n create${singularName}(data: ${singularName}Input!, options: CreateCmsEntryOptionsInput): ${singularName}Response\n\n create${singularName}From(revision: ID!, data: ${singularName}Input, options: CreateRevisionCmsEntryOptionsInput): ${singularName}Response\n \n update${singularName}(revision: ID!, data: ${singularName}Input!, options: UpdateCmsEntryOptionsInput): ${singularName}Response\n\n validate${singularName}(revision: ID, data: ${singularName}Input!): CmsEntryValidationResponse!\n \n move${singularName}(revision: ID!, folderId: ID!): ${singularName}MoveResponse\n\n delete${singularName}(revision: ID!, options: CmsDeleteEntryOptions): CmsDeleteResponse\n\n deleteMultiple${pluralName}(entries: [ID!]!): CmsDeleteMultipleResponse!\n \n publish${singularName}(revision: ID!, options: CmsPublishEntryOptionsInput): ${singularName}Response\n \n republish${singularName}(revision: ID!): ${singularName}Response\n \n unpublish${singularName}(revision: ID!): ${singularName}Response\n }\n `;\n};\n"],"mappings":";;;;;;AACA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAcO,MAAMK,eAAgC,GAAGA,CAAC;EAC7CC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC;AACJ,CAAC,KAAa;EACV,MAAMC,WAAW,GAAG,IAAAC,oCAAiB,EAAC;IAClCL,MAAM;IACNC,KAAK;IACLK,MAAM,EAAEL,KAAK,CAACK,MAAM;IACpBJ;EACJ,CAAC,CAAC;EACF,IAAIE,WAAW,CAACG,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO,EAAE;EACb;EACA,MAAMC,sBAAsB,GAAG,IAAAC,8CAAsB,EAAC;IAClDR,KAAK;IACLK,MAAM,EAAEL,KAAK,CAACK,MAAM;IACpBI,IAAI,EAAE,QAAQ;IACdR;EACJ,CAAC,CAAC;EAEF,MAAMS,cAAc,GAAG,IAAAC,8BAAc,EAAC;IAClCX,KAAK;IACLK,MAAM,EAAEL,KAAK,CAACK,MAAM;IACpBJ,gBAAgB;IAChBC;EACJ,CAAC,CAAC;EACF,MAAMU,qBAAqB,GAAG,IAAAC,4CAAqB,EAAC;IAChDR,MAAM,EAAEL,KAAK,CAACK,MAAM;IACpBJ;EACJ,CAAC,CAAC;EAEF,MAAMI,MAAM,GAAG,IAAAS,0BAAY,EAAC;IACxBf,MAAM;IACNC,KAAK;IACLK,MAAM,EAAEL,KAAK,CAACK,MAAM;IACpBI,IAAI,EAAE,QAAQ;IACdR;EACJ,CAAC,CAAC;EAEF,MAAM;IAAEc,eAAe,EAAEC,YAAY;IAAEC,aAAa,EAAEC;EAAW,CAAC,GAAGlB,KAAK;EAE1E,MAAMmB,kBAAkB,GAAGhB,WAAW,CAACiB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAAChB,MAAM,CAAC,CAACiB,IAAI,CAAC,IAAI,CAAC;EACpE;AACJ;AACA;EACI,OAAO,cAAe;AAC1B,aAAatB,KAAK,CAACuB,WAAW,IAAIP,YAAa;AAC/C,eAAeA,YAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoBA,YAAa;AACjC,cAAcX,MAAM,CAACe,GAAG,CAACC,CAAC,IAAIA,CAAC,CAAChB,MAAM,CAAC,CAACiB,IAAI,CAAC,IAAI,CAAE;AACnD;AACA;AACA;AACA;AACA,eAAeN,YAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BA,YAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUX,MAAM,CAACe,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACG,QAAQ,CAAC,CAACF,IAAI,CAAC,IAAI,CAAE;AACjD;AACA,UAAUnB,WAAW,CAACiB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACG,QAAQ,CAAC,CAACF,IAAI,CAAC,IAAI,CAAE;AACtD;AACA,gBAAgBN,YAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcG,kBAAmB;AACjC;AACA;AACA,gBAAgBH,YAAa;AAC7B,cAAcJ,qBAAsB;AACpC;AACA;AACA,gBAAgBI,YAAa;AAC7B;AACA,cAAcT,sBAAuB;AACrC,oBAAoBS,YAAa;AACjC,mBAAmBA,YAAa;AAChC;AACA;AACA;AACA,eAAeA,YAAa;AAC5B,oBAAoBA,YAAa;AACjC;AACA;AACA;AACA,eAAeA,YAAa;AAC5B;AACA;AACA;AACA;AACA,eAAeA,YAAa;AAC5B,qBAAqBA,YAAa;AAClC;AACA;AACA;AACA,eAAeA,YAAa;AAC5B,qBAAqBA,YAAa;AAClC;AACA;AACA;AACA;AACA;AACA,eAAeA,YAAa;AAC5B,cAAcN,cAAe;AAC7B;AACA;AACA;AACA,iBAAiBM,YAAa,4DAA2DA,YAAa;AACtG;AACA,iBAAiBA,YAAa,uBAAsBA,YAAa;AACjE;AACA,iBAAiBE,UAAW,6BAA4BF,YAAa;AACrE;AACA,kBAAkBE,UAAW;AAC7B,yBAAyBF,YAAa;AACtC,yBAAyBA,YAAa;AACtC;AACA;AACA;AACA,iBAAiBA,YAAa;AAC9B;AACA;AACA;AACA,oBAAoBA,YAAa,UAASA,YAAa,iDAAgDA,YAAa;AACpH;AACA,oBAAoBA,YAAa,6BAA4BA,YAAa,wDAAuDA,YAAa;AAC9I;AACA,oBAAoBA,YAAa,yBAAwBA,YAAa,iDAAgDA,YAAa;AACnI;AACA,sBAAsBA,YAAa,wBAAuBA,YAAa;AACvE;AACA,kBAAkBA,YAAa,mCAAkCA,YAAa;AAC9E;AACA,oBAAoBA,YAAa;AACjC;AACA,4BAA4BE,UAAW;AACvC;AACA,qBAAqBF,YAAa,0DAAyDA,YAAa;AACxG;AACA,uBAAuBA,YAAa,oBAAmBA,YAAa;AACpE;AACA,uBAAuBA,YAAa,oBAAmBA,YAAa;AACpE;AACA;EAAK;AACL,CAAC;AAACS,OAAA,CAAA3B,eAAA,GAAAA,eAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CmsEntryResolverFactory as ResolverFactory } from "../../../../types";
|
|
1
|
+
import { CmsEntryResolverFactory as ResolverFactory, CmsPublishEntryOptions } from "../../../../types";
|
|
2
2
|
interface ResolvePublishArgs {
|
|
3
3
|
revision: string;
|
|
4
|
+
options?: CmsPublishEntryOptions;
|
|
4
5
|
}
|
|
5
6
|
declare type ResolvePublish = ResolverFactory<any, ResolvePublishArgs>;
|
|
6
7
|
export declare const resolvePublish: ResolvePublish;
|
|
@@ -9,7 +9,7 @@ const resolvePublish = ({
|
|
|
9
9
|
model
|
|
10
10
|
}) => async (_, args, context) => {
|
|
11
11
|
try {
|
|
12
|
-
const entry = await context.cms.publishEntry(model, args.revision);
|
|
12
|
+
const entry = await context.cms.publishEntry(model, args.revision, args.options);
|
|
13
13
|
return new _responses.Response(entry);
|
|
14
14
|
} catch (e) {
|
|
15
15
|
return new _responses.ErrorResponse(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_responses","require","resolvePublish","model","_","args","context","entry","cms","publishEntry","revision","Response","e","ErrorResponse","exports"],"sources":["resolvePublish.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_responses","require","resolvePublish","model","_","args","context","entry","cms","publishEntry","revision","options","Response","e","ErrorResponse","exports"],"sources":["resolvePublish.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses\";\nimport { CmsEntryResolverFactory as ResolverFactory, CmsPublishEntryOptions } from \"~/types\";\n\ninterface ResolvePublishArgs {\n revision: string;\n options?: CmsPublishEntryOptions;\n}\n\ntype ResolvePublish = ResolverFactory<any, ResolvePublishArgs>;\n\nexport const resolvePublish: ResolvePublish =\n ({ model }) =>\n async (_, args: any, context) => {\n try {\n const entry = await context.cms.publishEntry(model, args.revision, args.options);\n return new Response(entry);\n } catch (e) {\n return new ErrorResponse(e);\n }\n };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAUO,MAAMC,cAA8B,GACvCA,CAAC;EAAEC;AAAM,CAAC,KACV,OAAOC,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;EAC7B,IAAI;IACA,MAAMC,KAAK,GAAG,MAAMD,OAAO,CAACE,GAAG,CAACC,YAAY,CAACN,KAAK,EAAEE,IAAI,CAACK,QAAQ,EAAEL,IAAI,CAACM,OAAO,CAAC;IAChF,OAAO,IAAIC,mBAAQ,CAACL,KAAK,CAAC;EAC9B,CAAC,CAAC,OAAOM,CAAC,EAAE;IACR,OAAO,IAAIC,wBAAa,CAACD,CAAC,CAAC;EAC/B;AACJ,CAAC;AAACE,OAAA,CAAAb,cAAA,GAAAA,cAAA"}
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CreateGraphQLParams } from "./graphql";
|
|
|
2
2
|
import { CrudParams } from "./context";
|
|
3
3
|
import { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStorageTransform } from "./utils/entryStorage";
|
|
4
4
|
export declare type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;
|
|
5
|
-
export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("
|
|
5
|
+
export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/plugins/types").PluginCollection | import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context>)[];
|
|
6
6
|
export declare type ContentContextParams = CrudParams;
|
|
7
7
|
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("./plugins").StorageTransformPlugin<any, any, import("./types").CmsModelDynamicZoneField> | import("./types").CmsModelFieldToGraphQLPlugin<any>[] | (import("./types").CmsModelFieldValidatorPlugin | import("./types").CmsModelFieldPatternValidatorPlugin[])[] | (import("./fieldConverters/CmsModelObjectFieldConverterPlugin").CmsModelObjectFieldConverterPlugin | import("./fieldConverters/CmsModelDefaultFieldConverterPlugin").CmsModelDefaultFieldConverterPlugin | import("./fieldConverters/CmsModelDynamicZoneFieldConverterPlugin").CmsModelDynamicZoneFieldConverterPlugin)[])[];
|
|
8
8
|
export * from "./graphqlFields";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.38.
|
|
3
|
+
"version": "5.38.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime": "7.22.6",
|
|
22
22
|
"@graphql-tools/schema": "7.1.5",
|
|
23
|
-
"@webiny/api": "5.38.
|
|
24
|
-
"@webiny/api-i18n": "5.38.
|
|
25
|
-
"@webiny/api-security": "5.38.
|
|
26
|
-
"@webiny/api-tenancy": "5.38.
|
|
27
|
-
"@webiny/error": "5.38.
|
|
28
|
-
"@webiny/handler": "5.38.
|
|
29
|
-
"@webiny/handler-aws": "5.38.
|
|
30
|
-
"@webiny/handler-db": "5.38.
|
|
31
|
-
"@webiny/handler-graphql": "5.38.
|
|
32
|
-
"@webiny/plugins": "5.38.
|
|
33
|
-
"@webiny/pubsub": "5.38.
|
|
34
|
-
"@webiny/utils": "5.38.
|
|
35
|
-
"@webiny/validation": "5.38.
|
|
23
|
+
"@webiny/api": "5.38.1",
|
|
24
|
+
"@webiny/api-i18n": "5.38.1",
|
|
25
|
+
"@webiny/api-security": "5.38.1",
|
|
26
|
+
"@webiny/api-tenancy": "5.38.1",
|
|
27
|
+
"@webiny/error": "5.38.1",
|
|
28
|
+
"@webiny/handler": "5.38.1",
|
|
29
|
+
"@webiny/handler-aws": "5.38.1",
|
|
30
|
+
"@webiny/handler-db": "5.38.1",
|
|
31
|
+
"@webiny/handler-graphql": "5.38.1",
|
|
32
|
+
"@webiny/plugins": "5.38.1",
|
|
33
|
+
"@webiny/pubsub": "5.38.1",
|
|
34
|
+
"@webiny/utils": "5.38.1",
|
|
35
|
+
"@webiny/validation": "5.38.1",
|
|
36
36
|
"code-frame": "5.0.0",
|
|
37
37
|
"dot-prop": "6.0.1",
|
|
38
38
|
"graphql-tag": "2.12.6",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@babel/cli": "7.22.6",
|
|
49
49
|
"@babel/core": "7.22.8",
|
|
50
50
|
"@babel/preset-env": "7.22.7",
|
|
51
|
-
"@webiny/api-wcp": "5.38.
|
|
52
|
-
"@webiny/cli": "5.38.
|
|
53
|
-
"@webiny/project-utils": "5.38.
|
|
51
|
+
"@webiny/api-wcp": "5.38.1",
|
|
52
|
+
"@webiny/cli": "5.38.1",
|
|
53
|
+
"@webiny/project-utils": "5.38.1",
|
|
54
54
|
"apollo-graphql": "0.9.7",
|
|
55
55
|
"get-yarn-workspaces": "1.0.2",
|
|
56
56
|
"graphql": "15.8.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"build": "yarn webiny run build",
|
|
71
71
|
"watch": "yarn webiny run watch"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "a22d4ab9fbb4ad35106687cbe17b51a84afd4976"
|
|
74
74
|
}
|
package/types.d.ts
CHANGED
|
@@ -1418,7 +1418,7 @@ export interface CmsEntry<T = CmsEntryValues> {
|
|
|
1418
1418
|
* A string of Date.toISOString() type - if published.
|
|
1419
1419
|
* Populated when entry is published.
|
|
1420
1420
|
*/
|
|
1421
|
-
publishedOn?: string;
|
|
1421
|
+
publishedOn?: string | null;
|
|
1422
1422
|
/**
|
|
1423
1423
|
* A revision version of the entry.
|
|
1424
1424
|
*/
|
|
@@ -1902,16 +1902,19 @@ export interface OnEntryMoveErrorTopicParams {
|
|
|
1902
1902
|
* Publish
|
|
1903
1903
|
*/
|
|
1904
1904
|
export interface OnEntryBeforePublishTopicParams {
|
|
1905
|
+
original: CmsEntry;
|
|
1905
1906
|
entry: CmsEntry;
|
|
1906
1907
|
model: CmsModel;
|
|
1907
1908
|
}
|
|
1908
1909
|
export interface OnEntryAfterPublishTopicParams {
|
|
1910
|
+
original: CmsEntry;
|
|
1909
1911
|
entry: CmsEntry;
|
|
1910
1912
|
model: CmsModel;
|
|
1911
1913
|
storageEntry: CmsEntry;
|
|
1912
1914
|
}
|
|
1913
1915
|
export interface OnEntryPublishErrorTopicParams {
|
|
1914
1916
|
error: Error;
|
|
1917
|
+
original: CmsEntry;
|
|
1915
1918
|
entry: CmsEntry;
|
|
1916
1919
|
model: CmsModel;
|
|
1917
1920
|
}
|
|
@@ -2005,6 +2008,12 @@ export interface EntryBeforeListTopicParams {
|
|
|
2005
2008
|
*/
|
|
2006
2009
|
export interface CreateCmsEntryInput {
|
|
2007
2010
|
id?: string;
|
|
2011
|
+
createdOn?: Date | string;
|
|
2012
|
+
savedOn?: Date | string;
|
|
2013
|
+
publishedOn?: Date | string;
|
|
2014
|
+
createdBy?: CmsIdentity | null;
|
|
2015
|
+
modifiedBy?: CmsIdentity | null;
|
|
2016
|
+
ownedBy?: CmsIdentity | null;
|
|
2008
2017
|
wbyAco_location?: {
|
|
2009
2018
|
folderId?: string | null;
|
|
2010
2019
|
};
|
|
@@ -2018,6 +2027,12 @@ export interface CreateCmsEntryOptionsInput {
|
|
|
2018
2027
|
* @category CmsEntry
|
|
2019
2028
|
*/
|
|
2020
2029
|
export interface CreateFromCmsEntryInput {
|
|
2030
|
+
createdOn?: Date;
|
|
2031
|
+
savedOn?: Date;
|
|
2032
|
+
publishedOn?: Date;
|
|
2033
|
+
createdBy?: CmsIdentity;
|
|
2034
|
+
modifiedBy?: CmsIdentity;
|
|
2035
|
+
ownedBy?: CmsIdentity;
|
|
2021
2036
|
[key: string]: any;
|
|
2022
2037
|
}
|
|
2023
2038
|
export interface CreateRevisionCmsEntryOptionsInput {
|
|
@@ -2028,6 +2043,12 @@ export interface CreateRevisionCmsEntryOptionsInput {
|
|
|
2028
2043
|
* @category CmsEntry
|
|
2029
2044
|
*/
|
|
2030
2045
|
export interface UpdateCmsEntryInput {
|
|
2046
|
+
createdOn?: Date | string | null;
|
|
2047
|
+
savedOn?: Date | string | null;
|
|
2048
|
+
publishedOn?: Date | string | null;
|
|
2049
|
+
createdBy?: CmsIdentity | null;
|
|
2050
|
+
modifiedBy?: CmsIdentity | null;
|
|
2051
|
+
ownedBy?: CmsIdentity;
|
|
2031
2052
|
wbyAco_location?: {
|
|
2032
2053
|
folderId?: string | null;
|
|
2033
2054
|
};
|
|
@@ -2054,6 +2075,19 @@ export interface CmsDeleteEntryOptions {
|
|
|
2054
2075
|
*/
|
|
2055
2076
|
force?: boolean;
|
|
2056
2077
|
}
|
|
2078
|
+
/**
|
|
2079
|
+
* @category CmsEntry
|
|
2080
|
+
*/
|
|
2081
|
+
export interface CmsPublishEntryOptions {
|
|
2082
|
+
/**
|
|
2083
|
+
* By default, updatePublishedOn is "true". User can set it to "false" to skip the publishedOn field update.
|
|
2084
|
+
*/
|
|
2085
|
+
updatePublishedOn?: boolean;
|
|
2086
|
+
/**
|
|
2087
|
+
* By default, updateSavedOn is "true". User can set it to "false" to skip the publishedOn field update.
|
|
2088
|
+
*/
|
|
2089
|
+
updateSavedOn?: boolean;
|
|
2090
|
+
}
|
|
2057
2091
|
/**
|
|
2058
2092
|
* @category Context
|
|
2059
2093
|
* @category CmsEntry
|
|
@@ -2146,7 +2180,7 @@ export interface CmsEntryContext {
|
|
|
2146
2180
|
/**
|
|
2147
2181
|
* Publish entry.
|
|
2148
2182
|
*/
|
|
2149
|
-
publishEntry: (model: CmsModel, id: string) => Promise<CmsEntry>;
|
|
2183
|
+
publishEntry: (model: CmsModel, id: string, options?: CmsPublishEntryOptions) => Promise<CmsEntry>;
|
|
2150
2184
|
/**
|
|
2151
2185
|
* Unpublish entry.
|
|
2152
2186
|
*/
|