@webiny/api-headless-cms 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e2758ee1cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants.d.ts +2 -1
- package/constants.js +4 -0
- package/constants.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryData.js +4 -3
- package/crud/contentEntry/entryDataFactories/createEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js +4 -3
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.js +4 -1
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js +4 -1
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js +2 -1
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js +4 -3
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/system.d.ts +10 -0
- package/crud/contentEntry/entryDataFactories/system.js +14 -0
- package/crud/contentEntry/entryDataFactories/system.js.map +1 -0
- package/crud/contentEntry/searchableFields.js +6 -2
- package/crud/contentEntry/searchableFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +9 -9
- package/crud/contentModel/validation.js +3 -3
- package/crud/contentModel/validation.js.map +1 -1
- package/domain/contentModel/errors.d.ts +1 -1
- package/domain/contentModel/errors.js.map +1 -1
- package/domain/contentModel/schemas.d.ts +126 -8
- package/domain/contentModel/schemas.js +12 -13
- package/domain/contentModel/schemas.js.map +1 -1
- package/export/graphql/index.js +1 -1
- package/export/graphql/index.js.map +1 -1
- package/exports/api/cms/model.d.ts +1 -0
- package/exports/api/cms/model.js.map +1 -1
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.d.ts +2 -2
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js +3 -4
- package/features/contentEntry/GetUniqueFieldValues/GetUniqueFieldValuesUseCase.js.map +1 -1
- package/features/contentModel/CreateModel/CreateModelRepository.js +4 -1
- package/features/contentModel/CreateModel/CreateModelRepository.js.map +1 -1
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js +12 -3
- package/features/contentModel/CreateModelFrom/CreateModelFromRepository.js.map +1 -1
- package/features/contentModel/UpdateModel/UpdateModelRepository.js +8 -2
- package/features/contentModel/UpdateModel/UpdateModelRepository.js.map +1 -1
- package/features/contentModel/UpdateModel/UpdateModelUseCase.js +4 -1
- package/features/contentModel/UpdateModel/UpdateModelUseCase.js.map +1 -1
- package/features/modelBuilder/feature.js +6 -0
- package/features/modelBuilder/feature.js.map +1 -1
- package/features/modelBuilder/fields/BaseFieldBuilder.d.ts +36 -0
- package/features/modelBuilder/fields/BaseFieldBuilder.js +41 -0
- package/features/modelBuilder/fields/BaseFieldBuilder.js.map +1 -0
- package/features/modelBuilder/fields/DataFieldBuilder.d.ts +228 -0
- package/features/modelBuilder/fields/DataFieldBuilder.js +219 -0
- package/features/modelBuilder/fields/DataFieldBuilder.js.map +1 -0
- package/features/modelBuilder/fields/DynamicZoneFieldType.d.ts +2 -2
- package/features/modelBuilder/fields/DynamicZoneFieldType.js +10 -3
- package/features/modelBuilder/fields/DynamicZoneFieldType.js.map +1 -1
- package/features/modelBuilder/fields/FieldBuilder.d.ts +5 -50
- package/features/modelBuilder/fields/FieldBuilder.js +3 -165
- package/features/modelBuilder/fields/FieldBuilder.js.map +1 -1
- package/features/modelBuilder/fields/FieldBuilderRegistry.js +11 -1
- package/features/modelBuilder/fields/FieldBuilderRegistry.js.map +1 -1
- package/features/modelBuilder/fields/LayoutFieldBuilder.d.ts +7 -0
- package/features/modelBuilder/fields/LayoutFieldBuilder.js +9 -0
- package/features/modelBuilder/fields/LayoutFieldBuilder.js.map +1 -0
- package/features/modelBuilder/fields/ObjectFieldType.d.ts +4 -3
- package/features/modelBuilder/fields/ObjectFieldType.js +19 -4
- package/features/modelBuilder/fields/ObjectFieldType.js.map +1 -1
- package/features/modelBuilder/fields/UiAlertFieldType.d.ts +19 -0
- package/features/modelBuilder/fields/UiAlertFieldType.js +36 -0
- package/features/modelBuilder/fields/UiAlertFieldType.js.map +1 -0
- package/features/modelBuilder/fields/UiSeparatorFieldType.d.ts +17 -0
- package/features/modelBuilder/fields/UiSeparatorFieldType.js +31 -0
- package/features/modelBuilder/fields/UiSeparatorFieldType.js.map +1 -0
- package/features/modelBuilder/fields/UiTabsFieldType.d.ts +28 -0
- package/features/modelBuilder/fields/UiTabsFieldType.js +75 -0
- package/features/modelBuilder/fields/UiTabsFieldType.js.map +1 -0
- package/features/modelBuilder/fields/abstractions.d.ts +2 -2
- package/features/modelBuilder/fields/abstractions.js.map +1 -1
- package/features/modelBuilder/index.d.ts +3 -0
- package/features/modelBuilder/index.js +3 -0
- package/features/modelBuilder/index.js.map +1 -1
- package/features/modelBuilder/models/BaseModelBuilder.d.ts +9 -4
- package/features/modelBuilder/models/BaseModelBuilder.js +19 -0
- package/features/modelBuilder/models/BaseModelBuilder.js.map +1 -1
- package/features/modelBuilder/models/PrivateModelBuilder.js +4 -2
- package/features/modelBuilder/models/PrivateModelBuilder.js.map +1 -1
- package/features/modelBuilder/models/PublicModelBuilder.js +16 -4
- package/features/modelBuilder/models/PublicModelBuilder.js.map +1 -1
- package/graphql/index.js +2 -1
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseSchema.js +17 -15
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/cms/createEntryResolver.d.ts +10 -0
- package/graphql/schema/cms/createEntryResolver.js +56 -0
- package/graphql/schema/cms/createEntryResolver.js.map +1 -0
- package/graphql/schema/cms/deleteEntryResolver.d.ts +10 -0
- package/graphql/schema/cms/deleteEntryResolver.js +56 -0
- package/graphql/schema/cms/deleteEntryResolver.js.map +1 -0
- package/graphql/schema/cms/getEntryResolver.d.ts +11 -0
- package/graphql/schema/cms/getEntryResolver.js +58 -0
- package/graphql/schema/cms/getEntryResolver.js.map +1 -0
- package/graphql/schema/cms/helpers/buildFieldsSelection.d.ts +23 -0
- package/graphql/schema/cms/helpers/buildFieldsSelection.js +79 -0
- package/graphql/schema/cms/helpers/buildFieldsSelection.js.map +1 -0
- package/graphql/schema/cms/helpers/getErrorMessage.d.ts +4 -0
- package/graphql/schema/cms/helpers/getErrorMessage.js +14 -0
- package/graphql/schema/cms/helpers/getErrorMessage.js.map +1 -0
- package/graphql/schema/cms/helpers/getModel.d.ts +6 -0
- package/graphql/schema/cms/helpers/getModel.js +12 -0
- package/graphql/schema/cms/helpers/getModel.js.map +1 -0
- package/graphql/schema/cms/helpers/index.d.ts +5 -0
- package/graphql/schema/cms/helpers/index.js +7 -0
- package/graphql/schema/cms/helpers/index.js.map +1 -0
- package/graphql/schema/cms/helpers/transformSortToArray.d.ts +18 -0
- package/graphql/schema/cms/helpers/transformSortToArray.js +38 -0
- package/graphql/schema/cms/helpers/transformSortToArray.js.map +1 -0
- package/graphql/schema/cms/helpers/transformWhereToNested.d.ts +17 -0
- package/graphql/schema/cms/helpers/transformWhereToNested.js +54 -0
- package/graphql/schema/cms/helpers/transformWhereToNested.js.map +1 -0
- package/graphql/schema/cms/helpers.d.ts +5 -0
- package/graphql/schema/cms/helpers.js +7 -0
- package/graphql/schema/cms/helpers.js.map +1 -0
- package/graphql/schema/cms/index.d.ts +2 -0
- package/graphql/schema/cms/index.js +26 -0
- package/graphql/schema/cms/index.js.map +1 -0
- package/graphql/schema/cms/listEntriesResolver.d.ts +14 -0
- package/graphql/schema/cms/listEntriesResolver.js +97 -0
- package/graphql/schema/cms/listEntriesResolver.js.map +1 -0
- package/graphql/schema/cms/publishEntryResolver.d.ts +10 -0
- package/graphql/schema/cms/publishEntryResolver.js +56 -0
- package/graphql/schema/cms/publishEntryResolver.js.map +1 -0
- package/graphql/schema/cms/resolvers/createEntry.d.ts +8 -0
- package/graphql/schema/cms/resolvers/createEntry.js +17 -0
- package/graphql/schema/cms/resolvers/createEntry.js.map +1 -0
- package/graphql/schema/cms/resolvers/deleteEntryRevision.d.ts +8 -0
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js +17 -0
- package/graphql/schema/cms/resolvers/deleteEntryRevision.js.map +1 -0
- package/graphql/schema/cms/resolvers/getEntry.d.ts +8 -0
- package/graphql/schema/cms/resolvers/getEntry.js +17 -0
- package/graphql/schema/cms/resolvers/getEntry.js.map +1 -0
- package/graphql/schema/cms/resolvers/index.d.ts +9 -0
- package/graphql/schema/cms/resolvers/index.js +11 -0
- package/graphql/schema/cms/resolvers/index.js.map +1 -0
- package/graphql/schema/cms/resolvers/listEntries.d.ts +8 -0
- package/graphql/schema/cms/resolvers/listEntries.js +17 -0
- package/graphql/schema/cms/resolvers/listEntries.js.map +1 -0
- package/graphql/schema/cms/resolvers/mutationCms.d.ts +8 -0
- package/graphql/schema/cms/resolvers/mutationCms.js +24 -0
- package/graphql/schema/cms/resolvers/mutationCms.js.map +1 -0
- package/graphql/schema/cms/resolvers/publishEntryRevision.d.ts +8 -0
- package/graphql/schema/cms/resolvers/publishEntryRevision.js +17 -0
- package/graphql/schema/cms/resolvers/publishEntryRevision.js.map +1 -0
- package/graphql/schema/cms/resolvers/queryCms.d.ts +8 -0
- package/graphql/schema/cms/resolvers/queryCms.js +23 -0
- package/graphql/schema/cms/resolvers/queryCms.js.map +1 -0
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.d.ts +8 -0
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js +17 -0
- package/graphql/schema/cms/resolvers/unpublishEntryRevision.js.map +1 -0
- package/graphql/schema/cms/resolvers/updateEntryRevision.d.ts +8 -0
- package/graphql/schema/cms/resolvers/updateEntryRevision.js +17 -0
- package/graphql/schema/cms/resolvers/updateEntryRevision.js.map +1 -0
- package/graphql/schema/cms/typeDefs/index.d.ts +3 -0
- package/graphql/schema/cms/typeDefs/index.js +5 -0
- package/graphql/schema/cms/typeDefs/index.js.map +1 -0
- package/graphql/schema/cms/typeDefs/mutation.d.ts +8 -0
- package/graphql/schema/cms/typeDefs/mutation.js +42 -0
- package/graphql/schema/cms/typeDefs/mutation.js.map +1 -0
- package/graphql/schema/cms/typeDefs/query.d.ts +8 -0
- package/graphql/schema/cms/typeDefs/query.js +35 -0
- package/graphql/schema/cms/typeDefs/query.js.map +1 -0
- package/graphql/schema/cms/typeDefs/responses.d.ts +8 -0
- package/graphql/schema/cms/typeDefs/responses.js +35 -0
- package/graphql/schema/cms/typeDefs/responses.js.map +1 -0
- package/graphql/schema/cms/unpublishEntryResolver.d.ts +10 -0
- package/graphql/schema/cms/unpublishEntryResolver.js +56 -0
- package/graphql/schema/cms/unpublishEntryResolver.js.map +1 -0
- package/graphql/schema/cms/updateEntryResolver.d.ts +11 -0
- package/graphql/schema/cms/updateEntryResolver.js +58 -0
- package/graphql/schema/cms/updateEntryResolver.js.map +1 -0
- package/graphql/schema/contentModels.js +21 -3
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createManageSDL.js +4 -2
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphqlFields/index.js.map +1 -1
- package/package.json +24 -23
- package/plugins/CmsModelPlugin.js +19 -4
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/types/fields/objectField.d.ts +2 -0
- package/types/fields/objectField.js.map +1 -1
- package/types/model.d.ts +32 -3
- package/types/model.js.map +1 -1
- package/types/modelField.d.ts +19 -3
- package/types/modelField.js.map +1 -1
- package/types/types.d.ts +12 -9
- package/types/types.js.map +1 -1
- package/utils/createModelField.js +4 -2
- package/utils/createModelField.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/state.d.ts +0 -10
- package/crud/contentEntry/entryDataFactories/state.js +0 -16
- package/crud/contentEntry/entryDataFactories/state.js.map +0 -1
- package/crud/contentModel/validateModel.d.ts +0 -9
- package/crud/contentModel/validateModel.js +0 -21
- package/crud/contentModel/validateModel.js.map +0 -1
- package/crud/contentModel/validateModelFields.d.ts +0 -9
- package/crud/contentModel/validateModelFields.js +0 -267
- package/crud/contentModel/validateModelFields.js.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { getModel, getErrorMessage, buildFieldsSelection, transformSortToArray, transformWhereToNested } from "./helpers.js";
|
|
2
|
+
export const createListEntriesResolver = () => {
|
|
3
|
+
return async ({
|
|
4
|
+
args,
|
|
5
|
+
context
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
modelId,
|
|
9
|
+
where,
|
|
10
|
+
sort,
|
|
11
|
+
limit,
|
|
12
|
+
after,
|
|
13
|
+
fields,
|
|
14
|
+
preview = false
|
|
15
|
+
} = args;
|
|
16
|
+
try {
|
|
17
|
+
const model = await getModel(context, modelId);
|
|
18
|
+
|
|
19
|
+
// Determine which API to use based on the preview flag.
|
|
20
|
+
// preview=true -> preview API, preview=false -> read API
|
|
21
|
+
const apiType = preview ? "preview" : "read";
|
|
22
|
+
const executeSchema = await context.cms.getExecutableSchema(apiType);
|
|
23
|
+
const fieldsSelection = buildFieldsSelection(fields);
|
|
24
|
+
|
|
25
|
+
// Transform sort to array format expected by the underlying GraphQL schema.
|
|
26
|
+
// Handles both object format {createdOn: "desc"} and array format ["createdOn_DESC"].
|
|
27
|
+
const transformedSort = transformSortToArray(sort);
|
|
28
|
+
|
|
29
|
+
// Transform dot-notation where keys (e.g. "values.name") into nested objects
|
|
30
|
+
// (e.g. { values: { name: ... } }) so they match the typed ListWhereInput.
|
|
31
|
+
const transformedWhere = transformWhereToNested(where);
|
|
32
|
+
const query = /* GraphQL */`
|
|
33
|
+
query List${model.pluralApiName}(
|
|
34
|
+
$where: ${model.singularApiName}ListWhereInput
|
|
35
|
+
$sort: [${model.singularApiName}ListSorter!]
|
|
36
|
+
$limit: Int
|
|
37
|
+
$after: String
|
|
38
|
+
) {
|
|
39
|
+
list${model.pluralApiName}(
|
|
40
|
+
where: $where
|
|
41
|
+
sort: $sort
|
|
42
|
+
limit: $limit
|
|
43
|
+
after: $after
|
|
44
|
+
) {
|
|
45
|
+
data {
|
|
46
|
+
${fieldsSelection}
|
|
47
|
+
}
|
|
48
|
+
meta {
|
|
49
|
+
cursor
|
|
50
|
+
hasMoreItems
|
|
51
|
+
totalCount
|
|
52
|
+
}
|
|
53
|
+
error {
|
|
54
|
+
message
|
|
55
|
+
code
|
|
56
|
+
data
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
const result = await executeSchema({
|
|
62
|
+
query,
|
|
63
|
+
variables: {
|
|
64
|
+
where: transformedWhere,
|
|
65
|
+
sort: transformedSort,
|
|
66
|
+
limit,
|
|
67
|
+
after
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const operationName = `list${model.pluralApiName}`;
|
|
71
|
+
return result.data?.[operationName] || {
|
|
72
|
+
data: [],
|
|
73
|
+
meta: {
|
|
74
|
+
cursor: null,
|
|
75
|
+
hasMoreItems: false,
|
|
76
|
+
totalCount: 0
|
|
77
|
+
},
|
|
78
|
+
error: null
|
|
79
|
+
};
|
|
80
|
+
} catch (error) {
|
|
81
|
+
return {
|
|
82
|
+
data: [],
|
|
83
|
+
meta: {
|
|
84
|
+
cursor: null,
|
|
85
|
+
hasMoreItems: false,
|
|
86
|
+
totalCount: 0
|
|
87
|
+
},
|
|
88
|
+
error: {
|
|
89
|
+
message: getErrorMessage(error, "Failed to list entries"),
|
|
90
|
+
code: "LIST_ENTRIES_ERROR"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=listEntriesResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getModel","getErrorMessage","buildFieldsSelection","transformSortToArray","transformWhereToNested","createListEntriesResolver","args","context","modelId","where","sort","limit","after","fields","preview","model","apiType","executeSchema","cms","getExecutableSchema","fieldsSelection","transformedSort","transformedWhere","query","pluralApiName","singularApiName","result","variables","operationName","data","meta","cursor","hasMoreItems","totalCount","error","message","code"],"sources":["listEntriesResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport {\n getModel,\n getErrorMessage,\n buildFieldsSelection,\n transformSortToArray,\n transformWhereToNested\n} from \"./helpers.js\";\n\nexport interface ListEntriesArgs {\n modelId: string;\n where?: Record<string, unknown>;\n sort?: Record<string, unknown> | string[];\n limit?: number;\n after?: string;\n fields: string[];\n preview?: boolean;\n}\n\nexport const createListEntriesResolver = () => {\n return async ({ args, context }: { args: ListEntriesArgs; context: CmsContext }) => {\n const { modelId, where, sort, limit, after, fields, preview = false } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Determine which API to use based on the preview flag.\n // preview=true -> preview API, preview=false -> read API\n const apiType: ApiEndpoint = preview ? \"preview\" : \"read\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n // Transform sort to array format expected by the underlying GraphQL schema.\n // Handles both object format {createdOn: \"desc\"} and array format [\"createdOn_DESC\"].\n const transformedSort = transformSortToArray(sort);\n\n // Transform dot-notation where keys (e.g. \"values.name\") into nested objects\n // (e.g. { values: { name: ... } }) so they match the typed ListWhereInput.\n const transformedWhere = transformWhereToNested(where);\n\n const query = /* GraphQL */ `\n query List${model.pluralApiName}(\n $where: ${model.singularApiName}ListWhereInput\n $sort: [${model.singularApiName}ListSorter!]\n $limit: Int\n $after: String\n ) {\n list${model.pluralApiName}(\n where: $where\n sort: $sort\n limit: $limit\n after: $after\n ) {\n data {\n ${fieldsSelection}\n }\n meta {\n cursor\n hasMoreItems\n totalCount\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: { where: transformedWhere, sort: transformedSort, limit, after }\n })) as ExecutionResult;\n\n const operationName = `list${model.pluralApiName}`;\n return (\n result.data?.[operationName] || {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: null\n }\n );\n } catch (error) {\n return {\n data: [],\n meta: { cursor: null, hasMoreItems: false, totalCount: 0 },\n error: {\n message: getErrorMessage(error, \"Failed to list entries\"),\n code: \"LIST_ENTRIES_ERROR\"\n }\n };\n }\n };\n};\n"],"mappings":"AAGA,SACIA,QAAQ,EACRC,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,sBAAsB;AAa1B,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,OAAO;IAAEC,IAAI;IAAEC;EAAwD,CAAC,KAAK;IAChF,MAAM;MAAEC,OAAO;MAAEC,KAAK;MAAEC,IAAI;MAAEC,KAAK;MAAEC,KAAK;MAAEC,MAAM;MAAEC,OAAO,GAAG;IAAM,CAAC,GAAGR,IAAI;IAE5E,IAAI;MACA,MAAMS,KAAK,GAAG,MAAMf,QAAQ,CAACO,OAAO,EAAEC,OAAO,CAAC;;MAE9C;MACA;MACA,MAAMQ,OAAoB,GAAGF,OAAO,GAAG,SAAS,GAAG,MAAM;MACzD,MAAMG,aAAa,GAAG,MAAMV,OAAO,CAACW,GAAG,CAACC,mBAAmB,CAACH,OAAO,CAAC;MAEpE,MAAMI,eAAe,GAAGlB,oBAAoB,CAACW,MAAM,CAAC;;MAEpD;MACA;MACA,MAAMQ,eAAe,GAAGlB,oBAAoB,CAACO,IAAI,CAAC;;MAElD;MACA;MACA,MAAMY,gBAAgB,GAAGlB,sBAAsB,CAACK,KAAK,CAAC;MAEtD,MAAMc,KAAK,GAAG,aAAc;AACxC,4BAA4BR,KAAK,CAACS,aAAa;AAC/C,8BAA8BT,KAAK,CAACU,eAAe;AACnD,8BAA8BV,KAAK,CAACU,eAAe;AACnD;AACA;AACA;AACA,0BAA0BV,KAAK,CAACS,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8BJ,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;MAED,MAAMM,MAAM,GAAI,MAAMT,aAAa,CAAC;QAChCM,KAAK;QACLI,SAAS,EAAE;UAAElB,KAAK,EAAEa,gBAAgB;UAAEZ,IAAI,EAAEW,eAAe;UAAEV,KAAK;UAAEC;QAAM;MAC9E,CAAC,CAAqB;MAEtB,MAAMgB,aAAa,GAAG,OAAOb,KAAK,CAACS,aAAa,EAAE;MAClD,OACIE,MAAM,CAACG,IAAI,GAAGD,aAAa,CAAC,IAAI;QAC5BC,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;UAAEC,MAAM,EAAE,IAAI;UAAEC,YAAY,EAAE,KAAK;UAAEC,UAAU,EAAE;QAAE,CAAC;QAC1DC,KAAK,EAAE;MACX,CAAC;IAET,CAAC,CAAC,OAAOA,KAAK,EAAE;MACZ,OAAO;QACHL,IAAI,EAAE,EAAE;QACRC,IAAI,EAAE;UAAEC,MAAM,EAAE,IAAI;UAAEC,YAAY,EAAE,KAAK;UAAEC,UAAU,EAAE;QAAE,CAAC;QAC1DC,KAAK,EAAE;UACHC,OAAO,EAAElC,eAAe,CAACiC,KAAK,EAAE,wBAAwB,CAAC;UACzDE,IAAI,EAAE;QACV;MACJ,CAAC;IACL;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CmsContext } from "../../../types/index.js";
|
|
2
|
+
export interface PublishEntryRevisionArgs {
|
|
3
|
+
modelId: string;
|
|
4
|
+
revisionId: string;
|
|
5
|
+
fields: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const createPublishEntryRevisionResolver: () => ({ args, context }: {
|
|
8
|
+
args: PublishEntryRevisionArgs;
|
|
9
|
+
context: CmsContext;
|
|
10
|
+
}) => Promise<{}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getModel, getErrorMessage, buildFieldsSelection } from "./helpers.js";
|
|
2
|
+
export const createPublishEntryRevisionResolver = () => {
|
|
3
|
+
return async ({
|
|
4
|
+
args,
|
|
5
|
+
context
|
|
6
|
+
}) => {
|
|
7
|
+
const {
|
|
8
|
+
modelId,
|
|
9
|
+
revisionId,
|
|
10
|
+
fields
|
|
11
|
+
} = args;
|
|
12
|
+
try {
|
|
13
|
+
const model = await getModel(context, modelId);
|
|
14
|
+
|
|
15
|
+
// Use manage API for publishing entries.
|
|
16
|
+
const apiType = "manage";
|
|
17
|
+
const executeSchema = await context.cms.getExecutableSchema(apiType);
|
|
18
|
+
const fieldsSelection = buildFieldsSelection(fields);
|
|
19
|
+
const query = /* GraphQL */`
|
|
20
|
+
mutation Publish${model.singularApiName}($revisionId: ID!) {
|
|
21
|
+
publish${model.singularApiName}(revision: $revisionId) {
|
|
22
|
+
data {
|
|
23
|
+
${fieldsSelection}
|
|
24
|
+
}
|
|
25
|
+
error {
|
|
26
|
+
message
|
|
27
|
+
code
|
|
28
|
+
data
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
const result = await executeSchema({
|
|
34
|
+
query,
|
|
35
|
+
variables: {
|
|
36
|
+
revisionId
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const operationName = `publish${model.singularApiName}`;
|
|
40
|
+
return result.data?.[operationName] || {
|
|
41
|
+
data: null,
|
|
42
|
+
error: null
|
|
43
|
+
};
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
data: null,
|
|
47
|
+
error: {
|
|
48
|
+
message: getErrorMessage(error, "Failed to publish entry"),
|
|
49
|
+
code: "PUBLISH_ENTRY_ERROR"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=publishEntryResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getModel","getErrorMessage","buildFieldsSelection","createPublishEntryRevisionResolver","args","context","modelId","revisionId","fields","model","apiType","executeSchema","cms","getExecutableSchema","fieldsSelection","query","singularApiName","result","variables","operationName","data","error","message","code"],"sources":["publishEntryResolver.ts"],"sourcesContent":["import type { CmsContext } from \"~/types/index.js\";\nimport type { ApiEndpoint } from \"~/types/index.js\";\nimport type { ExecutionResult } from \"graphql\";\nimport { getModel, getErrorMessage, buildFieldsSelection } from \"./helpers.js\";\n\nexport interface PublishEntryRevisionArgs {\n modelId: string;\n revisionId: string;\n fields: string[];\n}\n\nexport const createPublishEntryRevisionResolver = () => {\n return async ({ args, context }: { args: PublishEntryRevisionArgs; context: CmsContext }) => {\n const { modelId, revisionId, fields } = args;\n\n try {\n const model = await getModel(context, modelId);\n\n // Use manage API for publishing entries.\n const apiType: ApiEndpoint = \"manage\";\n const executeSchema = await context.cms.getExecutableSchema(apiType);\n\n const fieldsSelection = buildFieldsSelection(fields);\n\n const query = /* GraphQL */ `\n mutation Publish${model.singularApiName}($revisionId: ID!) {\n publish${model.singularApiName}(revision: $revisionId) {\n data {\n ${fieldsSelection}\n }\n error {\n message\n code\n data\n }\n }\n }\n `;\n\n const result = (await executeSchema({\n query,\n variables: { revisionId }\n })) as ExecutionResult;\n\n const operationName = `publish${model.singularApiName}`;\n return result.data?.[operationName] || { data: null, error: null };\n } catch (error) {\n return {\n data: null,\n error: {\n message: getErrorMessage(error, \"Failed to publish entry\"),\n code: \"PUBLISH_ENTRY_ERROR\"\n }\n };\n }\n };\n};\n"],"mappings":"AAGA,SAASA,QAAQ,EAAEC,eAAe,EAAEC,oBAAoB;AAQxD,OAAO,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;EACpD,OAAO,OAAO;IAAEC,IAAI;IAAEC;EAAiE,CAAC,KAAK;IACzF,MAAM;MAAEC,OAAO;MAAEC,UAAU;MAAEC;IAAO,CAAC,GAAGJ,IAAI;IAE5C,IAAI;MACA,MAAMK,KAAK,GAAG,MAAMT,QAAQ,CAACK,OAAO,EAAEC,OAAO,CAAC;;MAE9C;MACA,MAAMI,OAAoB,GAAG,QAAQ;MACrC,MAAMC,aAAa,GAAG,MAAMN,OAAO,CAACO,GAAG,CAACC,mBAAmB,CAACH,OAAO,CAAC;MAEpE,MAAMI,eAAe,GAAGZ,oBAAoB,CAACM,MAAM,CAAC;MAEpD,MAAMO,KAAK,GAAG,aAAc;AACxC,kCAAkCN,KAAK,CAACO,eAAe;AACvD,6BAA6BP,KAAK,CAACO,eAAe;AAClD;AACA,8BAA8BF,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;MAED,MAAMG,MAAM,GAAI,MAAMN,aAAa,CAAC;QAChCI,KAAK;QACLG,SAAS,EAAE;UAAEX;QAAW;MAC5B,CAAC,CAAqB;MAEtB,MAAMY,aAAa,GAAG,UAAUV,KAAK,CAACO,eAAe,EAAE;MACvD,OAAOC,MAAM,CAACG,IAAI,GAAGD,aAAa,CAAC,IAAI;QAAEC,IAAI,EAAE,IAAI;QAAEC,KAAK,EAAE;MAAK,CAAC;IACtE,CAAC,CAAC,OAAOA,KAAK,EAAE;MACZ,OAAO;QACHD,IAAI,EAAE,IAAI;QACVC,KAAK,EAAE;UACHC,OAAO,EAAErB,eAAe,CAACoB,KAAK,EAAE,yBAAyB,CAAC;UAC1DE,IAAI,EAAE;QACV;MACJ,CAAC;IACL;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class CreateEntryResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const CreateEntryResolverImpl: typeof CreateEntryResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createCreateEntryResolver } from "../createEntryResolver.js";
|
|
3
|
+
class CreateEntryResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsMutation.createEntry",
|
|
7
|
+
resolver: createCreateEntryResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const CreateEntryResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: CreateEntryResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=createEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createCreateEntryResolver","CreateEntryResolver","execute","builder","addResolver","path","resolver","CreateEntryResolverImpl","createImplementation","implementation","dependencies"],"sources":["createEntry.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createCreateEntryResolver } from \"../createEntryResolver.js\";\n\nclass CreateEntryResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsMutation.createEntry\",\n resolver: createCreateEntryResolver\n });\n\n return builder;\n }\n}\n\nexport const CreateEntryResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: CreateEntryResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,yBAAyB;AAElC,MAAMC,mBAAmB,CAA+C;EACpE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,yBAAyB;MAC/BC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,uBAAuB,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EACjFC,cAAc,EAAER,mBAAmB;EACnCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class DeleteEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const DeleteEntryRevisionResolverImpl: typeof DeleteEntryRevisionResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createDeleteEntryRevisionResolver } from "../deleteEntryResolver.js";
|
|
3
|
+
class DeleteEntryRevisionResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsMutation.deleteEntryRevision",
|
|
7
|
+
resolver: createDeleteEntryRevisionResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const DeleteEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: DeleteEntryRevisionResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=deleteEntryRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createDeleteEntryRevisionResolver","DeleteEntryRevisionResolver","execute","builder","addResolver","path","resolver","DeleteEntryRevisionResolverImpl","createImplementation","implementation","dependencies"],"sources":["deleteEntryRevision.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createDeleteEntryRevisionResolver } from \"../deleteEntryResolver.js\";\n\nclass DeleteEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsMutation.deleteEntryRevision\",\n resolver: createDeleteEntryRevisionResolver\n });\n\n return builder;\n }\n}\n\nexport const DeleteEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: DeleteEntryRevisionResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,iCAAiC;AAE1C,MAAMC,2BAA2B,CAA+C;EAC5E,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,iCAAiC;MACvCC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,+BAA+B,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EACzFC,cAAc,EAAER,2BAA2B;EAC3CS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class GetEntryResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const GetEntryResolverImpl: typeof GetEntryResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createGetEntryResolver } from "../getEntryResolver.js";
|
|
3
|
+
class GetEntryResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsQuery.getEntry",
|
|
7
|
+
resolver: createGetEntryResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const GetEntryResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: GetEntryResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=getEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createGetEntryResolver","GetEntryResolver","execute","builder","addResolver","path","resolver","GetEntryResolverImpl","createImplementation","implementation","dependencies"],"sources":["getEntry.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createGetEntryResolver } from \"../getEntryResolver.js\";\n\nclass GetEntryResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsQuery.getEntry\",\n resolver: createGetEntryResolver\n });\n\n return builder;\n }\n}\n\nexport const GetEntryResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: GetEntryResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,sBAAsB;AAE/B,MAAMC,gBAAgB,CAA+C;EACjE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,mBAAmB;MACzBC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,oBAAoB,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EAC9EC,cAAc,EAAER,gBAAgB;EAChCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { QueryCmsResolverImpl } from "./queryCms.js";
|
|
2
|
+
export { MutationCmsResolverImpl } from "./mutationCms.js";
|
|
3
|
+
export { GetEntryResolverImpl } from "./getEntry.js";
|
|
4
|
+
export { ListEntriesResolverImpl } from "./listEntries.js";
|
|
5
|
+
export { CreateEntryResolverImpl } from "./createEntry.js";
|
|
6
|
+
export { UpdateEntryRevisionResolverImpl } from "./updateEntryRevision.js";
|
|
7
|
+
export { DeleteEntryRevisionResolverImpl } from "./deleteEntryRevision.js";
|
|
8
|
+
export { PublishEntryRevisionResolverImpl } from "./publishEntryRevision.js";
|
|
9
|
+
export { UnpublishEntryRevisionResolverImpl } from "./unpublishEntryRevision.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { QueryCmsResolverImpl } from "./queryCms.js";
|
|
2
|
+
export { MutationCmsResolverImpl } from "./mutationCms.js";
|
|
3
|
+
export { GetEntryResolverImpl } from "./getEntry.js";
|
|
4
|
+
export { ListEntriesResolverImpl } from "./listEntries.js";
|
|
5
|
+
export { CreateEntryResolverImpl } from "./createEntry.js";
|
|
6
|
+
export { UpdateEntryRevisionResolverImpl } from "./updateEntryRevision.js";
|
|
7
|
+
export { DeleteEntryRevisionResolverImpl } from "./deleteEntryRevision.js";
|
|
8
|
+
export { PublishEntryRevisionResolverImpl } from "./publishEntryRevision.js";
|
|
9
|
+
export { UnpublishEntryRevisionResolverImpl } from "./unpublishEntryRevision.js";
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["QueryCmsResolverImpl","MutationCmsResolverImpl","GetEntryResolverImpl","ListEntriesResolverImpl","CreateEntryResolverImpl","UpdateEntryRevisionResolverImpl","DeleteEntryRevisionResolverImpl","PublishEntryRevisionResolverImpl","UnpublishEntryRevisionResolverImpl"],"sources":["index.ts"],"sourcesContent":["export { QueryCmsResolverImpl } from \"./queryCms.js\";\nexport { MutationCmsResolverImpl } from \"./mutationCms.js\";\nexport { GetEntryResolverImpl } from \"./getEntry.js\";\nexport { ListEntriesResolverImpl } from \"./listEntries.js\";\nexport { CreateEntryResolverImpl } from \"./createEntry.js\";\nexport { UpdateEntryRevisionResolverImpl } from \"./updateEntryRevision.js\";\nexport { DeleteEntryRevisionResolverImpl } from \"./deleteEntryRevision.js\";\nexport { PublishEntryRevisionResolverImpl } from \"./publishEntryRevision.js\";\nexport { UnpublishEntryRevisionResolverImpl } from \"./unpublishEntryRevision.js\";\n"],"mappings":"AAAA,SAASA,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB;AAChC,SAASC,uBAAuB;AAChC,SAASC,+BAA+B;AACxC,SAASC,+BAA+B;AACxC,SAASC,gCAAgC;AACzC,SAASC,kCAAkC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class ListEntriesResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const ListEntriesResolverImpl: typeof ListEntriesResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createListEntriesResolver } from "../listEntriesResolver.js";
|
|
3
|
+
class ListEntriesResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsQuery.listEntries",
|
|
7
|
+
resolver: createListEntriesResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const ListEntriesResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: ListEntriesResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=listEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createListEntriesResolver","ListEntriesResolver","execute","builder","addResolver","path","resolver","ListEntriesResolverImpl","createImplementation","implementation","dependencies"],"sources":["listEntries.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createListEntriesResolver } from \"../listEntriesResolver.js\";\n\nclass ListEntriesResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsQuery.listEntries\",\n resolver: createListEntriesResolver\n });\n\n return builder;\n }\n}\n\nexport const ListEntriesResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: ListEntriesResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,yBAAyB;AAElC,MAAMC,mBAAmB,CAA+C;EACpE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,sBAAsB;MAC5BC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,uBAAuB,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EACjFC,cAAc,EAAER,mBAAmB;EACnCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class MutationCmsResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const MutationCmsResolverImpl: typeof MutationCmsResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
class MutationCmsResolver {
|
|
3
|
+
async execute(builder) {
|
|
4
|
+
builder.addResolver({
|
|
5
|
+
path: "Mutation.cms",
|
|
6
|
+
resolver() {
|
|
7
|
+
/**
|
|
8
|
+
* Returns an empty object to serve as the namespace for CMS mutations.
|
|
9
|
+
* Individual mutation fields (createEntry, updateEntry, etc.) are resolved
|
|
10
|
+
* by their own dedicated resolvers registered under the CmsMutation type.
|
|
11
|
+
* This pattern provides a clean GraphQL API structure: mutation { cms { createEntry(...) } }
|
|
12
|
+
*/
|
|
13
|
+
return () => ({});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return builder;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const MutationCmsResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
20
|
+
implementation: MutationCmsResolver,
|
|
21
|
+
dependencies: []
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=mutationCms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","MutationCmsResolver","execute","builder","addResolver","path","resolver","MutationCmsResolverImpl","createImplementation","implementation","dependencies"],"sources":["mutationCms.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\n\nclass MutationCmsResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"Mutation.cms\",\n resolver() {\n /**\n * Returns an empty object to serve as the namespace for CMS mutations.\n * Individual mutation fields (createEntry, updateEntry, etc.) are resolved\n * by their own dedicated resolvers registered under the CmsMutation type.\n * This pattern provides a clean GraphQL API structure: mutation { cms { createEntry(...) } }\n */\n return () => ({});\n }\n });\n\n return builder;\n }\n}\n\nexport const MutationCmsResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: MutationCmsResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAE/F,MAAMC,mBAAmB,CAA+C;EACpE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,cAAc;MACpBC,QAAQA,CAAA,EAAG;QACP;AAChB;AACA;AACA;AACA;AACA;QACgB,OAAO,OAAO,CAAC,CAAC,CAAC;MACrB;IACJ,CAAC,CAAC;IAEF,OAAOH,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,uBAAuB,GAAGP,wBAAwB,CAACQ,oBAAoB,CAAC;EACjFC,cAAc,EAAER,mBAAmB;EACnCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class PublishEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const PublishEntryRevisionResolverImpl: typeof PublishEntryRevisionResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createPublishEntryRevisionResolver } from "../publishEntryResolver.js";
|
|
3
|
+
class PublishEntryRevisionResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsMutation.publishEntryRevision",
|
|
7
|
+
resolver: createPublishEntryRevisionResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const PublishEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: PublishEntryRevisionResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=publishEntryRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createPublishEntryRevisionResolver","PublishEntryRevisionResolver","execute","builder","addResolver","path","resolver","PublishEntryRevisionResolverImpl","createImplementation","implementation","dependencies"],"sources":["publishEntryRevision.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createPublishEntryRevisionResolver } from \"../publishEntryResolver.js\";\n\nclass PublishEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsMutation.publishEntryRevision\",\n resolver: createPublishEntryRevisionResolver\n });\n\n return builder;\n }\n}\n\nexport const PublishEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: PublishEntryRevisionResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,kCAAkC;AAE3C,MAAMC,4BAA4B,CAA+C;EAC7E,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,kCAAkC;MACxCC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,gCAAgC,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EAC1FC,cAAc,EAAER,4BAA4B;EAC5CS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class QueryCmsResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const QueryCmsResolverImpl: typeof QueryCmsResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
class QueryCmsResolver {
|
|
3
|
+
async execute(builder) {
|
|
4
|
+
builder.addResolver({
|
|
5
|
+
path: "Query.cms",
|
|
6
|
+
resolver() {
|
|
7
|
+
/**
|
|
8
|
+
* Returns an empty object that serves as a namespace for CMS queries.
|
|
9
|
+
* Actual query operations (getEntry, getEntryById, listEntries, etc.) are resolved
|
|
10
|
+
* by dedicated resolvers registered under the CmsQuery type.
|
|
11
|
+
*/
|
|
12
|
+
return () => ({});
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return builder;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export const QueryCmsResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
19
|
+
implementation: QueryCmsResolver,
|
|
20
|
+
dependencies: []
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=queryCms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","QueryCmsResolver","execute","builder","addResolver","path","resolver","QueryCmsResolverImpl","createImplementation","implementation","dependencies"],"sources":["queryCms.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\n\nclass QueryCmsResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"Query.cms\",\n resolver() {\n /**\n * Returns an empty object that serves as a namespace for CMS queries.\n * Actual query operations (getEntry, getEntryById, listEntries, etc.) are resolved\n * by dedicated resolvers registered under the CmsQuery type.\n */\n return () => ({});\n }\n });\n\n return builder;\n }\n}\n\nexport const QueryCmsResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: QueryCmsResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAE/F,MAAMC,gBAAgB,CAA+C;EACjE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,WAAW;MACjBC,QAAQA,CAAA,EAAG;QACP;AAChB;AACA;AACA;AACA;QACgB,OAAO,OAAO,CAAC,CAAC,CAAC;MACrB;IACJ,CAAC,CAAC;IAEF,OAAOH,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,oBAAoB,GAAGP,wBAAwB,CAACQ,oBAAoB,CAAC;EAC9EC,cAAc,EAAER,gBAAgB;EAChCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class UnpublishEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const UnpublishEntryRevisionResolverImpl: typeof UnpublishEntryRevisionResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createUnpublishEntryRevisionResolver } from "../unpublishEntryResolver.js";
|
|
3
|
+
class UnpublishEntryRevisionResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsMutation.unpublishEntryRevision",
|
|
7
|
+
resolver: createUnpublishEntryRevisionResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const UnpublishEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: UnpublishEntryRevisionResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=unpublishEntryRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createUnpublishEntryRevisionResolver","UnpublishEntryRevisionResolver","execute","builder","addResolver","path","resolver","UnpublishEntryRevisionResolverImpl","createImplementation","implementation","dependencies"],"sources":["unpublishEntryRevision.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createUnpublishEntryRevisionResolver } from \"../unpublishEntryResolver.js\";\n\nclass UnpublishEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsMutation.unpublishEntryRevision\",\n resolver: createUnpublishEntryRevisionResolver\n });\n\n return builder;\n }\n}\n\nexport const UnpublishEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: UnpublishEntryRevisionResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,oCAAoC;AAE7C,MAAMC,8BAA8B,CAA+C;EAC/E,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,oCAAoC;MAC1CC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,kCAAkC,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EAC5FC,cAAc,EAAER,8BAA8B;EAC9CS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class UpdateEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const UpdateEntryRevisionResolverImpl: typeof UpdateEntryRevisionResolver & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public.js").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
import { createUpdateEntryRevisionResolver } from "../updateEntryResolver.js";
|
|
3
|
+
class UpdateEntryRevisionResolver {
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
builder.addResolver({
|
|
6
|
+
path: "CmsMutation.updateEntryRevision",
|
|
7
|
+
resolver: createUpdateEntryRevisionResolver
|
|
8
|
+
});
|
|
9
|
+
return builder;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const UpdateEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
13
|
+
implementation: UpdateEntryRevisionResolver,
|
|
14
|
+
dependencies: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=updateEntryRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","createUpdateEntryRevisionResolver","UpdateEntryRevisionResolver","execute","builder","addResolver","path","resolver","UpdateEntryRevisionResolverImpl","createImplementation","implementation","dependencies"],"sources":["updateEntryRevision.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\nimport { createUpdateEntryRevisionResolver } from \"../updateEntryResolver.js\";\n\nclass UpdateEntryRevisionResolver implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addResolver({\n path: \"CmsMutation.updateEntryRevision\",\n resolver: createUpdateEntryRevisionResolver\n });\n\n return builder;\n }\n}\n\nexport const UpdateEntryRevisionResolverImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: UpdateEntryRevisionResolver,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAC/F,SAASC,iCAAiC;AAE1C,MAAMC,2BAA2B,CAA+C;EAC5E,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC;MAChBC,IAAI,EAAE,iCAAiC;MACvCC,QAAQ,EAAEN;IACd,CAAC,CAAC;IAEF,OAAOG,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMI,+BAA+B,GAAGR,wBAAwB,CAACS,oBAAoB,CAAC;EACzFC,cAAc,EAAER,2BAA2B;EAC3CS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsResponseTypeDefsImpl","CmsQueryTypeDefsImpl","CmsMutationTypeDefsImpl"],"sources":["index.ts"],"sourcesContent":["export { CmsResponseTypeDefsImpl } from \"./responses.js\";\nexport { CmsQueryTypeDefsImpl } from \"./query.js\";\nexport { CmsMutationTypeDefsImpl } from \"./mutation.js\";\n"],"mappings":"AAAA,SAASA,uBAAuB;AAChC,SAASC,oBAAoB;AAC7B,SAASC,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
declare class CmsMutationTypeDefs implements CoreGraphQLSchemaFactory.Interface {
|
|
3
|
+
execute(builder: CoreGraphQLSchemaFactory.SchemaBuilder): CoreGraphQLSchemaFactory.Return;
|
|
4
|
+
}
|
|
5
|
+
export declare const CmsMutationTypeDefsImpl: typeof CmsMutationTypeDefs & {
|
|
6
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.core.js";
|
|
2
|
+
class CmsMutationTypeDefs {
|
|
3
|
+
async execute(builder) {
|
|
4
|
+
builder.addTypeDefs(/* GraphQL */`
|
|
5
|
+
type CmsMutation {
|
|
6
|
+
createEntry(modelId: ID!, data: JSON!, fields: [String!]!): CmsEntryResponse!
|
|
7
|
+
updateEntryRevision(
|
|
8
|
+
modelId: ID!
|
|
9
|
+
revisionId: ID!
|
|
10
|
+
data: JSON!
|
|
11
|
+
fields: [String!]!
|
|
12
|
+
): CmsEntryResponse!
|
|
13
|
+
deleteEntryRevision(
|
|
14
|
+
modelId: ID!
|
|
15
|
+
revisionId: ID!
|
|
16
|
+
permanent: Boolean
|
|
17
|
+
): CmsDeleteResponse!
|
|
18
|
+
publishEntryRevision(
|
|
19
|
+
modelId: ID!
|
|
20
|
+
revisionId: ID!
|
|
21
|
+
fields: [String!]!
|
|
22
|
+
): CmsEntryResponse!
|
|
23
|
+
unpublishEntryRevision(
|
|
24
|
+
modelId: ID!
|
|
25
|
+
revisionId: ID!
|
|
26
|
+
fields: [String!]!
|
|
27
|
+
): CmsEntryResponse!
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
extend type Mutation {
|
|
31
|
+
cms: CmsMutation!
|
|
32
|
+
}
|
|
33
|
+
`);
|
|
34
|
+
return builder;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const CmsMutationTypeDefsImpl = CoreGraphQLSchemaFactory.createImplementation({
|
|
38
|
+
implementation: CmsMutationTypeDefs,
|
|
39
|
+
dependencies: []
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CoreGraphQLSchemaFactory","CmsMutationTypeDefs","execute","builder","addTypeDefs","CmsMutationTypeDefsImpl","createImplementation","implementation","dependencies"],"sources":["mutation.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.core.js\";\n\nclass CmsMutationTypeDefs implements CoreGraphQLSchemaFactory.Interface {\n async execute(\n builder: CoreGraphQLSchemaFactory.SchemaBuilder\n ): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(/* GraphQL */ `\n type CmsMutation {\n createEntry(modelId: ID!, data: JSON!, fields: [String!]!): CmsEntryResponse!\n updateEntryRevision(\n modelId: ID!\n revisionId: ID!\n data: JSON!\n fields: [String!]!\n ): CmsEntryResponse!\n deleteEntryRevision(\n modelId: ID!\n revisionId: ID!\n permanent: Boolean\n ): CmsDeleteResponse!\n publishEntryRevision(\n modelId: ID!\n revisionId: ID!\n fields: [String!]!\n ): CmsEntryResponse!\n unpublishEntryRevision(\n modelId: ID!\n revisionId: ID!\n fields: [String!]!\n ): CmsEntryResponse!\n }\n\n extend type Mutation {\n cms: CmsMutation!\n }\n `);\n\n return builder;\n }\n}\n\nexport const CmsMutationTypeDefsImpl = CoreGraphQLSchemaFactory.createImplementation({\n implementation: CmsMutationTypeDefs,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,sDAAsD;AAE/F,MAAMC,mBAAmB,CAA+C;EACpE,MAAMC,OAAOA,CACTC,OAA+C,EAChB;IAC/BA,OAAO,CAACC,WAAW,CAAC,aAAc;AAC1C;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,CAAC;IAEF,OAAOD,OAAO;EAClB;AACJ;AAEA,OAAO,MAAME,uBAAuB,GAAGL,wBAAwB,CAACM,oBAAoB,CAAC;EACjFC,cAAc,EAAEN,mBAAmB;EACnCO,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|