@webiny/app-headless-cms-common 5.40.6-beta.3 → 5.41.0-beta.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.
@@ -193,3 +193,26 @@ export interface CmsEntryUnpublishMutationVariables {
193
193
  revision: string;
194
194
  }
195
195
  export declare const createUnpublishMutation: (model: CmsEditorContentModel) => import("graphql").DocumentNode;
196
+ /**
197
+ * ############################################
198
+ * Bulk Action Mutation
199
+ */
200
+ export interface CmsEntryBulkActionMutationResponse {
201
+ content: {
202
+ data?: {
203
+ id: string;
204
+ };
205
+ error?: CmsErrorResponse;
206
+ };
207
+ }
208
+ export interface CmsEntryBulkActionMutationVariables {
209
+ action: string;
210
+ where?: {
211
+ [key: string]: any;
212
+ };
213
+ search?: string;
214
+ data?: {
215
+ [key: string]: any;
216
+ };
217
+ }
218
+ export declare const createBulkActionMutation: (model: CmsEditorContentModel) => import("graphql").DocumentNode;
@@ -4,13 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.createUpdateSingletonMutation = exports.createUpdateMutation = exports.createUnpublishMutation = exports.createRevisionsQuery = exports.createRestoreFromBinMutation = exports.createReadSingletonQuery = exports.createReadQuery = exports.createPublishMutation = exports.createListQueryDataSelection = exports.createListQuery = exports.createDeleteMutation = exports.createCreateMutation = exports.createCreateFromMutation = void 0;
7
+ exports.createUpdateSingletonMutation = exports.createUpdateMutation = exports.createUnpublishMutation = exports.createRevisionsQuery = exports.createRestoreFromBinMutation = exports.createReadSingletonQuery = exports.createReadQuery = exports.createPublishMutation = exports.createListQueryDataSelection = exports.createListQuery = exports.createDeleteMutation = exports.createCreateMutation = exports.createCreateFromMutation = exports.createBulkActionMutation = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
10
10
  var _createFieldsList = require("./createFieldsList");
11
11
  var _getModelTitleFieldId = require("./getModelTitleFieldId");
12
12
  var _constants = require("./constants");
13
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
13
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
14
14
  var CONTENT_META_FIELDS = /* GraphQL */"\n title\n description\n image\n version\n locked\n status\n";
15
15
  var createEntrySystemFields = function createEntrySystemFields(model) {
16
16
  var isSingletonModel = model.tags.includes(_constants.CMS_MODEL_SINGLETON_TAG);
@@ -168,4 +168,13 @@ var createUnpublishMutation = exports.createUnpublishMutation = function createU
168
168
  }), ERROR_FIELD);
169
169
  };
170
170
 
