@webiny/api-headless-cms 5.34.8 → 5.35.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.
- package/context.js +47 -68
- package/context.js.map +1 -1
- package/crud/contentEntry/afterDelete.js +0 -5
- package/crud/contentEntry/afterDelete.js.map +1 -1
- package/crud/contentEntry/beforeCreate.js +0 -3
- package/crud/contentEntry/beforeCreate.js.map +1 -1
- package/crud/contentEntry/beforeUpdate.js +0 -3
- package/crud/contentEntry/beforeUpdate.js.map +1 -1
- package/crud/contentEntry/entryDataValidation.js +1 -40
- package/crud/contentEntry/entryDataValidation.js.map +1 -1
- package/crud/contentEntry/markLockedFields.d.ts +1 -1
- package/crud/contentEntry/markLockedFields.js +5 -26
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js +39 -66
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry/searchableFields.js +1 -12
- package/crud/contentEntry/searchableFields.js.map +1 -1
- package/crud/contentEntry.crud.d.ts +5 -2
- package/crud/contentEntry.crud.js +859 -941
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/afterCreate.js +0 -2
- package/crud/contentModel/afterCreate.js.map +1 -1
- package/crud/contentModel/afterCreateFrom.js +0 -2
- package/crud/contentModel/afterCreateFrom.js.map +1 -1
- package/crud/contentModel/afterDelete.js +0 -2
- package/crud/contentModel/afterDelete.js.map +1 -1
- package/crud/contentModel/afterUpdate.js +0 -2
- package/crud/contentModel/afterUpdate.js.map +1 -1
- package/crud/contentModel/beforeCreate.js +39 -105
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeDelete.d.ts +1 -1
- package/crud/contentModel/beforeDelete.js +1 -15
- package/crud/contentModel/beforeDelete.js.map +1 -1
- package/crud/contentModel/beforeUpdate.js +31 -8
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
- package/crud/contentModel/compatibility/modelApiName.js +24 -0
- package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
- package/crud/contentModel/contentModelManagerFactory.js +0 -7
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
- package/crud/contentModel/createFieldStorageId.js +0 -3
- package/crud/contentModel/createFieldStorageId.js.map +1 -1
- package/crud/contentModel/defaultFields.d.ts +5 -0
- package/crud/contentModel/defaultFields.js +58 -0
- package/crud/contentModel/defaultFields.js.map +1 -0
- package/crud/contentModel/fields/descriptionField.d.ts +2 -0
- package/crud/contentModel/fields/descriptionField.js +42 -0
- package/crud/contentModel/fields/descriptionField.js.map +1 -0
- package/crud/contentModel/fields/imageField.d.ts +2 -0
- package/crud/contentModel/fields/imageField.js +46 -0
- package/crud/contentModel/fields/imageField.js.map +1 -0
- package/crud/contentModel/fields/titleField.d.ts +2 -0
- package/crud/contentModel/fields/titleField.js +58 -0
- package/crud/contentModel/fields/titleField.js.map +1 -0
- package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/endingAllowed.js +26 -0
- package/crud/contentModel/validate/endingAllowed.js.map +1 -0
- package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js +24 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
- package/crud/contentModel/validate/modelId.d.ts +11 -0
- package/crud/contentModel/validate/modelId.js +36 -0
- package/crud/contentModel/validate/modelId.js.map +1 -0
- package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
- package/crud/contentModel/validate/pluralApiName.js +24 -0
- package/crud/contentModel/validate/pluralApiName.js.map +1 -0
- package/crud/contentModel/validate/singularApiName.d.ts +7 -0
- package/crud/contentModel/validate/singularApiName.js +24 -0
- package/crud/contentModel/validate/singularApiName.js.map +1 -0
- package/crud/contentModel/validateLayout.js +0 -8
- package/crud/contentModel/validateLayout.js.map +1 -1
- package/crud/contentModel/validateModel.d.ts +1 -0
- package/crud/contentModel/validateModel.js +0 -8
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +2 -1
- package/crud/contentModel/validateModelFields.js +25 -133
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +551 -0
- package/crud/contentModel/validation.js +145 -0
- package/crud/contentModel/validation.js.map +1 -0
- package/crud/contentModel.crud.js +354 -373
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/beforeCreate.js +0 -12
- package/crud/contentModelGroup/beforeCreate.js.map +1 -1
- package/crud/contentModelGroup/beforeDelete.js +0 -8
- package/crud/contentModelGroup/beforeDelete.js.map +1 -1
- package/crud/contentModelGroup/beforeUpdate.js +0 -5
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
- package/crud/contentModelGroup/validation.d.ts +30 -0
- package/crud/contentModelGroup/validation.js +34 -0
- package/crud/contentModelGroup/validation.js.map +1 -0
- package/crud/contentModelGroup.crud.js +177 -221
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/settings.crud.d.ts +1 -1
- package/crud/settings.crud.js +5 -22
- package/crud/settings.crud.js.map +1 -1
- package/crud/system.crud.js +1 -96
- package/crud/system.crud.js.map +1 -1
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +0 -13
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +0 -36
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +0 -53
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/index.js +0 -5
- package/fieldConverters/index.js.map +1 -1
- package/graphql/buildSchemaPlugins.d.ts +2 -2
- package/graphql/buildSchemaPlugins.js +4 -9
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.d.ts +2 -0
- package/graphql/checkEndpointAccess.js +18 -0
- package/graphql/checkEndpointAccess.js.map +1 -0
- package/graphql/createExecutableSchema.d.ts +2 -3
- package/graphql/createExecutableSchema.js +2 -6
- package/graphql/createExecutableSchema.js.map +1 -1
- package/graphql/createRequestBody.d.ts +2 -0
- package/graphql/createRequestBody.js +14 -0
- package/graphql/createRequestBody.js.map +1 -0
- package/graphql/formatErrorPayload.d.ts +1 -0
- package/graphql/formatErrorPayload.js +25 -0
- package/graphql/formatErrorPayload.js.map +1 -0
- package/graphql/generateSchema.js +2 -9
- package/graphql/generateSchema.js.map +1 -1
- package/graphql/getSchema.d.ts +17 -0
- package/graphql/getSchema.js +102 -0
- package/graphql/getSchema.js.map +1 -0
- package/graphql/graphQLHandlerFactory.js +6 -173
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/handleRequest.d.ts +11 -0
- package/graphql/handleRequest.js +81 -0
- package/graphql/handleRequest.js.map +1 -0
- package/graphql/index.d.ts +1 -1
- package/graphql/index.js +0 -5
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +2 -2
- package/graphql/schema/baseContentSchema.js +5 -19
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +1 -1
- package/graphql/schema/baseSchema.js +5 -10
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/contentEntries.d.ts +2 -2
- package/graphql/schema/contentEntries.js +98 -100
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.d.ts +2 -2
- package/graphql/schema/contentModelGroups.js +12 -29
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.d.ts +2 -2
- package/graphql/schema/contentModels.js +28 -31
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.js +7 -29
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createManageResolvers.d.ts +1 -1
- package/graphql/schema/createManageResolvers.js +33 -43
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.d.ts +1 -0
- package/graphql/schema/createManageSDL.js +56 -63
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js +3 -17
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js +4 -18
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.d.ts +1 -0
- package/graphql/schema/createReadSDL.js +24 -32
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +3 -2
- package/graphql/schema/resolvers/commonFieldResolvers.js +2 -3
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.js +0 -3
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js +0 -3
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +0 -6
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGet.js +0 -16
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js +0 -3
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js +0 -3
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveList.js +0 -3
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.js +0 -3
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveGet.js +0 -8
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveList.js +0 -3
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveGet.js +0 -8
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveList.js +0 -3
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
- package/graphql/schema/schemaPlugins.d.ts +2 -2
- package/graphql/schema/schemaPlugins.js +21 -30
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.js +55 -87
- package/graphql/system.js.map +1 -1
- package/graphqlFields/boolean.js +0 -12
- package/graphqlFields/boolean.js.map +1 -1
- package/graphqlFields/datetime.js +0 -17
- package/graphqlFields/datetime.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js +57 -48
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +2 -18
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
- package/graphqlFields/dynamicZone/index.js +0 -2
- package/graphqlFields/dynamicZone/index.js.map +1 -1
- package/graphqlFields/file.js +0 -8
- package/graphqlFields/file.js.map +1 -1
- package/graphqlFields/helpers.js +0 -10
- package/graphqlFields/helpers.js.map +1 -1
- package/graphqlFields/index.js +0 -12
- package/graphqlFields/index.js.map +1 -1
- package/graphqlFields/longText.js +0 -10
- package/graphqlFields/longText.js.map +1 -1
- package/graphqlFields/number.js +0 -12
- package/graphqlFields/number.js.map +1 -1
- package/graphqlFields/object.js +21 -38
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js +59 -65
- package/graphqlFields/ref.js.map +1 -1
- package/graphqlFields/richText.js +0 -9
- package/graphqlFields/richText.js.map +1 -1
- package/graphqlFields/text.js +0 -11
- package/graphqlFields/text.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.js +26 -22
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.js +0 -16
- package/modelManager/DefaultCmsModelManager.js.map +1 -1
- package/modelManager/index.js +0 -4
- package/modelManager/index.js.map +1 -1
- package/package.json +26 -28
- package/parameters/context.js +0 -4
- package/parameters/context.js.map +1 -1
- package/parameters/header.js +0 -11
- package/parameters/header.js.map +1 -1
- package/parameters/index.js +0 -8
- package/parameters/index.js.map +1 -1
- package/parameters/manual.js +1 -8
- package/parameters/manual.js.map +1 -1
- package/parameters/path.js +0 -11
- package/parameters/path.js.map +1 -1
- package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
- package/plugins/CmsGraphQLSchemaPlugin.js +12 -0
- package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +0 -10
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -1
- package/plugins/CmsGroupPlugin.js +0 -8
- package/plugins/CmsGroupPlugin.js.map +1 -1
- package/plugins/CmsModelFieldConverterPlugin.js +0 -5
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
- package/plugins/CmsModelPlugin.d.ts +21 -3
- package/plugins/CmsModelPlugin.js +30 -40
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/CmsParametersPlugin.js +0 -7
- package/plugins/CmsParametersPlugin.js.map +1 -1
- package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
- package/plugins/StorageOperationsCmsModelPlugin.js +42 -0
- package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
- package/plugins/StorageTransformPlugin.js +0 -9
- package/plugins/StorageTransformPlugin.js.map +1 -1
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +22 -12
- package/plugins/index.js.map +1 -1
- package/storage/default.js +0 -3
- package/storage/default.js.map +1 -1
- package/storage/object.js +0 -19
- package/storage/object.js.map +1 -1
- package/types.d.ts +173 -79
- package/types.js +23 -73
- package/types.js.map +1 -1
- package/utils/access.js +11 -25
- package/utils/access.js.map +1 -1
- package/utils/converters/Converter.js +0 -13
- package/utils/converters/Converter.js.map +1 -1
- package/utils/converters/ConverterCollection.js +9 -33
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
- package/utils/converters/valueKeyStorageConverter.js +21 -44
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/createTypeFromFields.d.ts +1 -0
- package/utils/createTypeFromFields.js +11 -20
- package/utils/createTypeFromFields.js.map +1 -1
- package/utils/createTypeName.d.ts +0 -2
- package/utils/createTypeName.js +2 -19
- package/utils/createTypeName.js.map +1 -1
- package/utils/entryStorage.js +10 -26
- package/utils/entryStorage.js.map +1 -1
- package/utils/filterAsync.js +0 -5
- package/utils/filterAsync.js.map +1 -1
- package/utils/getBaseFieldType.js +0 -2
- package/utils/getBaseFieldType.js.map +1 -1
- package/utils/getEntryDescription.d.ts +2 -0
- package/utils/getEntryDescription.js +17 -0
- package/utils/getEntryDescription.js.map +1 -0
- package/utils/getEntryImage.d.ts +2 -0
- package/utils/getEntryImage.js +17 -0
- package/utils/getEntryImage.js.map +1 -0
- package/utils/getEntryTitle.js +0 -9
- package/utils/getEntryTitle.js.map +1 -1
- package/utils/getSchemaFromFieldPlugins.d.ts +4 -7
- package/utils/getSchemaFromFieldPlugins.js +23 -19
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/incrementEntryIdVersion.d.ts +5 -0
- package/utils/incrementEntryIdVersion.js +29 -0
- package/utils/incrementEntryIdVersion.js.map +1 -0
- package/utils/ownership.d.ts +3 -3
- package/utils/ownership.js +0 -8
- package/utils/ownership.js.map +1 -1
- package/utils/permissions.js +8 -23
- package/utils/permissions.js.map +1 -1
- package/utils/renderFields.d.ts +2 -1
- package/utils/renderFields.js +8 -10
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.js +0 -13
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.d.ts +2 -1
- package/utils/renderInputFields.js +4 -9
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.js +1 -10
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.js +0 -9
- package/utils/renderSortEnum.js.map +1 -1
- package/utils/toSlug.js +0 -4
- package/utils/toSlug.js.map +1 -1
- package/validators/dateGte.js +0 -7
- package/validators/dateGte.js.map +1 -1
- package/validators/dateLte.js +0 -7
- package/validators/dateLte.js.map +1 -1
- package/validators/dynamicZone.js +0 -4
- package/validators/dynamicZone.js.map +1 -1
- package/validators/gte.js +0 -8
- package/validators/gte.js.map +1 -1
- package/validators/in.js +0 -8
- package/validators/in.js.map +1 -1
- package/validators/index.js +0 -16
- package/validators/index.js.map +1 -1
- package/validators/lte.js +0 -8
- package/validators/lte.js.map +1 -1
- package/validators/maxLength.js +0 -8
- package/validators/maxLength.js.map +1 -1
- package/validators/minLength.js +0 -8
- package/validators/minLength.js.map +1 -1
- package/validators/pattern.js +0 -9
- package/validators/pattern.js.map +1 -1
- package/validators/patternPlugins/email.js +0 -2
- package/validators/patternPlugins/email.js.map +1 -1
- package/validators/patternPlugins/index.js +0 -8
- package/validators/patternPlugins/index.js.map +1 -1
- package/validators/patternPlugins/lowerCase.js +0 -2
- package/validators/patternPlugins/lowerCase.js.map +1 -1
- package/validators/patternPlugins/lowerCaseSpace.js +0 -2
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/validators/patternPlugins/upperCase.js +0 -2
- package/validators/patternPlugins/upperCase.js.map +1 -1
- package/validators/patternPlugins/upperCaseSpace.js +0 -2
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/validators/patternPlugins/url.js +0 -2
- package/validators/patternPlugins/url.js.map +1 -1
- package/validators/required.js +0 -5
- package/validators/required.js.map +1 -1
- package/validators/timeGte.js +0 -8
- package/validators/timeGte.js.map +1 -1
- package/validators/timeLte.js +0 -8
- package/validators/timeLte.js.map +1 -1
- package/validators/unique.js +0 -7
- package/validators/unique.js.map +1 -1
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.DefaultCmsModelManager = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _utils = require("@webiny/utils");
|
|
13
|
-
|
|
14
10
|
class DefaultCmsModelManager {
|
|
15
11
|
constructor(context, model) {
|
|
16
12
|
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
@@ -18,47 +14,35 @@ class DefaultCmsModelManager {
|
|
|
18
14
|
this._context = context;
|
|
19
15
|
this._model = model;
|
|
20
16
|
}
|
|
21
|
-
|
|
22
17
|
async create(data) {
|
|
23
18
|
return this._context.cms.createEntry(this._model, data);
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
async delete(id) {
|
|
27
21
|
const {
|
|
28
22
|
version
|
|
29
23
|
} = (0, _utils.parseIdentifier)(id);
|
|
30
|
-
|
|
31
24
|
if (version) {
|
|
32
25
|
return this._context.cms.deleteEntryRevision(this._model, id);
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
return this._context.cms.deleteEntry(this._model, id);
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
async get(id) {
|
|
39
30
|
return this._context.cms.getEntryById(this._model, id);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
async listPublished(params) {
|
|
43
33
|
return this._context.cms.listPublishedEntries(this._model, params);
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
async listLatest(params) {
|
|
47
36
|
return this._context.cms.listLatestEntries(this._model, params);
|
|
48
37
|
}
|
|
49
|
-
|
|
50
38
|
async getPublishedByIds(ids) {
|
|
51
39
|
return this._context.cms.getPublishedEntriesByIds(this._model, ids);
|
|
52
40
|
}
|
|
53
|
-
|
|
54
41
|
async getLatestByIds(ids) {
|
|
55
42
|
return this._context.cms.getLatestEntriesByIds(this._model, ids);
|
|
56
43
|
}
|
|
57
|
-
|
|
58
44
|
async update(id, data) {
|
|
59
45
|
return this._context.cms.updateEntry(this._model, id, data);
|
|
60
46
|
}
|
|
61
|
-
|
|
62
47
|
}
|
|
63
|
-
|
|
64
48
|
exports.DefaultCmsModelManager = DefaultCmsModelManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DefaultCmsModelManager","constructor","context","model","_context","_model","create","data","cms","createEntry","delete","id","version","parseIdentifier","deleteEntryRevision","deleteEntry","get","getEntryById","listPublished","params","listPublishedEntries","listLatest","listLatestEntries","getPublishedByIds","ids","getPublishedEntriesByIds","getLatestByIds","getLatestEntriesByIds","update","updateEntry"],"sources":["DefaultCmsModelManager.ts"],"sourcesContent":["import {\n CmsModelManager,\n CmsModel,\n CmsContext,\n CmsEntryListParams,\n CreateCmsEntryInput,\n UpdateCmsEntryInput\n} from \"~/types\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport class DefaultCmsModelManager implements CmsModelManager {\n private readonly _context: CmsContext;\n private readonly _model: CmsModel;\n\n public constructor(context: CmsContext, model: CmsModel) {\n this._context = context;\n this._model = model;\n }\n\n public async create(data: CreateCmsEntryInput) {\n return this._context.cms.createEntry(this._model, data);\n }\n\n public async delete(id: string) {\n const { version } = parseIdentifier(id);\n if (version) {\n return this._context.cms.deleteEntryRevision(this._model, id);\n }\n\n return this._context.cms.deleteEntry(this._model, id);\n }\n\n public async get(id: string) {\n return this._context.cms.getEntryById(this._model, id);\n }\n\n public async listPublished(params: CmsEntryListParams) {\n return this._context.cms.listPublishedEntries(this._model, params);\n }\n\n public async listLatest(params: CmsEntryListParams) {\n return this._context.cms.listLatestEntries(this._model, params);\n }\n\n public async getPublishedByIds(ids: string[]) {\n return this._context.cms.getPublishedEntriesByIds(this._model, ids);\n }\n\n public async getLatestByIds(ids: string[]) {\n return this._context.cms.getLatestEntriesByIds(this._model, ids);\n }\n\n public async update(id: string, data: UpdateCmsEntryInput) {\n return this._context.cms.updateEntry(this._model, id, data);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["DefaultCmsModelManager","constructor","context","model","_context","_model","create","data","cms","createEntry","delete","id","version","parseIdentifier","deleteEntryRevision","deleteEntry","get","getEntryById","listPublished","params","listPublishedEntries","listLatest","listLatestEntries","getPublishedByIds","ids","getPublishedEntriesByIds","getLatestByIds","getLatestEntriesByIds","update","updateEntry"],"sources":["DefaultCmsModelManager.ts"],"sourcesContent":["import {\n CmsModelManager,\n CmsModel,\n CmsContext,\n CmsEntryListParams,\n CreateCmsEntryInput,\n UpdateCmsEntryInput\n} from \"~/types\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport class DefaultCmsModelManager implements CmsModelManager {\n private readonly _context: CmsContext;\n private readonly _model: CmsModel;\n\n public constructor(context: CmsContext, model: CmsModel) {\n this._context = context;\n this._model = model;\n }\n\n public async create(data: CreateCmsEntryInput) {\n return this._context.cms.createEntry(this._model, data);\n }\n\n public async delete(id: string) {\n const { version } = parseIdentifier(id);\n if (version) {\n return this._context.cms.deleteEntryRevision(this._model, id);\n }\n\n return this._context.cms.deleteEntry(this._model, id);\n }\n\n public async get(id: string) {\n return this._context.cms.getEntryById(this._model, id);\n }\n\n public async listPublished(params: CmsEntryListParams) {\n return this._context.cms.listPublishedEntries(this._model, params);\n }\n\n public async listLatest(params: CmsEntryListParams) {\n return this._context.cms.listLatestEntries(this._model, params);\n }\n\n public async getPublishedByIds(ids: string[]) {\n return this._context.cms.getPublishedEntriesByIds(this._model, ids);\n }\n\n public async getLatestByIds(ids: string[]) {\n return this._context.cms.getLatestEntriesByIds(this._model, ids);\n }\n\n public async update(id: string, data: UpdateCmsEntryInput) {\n return this._context.cms.updateEntry(this._model, id, data);\n }\n}\n"],"mappings":";;;;;;;;AAQA;AAEO,MAAMA,sBAAsB,CAA4B;EAIpDC,WAAW,CAACC,OAAmB,EAAEC,KAAe,EAAE;IAAA;IAAA;IACrD,IAAI,CAACC,QAAQ,GAAGF,OAAO;IACvB,IAAI,CAACG,MAAM,GAAGF,KAAK;EACvB;EAEA,MAAaG,MAAM,CAACC,IAAyB,EAAE;IAC3C,OAAO,IAAI,CAACH,QAAQ,CAACI,GAAG,CAACC,WAAW,CAAC,IAAI,CAACJ,MAAM,EAAEE,IAAI,CAAC;EAC3D;EAEA,MAAaG,MAAM,CAACC,EAAU,EAAE;IAC5B,MAAM;MAAEC;IAAQ,CAAC,GAAG,IAAAC,sBAAe,EAACF,EAAE,CAAC;IACvC,IAAIC,OAAO,EAAE;MACT,OAAO,IAAI,CAACR,QAAQ,CAACI,GAAG,CAACM,mBAAmB,CAAC,IAAI,CAACT,MAAM,EAAEM,EAAE,CAAC;IACjE;IAEA,OAAO,IAAI,CAACP,QAAQ,CAACI,GAAG,CAACO,WAAW,CAAC,IAAI,CAACV,MAAM,EAAEM,EAAE,CAAC;EACzD;EAEA,MAAaK,GAAG,CAACL,EAAU,EAAE;IACzB,OAAO,IAAI,CAACP,QAAQ,CAACI,GAAG,CAACS,YAAY,CAAC,IAAI,CAACZ,MAAM,EAAEM,EAAE,CAAC;EAC1D;EAEA,MAAaO,aAAa,CAACC,MAA0B,EAAE;IACnD,OAAO,IAAI,CAACf,QAAQ,CAACI,GAAG,CAACY,oBAAoB,CAAC,IAAI,CAACf,MAAM,EAAEc,MAAM,CAAC;EACtE;EAEA,MAAaE,UAAU,CAACF,MAA0B,EAAE;IAChD,OAAO,IAAI,CAACf,QAAQ,CAACI,GAAG,CAACc,iBAAiB,CAAC,IAAI,CAACjB,MAAM,EAAEc,MAAM,CAAC;EACnE;EAEA,MAAaI,iBAAiB,CAACC,GAAa,EAAE;IAC1C,OAAO,IAAI,CAACpB,QAAQ,CAACI,GAAG,CAACiB,wBAAwB,CAAC,IAAI,CAACpB,MAAM,EAAEmB,GAAG,CAAC;EACvE;EAEA,MAAaE,cAAc,CAACF,GAAa,EAAE;IACvC,OAAO,IAAI,CAACpB,QAAQ,CAACI,GAAG,CAACmB,qBAAqB,CAAC,IAAI,CAACtB,MAAM,EAAEmB,GAAG,CAAC;EACpE;EAEA,MAAaI,MAAM,CAACjB,EAAU,EAAEJ,IAAyB,EAAE;IACvD,OAAO,IAAI,CAACH,QAAQ,CAACI,GAAG,CAACqB,WAAW,CAAC,IAAI,CAACxB,MAAM,EAAEM,EAAE,EAAEJ,IAAI,CAAC;EAC/D;AACJ;AAAC"}
|
package/modelManager/index.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createDefaultModelManager = void 0;
|
|
7
|
-
|
|
8
7
|
var _DefaultCmsModelManager = require("./DefaultCmsModelManager");
|
|
9
|
-
|
|
10
8
|
const plugin = {
|
|
11
9
|
type: "cms-content-model-manager",
|
|
12
10
|
name: "content-model-manager-default",
|
|
@@ -14,7 +12,5 @@ const plugin = {
|
|
|
14
12
|
return new _DefaultCmsModelManager.DefaultCmsModelManager(context, model);
|
|
15
13
|
}
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
const createDefaultModelManager = () => plugin;
|
|
19
|
-
|
|
20
16
|
exports.createDefaultModelManager = createDefaultModelManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["plugin","type","name","create","context","model","DefaultCmsModelManager","createDefaultModelManager"],"sources":["index.ts"],"sourcesContent":["import { ModelManagerPlugin } from \"~/types\";\nimport { DefaultCmsModelManager } from \"./DefaultCmsModelManager\";\n\nconst plugin: ModelManagerPlugin = {\n type: \"cms-content-model-manager\",\n name: \"content-model-manager-default\",\n create: async (context, model) => {\n return new DefaultCmsModelManager(context, model);\n }\n};\n\nexport const createDefaultModelManager = () => plugin;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["plugin","type","name","create","context","model","DefaultCmsModelManager","createDefaultModelManager"],"sources":["index.ts"],"sourcesContent":["import { ModelManagerPlugin } from \"~/types\";\nimport { DefaultCmsModelManager } from \"./DefaultCmsModelManager\";\n\nconst plugin: ModelManagerPlugin = {\n type: \"cms-content-model-manager\",\n name: \"content-model-manager-default\",\n create: async (context, model) => {\n return new DefaultCmsModelManager(context, model);\n }\n};\n\nexport const createDefaultModelManager = () => plugin;\n"],"mappings":";;;;;;AACA;AAEA,MAAMA,MAA0B,GAAG;EAC/BC,IAAI,EAAE,2BAA2B;EACjCC,IAAI,EAAE,+BAA+B;EACrCC,MAAM,EAAE,OAAOC,OAAO,EAAEC,KAAK,KAAK;IAC9B,OAAO,IAAIC,8CAAsB,CAACF,OAAO,EAAEC,KAAK,CAAC;EACrD;AACJ,CAAC;AAEM,MAAME,yBAAyB,GAAG,MAAMP,MAAM;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -18,28 +18,25 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@babel/runtime": "7.
|
|
22
|
-
"@commodo/fields": "1.1.2-beta.20",
|
|
21
|
+
"@babel/runtime": "7.20.13",
|
|
23
22
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api": "5.
|
|
25
|
-
"@webiny/api-file-manager": "5.
|
|
26
|
-
"@webiny/api-i18n": "5.
|
|
27
|
-
"@webiny/api-i18n-ddb": "5.
|
|
28
|
-
"@webiny/api-security": "5.
|
|
29
|
-
"@webiny/api-tenancy": "5.
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/handler": "5.
|
|
33
|
-
"@webiny/handler-
|
|
34
|
-
"@webiny/handler-
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/validation": "5.34.8",
|
|
23
|
+
"@webiny/api": "5.35.0-beta.0",
|
|
24
|
+
"@webiny/api-file-manager": "5.35.0-beta.0",
|
|
25
|
+
"@webiny/api-i18n": "5.35.0-beta.0",
|
|
26
|
+
"@webiny/api-i18n-ddb": "5.35.0-beta.0",
|
|
27
|
+
"@webiny/api-security": "5.35.0-beta.0",
|
|
28
|
+
"@webiny/api-tenancy": "5.35.0-beta.0",
|
|
29
|
+
"@webiny/error": "5.35.0-beta.0",
|
|
30
|
+
"@webiny/handler": "5.35.0-beta.0",
|
|
31
|
+
"@webiny/handler-aws": "5.35.0-beta.0",
|
|
32
|
+
"@webiny/handler-db": "5.35.0-beta.0",
|
|
33
|
+
"@webiny/handler-graphql": "5.35.0-beta.0",
|
|
34
|
+
"@webiny/plugins": "5.35.0-beta.0",
|
|
35
|
+
"@webiny/pubsub": "5.35.0-beta.0",
|
|
36
|
+
"@webiny/utils": "5.35.0-beta.0",
|
|
37
|
+
"@webiny/validation": "5.35.0-beta.0",
|
|
40
38
|
"code-frame": "5.0.0",
|
|
41
|
-
"
|
|
42
|
-
"dataloader": "2.1.0",
|
|
39
|
+
"dataloader": "2.2.1",
|
|
43
40
|
"dot-prop": "6.0.1",
|
|
44
41
|
"graphql-tag": "2.12.6",
|
|
45
42
|
"lodash": "4.17.21",
|
|
@@ -47,17 +44,18 @@
|
|
|
47
44
|
"p-reduce": "2.1.0",
|
|
48
45
|
"pluralize": "8.0.0",
|
|
49
46
|
"semver": "6.3.0",
|
|
50
|
-
"slugify": "1.6.5"
|
|
47
|
+
"slugify": "1.6.5",
|
|
48
|
+
"zod": "3.20.2"
|
|
51
49
|
},
|
|
52
50
|
"devDependencies": {
|
|
53
51
|
"@babel/cli": "^7.19.3",
|
|
54
52
|
"@babel/core": "^7.19.3",
|
|
55
53
|
"@babel/preset-env": "^7.19.4",
|
|
56
|
-
"@webiny/api-security-so-ddb": "^5.
|
|
57
|
-
"@webiny/api-tenancy-so-ddb": "^5.
|
|
58
|
-
"@webiny/api-wcp": "^5.
|
|
59
|
-
"@webiny/cli": "^5.
|
|
60
|
-
"@webiny/project-utils": "^5.
|
|
54
|
+
"@webiny/api-security-so-ddb": "^5.35.0-beta.0",
|
|
55
|
+
"@webiny/api-tenancy-so-ddb": "^5.35.0-beta.0",
|
|
56
|
+
"@webiny/api-wcp": "^5.35.0-beta.0",
|
|
57
|
+
"@webiny/cli": "^5.35.0-beta.0",
|
|
58
|
+
"@webiny/project-utils": "^5.35.0-beta.0",
|
|
61
59
|
"apollo-graphql": "^0.9.5",
|
|
62
60
|
"get-yarn-workspaces": "^1.0.2",
|
|
63
61
|
"graphql": "^15.7.2",
|
|
@@ -77,5 +75,5 @@
|
|
|
77
75
|
"build": "yarn webiny run build",
|
|
78
76
|
"watch": "yarn webiny run watch"
|
|
79
77
|
},
|
|
80
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "8acc9e8892842cabb3980ce0b6432fde55968d5b"
|
|
81
79
|
}
|
package/parameters/context.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createContextParameterPlugin = void 0;
|
|
7
|
-
|
|
8
7
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
9
|
-
|
|
10
8
|
const DEFAULT_LOCALE_CODE = "en-US";
|
|
11
|
-
|
|
12
9
|
const createContextParameterPlugin = () => {
|
|
13
10
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
14
11
|
const locale = context.i18n.getContentLocale();
|
|
@@ -18,5 +15,4 @@ const createContextParameterPlugin = () => {
|
|
|
18
15
|
};
|
|
19
16
|
});
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
exports.createContextParameterPlugin = createContextParameterPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_LOCALE_CODE","createContextParameterPlugin","CmsParametersPlugin","context","locale","i18n","getContentLocale","code","type"],"sources":["context.ts"],"sourcesContent":["import { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\n\nconst DEFAULT_LOCALE_CODE = \"en-US\";\n\nexport const createContextParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n const locale = context.i18n.getContentLocale();\n return {\n locale: locale?.code || DEFAULT_LOCALE_CODE,\n type: null\n };\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["DEFAULT_LOCALE_CODE","createContextParameterPlugin","CmsParametersPlugin","context","locale","i18n","getContentLocale","code","type"],"sources":["context.ts"],"sourcesContent":["import { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\n\nconst DEFAULT_LOCALE_CODE = \"en-US\";\n\nexport const createContextParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n const locale = context.i18n.getContentLocale();\n return {\n locale: locale?.code || DEFAULT_LOCALE_CODE,\n type: null\n };\n });\n};\n"],"mappings":";;;;;;AAAA;AAEA,MAAMA,mBAAmB,GAAG,OAAO;AAE5B,MAAMC,4BAA4B,GAAG,MAAM;EAC9C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAC5C,MAAMC,MAAM,GAAGD,OAAO,CAACE,IAAI,CAACC,gBAAgB,EAAE;IAC9C,OAAO;MACHF,MAAM,EAAE,CAAAA,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEG,IAAI,KAAIP,mBAAmB;MAC3CQ,IAAI,EAAE;IACV,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/header.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createHeaderParameterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
9
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
-
|
|
14
10
|
var HeaderKeys;
|
|
15
|
-
|
|
16
11
|
(function (HeaderKeys) {
|
|
17
12
|
HeaderKeys["TYPE"] = "x-webiny-cms-endpoint";
|
|
18
13
|
HeaderKeys["LOCALE"] = "x-webiny-cms-locale";
|
|
19
14
|
})(HeaderKeys || (HeaderKeys = {}));
|
|
20
|
-
|
|
21
15
|
const createHeaderParameterPlugin = () => {
|
|
22
16
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
23
17
|
var _context$request;
|
|
24
|
-
|
|
25
18
|
/**
|
|
26
19
|
* If any of the properties is not defined, just ignore this plugin
|
|
27
20
|
*/
|
|
28
21
|
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.headers)) {
|
|
29
22
|
return null;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
const headers = context.request.headers;
|
|
33
25
|
const type = headers[HeaderKeys.TYPE];
|
|
34
26
|
const locale = headers[HeaderKeys.LOCALE];
|
|
35
|
-
|
|
36
27
|
if (!type && !locale) {
|
|
37
28
|
return null;
|
|
38
29
|
} else if (!locale || typeof locale !== "string") {
|
|
@@ -44,12 +35,10 @@ const createHeaderParameterPlugin = () => {
|
|
|
44
35
|
headers
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
|
-
|
|
48
38
|
return {
|
|
49
39
|
type: type,
|
|
50
40
|
locale
|
|
51
41
|
};
|
|
52
42
|
});
|
|
53
43
|
};
|
|
54
|
-
|
|
55
44
|
exports.createHeaderParameterPlugin = createHeaderParameterPlugin;
|
package/parameters/header.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HeaderKeys","createHeaderParameterPlugin","CmsParametersPlugin","context","request","headers","type","TYPE","locale","LOCALE","WebinyError"],"sources":["header.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nenum HeaderKeys {\n TYPE = \"x-webiny-cms-endpoint\",\n LOCALE = \"x-webiny-cms-locale\"\n}\n\nexport const createHeaderParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.headers) {\n return null;\n }\n\n const headers = context.request.headers;\n\n const type = headers[HeaderKeys.TYPE];\n const locale = headers[HeaderKeys.LOCALE];\n\n if (!type && !locale) {\n return null;\n } else if (!locale || typeof locale !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.TYPE}\" header but no \"${HeaderKeys.LOCALE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n } else if (!type || typeof type !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.LOCALE}\" header but no \"${HeaderKeys.TYPE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["HeaderKeys","createHeaderParameterPlugin","CmsParametersPlugin","context","request","headers","type","TYPE","locale","LOCALE","WebinyError"],"sources":["header.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nenum HeaderKeys {\n TYPE = \"x-webiny-cms-endpoint\",\n LOCALE = \"x-webiny-cms-locale\"\n}\n\nexport const createHeaderParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.headers) {\n return null;\n }\n\n const headers = context.request.headers;\n\n const type = headers[HeaderKeys.TYPE];\n const locale = headers[HeaderKeys.LOCALE];\n\n if (!type && !locale) {\n return null;\n } else if (!locale || typeof locale !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.TYPE}\" header but no \"${HeaderKeys.LOCALE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n } else if (!type || typeof type !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.LOCALE}\" header but no \"${HeaderKeys.TYPE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAAoE,IAG/DA,UAAU;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU;AAKR,MAAMC,2BAA2B,GAAG,MAAM;EAC7C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAAA;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAO,6CAAf,iBAAiBC,OAAO,GAAE;MAC3B,OAAO,IAAI;IACf;IAEA,MAAMA,OAAO,GAAGF,OAAO,CAACC,OAAO,CAACC,OAAO;IAEvC,MAAMC,IAAI,GAAGD,OAAO,CAACL,UAAU,CAACO,IAAI,CAAC;IACrC,MAAMC,MAAM,GAAGH,OAAO,CAACL,UAAU,CAACS,MAAM,CAAC;IAEzC,IAAI,CAACH,IAAI,IAAI,CAACE,MAAM,EAAE;MAClB,OAAO,IAAI;IACf,CAAC,MAAM,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;MAC9C,MAAM,IAAIE,cAAW,CAChB,eAAcV,UAAU,CAACO,IAAK,oBAAmBP,UAAU,CAACS,MAAO,IAAG,EACvE,yBAAyB,EACzB;QACIJ;MACJ,CAAC,CACJ;IACL,CAAC,MAAM,IAAI,CAACC,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MAC1C,MAAM,IAAII,cAAW,CAChB,eAAcV,UAAU,CAACS,MAAO,oBAAmBT,UAAU,CAACO,IAAK,IAAG,EACvE,yBAAyB,EACzB;QACIF;MACJ,CAAC,CACJ;IACL;IAEA,OAAO;MACHC,IAAI,EAAEA,IAAmB;MACzBE;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _manual = require("./manual");
|
|
8
|
-
|
|
9
7
|
Object.keys(_manual).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _manual[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_manual).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _path = require("./path");
|
|
21
|
-
|
|
22
18
|
Object.keys(_path).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _path[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_path).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _context = require("./context");
|
|
34
|
-
|
|
35
29
|
Object.keys(_context).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _context[key]) return;
|
|
@@ -42,9 +36,7 @@ Object.keys(_context).forEach(function (key) {
|
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
|
-
|
|
46
39
|
var _header = require("./header");
|
|
47
|
-
|
|
48
40
|
Object.keys(_header).forEach(function (key) {
|
|
49
41
|
if (key === "default" || key === "__esModule") return;
|
|
50
42
|
if (key in exports && exports[key] === _header[key]) return;
|
package/parameters/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./manual\";\nexport * from \"./path\";\nexport * from \"./context\";\nexport * from \"./header\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./manual\";\nexport * from \"./path\";\nexport * from \"./context\";\nexport * from \"./header\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/parameters/manual.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createManualPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
10
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.
|
|
18
13
|
*/
|
|
14
|
+
|
|
19
15
|
const createManualPlugin = params => {
|
|
20
16
|
return new _CmsParametersPlugin.CmsParametersPlugin(async () => {
|
|
21
17
|
const {
|
|
@@ -25,7 +21,6 @@ const createManualPlugin = params => {
|
|
|
25
21
|
/**
|
|
26
22
|
* if both of parameters are not existing, just skip this plugin.
|
|
27
23
|
*/
|
|
28
|
-
|
|
29
24
|
if (!type && !locale) {
|
|
30
25
|
return null;
|
|
31
26
|
} else if (!type) {
|
|
@@ -33,12 +28,10 @@ const createManualPlugin = params => {
|
|
|
33
28
|
} else if (!locale) {
|
|
34
29
|
throw new _error.default(`There is defined "endpointType" CMS parameter but no "locale".`, "MALFORMED_LOCALE_TYPE", (0, _objectSpread2.default)({}, params));
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
return {
|
|
38
32
|
type,
|
|
39
33
|
locale
|
|
40
34
|
};
|
|
41
35
|
});
|
|
42
36
|
};
|
|
43
|
-
|
|
44
37
|
exports.createManualPlugin = createManualPlugin;
|
package/parameters/manual.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createManualPlugin","params","CmsParametersPlugin","endpointType","type","locale","WebinyError"],"sources":["manual.ts"],"sourcesContent":["/**\n * This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsParametersPlugin,\n CmsParametersPluginResponseLocale,\n CmsParametersPluginResponseType\n} from \"~/plugins/CmsParametersPlugin\";\n\nexport interface ManualPluginParams {\n endpointType?: CmsParametersPluginResponseType;\n locale?: CmsParametersPluginResponseLocale;\n}\n\nexport const createManualPlugin = (params: ManualPluginParams): CmsParametersPlugin => {\n return new CmsParametersPlugin(async () => {\n const { endpointType: type, locale } = params;\n /**\n * if both of parameters are not existing, just skip this plugin.\n */\n if (!type && !locale) {\n return null;\n } else if (!type) {\n throw new WebinyError(\n `There is defined \"locale\" CMS parameter but no \"endpointType\".`,\n \"MALFORMED_ENDPOINT_TYPE\",\n {\n ...params\n }\n );\n } else if (!locale) {\n throw new WebinyError(\n `There is defined \"endpointType\" CMS parameter but no \"locale\".`,\n \"MALFORMED_LOCALE_TYPE\",\n {\n ...params\n }\n );\n }\n\n return {\n type,\n locale\n };\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["createManualPlugin","params","CmsParametersPlugin","endpointType","type","locale","WebinyError"],"sources":["manual.ts"],"sourcesContent":["/**\n * This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsParametersPlugin,\n CmsParametersPluginResponseLocale,\n CmsParametersPluginResponseType\n} from \"~/plugins/CmsParametersPlugin\";\n\nexport interface ManualPluginParams {\n endpointType?: CmsParametersPluginResponseType;\n locale?: CmsParametersPluginResponseLocale;\n}\n\nexport const createManualPlugin = (params: ManualPluginParams): CmsParametersPlugin => {\n return new CmsParametersPlugin(async () => {\n const { endpointType: type, locale } = params;\n /**\n * if both of parameters are not existing, just skip this plugin.\n */\n if (!type && !locale) {\n return null;\n } else if (!type) {\n throw new WebinyError(\n `There is defined \"locale\" CMS parameter but no \"endpointType\".`,\n \"MALFORMED_ENDPOINT_TYPE\",\n {\n ...params\n }\n );\n } else if (!locale) {\n throw new WebinyError(\n `There is defined \"endpointType\" CMS parameter but no \"locale\".`,\n \"MALFORMED_LOCALE_TYPE\",\n {\n ...params\n }\n );\n }\n\n return {\n type,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;AAGA;AACA;AAJA;AACA;AACA;;AAaO,MAAMA,kBAAkB,GAAIC,MAA0B,IAA0B;EACnF,OAAO,IAAIC,wCAAmB,CAAC,YAAY;IACvC,MAAM;MAAEC,YAAY,EAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGJ,MAAM;IAC7C;AACR;AACA;IACQ,IAAI,CAACG,IAAI,IAAI,CAACC,MAAM,EAAE;MAClB,OAAO,IAAI;IACf,CAAC,MAAM,IAAI,CAACD,IAAI,EAAE;MACd,MAAM,IAAIE,cAAW,CAChB,gEAA+D,EAChE,yBAAyB,kCAElBL,MAAM,EAEhB;IACL,CAAC,MAAM,IAAI,CAACI,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,gEAA+D,EAChE,uBAAuB,kCAEhBL,MAAM,EAEhB;IACL;IAEA,OAAO;MACHG,IAAI;MACJC;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/path.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createPathParameterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
9
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
-
|
|
14
10
|
const allowedEndpoints = ["manage", "read", "preview"];
|
|
15
|
-
|
|
16
11
|
const createPathParameterPlugin = () => {
|
|
17
12
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
18
13
|
var _context$request;
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* If any of the properties is not defined, just ignore this plugin
|
|
22
16
|
*/
|
|
23
17
|
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.params)) {
|
|
24
18
|
return null;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
20
|
const {
|
|
28
21
|
type,
|
|
29
22
|
locale
|
|
30
23
|
} = context.request.params;
|
|
31
|
-
|
|
32
24
|
if (!type && !locale) {
|
|
33
25
|
return null;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
27
|
if (!type) {
|
|
37
28
|
throw new _error.default(`Missing request parameter "type".`);
|
|
38
29
|
} else if (!locale) {
|
|
@@ -40,12 +31,10 @@ const createPathParameterPlugin = () => {
|
|
|
40
31
|
} else if (allowedEndpoints.includes(type) === false) {
|
|
41
32
|
throw new _error.default(`Endpoint "${type}" not allowed!`);
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
return {
|
|
45
35
|
type: type,
|
|
46
36
|
locale
|
|
47
37
|
};
|
|
48
38
|
});
|
|
49
39
|
};
|
|
50
|
-
|
|
51
40
|
exports.createPathParameterPlugin = createPathParameterPlugin;
|
package/parameters/path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["allowedEndpoints","createPathParameterPlugin","CmsParametersPlugin","context","request","params","type","locale","WebinyError","includes"],"sources":["path.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nconst allowedEndpoints: ApiEndpoint[] = [\"manage\", \"read\", \"preview\"];\n\nexport const createPathParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.params) {\n return null;\n }\n\n const { type, locale } = context.request.params as Record<string, string | null>;\n if (!type && !locale) {\n return null;\n }\n\n if (!type) {\n throw new WebinyError(`Missing request parameter \"type\".`);\n } else if (!locale) {\n throw new WebinyError(`Missing request parameter \"locale\".`);\n } else if (allowedEndpoints.includes(type as ApiEndpoint) === false) {\n throw new WebinyError(`Endpoint \"${type}\" not allowed!`);\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["allowedEndpoints","createPathParameterPlugin","CmsParametersPlugin","context","request","params","type","locale","WebinyError","includes"],"sources":["path.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nconst allowedEndpoints: ApiEndpoint[] = [\"manage\", \"read\", \"preview\"];\n\nexport const createPathParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.params) {\n return null;\n }\n\n const { type, locale } = context.request.params as Record<string, string | null>;\n if (!type && !locale) {\n return null;\n }\n\n if (!type) {\n throw new WebinyError(`Missing request parameter \"type\".`);\n } else if (!locale) {\n throw new WebinyError(`Missing request parameter \"locale\".`);\n } else if (allowedEndpoints.includes(type as ApiEndpoint) === false) {\n throw new WebinyError(`Endpoint \"${type}\" not allowed!`);\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAGA,MAAMA,gBAA+B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC;AAE9D,MAAMC,yBAAyB,GAAG,MAAM;EAC3C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAAA;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAO,6CAAf,iBAAiBC,MAAM,GAAE;MAC1B,OAAO,IAAI;IACf;IAEA,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGJ,OAAO,CAACC,OAAO,CAACC,MAAuC;IAChF,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,EAAE;MAClB,OAAO,IAAI;IACf;IAEA,IAAI,CAACD,IAAI,EAAE;MACP,MAAM,IAAIE,cAAW,CAAE,mCAAkC,CAAC;IAC9D,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAAE,qCAAoC,CAAC;IAChE,CAAC,MAAM,IAAIR,gBAAgB,CAACS,QAAQ,CAACH,IAAI,CAAgB,KAAK,KAAK,EAAE;MACjE,MAAM,IAAIE,cAAW,CAAE,aAAYF,IAAK,gBAAe,CAAC;IAC5D;IAEA,OAAO;MACHA,IAAI,EAAEA,IAAmB;MACzBC;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CmsGraphQLSchemaPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
10
|
+
class CmsGraphQLSchemaPlugin extends _handlerGraphql.GraphQLSchemaPlugin {}
|
|
11
|
+
exports.CmsGraphQLSchemaPlugin = CmsGraphQLSchemaPlugin;
|
|
12
|
+
(0, _defineProperty2.default)(CmsGraphQLSchemaPlugin, "type", "cms.graphql.schema");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsGraphQLSchemaPlugin","GraphQLSchemaPlugin"],"sources":["CmsGraphQLSchemaPlugin.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { CmsContext } from \"~/types\";\n\nexport class CmsGraphQLSchemaPlugin<T = CmsContext> extends GraphQLSchemaPlugin<T> {\n public static override type = \"cms.graphql.schema\";\n}\n"],"mappings":";;;;;;;;AAAA;AAGO,MAAMA,sBAAsB,SAAyBC,mCAAmB,CAAI;AAElF;AAAA,8BAFYD,sBAAsB,UACD,oBAAoB"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createCmsGraphQLSchemaSorterPlugin = exports.CmsGraphQLSchemaSorterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _plugins = require("@webiny/plugins");
|
|
13
|
-
|
|
14
10
|
class CmsGraphQLSchemaSorterPlugin extends _plugins.Plugin {
|
|
15
11
|
constructor(cb) {
|
|
16
12
|
super();
|
|
@@ -20,19 +16,13 @@ class CmsGraphQLSchemaSorterPlugin extends _plugins.Plugin {
|
|
|
20
16
|
/**
|
|
21
17
|
* Method must return new sorting array. Or existing one if no changes are made.
|
|
22
18
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
19
|
createSorter(params) {
|
|
26
20
|
return this.cb(params);
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
exports.CmsGraphQLSchemaSorterPlugin = CmsGraphQLSchemaSorterPlugin;
|
|
32
24
|
(0, _defineProperty2.default)(CmsGraphQLSchemaSorterPlugin, "type", "cms.graphql.schema.sorter");
|
|
33
|
-
|
|
34
25
|
const createCmsGraphQLSchemaSorterPlugin = cb => {
|
|
35
26
|
return new CmsGraphQLSchemaSorterPlugin(cb);
|
|
36
27
|
};
|
|
37
|
-
|
|
38
28
|
exports.createCmsGraphQLSchemaSorterPlugin = createCmsGraphQLSchemaSorterPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsGraphQLSchemaSorterPlugin","Plugin","constructor","cb","createSorter","params","createCmsGraphQLSchemaSorterPlugin"],"sources":["CmsGraphQLSchemaSorterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsModel } from \"~/types\";\n\ninterface CmsGraphQLSchemaSorterPluginCallableParams {\n model: CmsModel;\n sorters: string[];\n}\ninterface CmsGraphQLSchemaSorterPluginCallable {\n (params: CmsGraphQLSchemaSorterPluginCallableParams): string[];\n}\nexport class CmsGraphQLSchemaSorterPlugin extends Plugin {\n public static override readonly type: string = \"cms.graphql.schema.sorter\";\n\n private readonly cb: CmsGraphQLSchemaSorterPluginCallable;\n public constructor(cb: CmsGraphQLSchemaSorterPluginCallable) {\n super();\n\n this.cb = cb;\n }\n /**\n * Method must return new sorting array. Or existing one if no changes are made.\n */\n public createSorter(params: CmsGraphQLSchemaSorterPluginCallableParams): string[] {\n return this.cb(params);\n }\n}\n\nexport const createCmsGraphQLSchemaSorterPlugin = (\n cb: CmsGraphQLSchemaSorterPluginCallable\n): CmsGraphQLSchemaSorterPlugin => {\n return new CmsGraphQLSchemaSorterPlugin(cb);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsGraphQLSchemaSorterPlugin","Plugin","constructor","cb","createSorter","params","createCmsGraphQLSchemaSorterPlugin"],"sources":["CmsGraphQLSchemaSorterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsModel } from \"~/types\";\n\ninterface CmsGraphQLSchemaSorterPluginCallableParams {\n model: CmsModel;\n sorters: string[];\n}\ninterface CmsGraphQLSchemaSorterPluginCallable {\n (params: CmsGraphQLSchemaSorterPluginCallableParams): string[];\n}\nexport class CmsGraphQLSchemaSorterPlugin extends Plugin {\n public static override readonly type: string = \"cms.graphql.schema.sorter\";\n\n private readonly cb: CmsGraphQLSchemaSorterPluginCallable;\n public constructor(cb: CmsGraphQLSchemaSorterPluginCallable) {\n super();\n\n this.cb = cb;\n }\n /**\n * Method must return new sorting array. Or existing one if no changes are made.\n */\n public createSorter(params: CmsGraphQLSchemaSorterPluginCallableParams): string[] {\n return this.cb(params);\n }\n}\n\nexport const createCmsGraphQLSchemaSorterPlugin = (\n cb: CmsGraphQLSchemaSorterPluginCallable\n): CmsGraphQLSchemaSorterPlugin => {\n return new CmsGraphQLSchemaSorterPlugin(cb);\n};\n"],"mappings":";;;;;;;;AAAA;AAUO,MAAMA,4BAA4B,SAASC,eAAM,CAAC;EAI9CC,WAAW,CAACC,EAAwC,EAAE;IACzD,KAAK,EAAE;IAAC;IAER,IAAI,CAACA,EAAE,GAAGA,EAAE;EAChB;EACA;AACJ;AACA;EACWC,YAAY,CAACC,MAAkD,EAAY;IAC9E,OAAO,IAAI,CAACF,EAAE,CAACE,MAAM,CAAC;EAC1B;AACJ;AAAC;AAAA,8BAfYL,4BAA4B,UACU,2BAA2B;AAgBvE,MAAMM,kCAAkC,GAC3CH,EAAwC,IACT;EAC/B,OAAO,IAAIH,4BAA4B,CAACG,EAAE,CAAC;AAC/C,CAAC;AAAC"}
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createCmsGroup = exports.CmsGroupPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _plugins = require("@webiny/plugins");
|
|
13
|
-
|
|
14
10
|
class CmsGroupPlugin extends _plugins.Plugin {
|
|
15
11
|
constructor(contentModelGroup) {
|
|
16
12
|
super();
|
|
17
13
|
(0, _defineProperty2.default)(this, "contentModelGroup", void 0);
|
|
18
14
|
this.contentModelGroup = contentModelGroup;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.CmsGroupPlugin = CmsGroupPlugin;
|
|
24
18
|
(0, _defineProperty2.default)(CmsGroupPlugin, "type", "cms-content-model-group");
|
|
25
|
-
|
|
26
19
|
const createCmsGroup = group => {
|
|
27
20
|
return new CmsGroupPlugin(group);
|
|
28
21
|
};
|
|
29
|
-
|
|
30
22
|
exports.createCmsGroup = createCmsGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsGroupPlugin","Plugin","constructor","contentModelGroup","createCmsGroup","group"],"sources":["CmsGroupPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsGroup as BaseCmsGroup } from \"~/types\";\n\ninterface CmsGroup extends Omit<BaseCmsGroup, \"locale\" | \"tenant\" | \"webinyVersion\"> {\n tenant?: string;\n locale?: string;\n}\nexport class CmsGroupPlugin extends Plugin {\n public static override readonly type: string = \"cms-content-model-group\";\n public readonly contentModelGroup: CmsGroup;\n\n constructor(contentModelGroup: CmsGroup) {\n super();\n this.contentModelGroup = contentModelGroup;\n }\n}\n\nexport const createCmsGroup = (group: CmsGroup): CmsGroupPlugin => {\n return new CmsGroupPlugin(group);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsGroupPlugin","Plugin","constructor","contentModelGroup","createCmsGroup","group"],"sources":["CmsGroupPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsGroup as BaseCmsGroup } from \"~/types\";\n\ninterface CmsGroup extends Omit<BaseCmsGroup, \"locale\" | \"tenant\" | \"webinyVersion\"> {\n tenant?: string;\n locale?: string;\n}\nexport class CmsGroupPlugin extends Plugin {\n public static override readonly type: string = \"cms-content-model-group\";\n public readonly contentModelGroup: CmsGroup;\n\n constructor(contentModelGroup: CmsGroup) {\n super();\n this.contentModelGroup = contentModelGroup;\n }\n}\n\nexport const createCmsGroup = (group: CmsGroup): CmsGroupPlugin => {\n return new CmsGroupPlugin(group);\n};\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAMA,cAAc,SAASC,eAAM,CAAC;EAIvCC,WAAW,CAACC,iBAA2B,EAAE;IACrC,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,iBAAiB,GAAGA,iBAAiB;EAC9C;AACJ;AAAC;AAAA,8BARYH,cAAc,UACwB,yBAAyB;AASrE,MAAMI,cAAc,GAAIC,KAAe,IAAqB;EAC/D,OAAO,IAAIL,cAAc,CAACK,KAAK,CAAC;AACpC,CAAC;AAAC"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.CmsModelFieldConverterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _plugins = require("@webiny/plugins");
|
|
13
|
-
|
|
14
10
|
class CmsModelFieldConverterPlugin extends _plugins.Plugin {}
|
|
15
|
-
|
|
16
11
|
exports.CmsModelFieldConverterPlugin = CmsModelFieldConverterPlugin;
|
|
17
12
|
(0, _defineProperty2.default)(CmsModelFieldConverterPlugin, "type", "cms.field.converter");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsModelFieldConverterPlugin","Plugin"],"sources":["CmsModelFieldConverterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsEntryValues, CmsModelFieldWithParent } from \"~/types\";\nimport { ConverterCollection } from \"~/utils/converters/ConverterCollection\";\n\nexport interface ConvertParams<F = CmsModelFieldWithParent> {\n field: F;\n value: any;\n converterCollection: ConverterCollection;\n}\n\nexport abstract class CmsModelFieldConverterPlugin extends Plugin {\n public static override type = \"cms.field.converter\";\n\n public abstract getFieldType(): string;\n\n public abstract convertToStorage(params: ConvertParams): CmsEntryValues;\n public abstract convertFromStorage(params: ConvertParams): CmsEntryValues;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsModelFieldConverterPlugin","Plugin"],"sources":["CmsModelFieldConverterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsEntryValues, CmsModelFieldWithParent } from \"~/types\";\nimport { ConverterCollection } from \"~/utils/converters/ConverterCollection\";\n\nexport interface ConvertParams<F = CmsModelFieldWithParent> {\n field: F;\n value: any;\n converterCollection: ConverterCollection;\n}\n\nexport abstract class CmsModelFieldConverterPlugin extends Plugin {\n public static override type = \"cms.field.converter\";\n\n public abstract getFieldType(): string;\n\n public abstract convertToStorage(params: ConvertParams): CmsEntryValues;\n public abstract convertFromStorage(params: ConvertParams): CmsEntryValues;\n}\n"],"mappings":";;;;;;;;AAAA;AAUO,MAAeA,4BAA4B,SAASC,eAAM,CAAC;AAOjE;AAAA,8BAPqBD,4BAA4B,UAChB,qBAAqB"}
|