@contentchef/contentchef-types 2.5.0 → 2.5.4
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/dist/api/Content.d.ts +3 -3
- package/dist/api/ContentDefinition.d.ts +8 -1
- package/dist/api/ContentTranslation.d.ts +10 -0
- package/lib/api/Content.ts +3 -3
- package/lib/api/ContentDefinition.ts +19 -10
- package/lib/api/ContentDefinitionSchema.ts +5 -5
- package/lib/api/ContentTranslation.ts +21 -6
- package/package.json +2 -2
package/dist/api/Content.d.ts
CHANGED
|
@@ -203,7 +203,7 @@ export declare type CreateContentRequest = {
|
|
|
203
203
|
/**
|
|
204
204
|
* Controls if translations should be ignored when publishing
|
|
205
205
|
*/
|
|
206
|
-
|
|
206
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
207
207
|
};
|
|
208
208
|
/**
|
|
209
209
|
* This type represent the data needed to make a update content API request
|
|
@@ -252,7 +252,7 @@ export declare type UpdateContentRequest = {
|
|
|
252
252
|
/**
|
|
253
253
|
* Controls if translations should be ignored when publishing
|
|
254
254
|
*/
|
|
255
|
-
|
|
255
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
256
256
|
};
|
|
257
257
|
/**
|
|
258
258
|
* This type represent the data that can be used to filter a list of contents
|
|
@@ -541,7 +541,7 @@ export declare type ContentResponse = {
|
|
|
541
541
|
/**
|
|
542
542
|
* Controls if translations should be ignored when publishing
|
|
543
543
|
*/
|
|
544
|
-
|
|
544
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
545
545
|
/**
|
|
546
546
|
* Content's checksum (it's different whenever at least one localized field changes)
|
|
547
547
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthorResponse } from './Author';
|
|
2
|
-
import { ContentDefinitionSchema, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
3
2
|
import { PagedListResponse } from './common';
|
|
3
|
+
import { ContentDefinitionSchema, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
4
4
|
import { Extension } from './Extension';
|
|
5
5
|
/**
|
|
6
6
|
* This type represent the unique content definition id type
|
|
@@ -15,6 +15,9 @@ export declare type GetContentDefinitionRequest = {
|
|
|
15
15
|
*/
|
|
16
16
|
id: ContentDefinitionId;
|
|
17
17
|
};
|
|
18
|
+
export declare type ArrayField = {
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
18
21
|
/**
|
|
19
22
|
* This type represent the data needed to make a list content definition API request
|
|
20
23
|
*/
|
|
@@ -160,6 +163,10 @@ export declare type ContentDefinitionResponse = {
|
|
|
160
163
|
* Extensions used by the definition (type Extension or string (mnemonicId) depending if they are resolved or not)
|
|
161
164
|
*/
|
|
162
165
|
extensions: Extension[] | string[];
|
|
166
|
+
/**
|
|
167
|
+
* Valued with paths to each array or null if definition is legacy
|
|
168
|
+
*/
|
|
169
|
+
trackableArrayFields?: ArrayField[] | null;
|
|
163
170
|
};
|
|
164
171
|
/**
|
|
165
172
|
* This type represent the response of a create content definition API request
|
|
@@ -48,3 +48,13 @@ export declare type ListContentTranslationRequest = {
|
|
|
48
48
|
contentId: ContentId;
|
|
49
49
|
};
|
|
50
50
|
export declare type ListContentTranslationResponse = ContentTranslation[];
|
|
51
|
+
export declare type DeleteContentTranslationRequest = {
|
|
52
|
+
contentId: ContentId;
|
|
53
|
+
locale: string;
|
|
54
|
+
};
|
|
55
|
+
export declare type DeleteContentTranslationResponse = boolean;
|
|
56
|
+
export declare type CleanContentTranslationRequest = {
|
|
57
|
+
contentId: ContentId;
|
|
58
|
+
locales: string[];
|
|
59
|
+
};
|
|
60
|
+
export declare type CleanContentTranslationResponse = boolean;
|
package/lib/api/Content.ts
CHANGED
|
@@ -217,7 +217,7 @@ export type CreateContentRequest = {
|
|
|
217
217
|
/**
|
|
218
218
|
* Controls if translations should be ignored when publishing
|
|
219
219
|
*/
|
|
220
|
-
|
|
220
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -268,7 +268,7 @@ export type UpdateContentRequest = {
|
|
|
268
268
|
/**
|
|
269
269
|
* Controls if translations should be ignored when publishing
|
|
270
270
|
*/
|
|
271
|
-
|
|
271
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
272
272
|
};
|
|
273
273
|
|
|
274
274
|
/**
|
|
@@ -570,7 +570,7 @@ export type ContentResponse = {
|
|
|
570
570
|
/**
|
|
571
571
|
* Controls if translations should be ignored when publishing
|
|
572
572
|
*/
|
|
573
|
-
|
|
573
|
+
contentLocalizationSettings?: LocalizationSettings;
|
|
574
574
|
|
|
575
575
|
/**
|
|
576
576
|
* Content's checksum (it's different whenever at least one localized field changes)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthorResponse } from './Author';
|
|
2
|
-
import { ContentDefinitionSchema, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
3
2
|
import { PagedListResponse } from './common';
|
|
3
|
+
import { ContentDefinitionSchema, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
4
4
|
import { Extension } from './Extension';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -18,6 +18,10 @@ export type GetContentDefinitionRequest = {
|
|
|
18
18
|
id: ContentDefinitionId;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
export type ArrayField = {
|
|
22
|
+
path: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
21
25
|
/**
|
|
22
26
|
* This type represent the data needed to make a list content definition API request
|
|
23
27
|
*/
|
|
@@ -42,7 +46,7 @@ export type ListContentDefinitionsRequest = {
|
|
|
42
46
|
* This filter is used to search contents that contain the value inserted in the mnemonic id
|
|
43
47
|
*/
|
|
44
48
|
mnemonicId?: string;
|
|
45
|
-
}
|
|
49
|
+
};
|
|
46
50
|
};
|
|
47
51
|
|
|
48
52
|
/**
|
|
@@ -81,7 +85,7 @@ export type ListContentDefinitionsItem = {
|
|
|
81
85
|
/**
|
|
82
86
|
* Extensions used by the definition
|
|
83
87
|
*/
|
|
84
|
-
|
|
88
|
+
extensions: string[];
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
/**
|
|
@@ -170,6 +174,11 @@ export type ContentDefinitionResponse = {
|
|
|
170
174
|
* Extensions used by the definition (type Extension or string (mnemonicId) depending if they are resolved or not)
|
|
171
175
|
*/
|
|
172
176
|
extensions: Extension[] | string[];
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Valued with paths to each array or null if definition is legacy
|
|
180
|
+
*/
|
|
181
|
+
trackableArrayFields?: ArrayField[] | null;
|
|
173
182
|
};
|
|
174
183
|
|
|
175
184
|
/**
|
|
@@ -200,7 +209,7 @@ export type ValidateDefinitionFieldRequest = {
|
|
|
200
209
|
/**
|
|
201
210
|
* The default content definition schema language
|
|
202
211
|
*/
|
|
203
|
-
defaultLanguage: string
|
|
212
|
+
defaultLanguage: string;
|
|
204
213
|
};
|
|
205
214
|
|
|
206
215
|
/**
|
|
@@ -261,7 +270,7 @@ export type ContentDefinitionSchemaErrors = {
|
|
|
261
270
|
/**
|
|
262
271
|
* This attribute represents an error if the language of the schema is not a valid string
|
|
263
272
|
*/
|
|
264
|
-
lang?: string
|
|
273
|
+
lang?: string;
|
|
265
274
|
};
|
|
266
275
|
|
|
267
276
|
/**
|
|
@@ -275,7 +284,7 @@ export type SchemaFragmentErrors = {
|
|
|
275
284
|
* - The value is a SchemaFieldViolationErrors if the fragment is valid but there are internal fields with validation validation errors
|
|
276
285
|
* - The value is a AttributeViolation if the fragment has invalid attributes
|
|
277
286
|
*/
|
|
278
|
-
[key: string]: (SchemaFieldViolationsErrors | AttributeViolation)[]
|
|
287
|
+
[key: string]: (SchemaFieldViolationsErrors | AttributeViolation)[];
|
|
279
288
|
};
|
|
280
289
|
|
|
281
290
|
/**
|
|
@@ -307,7 +316,7 @@ export type AttributeViolation = {
|
|
|
307
316
|
/**
|
|
308
317
|
* The detailed list of errors that occurred
|
|
309
318
|
*/
|
|
310
|
-
details: AttributeViolationDetail[]
|
|
319
|
+
details: AttributeViolationDetail[];
|
|
311
320
|
};
|
|
312
321
|
|
|
313
322
|
/**
|
|
@@ -323,7 +332,7 @@ export type AttributeViolationDetail = {
|
|
|
323
332
|
* The attributes affected by the error
|
|
324
333
|
*
|
|
325
334
|
*/
|
|
326
|
-
affectedAttributes: string[]
|
|
335
|
+
affectedAttributes: string[];
|
|
327
336
|
};
|
|
328
337
|
|
|
329
338
|
/**
|
|
@@ -337,7 +346,7 @@ export type ArrayAttributeViolation = {
|
|
|
337
346
|
/**
|
|
338
347
|
* The list of errors inside the attribute
|
|
339
348
|
*/
|
|
340
|
-
itemsDetails: ArrayAttributeViolationDetail[]
|
|
349
|
+
itemsDetails: ArrayAttributeViolationDetail[];
|
|
341
350
|
};
|
|
342
351
|
|
|
343
352
|
/**
|
|
@@ -351,7 +360,7 @@ export type ArrayAttributeViolationDetail = {
|
|
|
351
360
|
/**
|
|
352
361
|
* The detailed errors of the value
|
|
353
362
|
*/
|
|
354
|
-
details: AttributeViolationDetail[]
|
|
363
|
+
details: AttributeViolationDetail[];
|
|
355
364
|
};
|
|
356
365
|
|
|
357
366
|
/**
|
|
@@ -19,7 +19,7 @@ export enum SchemaTypeIds {
|
|
|
19
19
|
ONE_FRAGMENT_OF = 'oneFragmentOf',
|
|
20
20
|
ONE_LINKED_CONTENT_OF = 'oneLinkedContentOf',
|
|
21
21
|
ARRAY = 'array',
|
|
22
|
-
SLUG = 'slug'
|
|
22
|
+
SLUG = 'slug',
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -43,7 +43,7 @@ export type ContentDefinitionSchema = {
|
|
|
43
43
|
/**
|
|
44
44
|
* The list of fields defined for the definition
|
|
45
45
|
*/
|
|
46
|
-
fields: Field[]
|
|
46
|
+
fields: Field[];
|
|
47
47
|
/**
|
|
48
48
|
* The fragments defined for the definition
|
|
49
49
|
* A Fragment is a custom field defined by the user and can be used internally in the definition
|
|
@@ -272,7 +272,7 @@ export type LinkedContentFieldConstraints = {
|
|
|
272
272
|
*/
|
|
273
273
|
lazy?: boolean;
|
|
274
274
|
|
|
275
|
-
linkType?: LinkType;
|
|
275
|
+
linkType?: LinkType;
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
/**
|
|
@@ -292,7 +292,7 @@ export type OneFragmentOfConstraints = {
|
|
|
292
292
|
/**
|
|
293
293
|
* Set this value to define which fragments the field can use
|
|
294
294
|
*/
|
|
295
|
-
names: string[]
|
|
295
|
+
names: string[];
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
/**
|
|
@@ -373,7 +373,7 @@ export type SchemaType<T, C> = {
|
|
|
373
373
|
/**
|
|
374
374
|
* This attribute represent the constraints of the field
|
|
375
375
|
*/
|
|
376
|
-
constraints: C
|
|
376
|
+
constraints: C;
|
|
377
377
|
};
|
|
378
378
|
|
|
379
379
|
/**
|
|
@@ -8,7 +8,7 @@ export type FieldTranslation = {
|
|
|
8
8
|
path: FieldPath;
|
|
9
9
|
value: string;
|
|
10
10
|
checksum: string;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
|
|
13
13
|
export type ContentTranslation = {
|
|
14
14
|
id: ContentTranslationId;
|
|
@@ -21,14 +21,14 @@ export type ContentTranslation = {
|
|
|
21
21
|
latestContributor: AuthorResponse;
|
|
22
22
|
content: ContentResponse;
|
|
23
23
|
status: ContentTranslationStatus;
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
|
|
26
26
|
export type GetContentTranslationRequest = {
|
|
27
27
|
contentId: ContentId;
|
|
28
28
|
locale: string;
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
|
|
31
|
-
export type GetContentTranslationResponse = ContentTranslation & { translatedContent: ContentResponse };
|
|
31
|
+
export type GetContentTranslationResponse = ContentTranslation & { translatedContent: ContentResponse; };
|
|
32
32
|
|
|
33
33
|
export type CreateContentTranslationRequest = {
|
|
34
34
|
contentId: ContentId;
|
|
@@ -55,6 +55,21 @@ export enum ContentTranslationStatus {
|
|
|
55
55
|
|
|
56
56
|
export type ListContentTranslationRequest = {
|
|
57
57
|
contentId: ContentId;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type ListContentTranslationResponse = ContentTranslation[];
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export type DeleteContentTranslationRequest = {
|
|
64
|
+
contentId: ContentId;
|
|
65
|
+
locale: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type DeleteContentTranslationResponse = boolean;
|
|
69
|
+
|
|
70
|
+
export type CleanContentTranslationRequest = {
|
|
71
|
+
contentId: ContentId;
|
|
72
|
+
locales: string[];
|
|
73
|
+
};
|
|
59
74
|
|
|
60
|
-
export type
|
|
75
|
+
export type CleanContentTranslationResponse = boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentchef/contentchef-types",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "ContentChef types",
|
|
5
5
|
"author": "PierpaoloIannone <piannone@byte-code.com>",
|
|
6
6
|
"homepage": "https://github.com/ContentChef/contentchef-management-js-client#readme",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^4.0.5"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b0dc55381014c85de9ac26775586963a2584ebd5"
|
|
38
38
|
}
|