@enonic-types/lib-schema 7.16.2 → 8.0.0-A2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/schema.d.ts +23 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-schema",
3
- "version": "7.16.2",
3
+ "version": "8.0.0-A2",
4
4
  "description": "Type definitions for lib-schema.",
5
5
  "types": "schema.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "7.16.2"
30
+ "@enonic-types/core": "8.0.0-A2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
package/schema.d.ts CHANGED
@@ -12,7 +12,7 @@ declare global {
12
12
  }
13
13
  }
14
14
  import type { ByteSource, FormItem, UserKey } from '@enonic-types/core';
15
- export type { ByteSource, FormItem, FormItemInlineMixin, FormItemInput, FormItemLayout, FormItemOptionSet, FormItemSet, GroupKey, InputType, PrincipalKey, RoleKey, UserKey, ValueType, } from '@enonic-types/core';
15
+ export type { ByteSource, FormItem, FormItemFormFragment, FormItemInput, FormItemLayout, FormItemOptionSet, FormItemSet, GroupKey, InputType, PrincipalKey, RoleKey, UserKey, ValueType, } from '@enonic-types/core';
16
16
  export interface Icon {
17
17
  data: ByteSource;
18
18
  mimeType: string;
@@ -23,7 +23,7 @@ export interface CreateDynamicContentSchemaParams {
23
23
  type: string;
24
24
  resource?: string | null;
25
25
  }
26
- export declare type ContentSchemaType = 'CONTENT_TYPE' | 'MIXIN' | 'XDATA';
26
+ export type ContentSchemaType = 'CONTENT_TYPE' | 'FORM_FRAGMENT' | 'MIXIN';
27
27
  export interface Schema {
28
28
  name: string;
29
29
  displayName: string;
@@ -40,18 +40,16 @@ export interface Schema {
40
40
  }
41
41
  export interface ContentTypeSchema extends Schema {
42
42
  form: FormItem[];
43
- config: {
44
- [configName: string]: {
45
- [attributeKey: string]: string;
46
- value: string;
47
- }[];
48
- };
49
- xDataNames?: string[];
43
+ config: Record<string, {
44
+ [attributeKey: string]: string;
45
+ value: string;
46
+ }[]>;
47
+ mixinNames?: string[];
50
48
  }
51
- export interface MixinSchema extends Schema {
49
+ export interface FormFragmentSchema extends Schema {
52
50
  form: FormItem[];
53
51
  }
54
- export interface XDataSchema extends Schema {
52
+ export interface MixinSchema extends Schema {
55
53
  form: FormItem[];
56
54
  }
57
55
  /**
@@ -62,10 +60,10 @@ export interface XDataSchema extends Schema {
62
60
  * @param {string} params.type Schema type.
63
61
  * @param {string} [params.resource] Schema resource value.
64
62
  *
65
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} created resource.
63
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} created resource.
66
64
  */
67
- export declare function createSchema(params: CreateDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
68
- export declare type ComponentDescriptorType = 'PAGE' | 'LAYOUT' | 'PART';
65
+ export declare function createSchema(params: CreateDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
66
+ export type ComponentDescriptorType = 'PAGE' | 'LAYOUT' | 'PART';
69
67
  export interface CreateDynamicComponentParams {
70
68
  key: string;
71
69
  type: ComponentDescriptorType;
@@ -82,12 +80,10 @@ export interface ComponentDescriptor {
82
80
  resource: string;
83
81
  type: ComponentDescriptorType;
84
82
  form: FormItem[];
85
- config: {
86
- [configName: string]: {
87
- [attributeKey: string]: string;
88
- value: string;
89
- }[];
90
- };
83
+ config: Record<string, {
84
+ [attributeKey: string]: string;
85
+ value: string;
86
+ }[]>;
91
87
  }
92
88
  export interface LayoutDescriptor extends ComponentDescriptor {
93
89
  regions?: string[] | null;
@@ -145,9 +141,9 @@ export interface GetDynamicContentSchemaParams {
145
141
  * @param {string} params.name Content schema resource name.
146
142
  * @param {string} params.type Content schema type.
147
143
  *
148
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} fetched resource.
144
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} fetched resource.
149
145
  */
150
- export declare function getSchema(params: GetDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
146
+ export declare function getSchema(params: GetDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
151
147
  export interface GetDynamicComponentParams {
152
148
  key: string;
153
149
  type: ComponentDescriptorType;
@@ -167,7 +163,7 @@ export interface SiteDescriptor {
167
163
  resource: string;
168
164
  modifiedTime: string;
169
165
  form: FormItem[];
170
- xDataMappings?: {
166
+ mixinMappings?: {
171
167
  name: string;
172
168
  optional: boolean;
173
169
  allowContentTypes: string;
@@ -250,9 +246,9 @@ export interface UpdateDynamicContentSchemaParams {
250
246
  * @param {string} params.type Content schema type.
251
247
  * @param {string} [params.resource] Schema resource value.
252
248
  *
253
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} created resource.
249
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} created resource.
254
250
  */
255
- export declare function updateSchema(params: UpdateDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
251
+ export declare function updateSchema(params: UpdateDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
256
252
  export interface UpdateDynamicComponentParams {
257
253
  key: string;
258
254
  type: ComponentDescriptorType;
@@ -322,6 +318,6 @@ export interface ListDynamicSchemasParams {
322
318
  * @param {string} params.application Application key.
323
319
  * @param {string} params.type Content schema type.
324
320
  *
325
- * @returns {ContentSchemaType[] | MixinSchema[] | XDataSchema[]} fetched resources.
321
+ * @returns {ContentSchemaType[] | FormFragmentSchema[] | MixinSchema[]} fetched resources.
326
322
  */
327
- export declare function listSchemas(params: ListDynamicSchemasParams): ContentSchemaType[] | MixinSchema[] | XDataSchema[];
323
+ export declare function listSchemas(params: ListDynamicSchemasParams): ContentSchemaType[] | FormFragmentSchema[] | MixinSchema[];