171
+ /**
172
+ * ############################################
173
+ * Bulk Action Mutation
174
+ */
175
+
176
+ var createBulkActionMutation = exports.createBulkActionMutation = function createBulkActionMutation(model) {
177
+ return (0, _graphqlTag.default)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n mutation CmsBulkAction", "($action: BulkAction", "Name!, $where: ", "ListWhereInput, $search: String, $data: JSON) {\n content: bulkAction", "(action: $action, where: $where, search: $search, data: $data) {\n data {\n id\n }\n error ", "\n }\n }"])), model.singularApiName, model.singularApiName, model.singularApiName, model.singularApiName, ERROR_FIELD);
178
+ };
179
+
171
180
  //# sourceMappingURL=entries.graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_createFieldsList","_getModelTitleFieldId","_constants","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","CONTENT_META_FIELDS","createEntrySystemFields","model","isSingletonModel","tags","includes","CMS_MODEL_SINGLETON_TAG","optionalFields","concat","ERROR_FIELD","createReadQuery","exports","gql","_taggedTemplateLiteral2","default","singularApiName","createFieldsList","fields","createReadSingletonQuery","createRevisionsQuery","createListQueryDataSelection","getModelTitleFieldId","createListQuery","deleted","queryName","pluralApiName","createDeleteMutation","createRestoreFromBinMutation","createCreateMutation","createFields","createCreateFromMutation","createUpdateMutation","createUpdateSingletonMutation","createPublishMutation","createUnpublishMutation"],"sources":["entries.graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport {\n CmsContentEntryRevision,\n CmsContentEntry,\n CmsEditorContentModel,\n CmsErrorResponse,\n CmsMetaResponse,\n CmsModelField,\n CmsModel\n} from \"~/types\";\nimport { createFieldsList } from \"./createFieldsList\";\nimport { getModelTitleFieldId } from \"./getModelTitleFieldId\";\nimport { FormValidationOptions } from \"@webiny/form\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"./constants\";\n\nconst CONTENT_META_FIELDS = /* GraphQL */ `\n title\n description\n image\n version\n locked\n status\n`;\n\nconst createEntrySystemFields = (model: CmsModel) => {\n const isSingletonModel = model.tags.includes(CMS_MODEL_SINGLETON_TAG);\n\n let optionalFields = \"\";\n if (!isSingletonModel) {\n optionalFields = `\n wbyAco_location {\n folderId\n }\n meta {\n ${CONTENT_META_FIELDS}\n }\n `;\n }\n\n return /* GraphQL */ `\n id\n entryId\n createdOn\n savedOn\n modifiedOn,\n deletedOn\n firstPublishedOn\n lastPublishedOn\n createdBy {\n id\n type\n displayName\n }\n savedBy {\n id\n type\n displayName\n }\n modifiedBy {\n id\n type\n displayName\n }\n deletedBy {\n id\n type\n displayName\n }\n firstPublishedBy {\n id\n type\n displayName\n }\n lastPublishedBy {\n id\n type\n displayName\n }\n revisionCreatedOn\n revisionSavedOn\n revisionModifiedOn\n revisionDeletedOn\n revisionFirstPublishedOn\n revisionLastPublishedOn\n revisionCreatedBy {\n id\n type\n displayName\n }\n revisionSavedBy {\n id\n type\n displayName\n }\n revisionModifiedBy {\n id\n type\n displayName\n }\n revisionDeletedBy {\n id\n type\n displayName\n }\n revisionFirstPublishedBy {\n id\n type\n displayName\n }\n revisionLastPublishedBy {\n id\n type\n displayName\n }\n revisionCreatedOn\n revisionSavedOn\n revisionModifiedOn\n revisionFirstPublishedOn\n revisionLastPublishedOn\n revisionCreatedBy {\n id\n type\n displayName\n }\n revisionSavedBy {\n id\n type\n displayName\n }\n revisionModifiedBy {\n id\n type\n displayName\n }\n revisionFirstPublishedBy {\n id\n type\n displayName\n }\n revisionLastPublishedBy {\n id\n type\n displayName\n }\n ${optionalFields}\n `;\n};\n\nconst ERROR_FIELD = /* GraphQL */ `\n {\n message\n code\n data\n }\n`;\n\n/**\n * ############################################\n * Get CMS Entry Query\n */\nexport interface CmsEntryGetQueryResponse {\n content: {\n data: CmsContentEntry;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryGetQueryVariables {\n revision?: string;\n entryId?: string;\n}\n\nexport const createReadQuery = (model: CmsEditorContentModel) => {\n /**\n * This query now accepts both revision or entryId as we can load exact revision or latest (if entryId was sent).\n */\n return gql`\n query CmsEntriesGet${model.singularApiName}($revision: ID, $entryId: ID) {\n content: get${model.singularApiName}(revision: $revision, entryId: $entryId) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Get CMS Singleton Entry Query\n */\nexport interface CmsEntryGetSingletonQueryResponse {\n content: {\n data: CmsContentEntry;\n error: CmsErrorResponse | null;\n };\n}\n\nexport const createReadSingletonQuery = (model: CmsEditorContentModel) => {\n return gql`\n query CmsEntryGetSingleton${model.singularApiName} {\n content: get${model.singularApiName} {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * List CMS Entry Revisions Query\n */\nexport interface CmsEntriesListRevisionsQueryResponse {\n revisions: {\n data: CmsContentEntryRevision[];\n error: CmsErrorResponse | null;\n meta: CmsMetaResponse;\n };\n}\n\nexport interface CmsEntriesListRevisionsQueryVariables {\n id: string;\n}\n\nexport const createRevisionsQuery = (model: CmsEditorContentModel) => {\n return gql`\n query CmsEntriesGet${model.singularApiName}Revisions($id: ID!) {\n revisions: get${model.singularApiName}Revisions(id: $id) {\n data {\n ${createEntrySystemFields(model)}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * List CMS Entries Query\n */\nexport interface CmsEntriesListQueryResponse {\n content: {\n data: CmsContentEntry[];\n error: CmsErrorResponse | null;\n meta: CmsMetaResponse;\n };\n}\n\nexport interface CmsEntriesListQueryVariables {\n // TODO @ts-refactor better list types\n where?: {\n [key: string]: any;\n };\n sort?: string[];\n limit?: number;\n after?: string;\n}\n\nexport const createListQueryDataSelection = (\n model: CmsEditorContentModel,\n fields?: CmsModelField[]\n) => {\n return `\n ${createEntrySystemFields(model)}\n ${fields ? createFieldsList({ model, fields }) : \"\"}\n ${!fields ? getModelTitleFieldId(model) : \"\"}\n `;\n};\n\nexport const createListQuery = (\n model: CmsEditorContentModel,\n fields?: CmsModelField[],\n deleted?: boolean\n) => {\n const queryName = deleted ? `Deleted${model.pluralApiName}` : model.pluralApiName;\n\n return gql`\n query CmsEntriesList${queryName}($where: ${model.singularApiName}ListWhereInput, $sort: [${\n model.singularApiName\n }ListSorter], $limit: Int, $after: String, $search: String) {\n content: list${queryName}(\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n search: $search\n ) {\n data {\n ${createListQueryDataSelection(model, fields)}\n }\n meta {\n cursor\n hasMoreItems\n totalCount\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Delete Mutation\n */\nexport interface CmsEntryDeleteMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryDeleteMutationVariables {\n revision: string;\n permanently?: boolean;\n}\n\nexport const createDeleteMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsEntriesDelete${model.singularApiName}($revision: ID!, $permanently: Boolean) {\n content: delete${model.singularApiName}(revision: $revision, options: {permanently: $permanently}) {\n data\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Restore from bin Mutation\n */\nexport interface CmsEntryRestoreFromBinMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryRestoreFromBinMutationVariables {\n revision: string;\n}\n\nexport const createRestoreFromBinMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsEntriesRestore${model.singularApiName}FromBin($revision: ID!) {\n content: restore${model.singularApiName}FromBin(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Create Mutation\n */\nexport interface CmsEntryCreateMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryCreateMutationVariables {\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createCreateMutation = (model: CmsEditorContentModel) => {\n const createFields = createFieldsList({ model, fields: model.fields });\n\n return gql`\n mutation CmsEntriesCreate${model.singularApiName}($data: ${\n model.singularApiName\n }Input!, $options: CreateCmsEntryOptionsInput) {\n content: create${model.singularApiName}(data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFields}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Create From Mutation\n */\nexport interface CmsEntryCreateFromMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryCreateFromMutationVariables {\n revision: string;\n /**\n * We have any here because we do not know which fields does entry have\n */\n data?: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createCreateFromMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsCreate${model.singularApiName}From($revision: ID!, $data: ${\n model.singularApiName\n }Input, $options: CreateRevisionCmsEntryOptionsInput) {\n content: create${\n model.singularApiName\n }From(revision: $revision, data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n\n/**\n * ############################################\n * Update Mutation\n */\nexport interface CmsEntryUpdateMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUpdateMutationVariables {\n revision: string;\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createUpdateMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUpdate${model.singularApiName}($revision: ID!, $data: ${\n model.singularApiName\n }Input!, $options: UpdateCmsEntryOptionsInput) {\n content: update${\n model.singularApiName\n }(revision: $revision, data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Update Singleton Mutation\n */\nexport interface CmsEntryUpdateSingletonMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUpdateSingletonMutationVariables {\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createUpdateSingletonMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUpdate${model.singularApiName}($data: ${\n model.singularApiName\n }Input!, $options: UpdateCmsEntryOptionsInput) {\n content: update${model.singularApiName}(data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Publish Mutation\n */\nexport interface CmsEntryPublishMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryPublishMutationVariables {\n revision: string;\n}\n\nexport const createPublishMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsPublish${model.singularApiName}($revision: ID!) {\n content: publish${model.singularApiName}(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n\n/**\n * ############################################\n * Unpublish Mutation\n */\nexport interface CmsEntryUnpublishMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUnpublishMutationVariables {\n revision: string;\n}\n\nexport const createUnpublishMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUnpublish${model.singularApiName}($revision: ID!) {\n content: unpublish${model.singularApiName}(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAUA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAAsD,IAAAI,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA;AAEtD,IAAMC,mBAAmB,GAAG,6FAO3B;AAED,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,KAAe,EAAK;EACjD,IAAMC,gBAAgB,GAAGD,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACC,kCAAuB,CAAC;EAErE,IAAIC,cAAc,GAAG,EAAE;EACvB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,EACpBb,KAAK,CAACa,eAAe,EAE7Bd,uBAAuB,CAACC,KAAK,CAAC,EAC9B,IAAAc,kCAAgB,EAAC;IAAEd,KAAK,EAALA,KAAK;IAAEe,MAAM,EAAEf,KAAK,CAACe;EAAO,CAAC,CAAC,EAE/CR,WAAW;AAGnC,CAAC;;AAED;AACA;AACA;AACA;;AAYO,IAAMyB,uBAAuB,GAAAvB,OAAA,CAAAuB,uBAAA,GAAG,SAA1BA,uBAAuBA,CAAIhC,KAA4B,EAAK;EACrE,WAAOU,mBAAG,EAAAb,iBAAA,KAAAA,iBAAA,OAAAc,uBAAA,CAAAC,OAAA,gRACiBZ,KAAK,CAACa,eAAe,EACpBb,KAAK,CAACa,eAAe,EAE/Bd,uBAAuB,CAACC,KAAK,CAAC,EAC9B,IAAAc,kCAAgB,EAAC;IAAEd,KAAK,EAALA,KAAK;IAAEe,MAAM,EAAEf,KAAK,CAACe;EAAO,CAAC,CAAC,EAE/CR,WAAW;AAGnC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_createFieldsList","_getModelTitleFieldId","_constants","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","CONTENT_META_FIELDS","createEntrySystemFields","model","isSingletonModel","tags","includes","CMS_MODEL_SINGLETON_TAG","optionalFields","concat","ERROR_FIELD","createReadQuery","exports","gql","_taggedTemplateLiteral2","default","singularApiName","createFieldsList","fields","createReadSingletonQuery","createRevisionsQuery","createListQueryDataSelection","getModelTitleFieldId","createListQuery","deleted","queryName","pluralApiName","createDeleteMutation","createRestoreFromBinMutation","createCreateMutation","createFields","createCreateFromMutation","createUpdateMutation","createUpdateSingletonMutation","createPublishMutation","createUnpublishMutation","createBulkActionMutation"],"sources":["entries.graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport {\n CmsContentEntryRevision,\n CmsContentEntry,\n CmsEditorContentModel,\n CmsErrorResponse,\n CmsMetaResponse,\n CmsModelField,\n CmsModel\n} from \"~/types\";\nimport { createFieldsList } from \"./createFieldsList\";\nimport { getModelTitleFieldId } from \"./getModelTitleFieldId\";\nimport { FormValidationOptions } from \"@webiny/form\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"./constants\";\n\nconst CONTENT_META_FIELDS = /* GraphQL */ `\n title\n description\n image\n version\n locked\n status\n`;\n\nconst createEntrySystemFields = (model: CmsModel) => {\n const isSingletonModel = model.tags.includes(CMS_MODEL_SINGLETON_TAG);\n\n let optionalFields = \"\";\n if (!isSingletonModel) {\n optionalFields = `\n wbyAco_location {\n folderId\n }\n meta {\n ${CONTENT_META_FIELDS}\n }\n `;\n }\n\n return /* GraphQL */ `\n id\n entryId\n createdOn\n savedOn\n modifiedOn,\n deletedOn\n firstPublishedOn\n lastPublishedOn\n createdBy {\n id\n type\n displayName\n }\n savedBy {\n id\n type\n displayName\n }\n modifiedBy {\n id\n type\n displayName\n }\n deletedBy {\n id\n type\n displayName\n }\n firstPublishedBy {\n id\n type\n displayName\n }\n lastPublishedBy {\n id\n type\n displayName\n }\n revisionCreatedOn\n revisionSavedOn\n revisionModifiedOn\n revisionDeletedOn\n revisionFirstPublishedOn\n revisionLastPublishedOn\n revisionCreatedBy {\n id\n type\n displayName\n }\n revisionSavedBy {\n id\n type\n displayName\n }\n revisionModifiedBy {\n id\n type\n displayName\n }\n revisionDeletedBy {\n id\n type\n displayName\n }\n revisionFirstPublishedBy {\n id\n type\n displayName\n }\n revisionLastPublishedBy {\n id\n type\n displayName\n }\n revisionCreatedOn\n revisionSavedOn\n revisionModifiedOn\n revisionFirstPublishedOn\n revisionLastPublishedOn\n revisionCreatedBy {\n id\n type\n displayName\n }\n revisionSavedBy {\n id\n type\n displayName\n }\n revisionModifiedBy {\n id\n type\n displayName\n }\n revisionFirstPublishedBy {\n id\n type\n displayName\n }\n revisionLastPublishedBy {\n id\n type\n displayName\n }\n ${optionalFields}\n `;\n};\n\nconst ERROR_FIELD = /* GraphQL */ `\n {\n message\n code\n data\n }\n`;\n\n/**\n * ############################################\n * Get CMS Entry Query\n */\nexport interface CmsEntryGetQueryResponse {\n content: {\n data: CmsContentEntry;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryGetQueryVariables {\n revision?: string;\n entryId?: string;\n}\n\nexport const createReadQuery = (model: CmsEditorContentModel) => {\n /**\n * This query now accepts both revision or entryId as we can load exact revision or latest (if entryId was sent).\n */\n return gql`\n query CmsEntriesGet${model.singularApiName}($revision: ID, $entryId: ID) {\n content: get${model.singularApiName}(revision: $revision, entryId: $entryId) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Get CMS Singleton Entry Query\n */\nexport interface CmsEntryGetSingletonQueryResponse {\n content: {\n data: CmsContentEntry;\n error: CmsErrorResponse | null;\n };\n}\n\nexport const createReadSingletonQuery = (model: CmsEditorContentModel) => {\n return gql`\n query CmsEntryGetSingleton${model.singularApiName} {\n content: get${model.singularApiName} {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * List CMS Entry Revisions Query\n */\nexport interface CmsEntriesListRevisionsQueryResponse {\n revisions: {\n data: CmsContentEntryRevision[];\n error: CmsErrorResponse | null;\n meta: CmsMetaResponse;\n };\n}\n\nexport interface CmsEntriesListRevisionsQueryVariables {\n id: string;\n}\n\nexport const createRevisionsQuery = (model: CmsEditorContentModel) => {\n return gql`\n query CmsEntriesGet${model.singularApiName}Revisions($id: ID!) {\n revisions: get${model.singularApiName}Revisions(id: $id) {\n data {\n ${createEntrySystemFields(model)}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * List CMS Entries Query\n */\nexport interface CmsEntriesListQueryResponse {\n content: {\n data: CmsContentEntry[];\n error: CmsErrorResponse | null;\n meta: CmsMetaResponse;\n };\n}\n\nexport interface CmsEntriesListQueryVariables {\n // TODO @ts-refactor better list types\n where?: {\n [key: string]: any;\n };\n sort?: string[];\n limit?: number;\n after?: string;\n}\n\nexport const createListQueryDataSelection = (\n model: CmsEditorContentModel,\n fields?: CmsModelField[]\n) => {\n return `\n ${createEntrySystemFields(model)}\n ${fields ? createFieldsList({ model, fields }) : \"\"}\n ${!fields ? getModelTitleFieldId(model) : \"\"}\n `;\n};\n\nexport const createListQuery = (\n model: CmsEditorContentModel,\n fields?: CmsModelField[],\n deleted?: boolean\n) => {\n const queryName = deleted ? `Deleted${model.pluralApiName}` : model.pluralApiName;\n\n return gql`\n query CmsEntriesList${queryName}($where: ${model.singularApiName}ListWhereInput, $sort: [${\n model.singularApiName\n }ListSorter], $limit: Int, $after: String, $search: String) {\n content: list${queryName}(\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n search: $search\n ) {\n data {\n ${createListQueryDataSelection(model, fields)}\n }\n meta {\n cursor\n hasMoreItems\n totalCount\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Delete Mutation\n */\nexport interface CmsEntryDeleteMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryDeleteMutationVariables {\n revision: string;\n permanently?: boolean;\n}\n\nexport const createDeleteMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsEntriesDelete${model.singularApiName}($revision: ID!, $permanently: Boolean) {\n content: delete${model.singularApiName}(revision: $revision, options: {permanently: $permanently}) {\n data\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Restore from bin Mutation\n */\nexport interface CmsEntryRestoreFromBinMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryRestoreFromBinMutationVariables {\n revision: string;\n}\n\nexport const createRestoreFromBinMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsEntriesRestore${model.singularApiName}FromBin($revision: ID!) {\n content: restore${model.singularApiName}FromBin(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Create Mutation\n */\nexport interface CmsEntryCreateMutationResponse {\n content: {\n data: CmsContentEntry | null;\n error: CmsErrorResponse | null;\n };\n}\n\nexport interface CmsEntryCreateMutationVariables {\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createCreateMutation = (model: CmsEditorContentModel) => {\n const createFields = createFieldsList({ model, fields: model.fields });\n\n return gql`\n mutation CmsEntriesCreate${model.singularApiName}($data: ${\n model.singularApiName\n }Input!, $options: CreateCmsEntryOptionsInput) {\n content: create${model.singularApiName}(data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFields}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Create From Mutation\n */\nexport interface CmsEntryCreateFromMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryCreateFromMutationVariables {\n revision: string;\n /**\n * We have any here because we do not know which fields does entry have\n */\n data?: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createCreateFromMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsCreate${model.singularApiName}From($revision: ID!, $data: ${\n model.singularApiName\n }Input, $options: CreateRevisionCmsEntryOptionsInput) {\n content: create${\n model.singularApiName\n }From(revision: $revision, data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n\n/**\n * ############################################\n * Update Mutation\n */\nexport interface CmsEntryUpdateMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUpdateMutationVariables {\n revision: string;\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createUpdateMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUpdate${model.singularApiName}($revision: ID!, $data: ${\n model.singularApiName\n }Input!, $options: UpdateCmsEntryOptionsInput) {\n content: update${\n model.singularApiName\n }(revision: $revision, data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Update Singleton Mutation\n */\nexport interface CmsEntryUpdateSingletonMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUpdateSingletonMutationVariables {\n /**\n * We have any here because we do not know which fields does entry have\n */\n data: Record<string, any>;\n options?: FormValidationOptions;\n}\n\nexport const createUpdateSingletonMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUpdate${model.singularApiName}($data: ${\n model.singularApiName\n }Input!, $options: UpdateCmsEntryOptionsInput) {\n content: update${model.singularApiName}(data: $data, options: $options) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\n/**\n * ############################################\n * Publish Mutation\n */\nexport interface CmsEntryPublishMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryPublishMutationVariables {\n revision: string;\n}\n\nexport const createPublishMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsPublish${model.singularApiName}($revision: ID!) {\n content: publish${model.singularApiName}(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n\n/**\n * ############################################\n * Unpublish Mutation\n */\nexport interface CmsEntryUnpublishMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUnpublishMutationVariables {\n revision: string;\n}\n\nexport const createUnpublishMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUnpublish${model.singularApiName}($revision: ID!) {\n content: unpublish${model.singularApiName}(revision: $revision) {\n data {\n ${createEntrySystemFields(model)}\n ${createFieldsList({ model, fields: model.fields })}\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n\n/**\n * ############################################\n * Bulk Action Mutation\n */\nexport interface CmsEntryBulkActionMutationResponse {\n content: {\n data?: {\n id: string;\n };\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryBulkActionMutationVariables {\n action: string;\n where?: {\n [key: string]: any;\n };\n search?: string;\n data?: {\n [key: string]: any;\n };\n}\n\nexport const createBulkActionMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsBulkAction${model.singularApiName}($action: BulkAction${model.singularApiName}Name!, $where: ${model.singularApiName}ListWhereInput, $search: String, $data: JSON) {\n content: bulkAction${model.singularApiName}(action: $action, where: $where, search: $search, data: $data) {\n data {\n id\n }\n error ${ERROR_FIELD}\n }\n }`;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAUA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAAsD,IAAAI,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA;AAEtD,IAAMC,mBAAmB,GAAG,6FAO3B;AAED,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,KAAe,EAAK;EACjD,I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B,EAAK;EACnE,WAAOU,mBAAG,EAAAf,iBAAA,KAAAA,iBAAA,OAAAgB,uBAAA,CAAAC,OAAA,2QACeZ,KAAK,CAACa,eAAe,EACpBb,KAAK,CAACa,eAAe,EAE7Bd,uBAAuB,CAACC,KAAK,CAAC,EAC9B,IAAAc,kCAAgB,EAAC;IAAEd,KAAK,EAALA,KAAK;IAAEe,MAAM,EAAEf,KAAK,CAACe;EAAO,CAAC,CAAC,EAE/CR,WAAW;AAGnC,CAAC;;AAED;AACA;AACA;AACA;;AAYO,IAAMyB,uBAAuB,GAAAvB,OAAA,CAAAuB,uBAAA,GAAG,SAA1BA,uBAAuBA,CAAIhC,KAA4B,EAAK;EACrE,WAAOU,mBAAG,EAAAd,iBAAA,KAAAA,iBAAA,OAAAe,uBAAA,CAAAC,OAAA,gRACiBZ,KAAK,CAACa,eAAe,EACpBb,KAAK,CAACa,eAAe,EAE/Bd,uBAAuB,CAACC,KAAK,CAAC,EAC9B,IAAAc,kCAAgB,EAAC;IAAEd,KAAK,EAALA,KAAK;IAAEe,MAAM,EAAEf,KAAK,CAACe;EAAO,CAAC,CAAC,EAE/CR,WAAW;AAGnC,CAAC;;AAED;AACA;AACA;AACA;;AAqBO,IAAM0B,wBAAwB,GAAAxB,OAAA,CAAAwB,wBAAA,GAAG,SAA3BA,wBAAwBA,CAAIjC,KAA4B,EAAK;EACtE,WAAOU,mBAAG,EAAAb,iBAAA,KAAAA,iBAAA,OAAAc,uBAAA,CAAAC,OAAA,uWACkBZ,KAAK,CAACa,eAAe,EAAuBb,KAAK,CAACa,eAAe,EAAkBb,KAAK,CAACa,eAAe,EACvGb,KAAK,CAACa,eAAe,EAI9BN,WAAW;AAGnC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms-common",
