@webiny/app-headless-cms-common 6.3.0-beta.4 → 6.4.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.
Files changed (82) hide show
  1. package/Fields/ErrorBoundary.js +29 -34
  2. package/Fields/ErrorBoundary.js.map +1 -1
  3. package/Fields/FieldElement.js +38 -61
  4. package/Fields/FieldElement.js.map +1 -1
  5. package/Fields/FieldElementError.js +13 -22
  6. package/Fields/FieldElementError.js.map +1 -1
  7. package/Fields/FieldRulesProvider.js +11 -17
  8. package/Fields/FieldRulesProvider.js.map +1 -1
  9. package/Fields/Fields.js +76 -139
  10. package/Fields/Fields.js.map +1 -1
  11. package/Fields/Label.js +7 -7
  12. package/Fields/Label.js.map +1 -1
  13. package/Fields/LayoutDescriptorCell.js +33 -40
  14. package/Fields/LayoutDescriptorCell.js.map +1 -1
  15. package/Fields/evaluateExpression.js +54 -94
  16. package/Fields/evaluateExpression.js.map +1 -1
  17. package/Fields/fieldOptions.js +56 -104
  18. package/Fields/fieldOptions.js.map +1 -1
  19. package/Fields/index.js +0 -2
  20. package/Fields/layoutFieldRenderers/AlertFieldRenderer.js +7 -10
  21. package/Fields/layoutFieldRenderers/AlertFieldRenderer.js.map +1 -1
  22. package/Fields/layoutFieldRenderers/SeparatorFieldRenderer.js +12 -15
  23. package/Fields/layoutFieldRenderers/SeparatorFieldRenderer.js.map +1 -1
  24. package/Fields/layoutFieldRenderers/TabsFieldRenderer.js +52 -63
  25. package/Fields/layoutFieldRenderers/TabsFieldRenderer.js.map +1 -1
  26. package/Fields/operatorOptions.js +115 -87
  27. package/Fields/operatorOptions.js.map +1 -1
  28. package/Fields/useBind.js +101 -107
  29. package/Fields/useBind.js.map +1 -1
  30. package/Fields/useFieldRules.js +79 -133
  31. package/Fields/useFieldRules.js.map +1 -1
  32. package/Fields/useRenderPlugins.js +3 -2
  33. package/Fields/useRenderPlugins.js.map +1 -1
  34. package/ModelFieldProvider/CanEditField.js +6 -9
  35. package/ModelFieldProvider/CanEditField.js.map +1 -1
  36. package/ModelFieldProvider/ModelFieldContext.js +15 -22
  37. package/ModelFieldProvider/ModelFieldContext.js.map +1 -1
  38. package/ModelFieldProvider/index.js +0 -2
  39. package/ModelFieldProvider/useModelField.js +15 -21
  40. package/ModelFieldProvider/useModelField.js.map +1 -1
  41. package/ModelProvider/ModelContext.js +11 -15
  42. package/ModelProvider/ModelContext.js.map +1 -1
  43. package/ModelProvider/index.js +0 -2
  44. package/ModelProvider/useModel.js +7 -11
  45. package/ModelProvider/useModel.js.map +1 -1
  46. package/constants.js +2 -1
  47. package/constants.js.map +1 -1
  48. package/createFieldsList.js +27 -49
  49. package/createFieldsList.js.map +1 -1
  50. package/createValidationContainer.js +13 -20
  51. package/createValidationContainer.js.map +1 -1
  52. package/createValidators.js +42 -47
  53. package/createValidators.js.map +1 -1
  54. package/entries.graphql.d.ts +11 -0
  55. package/entries.graphql.js +74 -164
  56. package/entries.graphql.js.map +1 -1
  57. package/exports/admin/cms/model.js +0 -2
  58. package/exports/admin/cms.d.ts +1 -1
  59. package/exports/admin/cms.js +0 -3
  60. package/getModelTitleFieldId.js +4 -5
  61. package/getModelTitleFieldId.js.map +1 -1
  62. package/index.js +0 -2
  63. package/normalizeIcon.js +8 -7
  64. package/normalizeIcon.js.map +1 -1
  65. package/package.json +11 -13
  66. package/prepareFormData.js +39 -61
  67. package/prepareFormData.js.map +1 -1
  68. package/types/index.d.ts +2 -0
  69. package/types/index.js +1 -41
  70. package/types/model.js +4 -27
  71. package/types/model.js.map +1 -1
  72. package/types/shared.js +0 -3
  73. package/types/validation.js +0 -3
  74. package/Fields/index.js.map +0 -1
  75. package/ModelFieldProvider/index.js.map +0 -1
  76. package/ModelProvider/index.js.map +0 -1
  77. package/exports/admin/cms/model.js.map +0 -1
  78. package/exports/admin/cms.js.map +0 -1
  79. package/index.js.map +0 -1
  80. package/types/index.js.map +0 -1
  81. package/types/shared.js.map +0 -1
  82. package/types/validation.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import gql from "graphql-tag";
