contentful-migration 4.9.3 → 4.9.5
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/CHANGELOG.md +6 -1
- package/built/bin/cli.d.ts +9 -0
- package/built/bin/lib/config.d.ts +13 -0
- package/built/bin/lib/contentful-client/index.d.ts +2 -0
- package/built/bin/lib/contentful-client/proxy.d.ts +19 -0
- package/built/bin/lib/render-migration.d.ts +5 -0
- package/built/bin/lib/steps-errors.d.ts +3 -0
- package/built/bin/lib/write-errors-to-log.d.ts +2 -0
- package/built/bin/usage-params.d.ts +2 -0
- package/built/index.d.ts +1 -0
- package/built/lib/action/action.d.ts +18 -0
- package/built/lib/action/content-type-annotate.d.ts +11 -0
- package/built/lib/action/content-type-create.d.ts +8 -0
- package/built/lib/action/content-type-delete.d.ts +8 -0
- package/built/lib/action/content-type-publish.d.ts +8 -0
- package/built/lib/action/content-type-save.d.ts +8 -0
- package/built/lib/action/content-type-unpublish.d.ts +8 -0
- package/built/lib/action/content-type-update.d.ts +11 -0
- package/built/lib/action/editor-layout/editor-layout-change-field-group-control.d.ts +13 -0
- package/built/lib/action/editor-layout/editor-layout-create-field-group.d.ts +12 -0
- package/built/lib/action/editor-layout/editor-layout-create.d.ts +8 -0
- package/built/lib/action/editor-layout/editor-layout-delete-field-group.d.ts +21 -0
- package/built/lib/action/editor-layout/editor-layout-delete.d.ts +10 -0
- package/built/lib/action/editor-layout/editor-layout-move-field.d.ts +13 -0
- package/built/lib/action/editor-layout/editor-layout-update-field-group.d.ts +22 -0
- package/built/lib/action/editorinterface-copy.d.ts +14 -0
- package/built/lib/action/editorinterface-reset.d.ts +12 -0
- package/built/lib/action/editorinterface-save.d.ts +8 -0
- package/built/lib/action/editorinterface-update.d.ts +16 -0
- package/built/lib/action/entry-derive.d.ts +15 -0
- package/built/lib/action/entry-field-purge.d.ts +9 -0
- package/built/lib/action/entry-field-rename.d.ts +11 -0
- package/built/lib/action/entry-set-tags.d.ts +10 -0
- package/built/lib/action/entry-transform-to-type.d.ts +16 -0
- package/built/lib/action/entry-transform.d.ts +11 -0
- package/built/lib/action/entryeditor-configure.d.ts +17 -0
- package/built/lib/action/entryeditor-reset-to-default.d.ts +10 -0
- package/built/lib/action/entryeditor.d.ts +8 -0
- package/built/lib/action/entryeditors-configure.d.ts +21 -0
- package/built/lib/action/field-action.d.ts +10 -0
- package/built/lib/action/field-annotate.d.ts +12 -0
- package/built/lib/action/field-create.d.ts +7 -0
- package/built/lib/action/field-move.d.ts +9 -0
- package/built/lib/action/field-rename.d.ts +15 -0
- package/built/lib/action/field-update.d.ts +10 -0
- package/built/lib/action/sidebar-reset-to-default.d.ts +10 -0
- package/built/lib/action/sidebarwidget-add.d.ts +16 -0
- package/built/lib/action/sidebarwidget-remove.d.ts +13 -0
- package/built/lib/action/sidebarwidget-update.d.ts +15 -0
- package/built/lib/action/sidebarwidget.d.ts +13 -0
- package/built/lib/action/tag-create.d.ts +12 -0
- package/built/lib/action/tag-delete.d.ts +8 -0
- package/built/lib/action/tag-save.d.ts +10 -0
- package/built/lib/action/tag-update.d.ts +11 -0
- package/built/lib/entities/content-type.d.ts +90 -0
- package/built/lib/entities/entry.d.ts +28 -0
- package/built/lib/entities/link.d.ts +15 -0
- package/built/lib/entities/tag.d.ts +18 -0
- package/built/lib/errors/chunks-validation.d.ts +5 -0
- package/built/lib/errors/editorinterfaces-fetching.d.ts +4 -0
- package/built/lib/errors/index.d.ts +6 -0
- package/built/lib/errors/payload-validation.d.ts +5 -0
- package/built/lib/errors/space-access.d.ts +4 -0
- package/built/lib/errors/steps-validation.d.ts +5 -0
- package/built/lib/fetcher.d.ts +19 -0
- package/built/lib/intent/base-intent.d.ts +64 -0
- package/built/lib/intent/base-intent.js +4 -3
- package/built/lib/intent/base-intent.js.map +1 -1
- package/built/lib/intent/composed-intent.d.ts +62 -0
- package/built/lib/intent/content-type-annotate.d.ts +11 -0
- package/built/lib/intent/content-type-annotate.js +4 -0
- package/built/lib/intent/content-type-annotate.js.map +1 -1
- package/built/lib/intent/content-type-create.d.ts +10 -0
- package/built/lib/intent/content-type-delete.d.ts +13 -0
- package/built/lib/intent/content-type-update.d.ts +10 -0
- package/built/lib/intent/content-type-update.js +1 -0
- package/built/lib/intent/content-type-update.js.map +1 -1
- package/built/lib/intent/editor-layout/editor-layout-change-field-group-control.d.ts +15 -0
- package/built/lib/intent/editor-layout/editor-layout-change-field-group-id.d.ts +17 -0
- package/built/lib/intent/editor-layout/editor-layout-create-field-group.d.ts +15 -0
- package/built/lib/intent/editor-layout/editor-layout-create.d.ts +15 -0
- package/built/lib/intent/editor-layout/editor-layout-delete-field-group.d.ts +15 -0
- package/built/lib/intent/editor-layout/editor-layout-delete.d.ts +14 -0
- package/built/lib/intent/editor-layout/editor-layout-invalid-method.d.ts +12 -0
- package/built/lib/intent/editor-layout/editor-layout-move-field.d.ts +18 -0
- package/built/lib/intent/editor-layout/editor-layout-update-field-group.d.ts +15 -0
- package/built/lib/intent/editorinterface-copy.d.ts +14 -0
- package/built/lib/intent/editorinterface-reset.d.ts +14 -0
- package/built/lib/intent/editorinterface-update.d.ts +15 -0
- package/built/lib/intent/entry-derive.d.ts +14 -0
- package/built/lib/intent/entry-set-tags.d.ts +13 -0
- package/built/lib/intent/entry-transform-to-type.d.ts +15 -0
- package/built/lib/intent/entry-transform.d.ts +13 -0
- package/built/lib/intent/entryeditor-configure.d.ts +14 -0
- package/built/lib/intent/entryeditor-reset-to-default.d.ts +14 -0
- package/built/lib/intent/entryeditors-configure.d.ts +14 -0
- package/built/lib/intent/field-annotate.d.ts +10 -0
- package/built/lib/intent/field-create.d.ts +10 -0
- package/built/lib/intent/field-create.js +1 -0
- package/built/lib/intent/field-create.js.map +1 -1
- package/built/lib/intent/field-delete.d.ts +13 -0
- package/built/lib/intent/field-move.d.ts +13 -0
- package/built/lib/intent/field-move.js +1 -0
- package/built/lib/intent/field-move.js.map +1 -1
- package/built/lib/intent/field-rename.d.ts +20 -0
- package/built/lib/intent/field-update.d.ts +10 -0
- package/built/lib/intent/field-update.js +1 -0
- package/built/lib/intent/field-update.js.map +1 -1
- package/built/lib/intent/index.d.ts +38 -0
- package/built/lib/intent/sidebar-reset-to-default.d.ts +14 -0
- package/built/lib/intent/sidebarwidget-add.d.ts +15 -0
- package/built/lib/intent/sidebarwidget-remove.d.ts +15 -0
- package/built/lib/intent/sidebarwidget-update.d.ts +15 -0
- package/built/lib/intent/tag-create.d.ts +16 -0
- package/built/lib/intent/tag-delete.d.ts +15 -0
- package/built/lib/intent/tag-update.d.ts +14 -0
- package/built/lib/intent-list/index.d.ts +17 -0
- package/built/lib/intent-validator/content-transform.d.ts +17 -0
- package/built/lib/intent-validator/content-type-update.d.ts +13 -0
- package/built/lib/intent-validator/entry-derive.d.ts +20 -0
- package/built/lib/intent-validator/entry-set-tags.d.ts +15 -0
- package/built/lib/intent-validator/entry-transform-to-type.d.ts +19 -0
- package/built/lib/intent-validator/field-movement.d.ts +21 -0
- package/built/lib/intent-validator/field-update.d.ts +23 -0
- package/built/lib/intent-validator/schema-validator.d.ts +19 -0
- package/built/lib/intent-validator/tag-update.d.ts +11 -0
- package/built/lib/interfaces/annotation.d.ts +41 -0
- package/built/lib/interfaces/api-entry.d.ts +19 -0
- package/built/lib/interfaces/api-fetcher.d.ts +10 -0
- package/built/lib/interfaces/api-tag-link.d.ts +7 -0
- package/built/lib/interfaces/api-tag.d.ts +9 -0
- package/built/lib/interfaces/content-transform.d.ts +6 -0
- package/built/lib/interfaces/content-type.d.ts +95 -0
- package/built/lib/interfaces/entry-derive.d.ts +9 -0
- package/built/lib/interfaces/entry-set-tags.d.ts +6 -0
- package/built/lib/interfaces/entry-transform-to-type.d.ts +10 -0
- package/built/lib/interfaces/errors.d.ts +35 -0
- package/built/lib/interfaces/intent-validator.d.ts +6 -0
- package/built/lib/interfaces/intent.d.ts +60 -0
- package/built/lib/interfaces/plan-message.d.ts +10 -0
- package/built/lib/interfaces/raw-step.d.ts +89 -0
- package/built/lib/interfaces/request.d.ts +12 -0
- package/built/lib/migration-chunks/validation/content-type.d.ts +4 -0
- package/built/lib/migration-chunks/validation/duplicate-props.d.ts +3 -0
- package/built/lib/migration-chunks/validation/editor-layout.d.ts +5 -0
- package/built/lib/migration-chunks/validation/errors.d.ts +23 -0
- package/built/lib/migration-chunks/validation/field.d.ts +8 -0
- package/built/lib/migration-chunks/validation/index.d.ts +19 -0
- package/built/lib/migration-chunks/validation/tag.d.ts +4 -0
- package/built/lib/migration-parser.d.ts +16 -0
- package/built/lib/migration-steps/action-creators.d.ts +53 -0
- package/built/lib/migration-steps/action-creators.js +72 -72
- package/built/lib/migration-steps/action-creators.js.map +1 -1
- package/built/lib/migration-steps/dispatch-proxy.d.ts +6 -0
- package/built/lib/migration-steps/first-external-caller.d.ts +3 -0
- package/built/lib/migration-steps/index.d.ts +3 -0
- package/built/lib/offline-api/index.d.ts +80 -0
- package/built/lib/offline-api/validator/annotations.d.ts +9 -0
- package/built/lib/offline-api/validator/content-type.d.ts +13 -0
- package/built/lib/offline-api/validator/display-field.d.ts +9 -0
- package/built/lib/offline-api/validator/editor-interface.d.ts +11 -0
- package/built/lib/offline-api/validator/entry.d.ts +7 -0
- package/built/lib/offline-api/validator/errors.d.ts +48 -0
- package/built/lib/offline-api/validator/field-deletion.d.ts +7 -0
- package/built/lib/offline-api/validator/field-groups-count.d.ts +8 -0
- package/built/lib/offline-api/validator/schema/content-type-schema.d.ts +5 -0
- package/built/lib/offline-api/validator/schema/editor-layout-schema.d.ts +2 -0
- package/built/lib/offline-api/validator/schema/field-validations-schema.d.ts +3 -0
- package/built/lib/offline-api/validator/schema/fields-schema.d.ts +2 -0
- package/built/lib/offline-api/validator/schema/index.d.ts +10 -0
- package/built/lib/offline-api/validator/schema/schema-validation.d.ts +8 -0
- package/built/lib/offline-api/validator/schema/tag-schema.d.ts +4 -0
- package/built/lib/offline-api/validator/tag.d.ts +12 -0
- package/built/lib/offline-api/validator/tags-on-entry.d.ts +11 -0
- package/built/lib/offline-api/validator/type-change.d.ts +7 -0
- package/built/lib/utils/deprecated.d.ts +1 -0
- package/built/lib/utils/editor-layout.d.ts +26 -0
- package/built/lib/utils/is-defined.d.ts +1 -0
- package/built/lib/utils/should-publish-local-changes.d.ts +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import FieldMoveIntent from '../intent/field-move';
|
|
2
|
+
import * as Joi from 'joi';
|
|
3
|
+
import IntentValidator from '../interfaces/intent-validator';
|
|
4
|
+
import ValidationError from '../interfaces/errors';
|
|
5
|
+
declare class FieldMovementStepValidator implements IntentValidator {
|
|
6
|
+
appliesTo(step: any): any;
|
|
7
|
+
get validationErrors(): {
|
|
8
|
+
INVALID_MOVEMENT_TYPE: (typeName: any) => string;
|
|
9
|
+
INVALID_MOVEMENT_WITH_SELF: (fieldId: any) => string;
|
|
10
|
+
INVALID_MOVEMENT_NAME: (movement: any) => string;
|
|
11
|
+
INVALID_MOVEMENT_NAME_WITH_SUGGESTION: (movement: any, suggestion: any) => string;
|
|
12
|
+
};
|
|
13
|
+
get schema(): {
|
|
14
|
+
toTheTop: Joi.AnySchema<any>;
|
|
15
|
+
toTheBottom: Joi.AnySchema<any>;
|
|
16
|
+
afterField: Joi.StringSchema;
|
|
17
|
+
beforeField: Joi.StringSchema;
|
|
18
|
+
};
|
|
19
|
+
validate(intent: FieldMoveIntent): ValidationError[];
|
|
20
|
+
}
|
|
21
|
+
export default FieldMovementStepValidator;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import SchemaValidator from './schema-validator';
|
|
2
|
+
import * as Joi from 'joi';
|
|
3
|
+
declare class FieldUpdateStepValidator extends SchemaValidator {
|
|
4
|
+
protected article: string;
|
|
5
|
+
protected displayName: string;
|
|
6
|
+
appliesTo(step: any): any;
|
|
7
|
+
get schema(): {
|
|
8
|
+
id: Joi.StringSchema;
|
|
9
|
+
newId: Joi.StringSchema;
|
|
10
|
+
name: Joi.StringSchema;
|
|
11
|
+
type: Joi.StringSchema;
|
|
12
|
+
localized: Joi.BooleanSchema;
|
|
13
|
+
required: Joi.BooleanSchema;
|
|
14
|
+
validations: Joi.ArraySchema;
|
|
15
|
+
defaultValue: Joi.ObjectSchema<any>;
|
|
16
|
+
disabled: Joi.BooleanSchema;
|
|
17
|
+
omitted: Joi.BooleanSchema;
|
|
18
|
+
deleted: Joi.BooleanSchema;
|
|
19
|
+
linkType: Joi.StringSchema;
|
|
20
|
+
items: Joi.ObjectSchema<any>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export default FieldUpdateStepValidator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import IntentValidator from '../interfaces/intent-validator';
|
|
2
|
+
import ValidationError from '../interfaces/errors';
|
|
3
|
+
import Intent from '../interfaces/intent';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
declare abstract class SchemaValidator implements IntentValidator {
|
|
6
|
+
protected abstract displayName: string;
|
|
7
|
+
protected abstract article: string;
|
|
8
|
+
get validationErrors(): {
|
|
9
|
+
INVALID_PROPERTY_NAME: (propName: any, article: any, typeName: any) => string;
|
|
10
|
+
INVALID_PROPERTY_NAME_WITH_SUGGESTION: (propName: any, article: any, typeName: any, suggestion: any) => string;
|
|
11
|
+
INVALID_PROPERTY_TYPE: (propName: any, typeName: any, actualType: any, expectedType: any) => string;
|
|
12
|
+
INVALID_VALUE_IN_ALTERNATIVES: (propName: any, typeName: any, value: any, expectedTypes: any) => string;
|
|
13
|
+
};
|
|
14
|
+
abstract appliesTo(intent: Intent): boolean;
|
|
15
|
+
get propertyNameToValidate(): string;
|
|
16
|
+
get schema(): Record<string, Joi.Schema>;
|
|
17
|
+
validate(intent: Intent): ValidationError[];
|
|
18
|
+
}
|
|
19
|
+
export default SchemaValidator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import SchemaValidator from './schema-validator';
|
|
2
|
+
import * as Joi from 'joi';
|
|
3
|
+
declare class TagUpdateStepValidator extends SchemaValidator {
|
|
4
|
+
protected article: string;
|
|
5
|
+
protected displayName: string;
|
|
6
|
+
appliesTo(step: any): any;
|
|
7
|
+
get schema(): {
|
|
8
|
+
name: Joi.StringSchema;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default TagUpdateStepValidator;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PayloadValidationError } from './errors';
|
|
2
|
+
declare type AnnotationTarget = {
|
|
3
|
+
type: string;
|
|
4
|
+
accept?: Record<string, any>[];
|
|
5
|
+
};
|
|
6
|
+
declare type AssignmentTarget = {
|
|
7
|
+
type: string;
|
|
8
|
+
data: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
export declare type AnnotationAssignment = {
|
|
11
|
+
annotationId: string;
|
|
12
|
+
target: AssignmentTarget;
|
|
13
|
+
};
|
|
14
|
+
export declare type AnnotationData = {
|
|
15
|
+
id: string;
|
|
16
|
+
targets: AnnotationTarget[];
|
|
17
|
+
};
|
|
18
|
+
export declare class Annotation {
|
|
19
|
+
private annotationData;
|
|
20
|
+
constructor(annotationData: AnnotationData);
|
|
21
|
+
static isValidId(id: string): id is AnnotationId;
|
|
22
|
+
/**
|
|
23
|
+
* Verifies if given assignment complies with the annotation definition
|
|
24
|
+
*/
|
|
25
|
+
validateAssignment(assignment: AnnotationAssignment): PayloadValidationError | undefined;
|
|
26
|
+
}
|
|
27
|
+
export declare const availableAnnotations: {
|
|
28
|
+
'Contentful:AggregateRoot': Annotation;
|
|
29
|
+
'Contentful:ManagedByEnvironmentTemplate': Annotation;
|
|
30
|
+
'Contentful:AggregateComponent': Annotation;
|
|
31
|
+
};
|
|
32
|
+
export declare type AnnotationId = keyof typeof availableAnnotations;
|
|
33
|
+
export declare function validateAnnotationAssignment(assignment: AnnotationAssignment): PayloadValidationError | undefined;
|
|
34
|
+
export declare type AnnotationLink = {
|
|
35
|
+
sys: {
|
|
36
|
+
type: 'Link';
|
|
37
|
+
linkType: 'Annotation';
|
|
38
|
+
id: AnnotationId;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import APITagLink from './api-tag-link';
|
|
2
|
+
export default interface APIEntry {
|
|
3
|
+
sys: {
|
|
4
|
+
id: string;
|
|
5
|
+
version: number;
|
|
6
|
+
publishedVersion?: number;
|
|
7
|
+
contentType: {
|
|
8
|
+
sys: {
|
|
9
|
+
type: string;
|
|
10
|
+
linkType: string;
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
fields: object;
|
|
16
|
+
metadata?: {
|
|
17
|
+
tags: APITagLink[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import IntentList from '../intent-list/index';
|
|
2
|
+
import { ContentType } from '../entities/content-type';
|
|
3
|
+
export default interface APIFetcher {
|
|
4
|
+
getEntriesInIntents(intentList: IntentList): any;
|
|
5
|
+
getContentTypesInChunks(intentList: IntentList): any;
|
|
6
|
+
getEditorInterfacesInIntents(intentList: IntentList): any;
|
|
7
|
+
getLocalesForSpace(): any;
|
|
8
|
+
checkContentTypesForDeletedCts(intentList: IntentList, contentTypes: ContentType[]): any;
|
|
9
|
+
getTagsForEnvironment(intentList: IntentList): any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { AnnotationLink } from './annotation';
|
|
2
|
+
interface Field {
|
|
3
|
+
id: string;
|
|
4
|
+
newId?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
linkType?: string;
|
|
8
|
+
items?: {
|
|
9
|
+
type: string;
|
|
10
|
+
linkType?: string;
|
|
11
|
+
validations?: any[];
|
|
12
|
+
};
|
|
13
|
+
omitted?: boolean;
|
|
14
|
+
deleted?: boolean;
|
|
15
|
+
localized?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
validations?: any[];
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
defaultValue?: {
|
|
20
|
+
[locale: string]: any;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
declare type ContentTypeMetadata = {
|
|
24
|
+
annotations?: {
|
|
25
|
+
ContentType?: AnnotationLink[];
|
|
26
|
+
ContentTypeField?: Record<string, AnnotationLink[]>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
interface APIContentType {
|
|
30
|
+
sys: {
|
|
31
|
+
id: string;
|
|
32
|
+
version: number;
|
|
33
|
+
};
|
|
34
|
+
fields: Field[];
|
|
35
|
+
name: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
displayField?: string;
|
|
38
|
+
metadata?: ContentTypeMetadata;
|
|
39
|
+
}
|
|
40
|
+
declare type APIParameterValue = number | boolean | string;
|
|
41
|
+
interface APIEditorInterfaceSettings {
|
|
42
|
+
[setting: string]: APIParameterValue;
|
|
43
|
+
}
|
|
44
|
+
declare type APISidebarWidgetNamespace = 'sidebar-builtin' | 'extension' | 'app';
|
|
45
|
+
declare type APIControlWidgetNamespace = 'builtin' | 'extension' | 'app';
|
|
46
|
+
interface APIEditorInterfaceControl {
|
|
47
|
+
fieldId: string;
|
|
48
|
+
widgetId?: string;
|
|
49
|
+
widgetNamespace?: APIControlWidgetNamespace;
|
|
50
|
+
settings?: APIEditorInterfaceSettings;
|
|
51
|
+
}
|
|
52
|
+
interface APIEditorInterfaceGroupControl {
|
|
53
|
+
groupId: string;
|
|
54
|
+
widgetId?: string;
|
|
55
|
+
widgetNamespace?: string;
|
|
56
|
+
settings?: APIEditorInterfaceSettings;
|
|
57
|
+
}
|
|
58
|
+
interface APISidebarWidgetSettings {
|
|
59
|
+
[key: string]: APIParameterValue;
|
|
60
|
+
}
|
|
61
|
+
interface APIEditorInterfaceSidebar {
|
|
62
|
+
widgetId: string;
|
|
63
|
+
widgetNamespace: APISidebarWidgetNamespace;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
settings?: APISidebarWidgetSettings;
|
|
66
|
+
}
|
|
67
|
+
interface APIEditorIntefaceEditor {
|
|
68
|
+
widgetId: string;
|
|
69
|
+
widgetNamespace: APIControlWidgetNamespace;
|
|
70
|
+
settings?: {
|
|
71
|
+
[key: string]: APIParameterValue;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface APIEditorLayoutFieldGroupItem {
|
|
75
|
+
groupId: string;
|
|
76
|
+
name?: string;
|
|
77
|
+
items: APIEditorLayoutItem[];
|
|
78
|
+
}
|
|
79
|
+
interface APIEditorLayoutFieldItem {
|
|
80
|
+
fieldId: string;
|
|
81
|
+
}
|
|
82
|
+
declare type APIEditorLayoutItem = APIEditorLayoutFieldItem | APIEditorLayoutFieldGroupItem;
|
|
83
|
+
declare type APIEditorInterfaceEditorLayout = APIEditorLayoutFieldGroupItem[];
|
|
84
|
+
interface APIEditorInterfaces {
|
|
85
|
+
sys: {
|
|
86
|
+
version: number;
|
|
87
|
+
};
|
|
88
|
+
controls: APIEditorInterfaceControl[];
|
|
89
|
+
sidebar?: APIEditorInterfaceSidebar[];
|
|
90
|
+
editor?: APIEditorIntefaceEditor;
|
|
91
|
+
editors?: APIEditorIntefaceEditor[];
|
|
92
|
+
editorLayout?: APIEditorInterfaceEditorLayout;
|
|
93
|
+
groupControls?: APIEditorInterfaceGroupControl[];
|
|
94
|
+
}
|
|
95
|
+
export { APIContentType as default, APIContentType, Field, APIEditorInterfaces, APIEditorInterfaceControl, APIEditorInterfaceGroupControl, APIEditorInterfaceSettings, APIEditorInterfaceSidebar, APIEditorIntefaceEditor, APIEditorInterfaceEditorLayout, APIEditorLayoutFieldGroupItem, APISidebarWidgetSettings, APIControlWidgetNamespace, APISidebarWidgetNamespace, ContentTypeMetadata };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default interface EntryDerive {
|
|
2
|
+
derivedContentType: string;
|
|
3
|
+
from: string[];
|
|
4
|
+
toReferenceField: string;
|
|
5
|
+
derivedFields: string[];
|
|
6
|
+
identityKey: (fromFields: any) => Promise<string>;
|
|
7
|
+
shouldPublish?: boolean | 'preserve';
|
|
8
|
+
deriveEntryForLocale(inputFields: any, locale: string): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default interface TransformEntryToType {
|
|
2
|
+
sourceContentType: string;
|
|
3
|
+
targetContentType: string;
|
|
4
|
+
from?: string[];
|
|
5
|
+
identityKey: (fromFields: any) => Promise<string>;
|
|
6
|
+
shouldPublish?: boolean | 'preserve';
|
|
7
|
+
removeOldEntries?: boolean;
|
|
8
|
+
updateReferences?: boolean;
|
|
9
|
+
transformEntryForLocale(inputFields: any, locale: string): Promise<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Intent } from './intent';
|
|
2
|
+
interface ValidationError {
|
|
3
|
+
type: string;
|
|
4
|
+
message: string;
|
|
5
|
+
details?: {
|
|
6
|
+
intent: Intent;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface PayloadValidationError extends ValidationError {
|
|
10
|
+
type: 'InvalidPayload';
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
interface InvalidActionError extends ValidationError {
|
|
14
|
+
type: 'InvalidAction';
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
interface InvalidTypeError extends ValidationError {
|
|
18
|
+
type: 'InvalidType';
|
|
19
|
+
message: string;
|
|
20
|
+
details: {
|
|
21
|
+
intent: Intent;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface InvalidMovementError extends ValidationError {
|
|
25
|
+
type: 'InvalidMovement';
|
|
26
|
+
message: string;
|
|
27
|
+
details: {
|
|
28
|
+
intent: Intent;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface InvalidPropertyError extends ValidationError {
|
|
32
|
+
type: 'InvalidProperty';
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
export { ValidationError as default, PayloadValidationError, InvalidActionError, InvalidTypeError, InvalidMovementError, InvalidPropertyError };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { APIAction, EntityAction } from '../action/action';
|
|
2
|
+
import RawStep from './raw-step';
|
|
3
|
+
import { PlanMessage } from './plan-message';
|
|
4
|
+
interface Intent {
|
|
5
|
+
toActions(): (APIAction | EntityAction)[];
|
|
6
|
+
toRaw(): RawStep;
|
|
7
|
+
getContentTypeId(): string;
|
|
8
|
+
getRelatedContentTypeIds(): string[];
|
|
9
|
+
getFieldId(): string;
|
|
10
|
+
getInvalidMethod(): string;
|
|
11
|
+
getFieldGroupId(): string;
|
|
12
|
+
getNewFieldGroupId(): string;
|
|
13
|
+
getFieldGroupProps(): {
|
|
14
|
+
[prop: string]: string;
|
|
15
|
+
};
|
|
16
|
+
getRawType(): string;
|
|
17
|
+
getTagId(): string;
|
|
18
|
+
requiresAllEntries(): boolean;
|
|
19
|
+
requiresAllTags(): boolean;
|
|
20
|
+
requiresContentType(): boolean;
|
|
21
|
+
shouldSave(): boolean;
|
|
22
|
+
shouldPublish(): boolean;
|
|
23
|
+
isContentTypeUpdate(): boolean;
|
|
24
|
+
isContentTypeDelete(): boolean;
|
|
25
|
+
isContentTypeCreate(): boolean;
|
|
26
|
+
isFieldCreate(): boolean;
|
|
27
|
+
isFieldUpdate(): boolean;
|
|
28
|
+
isFieldDelete(): boolean;
|
|
29
|
+
isFieldRename(): boolean;
|
|
30
|
+
isFieldMove(): boolean;
|
|
31
|
+
isAboutContentType(): boolean;
|
|
32
|
+
isAboutField(): boolean;
|
|
33
|
+
isAboutEditorLayout(): boolean;
|
|
34
|
+
isContentTransform(): boolean;
|
|
35
|
+
isEntryDerive(): boolean;
|
|
36
|
+
isEntryTransformToType(): boolean;
|
|
37
|
+
isGroupable(): boolean;
|
|
38
|
+
isEditorInterfaceIntent(): boolean;
|
|
39
|
+
isEditorInterfaceUpdate(): boolean;
|
|
40
|
+
isSidebarUpdate(): boolean;
|
|
41
|
+
isTagIntent(): boolean;
|
|
42
|
+
isTagCreate(): boolean;
|
|
43
|
+
isTagUpdate(): boolean;
|
|
44
|
+
isTagDelete(): boolean;
|
|
45
|
+
isEntrySetTags(): boolean;
|
|
46
|
+
isEditorLayoutCreate(): boolean;
|
|
47
|
+
isEditorLayoutDelete(): boolean;
|
|
48
|
+
isEditorLayoutUpdate(): boolean;
|
|
49
|
+
isEditorLayoutInvalidMethod(): boolean;
|
|
50
|
+
isFieldGroupCreate(): boolean;
|
|
51
|
+
isFieldGroupDelete(): boolean;
|
|
52
|
+
isFieldGroupUpdate(): boolean;
|
|
53
|
+
isFieldGroupIdChange(): boolean;
|
|
54
|
+
isFieldGroupControlChange(): boolean;
|
|
55
|
+
isComposedIntent(): boolean;
|
|
56
|
+
groupsWith(other: Intent): boolean;
|
|
57
|
+
endsGroup(): boolean;
|
|
58
|
+
toPlanMessage(): PlanMessage;
|
|
59
|
+
}
|
|
60
|
+
export { Intent as default, Intent };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { TagVisibility } from './api-tag';
|
|
2
|
+
import ContentTransform from './content-transform';
|
|
3
|
+
import EntryDerive from './entry-derive';
|
|
4
|
+
import EntrySetTags from './entry-set-tags';
|
|
5
|
+
import TransformEntryToType from './entry-transform-to-type';
|
|
6
|
+
import { SidebarWidgetNamespace, SidebarWidgetSettings } from '../action/sidebarwidget';
|
|
7
|
+
import { EntryEditorNamespace, EntryEditorSettings } from '../action/entryeditor-configure';
|
|
8
|
+
import { EntryEditor } from '../action/entryeditors-configure';
|
|
9
|
+
import { APIEditorInterfaceGroupControl, APIEditorLayoutFieldGroupItem } from './content-type';
|
|
10
|
+
import { AnnotationId } from './annotation';
|
|
11
|
+
interface RawStep {
|
|
12
|
+
type: string;
|
|
13
|
+
meta: RawStepMeta;
|
|
14
|
+
payload: RawStepPayload;
|
|
15
|
+
}
|
|
16
|
+
interface RawStepMeta {
|
|
17
|
+
contentTypeInstanceId?: string;
|
|
18
|
+
fieldInstanceId?: string;
|
|
19
|
+
fieldGroupInstanceId?: string;
|
|
20
|
+
tagInstanceId?: string;
|
|
21
|
+
callsite: CallSiteInfo;
|
|
22
|
+
}
|
|
23
|
+
interface CallSiteInfo {
|
|
24
|
+
line: number;
|
|
25
|
+
file: string;
|
|
26
|
+
}
|
|
27
|
+
interface RawStepPayload {
|
|
28
|
+
contentTypeId?: string;
|
|
29
|
+
fieldId?: string;
|
|
30
|
+
props?: RawStepProps;
|
|
31
|
+
transformation?: ContentTransform;
|
|
32
|
+
derivation?: EntryDerive;
|
|
33
|
+
movement?: Movement;
|
|
34
|
+
entryTransformationToType?: TransformEntryToType;
|
|
35
|
+
editorInterfaceCopy?: EditorInterfaceCopy;
|
|
36
|
+
editorInterfaceReset?: EditorInterfaceReset;
|
|
37
|
+
editorInterface?: EditorInterfaceInfo;
|
|
38
|
+
sidebarWidget?: SidebarWidgetInfo;
|
|
39
|
+
entryEditor?: EntryEditorInfo;
|
|
40
|
+
entryEditors?: EntryEditor[];
|
|
41
|
+
invalidMethod?: string;
|
|
42
|
+
fieldGroupId?: string;
|
|
43
|
+
newFieldGroupId?: string;
|
|
44
|
+
parentFieldGroupId?: string;
|
|
45
|
+
fieldGroupProps?: Omit<APIEditorLayoutFieldGroupItem, 'groupId' | 'items'>;
|
|
46
|
+
groupControl?: Omit<APIEditorInterfaceGroupControl, 'groupId'>;
|
|
47
|
+
tagId?: string;
|
|
48
|
+
tagVisibility?: TagVisibility;
|
|
49
|
+
entryTransformationForTags?: EntrySetTags;
|
|
50
|
+
annotations?: AnnotationId[];
|
|
51
|
+
}
|
|
52
|
+
interface EditorInterfaceInfo {
|
|
53
|
+
fieldId: string;
|
|
54
|
+
widgetId: string;
|
|
55
|
+
widgetNamespace: FieldControlNamespace;
|
|
56
|
+
settings?: FieldControlSettings;
|
|
57
|
+
}
|
|
58
|
+
declare type SettingsParameterValue = number | boolean | string;
|
|
59
|
+
interface FieldControlSettings {
|
|
60
|
+
[setting: string]: SettingsParameterValue;
|
|
61
|
+
}
|
|
62
|
+
declare type FieldControlNamespace = 'builtin' | 'extension';
|
|
63
|
+
interface Movement {
|
|
64
|
+
pivot?: string;
|
|
65
|
+
direction?: string;
|
|
66
|
+
}
|
|
67
|
+
interface EditorInterfaceCopy {
|
|
68
|
+
source?: string;
|
|
69
|
+
destination?: string;
|
|
70
|
+
}
|
|
71
|
+
interface EditorInterfaceReset {
|
|
72
|
+
fieldId: string;
|
|
73
|
+
}
|
|
74
|
+
interface RawStepProps {
|
|
75
|
+
[propName: string]: any;
|
|
76
|
+
}
|
|
77
|
+
export interface SidebarWidgetInfo {
|
|
78
|
+
widgetId: string;
|
|
79
|
+
widgetNamespace?: SidebarWidgetNamespace;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
settings?: SidebarWidgetSettings;
|
|
82
|
+
insertBeforeWidgetId?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface EntryEditorInfo {
|
|
85
|
+
widgetId: string;
|
|
86
|
+
widgetNamespace?: EntryEditorNamespace;
|
|
87
|
+
settings?: EntryEditorSettings;
|
|
88
|
+
}
|
|
89
|
+
export { RawStep as default, RawStep, RawStepMeta, CallSiteInfo, RawStepPayload, RawStepProps, EditorInterfaceInfo };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface HttpRequest {
|
|
2
|
+
method: 'PUT' | 'POST' | 'DELETE' | 'GET';
|
|
3
|
+
url: string;
|
|
4
|
+
headers?: object;
|
|
5
|
+
data?: {
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
displayField?: string;
|
|
9
|
+
fields?: object;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export { HttpRequest as default, HttpRequest };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Intent from '../../interfaces/intent';
|
|
2
|
+
import { ContentType, EditorInterfaces } from '../../entities/content-type';
|
|
3
|
+
import { InvalidActionError } from '../../interfaces/errors';
|
|
4
|
+
import { FieldsContext } from './index';
|
|
5
|
+
export default function (intents: Intent[], editorInterfaces: Map<string, EditorInterfaces>, fieldsContext: FieldsContext, contentTypes: ContentType[]): InvalidActionError[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface ErrorGroup {
|
|
2
|
+
[identifier: string]: (id?: any, ...args: any[]) => string;
|
|
3
|
+
}
|
|
4
|
+
interface ErrorCreators {
|
|
5
|
+
field: {
|
|
6
|
+
[groupIdentifier: string]: ErrorGroup;
|
|
7
|
+
};
|
|
8
|
+
contentType: {
|
|
9
|
+
[groupIdentifier: string]: ErrorGroup;
|
|
10
|
+
};
|
|
11
|
+
editorLayout: {
|
|
12
|
+
[groupIdentifier: string]: ErrorGroup;
|
|
13
|
+
};
|
|
14
|
+
entry: {
|
|
15
|
+
[groupIdentifier: string]: ErrorGroup;
|
|
16
|
+
};
|
|
17
|
+
tag: {
|
|
18
|
+
[groupIdentifier: string]: ErrorGroup;
|
|
19
|
+
};
|
|
20
|
+
generic: ErrorGroup;
|
|
21
|
+
}
|
|
22
|
+
declare const errorCreators: ErrorCreators;
|
|
23
|
+
export default errorCreators;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ValidationError from '../../interfaces/errors';
|
|
2
|
+
import { Intent } from '../../interfaces/intent';
|
|
3
|
+
import { ContentType } from '../../entities/content-type';
|
|
4
|
+
import { FieldsContext } from './index';
|
|
5
|
+
export default function (intents: Intent[], contentTypes?: ContentType[]): {
|
|
6
|
+
errors: ValidationError[];
|
|
7
|
+
fieldsContext: FieldsContext;
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import IntentList from '../../intent-list';
|
|
2
|
+
import { ContentType, EditorInterfaces } from '../../entities/content-type';
|
|
3
|
+
import { Tag } from '../../entities/tag';
|
|
4
|
+
import ValidationError, { InvalidActionError } from '../../interfaces/errors';
|
|
5
|
+
export declare type FieldsContext = {
|
|
6
|
+
contentTypeFields: Record<string, Set<string>>;
|
|
7
|
+
recentlyRemoved: Record<string, Set<string>>;
|
|
8
|
+
recentlyMoved: Record<string, Set<string>>;
|
|
9
|
+
changedFieldIds: Record<string, Map<string, string>>;
|
|
10
|
+
};
|
|
11
|
+
export declare const invalidActionError: (message: any, intent: any) => {
|
|
12
|
+
type: string;
|
|
13
|
+
message: any;
|
|
14
|
+
details: {
|
|
15
|
+
intent: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare function validateIntents(intentList: IntentList, contentTypes: ContentType[], editorInterfaces: Map<string, EditorInterfaces>, tags: Tag[]): ValidationError[] | InvalidActionError[];
|
|
19
|
+
export { validateIntents as default, validateIntents };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestBatch } from './offline-api';
|
|
2
|
+
import ValidationError, { InvalidActionError } from './interfaces/errors';
|
|
3
|
+
import { ClientConfig } from '../bin/lib/config';
|
|
4
|
+
declare class ParseResult {
|
|
5
|
+
batches: RequestBatch[];
|
|
6
|
+
stepsValidationErrors: ValidationError[];
|
|
7
|
+
payloadValidationErrors: InvalidActionError[] | ValidationError[];
|
|
8
|
+
hasValidationErrors(): boolean;
|
|
9
|
+
hasRuntimeErrors(): boolean;
|
|
10
|
+
hasStepsValidationErrors(): boolean;
|
|
11
|
+
hasPayloadValidationErrors(): boolean;
|
|
12
|
+
getRuntimeErrors(): any[];
|
|
13
|
+
getValidationErrors(): any[];
|
|
14
|
+
}
|
|
15
|
+
declare const createMigrationParser: (makeRequest: Function, config: ClientConfig) => (migrationCreator: (migration: any) => any) => Promise<ParseResult>;
|
|
16
|
+
export { createMigrationParser as default, createMigrationParser, ParseResult };
|