3
- "version": "5.40.6-beta.3",
3
+ "version": "5.41.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,10 +16,10 @@
16
16
  "@babel/runtime": "7.24.1",
17
17
  "@fortawesome/fontawesome-svg-core": "1.3.0",
18
18
  "@types/react": "18.2.79",
19
- "@webiny/app-security": "5.40.6-beta.3",
20
- "@webiny/form": "5.40.6-beta.3",
21
- "@webiny/plugins": "5.40.6-beta.3",
22
- "@webiny/validation": "5.40.6-beta.3",
19
+ "@webiny/app-security": "5.41.0-beta.0",
20
+ "@webiny/form": "5.41.0-beta.0",
21
+ "@webiny/plugins": "5.41.0-beta.0",
22
+ "@webiny/validation": "5.41.0-beta.0",
23
23
  "dnd-core": "16.0.1",
24
24
  "graphql": "15.8.0",
25
25
  "graphql-tag": "2.12.6",
@@ -33,12 +33,12 @@
33
33
  "@babel/preset-react": "7.24.1",
34
34
  "@babel/preset-typescript": "7.24.1",
35
35
  "@emotion/babel-plugin": "11.11.0",
36
- "@webiny/cli": "5.40.6-beta.3",
37
- "@webiny/project-utils": "5.40.6-beta.3",
36
+ "@webiny/cli": "5.41.0-beta.0",
37
+ "@webiny/project-utils": "5.41.0-beta.0",
38
38
  "babel-plugin-module-resolver": "5.0.0",