1
+ import graphql_tag from "graphql-tag";
2
2
  import { createFieldsList } from "./createFieldsList.js";
3
3
  import { getModelTitleFieldId } from "./getModelTitleFieldId.js";
4
4
  import { CMS_MODEL_SINGLETON_TAG } from "./constants.js";
5
- const CONTENT_META_FIELDS = /* GraphQL */`
5
+ const CONTENT_META_FIELDS = `
6
6
  title
7
7
  description
8
8
  image
@@ -10,11 +10,10 @@ const CONTENT_META_FIELDS = /* GraphQL */`
10
10
  locked
11
11
  status
12
12
  `;
13
- const createEntrySystemFields = model => {
14
- const isSingletonModel = model.tags.includes(CMS_MODEL_SINGLETON_TAG);
15
- let optionalFields = "";
16
- if (!isSingletonModel) {
17
- optionalFields = `
13
+ const createEntrySystemFields = (model)=>{
14
+ const isSingletonModel = model.tags.includes(CMS_MODEL_SINGLETON_TAG);
15
+ let optionalFields = "";
16
+ if (!isSingletonModel) optionalFields = `
18
17
  wbyAco_location {
19
18
  folderId
20
19
  }
@@ -22,8 +21,7 @@ const createEntrySystemFields = model => {
22
21
  ${CONTENT_META_FIELDS}
23
22
  }
24
23
  `;
25
- }
26
- return /* GraphQL */`
24
+ return `
27
25
  id
28
26
  entryId
29
27
  createdOn
@@ -102,74 +100,49 @@ const createEntrySystemFields = model => {
102
100
  live {
103
101
  version
104
102
  }
103
+ revisionDescription
105
104
  `;
106
105
  };
107
- const ERROR_FIELD = /* GraphQL */`
106
+ const ERROR_FIELD = `
108
107
  {
109
108
  message
110
109
  code
111
110
  data
112
111
  }
113
112
  `;
114
-
115
- /**
116
- * ############################################
117
- * Get CMS Entry Query
118
- */
119
-
120
- export const createReadQuery = model => {
121
- /**
122
- * This query now accepts both revision or entryId as we can load exact revision or latest (if entryId was sent).
123
- */
124
- return gql`
113
+ const createReadQuery = (model)=>graphql_tag`
125
114
  query CmsEntriesGet${model.singularApiName}($revision: ID, $entryId: ID) {
126
115
  content: get${model.singularApiName}(revision: $revision, entryId: $entryId) {
127
116
  data {
128
117
  ${createEntrySystemFields(model)}
129
118
  values {
130
119
  ${createFieldsList({
131
- model,
132
- fields: model.fields
133
- })}
120
+ model,
121
+ fields: model.fields
122
+ })}
134
123
  }
135
124
  }
136
125
  error ${ERROR_FIELD}
137
126
  }
138
127
  }
139
128
  `;
140
- };
141
-
142
- /**
143
- * ############################################
144
- * Get CMS Singleton Entry Query
145
- */
146
-
147
- export const createReadSingletonQuery = model => {
148
- return gql`
129
+ const createReadSingletonQuery = (model)=>graphql_tag`
149
130
  query CmsEntryGetSingleton${model.singularApiName} {
150
131
  content: get${model.singularApiName} {
151
132
  data {
152
133
  ${createEntrySystemFields(model)}
153
134
  values {
154
135
  ${createFieldsList({
155
- model,
156
- fields: model.fields
157
- })}
136
+ model,
137
+ fields: model.fields
138
+ })}
158
139
  }
159
140
  }
