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

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 -32
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-A3",
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-A3"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
package/schema.d.ts CHANGED
@@ -11,8 +11,8 @@ declare global {
11
11
  '/lib/xp/schema': typeof import('./schema');
12
12
  }
13
13
  }
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';
14
+ import type { ByteSource, FormItem, UserKey, ConfigValue } from '@enonic-types/core';
15
+ export type { ByteSource, FormItem, FormItemFormFragment, FormItemInput, FormItemLayout, FormItemOptionSet, FormItemSet, GroupKey, InputType, PrincipalKey, RoleKey, UserKey, ValueType, ConfigValue, } from '@enonic-types/core';
16
16
  export interface Icon {
17
17
  data: ByteSource;
18
18
  mimeType: string;
@@ -23,11 +23,11 @@ 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
- displayName: string;
30
- displayNameI18nKey: string;
29
+ title: string;
30
+ titleI18nKey: string;
31
31
  description: string;
32
32
  descriptionI18nKey: string;
33
33
  createdTime: string;
@@ -40,19 +40,15 @@ 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, ConfigValue>;
44
+ mixinNames?: string[];
50
45
  }
51
- export interface MixinSchema extends Schema {
46
+ export interface FormFragmentSchema extends Schema {
52
47
  form: FormItem[];
53
48
  }
54
- export interface XDataSchema extends Schema {
49
+ export interface MixinSchema extends Schema {
55
50
  form: FormItem[];
51
+ config: Record<string, ConfigValue>;
56
52
  }
57
53
  /**
58
54
  * Creates dynamic content schema resource.
@@ -62,10 +58,10 @@ export interface XDataSchema extends Schema {
62
58
  * @param {string} params.type Schema type.
63
59
  * @param {string} [params.resource] Schema resource value.
64
60
  *
65
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} created resource.
61
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} created resource.
66
62
  */
67
- export declare function createSchema(params: CreateDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
68
- export declare type ComponentDescriptorType = 'PAGE' | 'LAYOUT' | 'PART';
63
+ export declare function createSchema(params: CreateDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
64
+ export type ComponentDescriptorType = 'PAGE' | 'LAYOUT' | 'PART';
69
65
  export interface CreateDynamicComponentParams {
70
66
  key: string;
71
67
  type: ComponentDescriptorType;
@@ -73,8 +69,8 @@ export interface CreateDynamicComponentParams {
73
69
  }
74
70
  export interface ComponentDescriptor {
75
71
  key: string;
76
- displayName: string;
77
- displayNameI18nKey: string;
72
+ title: string;
73
+ titleI18nKey: string;
78
74
  description: string;
79
75
  descriptionI18nKey: string;
80
76
  componentPath: string;
@@ -82,12 +78,7 @@ export interface ComponentDescriptor {
82
78
  resource: string;
83
79
  type: ComponentDescriptorType;
84
80
  form: FormItem[];
85
- config: {
86
- [configName: string]: {
87
- [attributeKey: string]: string;
88
- value: string;
89
- }[];
90
- };
81
+ config: Record<string, ConfigValue>;
91
82
  }
92
83
  export interface LayoutDescriptor extends ComponentDescriptor {
93
84
  regions?: string[] | null;
@@ -145,9 +136,9 @@ export interface GetDynamicContentSchemaParams {
145
136
  * @param {string} params.name Content schema resource name.
146
137
  * @param {string} params.type Content schema type.
147
138
  *
148
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} fetched resource.
139
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} fetched resource.
149
140
  */
150
- export declare function getSchema(params: GetDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
141
+ export declare function getSchema(params: GetDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
151
142
  export interface GetDynamicComponentParams {
152
143
  key: string;
153
144
  type: ComponentDescriptorType;
@@ -167,7 +158,7 @@ export interface SiteDescriptor {
167
158
  resource: string;
168
159
  modifiedTime: string;
169
160
  form: FormItem[];
170
- xDataMappings?: {
161
+ mixinMappings?: {
171
162
  name: string;
172
163
  optional: boolean;
173
164
  allowContentTypes: string;
@@ -250,9 +241,9 @@ export interface UpdateDynamicContentSchemaParams {
250
241
  * @param {string} params.type Content schema type.
251
242
  * @param {string} [params.resource] Schema resource value.
252
243
  *
253
- * @returns {ContentTypeSchema | MixinSchema | XDataSchema} created resource.
244
+ * @returns {ContentTypeSchema | FormFragmentSchema | MixinSchema} created resource.
254
245
  */
255
- export declare function updateSchema(params: UpdateDynamicContentSchemaParams): ContentTypeSchema | MixinSchema | XDataSchema;
246
+ export declare function updateSchema(params: UpdateDynamicContentSchemaParams): ContentTypeSchema | FormFragmentSchema | MixinSchema;
256
247
  export interface UpdateDynamicComponentParams {
257
248
  key: string;
258
249
  type: ComponentDescriptorType;
@@ -322,6 +313,6 @@ export interface ListDynamicSchemasParams {
322
313
  * @param {string} params.application Application key.
323
314
  * @param {string} params.type Content schema type.
324
315
  *
325
- * @returns {ContentSchemaType[] | MixinSchema[] | XDataSchema[]} fetched resources.
316
+ * @returns {ContentSchemaType[] | FormFragmentSchema[] | MixinSchema[]} fetched resources.
326
317
  */
327
- export declare function listSchemas(params: ListDynamicSchemasParams): ContentSchemaType[] | MixinSchema[] | XDataSchema[];
318
+ export declare function listSchemas(params: ListDynamicSchemasParams): ContentSchemaType[] | FormFragmentSchema[] | MixinSchema[];