39
39
  "rimraf": "5.0.5",
40
40
  "ttypescript": "1.5.15",
41
- "typescript": "4.7.4"
41
+ "typescript": "4.9.5"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",
@@ -48,5 +48,5 @@
48
48
  "build": "yarn webiny run build",
49
49
  "watch": "yarn webiny run watch"
50
50
  },
51
- "gitHead": "f9da84b373e62f9f269599c4301e5e4418a98d51"
51
+ "gitHead": "9ce5e75fc577aa4de2cf08d5ca734b3c98fe65b6"
52
52
  }
package/types/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { CmsModelFieldValidator, CmsModelFieldValidatorsFactory, CmsModelFieldVa
8
8
  import { CmsModel, CmsModelField } from "./model";
9
9
  import { CmsIdentity } from "./shared";
10
10
  import type { SourceType } from "dnd-core";
11
- export declare type DragObjectWithType = {
11
+ export type DragObjectWithType = {
12
12
  type: SourceType;
13
13
  };
14
14
  export * from "./validation";
@@ -37,7 +37,7 @@ export interface DragSource extends DragObjectWithType {
37
37
  /**
38
38
  * @deprecated Use `CmsModelFieldTypePlugin`.
39
39
  */
40
- export declare type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;
40
+ export type CmsEditorFieldTypePlugin = CmsModelFieldTypePlugin;
41
41
  export interface CmsModelFieldTypePlugin extends Plugin {
42
42
  /**
43
43
  * a plugin type
@@ -224,11 +224,11 @@ export interface CmsModelFieldRendererProps {
224
224
  /**
225
225
  * @deprecated Use `CmsModelFieldRendererProps`.
226
226
  */
227
- export declare type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;
227
+ export type CmsEditorFieldRendererProps = CmsModelFieldRendererProps;
228
228
  /**
229
229
  * @deprecated Use `CmsModelFieldRendererPlugin`.
230
230
  */
231
- export declare type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;
231
+ export type CmsEditorFieldRendererPlugin = CmsModelFieldRendererPlugin;
232
232
  export interface CmsModelFieldRendererPlugin extends Plugin {
233
233
  /**
234
234
  * a plugin type
@@ -324,11 +324,11 @@ export interface CmsDynamicZoneTemplate {
324
324
  export interface CmsDynamicZoneTemplateWithTypename extends CmsDynamicZoneTemplate {
325
325
  __typename: string;
326
326
  }
327
- export declare type CmsContentEntryStatusType = "draft" | "published" | "unpublished";
327
+ export type CmsContentEntryStatusType = "draft" | "published" | "unpublished";
328
328
  /**
329
329
  * @deprecated Use `CmsContentEntry`.
330
330
  */
331
- export declare type CmsEditorContentEntry = CmsContentEntry;
331
+ export type CmsEditorContentEntry = CmsContentEntry;
332
332
  export interface CmsContentEntry {
333
333
  id: string;
334
334
  entryId: string;
@@ -397,7 +397,7 @@ export interface CmsContentEntryRevision {
397
397
  version: number;
398
398
  };
399
399
  }
400
- export declare type CmsEditorContentTab = React.ComponentType<{
400
+ export type CmsEditorContentTab = React.ComponentType<{
401
401
  activeTab: boolean;
402
402
  }>;
403
403
  export interface CmsEditorFieldOptionPlugin extends Plugin {
@@ -545,7 +545,7 @@ interface BindComponentProps<T = any> extends Omit<BaseBindComponentProps, "chil
545
545
  name?: string;
546
546
  children?: ((props: BindComponentRenderProp<T>) => React.ReactElement) | React.ReactElement;
547
547
  }
548
- export declare type BindComponent<T = any> = React.ComponentType<BindComponentProps<T>> & {
548
+ export type BindComponent<T = any> = React.ComponentType<BindComponentProps<T>> & {
549
549
  parentName: string;
550
550
  };
551
551
  /**
package/types/model.d.ts CHANGED
@@ -5,7 +5,7 @@ import { CmsIdentity } from "./shared";
5
5
  /**
6
6
  * @deprecated Use `CmsModelField` instead.
7
7
  */
8
- export declare type CmsEditorField<T = unknown> = CmsModelField<T>;
8
+ export type CmsEditorField<T = unknown> = CmsModelField<T>;
9
9
  export interface CmsModelFieldSettings<T = unknown> {
10
10
  defaultValue?: string | boolean | number | null | undefined;
11
11
  defaultSetValue?: string;
@@ -17,7 +17,7 @@ export interface CmsModelFieldSettings<T = unknown> {
17
17
  imagesOnly?: boolean;
18
18
  [key: string]: any;
19
19
  }
20
- export declare type CmsModelField<T = unknown> = T & {
20
+ export type CmsModelField<T = unknown> = T & {
21
21
  id: string;
22
22
  type: string;
23
23
  fieldId: CmsEditorFieldId;
@@ -41,13 +41,13 @@ export declare type CmsModelField<T = unknown> = T & {
41
41
  | CmsModelFieldRendererPlugin["renderer"]["render"];
42
42
  tags?: string[];
43
43
  };
44
- export declare type CmsEditorFieldId = string;
45
- export declare type CmsEditorFieldsLayout = CmsEditorFieldId[][];
44
+ export type CmsEditorFieldId = string;
45
+ export type CmsEditorFieldsLayout = CmsEditorFieldId[][];
46
46
  /**
47
47
  * @category GraphQL
48
48
  * @category Model
49
49
  */
50
- export declare type CmsEditorContentModel = CmsModel;
50
+ export type CmsEditorContentModel = CmsModel;
51
51
  /**
52
52
  * @category GraphQL
53
53
  * @category Group