160
141
  error ${ERROR_FIELD}
161
142
  }
162
143
  }
163
144
  `;
164
- };
165
-
166
- /**
167
- * ############################################
168
- * List CMS Entry Revisions Query
169
- */
170
-
171
- export const createRevisionsQuery = model => {
172
- return gql`
145
+ const createRevisionsQuery = (model)=>graphql_tag`
173
146
  query CmsEntriesGet${model.singularApiName}Revisions($id: ID!) {
174
147
  revisions: get${model.singularApiName}Revisions(id: $id) {
175
148
  data {
@@ -179,28 +152,19 @@ export const createRevisionsQuery = model => {
179
152
  }
180
153
  }
181
154
  `;
182
- };
183
-
184
- /**
185
- * ############################################
186
- * List CMS Entries Query
187
- */
188
-
189
- export const createListQueryDataSelection = (model, fields) => {
190
- return `
155
+ const createListQueryDataSelection = (model, fields)=>`
191
156
  ${createEntrySystemFields(model)}
192
157
  values {
193
158
  ${fields ? createFieldsList({
194
- model,
195
- fields
196
- }) : getModelTitleFieldId(model)}
159
+ model,
160
+ fields
161
+ }) : getModelTitleFieldId(model)}
197
162
  }
198
163
  `;
199
- };
200
- export const createListQuery = (model, fields, deleted) => {
201
- const queryName = deleted ? `Deleted${model.pluralApiName}` : model.pluralApiName;
202
- const selection = createListQueryDataSelection(model, fields);
203
- return gql`
164
+ const createListQuery = (model, fields, deleted)=>{
165
+ const queryName = deleted ? `Deleted${model.pluralApiName}` : model.pluralApiName;
166
+ const selection = createListQueryDataSelection(model, fields);
167
+ return graphql_tag`
204
168
  query CmsEntriesList${queryName}($where: ${model.singularApiName}ListWhereInput, $sort: [${model.singularApiName}ListSorter], $limit: Int, $after: String, $search: String) {
205
169
  content: list${queryName}(
206
170
  where: $where
@@ -222,14 +186,7 @@ export const createListQuery = (model, fields, deleted) => {
222
186
  }
223
187
  `;
224
188
  };
225
-
226
- /**
227
- * ############################################
228
- * Delete Mutation
229
- */
230
-
231
- export const createDeleteMutation = model => {
232
- return gql`
189
+ const createDeleteMutation = (model)=>graphql_tag`
233
190
  mutation CmsEntriesDelete${model.singularApiName}($revision: ID!, $permanently: Boolean) {
234
191
  content: delete${model.singularApiName}(revision: $revision, options: {permanently: $permanently}) {
235
192
  data
@@ -237,43 +194,28 @@ export const createDeleteMutation = model => {
237
194
  }
238
195
  }
239
196
  `;
240
- };
241
-
242
- /**
243
- * ############################################
244
- * Restore from bin Mutation
245
- */
246
-
247
- export const createRestoreFromBinMutation = model => {
248
- return gql`
197
+ const createRestoreFromBinMutation = (model)=>graphql_tag`
249
198
  mutation CmsEntriesRestore${model.singularApiName}FromBin($revision: ID!) {
250
199
  content: restore${model.singularApiName}FromBin(revision: $revision) {
251
200
  data {
252
201
  ${createEntrySystemFields(model)}
253
202
  values {
254
203
  ${createFieldsList({
255
- model,
256
- fields: model.fields
257
- })}
204
+ model,
205
+ fields: model.fields
206
+ })}
258
207
  }
259
208
  }
260
209
  error ${ERROR_FIELD}
261
210
  }
262
211
  }
263
212
  `;
264
- };
265
-
266
- /**
267
- * ############################################
268
- * Create Mutation
269
- */
270
-
271
- export const createCreateMutation = model => {
272
- const createFields = createFieldsList({
273
- model,
274
- fields: model.fields
275
- });
276
- return gql`
213
+ const createCreateMutation = (model)=>{
214
+ const createFields = createFieldsList({
215
+ model,
216
+ fields: model.fields
217
+ });
218
+ return graphql_tag`
277
219
  mutation CmsEntriesCreate${model.singularApiName}($data: ${model.singularApiName}Input!, $options: CreateCmsEntryOptionsInput) {
278
220
  content: create${model.singularApiName}(data: $data, options: $options) {
279
221
  data {
@@ -287,131 +229,99 @@ export const createCreateMutation = model => {
287
229
  }
288
230
  `;
289
231
  };
290
-
291
- /**
292
- * ############################################
293
- * Create From Mutation
294
- */
295
-
296
- export const createCreateFromMutation = model => {
297
- return gql`
232
+ const createCreateFromMutation = (model)=>graphql_tag`
298
233
  mutation CmsCreate${model.singularApiName}From($revision: ID!, $data: ${model.singularApiName}Input, $options: CreateRevisionCmsEntryOptionsInput) {
299
234
  content: create${model.singularApiName}From(revision: $revision, data: $data, options: $options) {
300
235
  data {
301
236
  ${createEntrySystemFields(model)}
302
237
  values {
303
238
  ${createFieldsList({
304
- model,
305
- fields: model.fields
306
- })}
239
+ model,
240
+ fields: model.fields
241
+ })}
307
242
  }
308
243
  }
309
244
  error ${ERROR_FIELD}
310
245
  }
311
246
  }`;
312
- };
313
-
314
- /**
315
- * ############################################
316
- * Update Mutation
317
- */
318
-
319
- export const createUpdateMutation = model => {
320
- return gql`
247
+ const createUpdateMutation = (model)=>graphql_tag`
321
248
  mutation CmsUpdate${model.singularApiName}($revision: ID!, $data: ${model.singularApiName}Input!, $options: UpdateCmsEntryOptionsInput) {
322
249
  content: update${model.singularApiName}(revision: $revision, data: $data, options: $options) {
323
250
  data {
324
251
  ${createEntrySystemFields(model)}
325
252
  values {
326
253
  ${createFieldsList({
327
- model,
328
- fields: model.fields
329
- })}
254
+ model,
255
+ fields: model.fields
256
+ })}
330
257
  }
331
258
  }
332
259
  error ${ERROR_FIELD}
333
260
  }
334
261
  }
335
262
  `;
336
- };
337
-
338
- /**
339
- * ############################################
340
- * Update Singleton Mutation
341
- */
342
-
343
- export const createUpdateSingletonMutation = model => {
344
- return gql`
263
+ const createUpdateSingletonMutation = (model)=>graphql_tag`
345
264
  mutation CmsUpdate${model.singularApiName}($data: ${model.singularApiName}Input!, $options: UpdateCmsEntryOptionsInput) {
346
265
  content: update${model.singularApiName}(data: $data, options: $options) {
347
266
  data {
348
267
  ${createEntrySystemFields(model)}
349
268
  values {
350
269
  ${createFieldsList({
351
- model,
352
- fields: model.fields
353
- })}
270
+ model,
271
+ fields: model.fields
272
+ })}
354
273
  }
355
274
  }
356
275
  error ${ERROR_FIELD}
357
276
  }
358
277
  }
359
278
  `;
360
- };
361
-
362
- /**
363
- * ############################################
364
- * Publish Mutation
365
- */
366
-
367
- export const createPublishMutation = model => {
368
- return gql`
279
+ const createUpdateRevisionDescriptionMutation = (model)=>graphql_tag`
280
+ mutation CmsUpdate${model.singularApiName}RevisionDescription($revision: ID!, $revisionDescription: String!) {
281
+ content: update${model.singularApiName}RevisionDescription(revision: $revision, revisionDescription: $revisionDescription) {
282
+ data {
283
+ ${createEntrySystemFields(model)}
284
+ values {
285
+ ${createFieldsList({
286
+ model,
287
+ fields: model.fields
288
+ })}
289
+ }
290
+ }
291
+ error ${ERROR_FIELD}
292
+ }
293
+ }`;
294
+ const createPublishMutation = (model)=>graphql_tag`
369
295
  mutation CmsPublish${model.singularApiName}($revision: ID!) {
370
296
  content: publish${model.singularApiName}(revision: $revision) {
371
297
  data {
372
298
  ${createEntrySystemFields(model)}
373
299
  values {
374
300
  ${createFieldsList({
375
- model,
376
- fields: model.fields
377
- })}
301
+ model,
302
+ fields: model.fields
303
+ })}
378
304
  }
379
305
  }
380
306
  error ${ERROR_FIELD}
381
307
  }
382
308
  }`;
383
- };
384
-
385
- /**
386
- * ############################################
387
- * Unpublish Mutation
388
- */
389
-
390
- export const createUnpublishMutation = model => {
391
- return gql`
309
+ const createUnpublishMutation = (model)=>graphql_tag`
392
310
  mutation CmsUnpublish${model.singularApiName}($revision: ID!) {
393
311
  content: unpublish${model.singularApiName}(revision: $revision) {
394
312
  data {
395
313
  ${createEntrySystemFields(model)}
396
314
  values {
397
315
  ${createFieldsList({
398
- model,
399
- fields: model.fields
400
- })}
316
+ model,
317
+ fields: model.fields
318
+ })}
401
319
  }
402
320
  }
403
321
  error ${ERROR_FIELD}
404
322
  }
405
323
  }`;
406
- };
407
-
408
- /**
409
- * ############################################
410
- * Bulk Action Mutation
411
- */
412
-
413
- export const createBulkActionMutation = model => {
414
- return gql`
324
+ const createBulkActionMutation = (model)=>graphql_tag`
415
325
  mutation CmsBulkAction${model.singularApiName}($action: BulkAction${model.singularApiName}Name!, $where: ${model.singularApiName}ListWhereInput, $search: String, $data: JSON) {
416
326
  content: bulkAction${model.singularApiName}(action: $action, where: $where, search: $search, data: $data) {
417
327
  data {
@@ -420,6 +330,6 @@ export const createBulkActionMutation = model => {
420
330
  error ${ERROR_FIELD}
421
331
  }
422
332
  }`;
423
- };
333
+ export { createBulkActionMutation, createCreateFromMutation, createCreateMutation, createDeleteMutation, createListQuery, createListQueryDataSelection, createPublishMutation, createReadQuery, createReadSingletonQuery, createRestoreFromBinMutation, createRevisionsQuery, createUnpublishMutation, createUpdateMutation, createUpdateRevisionDescriptionMutation, createUpdateSingletonMutation };
424
334
 
425
335
  //# sourceMappingURL=entries.graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gql","createFieldsList","getModelTitleFieldId","CMS_MODEL_SINGLETON_TAG","CONTENT_META_FIELDS","createEntrySystemFields","model","isSingletonModel","tags","includes","optionalFields","ERROR_FIELD","createReadQuery","singularApiName","fields","createReadSingletonQuery","createRevisionsQuery","createListQueryDataSelection","createListQuery","deleted","queryName","pluralApiName","selection","createDeleteMutation","createRestoreFromBinMutation","createCreateMutation","createFields","createCreateFromMutation","createUpdateMutation","createUpdateSingletonMutation","createPublishMutation","createUnpublishMutation","createBulkActionMutation"],"sources":["entries.graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type {\n CmsContentEntry,\n CmsContentEntryRevision,\n CmsEditorContentModel,\n CmsErrorResponse,\n CmsMetaResponse,\n CmsModel,\n CmsModelField\n} from \"~/types/index.js\";\nimport { createFieldsList } from \"./createFieldsList.js\";\nimport { getModelTitleFieldId } from \"./getModelTitleFieldId.js\";\nimport type { FormValidationOptions } from \"@webiny/form\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"./constants.js\";\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 ${optionalFields}\n live {\n version\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${fields ? createFieldsList({ model, fields }) : getModelTitleFieldId(model)}\n }\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 const selection = createListQueryDataSelection(model, fields);\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 ${selection}\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFields}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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,OAAOA,GAAG,MAAM,aAAa;AAU7B,SAASC,gBAAgB;AACzB,SAASC,oBAAoB;AAE7B,SAASC,uBAAuB;AAEhC,MAAMC,mBAAmB,GAAG,aAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,uBAAuB,GAAIC,KAAe,IAAK;EACjD,MAAMC,gBAAgB,GAAGD,KAAK,CAACE,IAAI,CAACC,QAAQ,CAACN,uBAAuB,CAAC;EAErE,IAAIO,cAAc,GAAG,EAAE;EACvB,IAAI,CAACH,gBAAgB,EAAE;IACnBG,cAAc,GAAG;AACzB;AACA;AACA;AACA;AACA,kBAAkBN,mBAAmB;AACrC;AACA,SAAS;EACL;EAEA,OAAO,aAAc;AACzB;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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AACA,wBAAwBH,WAAW;AACnC;AACA,UAAU;AACV,CAAC;;AAED;AACA;AACA;AACA;;AAqBA,OAAO,MAAMqB,wBAAwB,GAAI1B,KAA4B,IAAK;EACtE,OAAON,GAAG;AACd,gCAAgCM,KAAK,CAACO,eAAe,uBAAuBP,KAAK,CAACO,eAAe,kBAAkBP,KAAK,CAACO,eAAe;AACxI,iCAAiCP,KAAK,CAACO,eAAe;AACtD;AACA;AACA;AACA,wBAAwBF,WAAW;AACnC;AACA,UAAU;AACV,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"entries.graphql.js","sources":["../src/entries.graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport type {\n CmsContentEntry,\n CmsContentEntryRevision,\n CmsEditorContentModel,\n CmsErrorResponse,\n CmsMetaResponse,\n CmsModel,\n CmsModelField\n} from \"~/types/index.js\";\nimport { createFieldsList } from \"./createFieldsList.js\";\nimport { getModelTitleFieldId } from \"./getModelTitleFieldId.js\";\nimport type { FormValidationOptions } from \"@webiny/form\";\nimport { CMS_MODEL_SINGLETON_TAG } from \"./constants.js\";\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 ${optionalFields}\n live {\n version\n }\n revisionDescription\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${fields ? createFieldsList({ model, fields }) : getModelTitleFieldId(model)}\n }\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 const selection = createListQueryDataSelection(model, fields);\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 ${selection}\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFields}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\n }\n error ${ERROR_FIELD}\n }\n }\n `;\n};\n\nexport interface CmsEntryUpdateRevisionDescriptionMutationResponse {\n content: {\n data?: CmsContentEntry;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CmsEntryUpdateRevisionDescriptionMutationVariables {\n revision: string;\n revisionDescription: string;\n}\n\nexport const createUpdateRevisionDescriptionMutation = (model: CmsEditorContentModel) => {\n return gql`\n mutation CmsUpdate${model.singularApiName}RevisionDescription($revision: ID!, $revisionDescription: String!) {\n content: update${model.singularApiName}RevisionDescription(revision: $revision, revisionDescription: $revisionDescription) {\n data {\n ${createEntrySystemFields(model)}\n values {\n ${createFieldsList({ model, fields: model.fields })}\n }\n }\n error ${ERROR_FIELD}\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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 values {\n ${createFieldsList({ model, fields: model.fields })}\n }\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"],"names":["CONTENT_META_FIELDS","createEntrySystemFields","model","isSingletonModel","CMS_MODEL_SINGLETON_TAG","optionalFields","ERROR_FIELD","createReadQuery","gql","createFieldsList","createReadSingletonQuery","createRevisionsQuery","createListQueryDataSelection","fields","getModelTitleFieldId","createListQuery","deleted","queryName","selection","createDeleteMutation","createRestoreFromBinMutation","createCreateMutation","createFields","createCreateFromMutation","createUpdateMutation","createUpdateSingletonMutation","createUpdateRevisionDescriptionMutation","createPublishMutation","createUnpublishMutation","createBulkActionMutation"],"mappings":";;;;AAeA,MAAMA,sBAAoC,CAAC;;;;;;;AAO3C,CAAC;AAED,MAAMC,0BAA0B,CAACC;IAC7B,MAAMC,mBAAmBD,MAAM,IAAI,CAAC,QAAQ,CAACE;IAE7C,IAAIC,iBAAiB;IACrB,IAAI,CAACF,kBACDE,iBAAiB,CAAC;;;;;gBAKV,EAAEL,oBAAoB;;QAE9B,CAAC;IAGL,OAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2ElB,EAAEK,eAAe;;;;;IAKrB,CAAC;AACL;AAEA,MAAMC,cAA4B,CAAC;;;;;;AAMnC,CAAC;AAkBM,MAAMC,kBAAkB,CAACL,QAIrBM,WAAG,CAAC;2BACY,EAAEN,MAAM,eAAe,CAAC;wBAC3B,EAAEA,MAAM,eAAe,CAAC;;oBAE5B,EAAED,wBAAwBC,OAAO;;wBAE7B,EAAEO,iBAAiB;QAAEP;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} from "../../../Fields/index.js";
2
-
3
- //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- export type { CmsContentEntry, CmsModel, CmsModelField, CmsModelLayoutField, CmsIdentity } from "../../types/index.ts";
1
+ export type { CmsContentEntry, CmsModel, CmsModelField, CmsModelLayoutField, CmsIdentity } from "../../types/index.js";
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=cms.js.map
@@ -1,8 +1,7 @@
1
- export const getModelTitleFieldId = model => {
2
- if (!model.titleFieldId || model.titleFieldId === "id") {
3
- return "";
4
- }
5
- return model.titleFieldId;
1
+ const getModelTitleFieldId = (model)=>{
2
+ if (!model.titleFieldId || "id" === model.titleFieldId) return "";
3
+ return model.titleFieldId;
6
4
  };
5
+ export { getModelTitleFieldId };
7
6
 
8
7
  //# sourceMappingURL=getModelTitleFieldId.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getModelTitleFieldId","model","titleFieldId"],"sources":["getModelTitleFieldId.ts"],"sourcesContent":["import type { CmsEditorContentModel } from \"~/types/index.js\";\n\nexport const getModelTitleFieldId = (model: CmsEditorContentModel): string => {\n if (!model.titleFieldId || model.titleFieldId === \"id\") {\n return \"\";\n }\n return model.titleFieldId;\n};\n"],"mappings":"AAEA,OAAO,MAAMA,oBAAoB,GAAIC,KAA4B,IAAa;EAC1E,IAAI,CAACA,KAAK,CAACC,YAAY,IAAID,KAAK,CAACC,YAAY,KAAK,IAAI,EAAE;IACpD,OAAO,EAAE;EACb;EACA,OAAOD,KAAK,CAACC,YAAY;AAC7B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"getModelTitleFieldId.js","sources":["../src/getModelTitleFieldId.ts"],"sourcesContent":["import type { CmsEditorContentModel } from \"~/types/index.js\";\n\nexport const getModelTitleFieldId = (model: CmsEditorContentModel): string => {\n if (!model.titleFieldId || model.titleFieldId === \"id\") {\n return \"\";\n }\n return model.titleFieldId;\n};\n"],"names":["getModelTitleFieldId","model"],"mappings":"AAEO,MAAMA,uBAAuB,CAACC;IACjC,IAAI,CAACA,MAAM,YAAY,IAAIA,AAAuB,SAAvBA,MAAM,YAAY,EACzC,OAAO;IAEX,OAAOA,MAAM,YAAY;AAC7B"}
package/index.js CHANGED
@@ -8,5 +8,3 @@ export * from "./createValidationContainer.js";
8
8
  export * from "./createValidators.js";
9
9
  export * from "./prepareFormData.js";
10
10
  export * from "./constants.js";
11
-
12
- //# sourceMappingURL=index.js.map
package/normalizeIcon.js CHANGED
@@ -1,10 +1,11 @@
1
- export const normalizeIcon = icon => {
2
- let iconName = undefined;
3
- if (icon) {
4
- const name = typeof icon === "string" ? icon : icon.name;
5
- iconName = name.split("/");
6
- }
7
- return iconName;
1
+ const normalizeIcon = (icon)=>{
2
+ let iconName;
3
+ if (icon) {
4
+ const name = "string" == typeof icon ? icon : icon.name;
5
+ iconName = name.split("/");
6
+ }
7
+ return iconName;
8
8
  };
9
+ export { normalizeIcon };
9
10
 
10
11
  //# sourceMappingURL=normalizeIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["normalizeIcon","icon","iconName","undefined","name","split"],"sources":["normalizeIcon.ts"],"sourcesContent":["import type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport type { CmsIcon } from \"~/types/index.js\";\n\nexport const normalizeIcon = (icon: string | CmsIcon | undefined) => {\n let iconName: IconProp | undefined = undefined;\n if (icon) {\n const name = typeof icon === \"string\" ? icon : icon.name;\n iconName = name.split(\"/\") as IconProp;\n }\n return iconName;\n};\n"],"mappings":"AAGA,OAAO,MAAMA,aAAa,GAAIC,IAAkC,IAAK;EACjE,IAAIC,QAA8B,GAAGC,SAAS;EAC9C,IAAIF,IAAI,EAAE;IACN,MAAMG,IAAI,GAAG,OAAOH,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACG,IAAI;IACxDF,QAAQ,GAAGE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAa;EAC1C;EACA,OAAOH,QAAQ;AACnB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"normalizeIcon.js","sources":["../src/normalizeIcon.ts"],"sourcesContent":["import type { IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport type { CmsIcon } from \"~/types/index.js\";\n\nexport const normalizeIcon = (icon: string | CmsIcon | undefined) => {\n let iconName: IconProp | undefined = undefined;\n if (icon) {\n const name = typeof icon === \"string\" ? icon : icon.name;\n iconName = name.split(\"/\") as IconProp;\n }\n return iconName;\n};\n"],"names":["normalizeIcon","icon","iconName","name"],"mappings":"AAGO,MAAMA,gBAAgB,CAACC;IAC1B,IAAIC;IACJ,IAAID,MAAM;QACN,MAAME,OAAO,AAAgB,YAAhB,OAAOF,OAAoBA,OAAOA,KAAK,IAAI;QACxDC,WAAWC,KAAK,KAAK,CAAC;IAC1B;IACA,OAAOD;AACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms-common",
3
- "version": "6.3.0-beta.4",
3
+ "version": "6.4.0-beta.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -21,24 +21,22 @@
21
21
  "@emotion/styled": "11.14.1",
22
22
  "@fortawesome/fontawesome-svg-core": "7.2.0",
23
23
  "@fortawesome/react-fontawesome": "3.3.1",
24
- "@webiny/admin-ui": "6.3.0-beta.4",
25
- "@webiny/app": "6.3.0-beta.4",
26
- "@webiny/app-admin": "6.3.0-beta.4",
27
- "@webiny/form": "6.3.0-beta.4",
28
- "@webiny/plugins": "6.3.0-beta.4",
29
- "@webiny/react-composition": "6.3.0-beta.4",
30
- "@webiny/validation": "6.3.0-beta.4",
24
+ "@webiny/admin-ui": "6.4.0-beta.0",
25
+ "@webiny/app": "6.4.0-beta.0",
26
+ "@webiny/app-admin": "6.4.0-beta.0",
27
+ "@webiny/form": "6.4.0-beta.0",
28
+ "@webiny/plugins": "6.4.0-beta.0",
29
+ "@webiny/react-composition": "6.4.0-beta.0",
30
+ "@webiny/validation": "6.4.0-beta.0",
31
31
  "dnd-core": "16.0.1",
32
- "graphql": "16.13.2",
32
+ "graphql": "16.14.0",
33
33
  "graphql-tag": "2.12.6",
34
34
  "lodash": "4.18.1",
35
35
  "react": "18.3.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@emotion/babel-plugin": "11.13.5",
39
38
  "@types/react": "18.3.28",
40
- "@webiny/build-tools": "6.3.0-beta.4",
41
- "babel-plugin-module-resolver": "5.0.3",
39
+ "@webiny/build-tools": "6.4.0-beta.0",
42
40
  "rimraf": "6.1.3",
43
41
  "typescript": "6.0.3"
44
42
  },
@@ -46,5 +44,5 @@
46
44
  "access": "public",
47
45
  "directory": "dist"
48
46
  },
49
- "gitHead": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
47
+ "gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
50
48
  }