@stackbit/cms-core 0.0.18-alpha.0 → 0.0.19

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 (59) hide show
  1. package/dist/annotator/html.d.ts +0 -1
  2. package/dist/annotator/index.d.ts +2 -3
  3. package/dist/annotator/react.d.ts +0 -1
  4. package/dist/common/common-schema.d.ts +10 -3
  5. package/dist/common/common-schema.js +4 -3
  6. package/dist/common/common-schema.js.map +1 -1
  7. package/dist/consts.d.ts +0 -1
  8. package/dist/encoder.d.ts +7 -36
  9. package/dist/encoder.js +40 -63
  10. package/dist/encoder.js.map +1 -1
  11. package/dist/index.d.ts +6 -11
  12. package/dist/index.js +11 -37
  13. package/dist/index.js.map +1 -1
  14. package/dist/stackbit/index.d.ts +3 -7
  15. package/dist/stackbit/index.js +10 -13
  16. package/dist/stackbit/index.js.map +1 -1
  17. package/dist/utils/index.d.ts +7 -8
  18. package/dist/utils/lazy-poller.d.ts +21 -0
  19. package/dist/utils/lazy-poller.js +56 -0
  20. package/dist/utils/lazy-poller.js.map +1 -0
  21. package/dist/utils/schema-utils.d.ts +2 -3
  22. package/package.json +4 -8
  23. package/src/common/common-schema.js +14 -0
  24. package/src/{encoder.ts → encoder.js} +17 -55
  25. package/src/index.js +13 -0
  26. package/src/stackbit/{index.ts → index.js} +9 -5
  27. package/src/utils/lazy-poller.ts +74 -0
  28. package/dist/annotator/html.d.ts.map +0 -1
  29. package/dist/annotator/index.d.ts.map +0 -1
  30. package/dist/annotator/react.d.ts.map +0 -1
  31. package/dist/common/common-schema.d.ts.map +0 -1
  32. package/dist/consts.d.ts.map +0 -1
  33. package/dist/content-source-interface.d.ts +0 -292
  34. package/dist/content-source-interface.d.ts.map +0 -1
  35. package/dist/content-source-interface.js +0 -28
  36. package/dist/content-source-interface.js.map +0 -1
  37. package/dist/content-store-types.d.ts +0 -324
  38. package/dist/content-store-types.d.ts.map +0 -1
  39. package/dist/content-store-types.js +0 -3
  40. package/dist/content-store-types.js.map +0 -1
  41. package/dist/content-store.d.ts +0 -207
  42. package/dist/content-store.d.ts.map +0 -1
  43. package/dist/content-store.js +0 -1643
  44. package/dist/content-store.js.map +0 -1
  45. package/dist/encoder.d.ts.map +0 -1
  46. package/dist/index.d.ts.map +0 -1
  47. package/dist/stackbit/index.d.ts.map +0 -1
  48. package/dist/utils/index.d.ts.map +0 -1
  49. package/dist/utils/schema-utils.d.ts.map +0 -1
  50. package/dist/utils/timer.d.ts +0 -18
  51. package/dist/utils/timer.d.ts.map +0 -1
  52. package/dist/utils/timer.js +0 -36
  53. package/dist/utils/timer.js.map +0 -1
  54. package/src/common/common-schema.ts +0 -12
  55. package/src/content-source-interface.ts +0 -417
  56. package/src/content-store-types.ts +0 -406
  57. package/src/content-store.ts +0 -2112
  58. package/src/index.ts +0 -10
  59. package/src/utils/timer.ts +0 -42
@@ -1,292 +0,0 @@
1
- import type { Model, Field } from '@stackbit/sdk';
2
- export declare type DocumentStatus = 'added' | 'modified' | 'published' | 'deleted';
3
- export interface LeveledLogMethod {
4
- (message: string): void;
5
- (message: string, ...meta: any[]): void;
6
- (message: any): void;
7
- }
8
- export interface Logger {
9
- error: LeveledLogMethod;
10
- warn: LeveledLogMethod;
11
- info: LeveledLogMethod;
12
- debug: LeveledLogMethod;
13
- createLogger: ({ label }: {
14
- label: string;
15
- }) => Logger;
16
- }
17
- export interface Locale {
18
- code: string;
19
- default?: boolean;
20
- }
21
- export interface Document {
22
- type: 'document';
23
- id: string;
24
- manageUrl: string;
25
- modelName: string;
26
- status: DocumentStatus;
27
- createdAt: string;
28
- createdBy?: string;
29
- updatedAt: string;
30
- updatedBy?: string[];
31
- fields: Record<string, DocumentField>;
32
- }
33
- export interface Asset {
34
- type: 'asset';
35
- id: string;
36
- manageUrl: string;
37
- status: DocumentStatus;
38
- createdAt: string;
39
- createdBy?: string;
40
- updatedAt: string;
41
- updatedBy?: string[];
42
- fields: AssetFields;
43
- }
44
- export declare type AssetFields = {
45
- title: DocumentValueFieldForType<'string'>;
46
- file: AssetFileField;
47
- };
48
- export declare type DocumentField = DocumentValueField | DocumentObjectField | DocumentModelField | DocumentReferenceField | DocumentListField | DocumentRichTextField;
49
- export declare type DocumentFieldLocalized = DocumentValueFieldLocalized | DocumentObjectFieldLocalized | DocumentModelFieldLocalized | DocumentReferenceFieldLocalized | DocumentListFieldLocalized | DocumentRichTextFieldLocalized;
50
- export declare type DocumentFieldNonLocalized = DocumentValueFieldNonLocalized | DocumentObjectFieldNonLocalized | DocumentModelFieldNonLocalized | DocumentReferenceFieldNonLocalized | DocumentListFieldNonLocalized | DocumentRichTextFieldNonLocalized;
51
- export declare type DocumentFieldBaseProps = DocumentValueFieldBaseProps | DocumentObjectFieldBase | DocumentModelFieldBase | DocumentReferenceFieldBase | DocumentListFieldBase | DocumentRichTextFieldBase;
52
- export declare type DocumentFieldSpecificProps = DocumentValueFieldProps | DocumentObjectFieldProps | DocumentModelFieldProps | DocumentReferenceFieldProps | DocumentListFieldProps | DocumentRichTextFieldProps;
53
- export declare function isLocalizedField(field: DocumentField | AssetFileField): field is DocumentFieldLocalized | AssetFileFieldLocalized;
54
- export declare function getLocalizedFieldForLocale<Type extends FieldType>(field: DocumentFieldForType<Type>, locale?: string): DocumentFieldNonLocalizedForType<Type> | null;
55
- export declare type FieldType = 'string' | 'url' | 'slug' | 'text' | 'markdown' | 'html' | 'number' | 'boolean' | 'enum' | 'date' | 'datetime' | 'color' | 'image' | 'file' | 'json' | 'richText' | 'object' | 'model' | 'reference' | 'style' | 'list';
56
- export declare type Simplify<T> = {
57
- [K in keyof T]: T[K];
58
- };
59
- export declare type FindByType<Union extends {
60
- type: FieldType;
61
- }, Type> = Union extends {
62
- type: Type;
63
- } ? Union : never;
64
- export declare type DocumentFieldForType<Type extends FieldType> = FindByType<DocumentField, Type>;
65
- export declare type DocumentFieldLocalizedForType<Type extends FieldType> = FindByType<DocumentFieldLocalized, Type>;
66
- export declare type DocumentFieldNonLocalizedForType<Type extends FieldType> = FindByType<DocumentFieldNonLocalized, Type>;
67
- export declare type DocumentFieldBasePropsForType<Type extends FieldType> = FindByType<DocumentFieldBaseProps, Type>;
68
- export declare type DocumentFieldSpecificPropsForType<Type extends FieldType> = Simplify<Omit<DocumentFieldNonLocalizedForType<Type>, keyof DocumentFieldBasePropsForType<Type> | 'locale' | 'localized'>>;
69
- export declare type DocumentFieldTypeLocalized<BaseFieldProps, LocalizedFieldProps> = Simplify<BaseFieldProps & {
70
- localized: true;
71
- locales: Record<string, {
72
- locale: string;
73
- } & LocalizedFieldProps>;
74
- }>;
75
- export declare type DocumentFieldTypeNonLocalized<BaseFieldProps, LocalizedFieldProps> = Simplify<BaseFieldProps & LocalizedFieldProps & {
76
- localized?: false;
77
- locale?: string;
78
- }>;
79
- export declare type DocumentValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference' | 'richText' | 'list'>;
80
- export declare type DocumentValueFieldForType<Type> = Type extends DocumentValueFieldType ? DocumentValueFieldLocalizedForType<Type> | DocumentValueFieldNonLocalizedForType<Type> : never;
81
- export declare type DocumentValueField = DocumentValueFieldForType<DocumentValueFieldType>;
82
- export declare type DocumentValueFieldLocalizedForType<Type> = Type extends DocumentValueFieldType ? DocumentFieldTypeLocalized<DocumentValueFieldBase<Type>, DocumentValueFieldProps> : never;
83
- export declare type DocumentValueFieldLocalized = DocumentValueFieldLocalizedForType<DocumentValueFieldType>;
84
- export declare type DocumentValueFieldNonLocalizedForType<Type> = Type extends DocumentValueFieldType ? DocumentFieldTypeNonLocalized<DocumentValueFieldBase<Type>, DocumentValueFieldProps> : never;
85
- export declare type DocumentValueFieldNonLocalized = DocumentValueFieldNonLocalizedForType<DocumentValueFieldType>;
86
- export declare type DocumentValueFieldBasePropsForType<Type> = Type extends DocumentValueFieldType ? DocumentValueFieldBase<Type> : never;
87
- export declare type DocumentValueFieldBaseProps = DocumentValueFieldBasePropsForType<DocumentValueFieldType>;
88
- export declare type DocumentValueFieldBase<Type extends DocumentValueFieldType> = {
89
- type: Type;
90
- };
91
- export declare type DocumentValueFieldProps = {
92
- value: any;
93
- };
94
- export declare type DocumentObjectField = DocumentObjectFieldLocalized | DocumentObjectFieldNonLocalized;
95
- export declare type DocumentObjectFieldLocalized = DocumentFieldTypeLocalized<DocumentObjectFieldBase, DocumentObjectFieldProps>;
96
- export declare type DocumentObjectFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentObjectFieldBase, DocumentObjectFieldProps>;
97
- export declare type DocumentObjectFieldBase = {
98
- type: 'object';
99
- };
100
- export declare type DocumentObjectFieldProps = {
101
- fields: Record<string, DocumentField>;
102
- };
103
- export declare type DocumentModelField = DocumentModelFieldLocalized | DocumentModelFieldNonLocalized;
104
- export declare type DocumentModelFieldLocalized = DocumentFieldTypeLocalized<DocumentModelFieldBase, DocumentModelFieldProps>;
105
- export declare type DocumentModelFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentModelFieldBase, DocumentModelFieldProps>;
106
- export declare type DocumentModelFieldBase = {
107
- type: 'model';
108
- };
109
- export declare type DocumentModelFieldProps = {
110
- modelName: string;
111
- fields: Record<string, DocumentField>;
112
- };
113
- export declare type DocumentReferenceField = DocumentReferenceFieldLocalized | DocumentReferenceFieldNonLocalized;
114
- export declare type DocumentReferenceFieldLocalized = DocumentFieldTypeLocalized<DocumentReferenceFieldBase, DocumentReferenceFieldProps>;
115
- export declare type DocumentReferenceFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentReferenceFieldBase, DocumentReferenceFieldProps>;
116
- export declare type DocumentReferenceFieldBase = {
117
- type: 'reference';
118
- refType: 'document' | 'asset';
119
- };
120
- export declare type DocumentReferenceFieldProps = {
121
- refId: string;
122
- };
123
- export declare type DocumentRichTextField = DocumentRichTextFieldLocalized | DocumentRichTextFieldNonLocalized;
124
- export declare type DocumentRichTextFieldLocalized = DocumentFieldTypeLocalized<DocumentRichTextFieldBase, DocumentRichTextFieldProps>;
125
- export declare type DocumentRichTextFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentRichTextFieldBase, DocumentRichTextFieldProps>;
126
- export declare type DocumentRichTextFieldBase = {
127
- type: 'richText';
128
- };
129
- export declare type DocumentRichTextFieldProps = {
130
- hint?: string;
131
- value: any;
132
- };
133
- export declare type DocumentListField = DocumentListFieldLocalized | DocumentListFieldNonLocalized;
134
- export declare type DocumentListFieldLocalized = DocumentFieldTypeLocalized<DocumentListFieldBase, DocumentListFieldProps>;
135
- export declare type DocumentListFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentListFieldBase, DocumentListFieldProps>;
136
- export declare type DocumentListFieldBase = {
137
- type: 'list';
138
- };
139
- export declare type DocumentListFieldProps = {
140
- items: DocumentFieldNonLocalized[];
141
- };
142
- export declare type AssetFileField = AssetFileFieldLocalized | AssetFileFieldNonLocalized;
143
- export declare type AssetFileFieldLocalized = DocumentFieldTypeLocalized<AssetFileFieldBase, AssetFileFieldProps>;
144
- export declare type AssetFileFieldNonLocalized = DocumentFieldTypeNonLocalized<AssetFileFieldBase, AssetFileFieldProps>;
145
- export declare type AssetFileFieldBase = {
146
- type: 'assetFile';
147
- };
148
- export declare type AssetFileFieldProps = {
149
- url: string;
150
- fileName?: string;
151
- contentType?: string;
152
- size?: number;
153
- dimensions: {
154
- width?: number;
155
- height?: number;
156
- };
157
- };
158
- export interface InitOptions {
159
- logger: Logger;
160
- userLogger: Logger;
161
- localDev: boolean;
162
- }
163
- export interface ContentChangeEvent {
164
- documents: Document[];
165
- assets: Asset[];
166
- deletedDocumentIds: string[];
167
- deletedAssetIds: string[];
168
- }
169
- export declare type UpdateOperation = UpdateOperationSet | UpdateOperationUnset | UpdateOperationInsert | UpdateOperationRemove | UpdateOperationReorder;
170
- export declare type UpdateOperationBase = {
171
- opType: string;
172
- fieldPath: (string | number)[];
173
- modelField: Field;
174
- locale?: string;
175
- };
176
- export declare type UpdateOperationSet = Simplify<UpdateOperationBase & {
177
- opType: 'set';
178
- field: UpdateOperationField;
179
- }>;
180
- export declare type UpdateOperationUnset = Simplify<UpdateOperationBase & {
181
- opType: 'unset';
182
- }>;
183
- export declare type UpdateOperationInsert = Simplify<UpdateOperationBase & {
184
- opType: 'insert';
185
- index?: number;
186
- item: UpdateOperationField;
187
- }>;
188
- export declare type UpdateOperationRemove = Simplify<UpdateOperationBase & {
189
- opType: 'remove';
190
- index: number;
191
- }>;
192
- export declare type UpdateOperationReorder = Simplify<UpdateOperationBase & {
193
- opType: 'reorder';
194
- order: number[];
195
- }>;
196
- export declare type UpdateOperationField = DocumentValueFieldNonLocalized | DocumentObjectFieldNonLocalized | DocumentModelFieldNonLocalized | DocumentReferenceFieldNonLocalized | DocumentRichTextFieldNonLocalized;
197
- export declare type ValidationError = {
198
- message: string;
199
- objectType: 'document' | 'asset';
200
- objectId: string;
201
- fieldPath: (string | number)[];
202
- isUniqueValidation?: boolean;
203
- };
204
- export declare type ModelMap = Record<string, Model>;
205
- export interface ContentSourceInterface<UserContext = unknown> {
206
- /**
207
- * This function should return the type of the content source.
208
- * The type must be unique among other content sources within the same project.
209
- */
210
- getContentSourceType(): string;
211
- /**
212
- * This function should return the project ID of the content source.
213
- * The ID must be unique among other content sources of the same type.
214
- */
215
- getProjectId(): string;
216
- getProjectEnvironment(): string;
217
- getProjectManageUrl(): string;
218
- /**
219
- * This function should initialize the content source by fetching the schema
220
- * and everything else needed to produce the StackbitSchema
221
- */
222
- init(options: InitOptions): Promise<void>;
223
- reset(): Promise<void>;
224
- onFilesChange?({ updatedFiles }: {
225
- updatedFiles: string[];
226
- }): {
227
- schemaChanged?: boolean;
228
- contentChangeEvent?: ContentChangeEvent;
229
- };
230
- startWatchingContentUpdates(options: {
231
- getModelMap: () => ModelMap;
232
- onContentChange: (contentChangeEvent: ContentChangeEvent) => void;
233
- onSchemaChange: () => void;
234
- }): void;
235
- stopWatchingContentUpdates(): void;
236
- /**
237
- * This function is responsible to fetch and convert content models
238
- * to Stackbit models.
239
- */
240
- getModels(): Promise<Model[]>;
241
- getLocales(): Promise<Locale[]>;
242
- /**
243
- * This function should fetch the documents and convert them into Stackbit's
244
- * Document type
245
- */
246
- getDocuments(options: {
247
- modelMap: ModelMap;
248
- }): Promise<Document[]>;
249
- getAssets(): Promise<Asset[]>;
250
- hasAccess(options: {
251
- userContext?: UserContext;
252
- }): Promise<boolean>;
253
- createDocument(options: {
254
- documentFields: Record<string, DocumentField>;
255
- model: Model;
256
- modelMap: ModelMap;
257
- locale?: string;
258
- userContext?: UserContext;
259
- }): Promise<Document>;
260
- updateDocument(options: {
261
- documentId: string;
262
- operations: UpdateOperation[];
263
- modelMap: ModelMap;
264
- userContext?: UserContext;
265
- }): Promise<Document>;
266
- deleteDocument(options: {
267
- documentId: string;
268
- userContext?: UserContext;
269
- }): Promise<void>;
270
- uploadAsset(options: {
271
- url?: string;
272
- base64?: string;
273
- fileName: string;
274
- mimeType: string;
275
- locale?: string;
276
- userContext?: UserContext;
277
- }): Promise<Asset>;
278
- validateDocuments(options: {
279
- documentIds: string[];
280
- assetIds: string[];
281
- locale?: string;
282
- userContext?: UserContext;
283
- }): Promise<{
284
- errors: ValidationError[];
285
- }>;
286
- publishDocuments(options: {
287
- documentIds: string[];
288
- assetIds: string[];
289
- userContext?: UserContext;
290
- }): Promise<void>;
291
- }
292
- //# sourceMappingURL=content-source-interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-source-interface.d.ts","sourceRoot":"","sources":["../src/content-source-interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAElD,oBAAY,cAAc,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC7B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACxC,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CA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W,CAAC;KAC7B,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC,CAAC;IAE3C,gBAAgB,CAAC,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,WAAW,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtH"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLocalizedFieldForLocale = exports.isLocalizedField = void 0;
4
- function isLocalizedField(field) {
5
- return 'localized' in field;
6
- }
7
- exports.isLocalizedField = isLocalizedField;
8
- function getLocalizedFieldForLocale(field, locale) {
9
- if (field.localized) {
10
- if (!locale) {
11
- return null;
12
- }
13
- const { localized, locales, ...base } = field;
14
- const localizedField = locales[locale];
15
- if (!localizedField) {
16
- return null;
17
- }
18
- return {
19
- ...base,
20
- ...localizedField
21
- };
22
- }
23
- else {
24
- return field;
25
- }
26
- }
27
- exports.getLocalizedFieldForLocale = getLocalizedFieldForLocale;
28
- //# sourceMappingURL=content-source-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-source-interface.js","sourceRoot":"","sources":["../src/content-source-interface.ts"],"names":[],"mappings":";;;AAuFA,SAAgB,gBAAgB,CAAC,KAAqC;IAClE,OAAO,WAAW,IAAI,KAAK,CAAC;AAChC,CAAC;AAFD,4CAEC;AAED,SAAgB,0BAA0B,CACtC,KAAiC,EACjC,MAAe;IAEf,IAAI,KAAK,CAAC,SAAS,EAAE;QACjB,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,IAAI,CAAC;SACf;QACD,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,cAAc,EAAE;YACjB,OAAO,IAAI,CAAC;SACf;QACD,OAAQ;YACJ,GAAG,IAAI;YACP,GAAG,cAAc;SACkC,CAAC;KAC3D;SAAM;QACH,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AApBD,gEAoBC"}
@@ -1,324 +0,0 @@
1
- import { DocumentStatus, FieldType } from './content-source-interface';
2
- export { FieldType, Logger, LeveledLogMethod, DocumentStatus } from './content-source-interface';
3
- export interface Document {
4
- type: 'document';
5
- srcType: string;
6
- srcProjectId: string;
7
- srcProjectUrl: string;
8
- srcEnvironment: string;
9
- srcObjectId: string;
10
- srcObjectUrl: string;
11
- srcObjectLabel: string;
12
- srcModelName: string;
13
- srcModelLabel: string;
14
- isChanged: boolean;
15
- status: DocumentStatus;
16
- createdAt: string;
17
- createdBy?: string;
18
- updatedAt: string;
19
- updatedBy?: string[];
20
- fields: Record<string, DocumentField>;
21
- }
22
- export interface Asset {
23
- type: 'asset';
24
- srcType: string;
25
- srcProjectId: string;
26
- srcProjectUrl: string;
27
- srcEnvironment: string;
28
- srcObjectId: string;
29
- srcObjectUrl: string;
30
- srcObjectLabel: string;
31
- srcModelName: string;
32
- srcModelLabel: string;
33
- isChanged: boolean;
34
- status: DocumentStatus;
35
- createdAt: string;
36
- createdBy?: string;
37
- updatedAt: string;
38
- updatedBy?: string[];
39
- fields: AssetFields;
40
- }
41
- export declare type AssetFields = {
42
- title: DocumentValueFieldForType<'string'>;
43
- file: AssetFileField;
44
- };
45
- export interface UploadAssetData {
46
- url: string;
47
- data?: string;
48
- metadata: {
49
- name: string;
50
- type: string;
51
- };
52
- }
53
- export interface ContentChangeResultItem {
54
- srcType: string;
55
- srcProjectId: string;
56
- srcObjectId: string;
57
- }
58
- export interface ContentChangeResult {
59
- updatedDocuments: ContentChangeResultItem[];
60
- updatedAssets: ContentChangeResultItem[];
61
- deletedDocuments: ContentChangeResultItem[];
62
- deletedAssets: ContentChangeResultItem[];
63
- }
64
- export declare type APIObject = APIDocumentObject | APIImageObject;
65
- export interface APIDocumentObject extends Omit<Document, 'fields' | 'type'> {
66
- type: 'object';
67
- fields: Record<string, DocumentFieldAPI>;
68
- }
69
- export interface APIImageObject extends Omit<Asset, 'fields' | 'type'> {
70
- type: 'image';
71
- fields: AssetFieldsAPI;
72
- }
73
- export declare type AssetFieldsAPI = {
74
- title: DocumentFieldAPIForType<'string'>;
75
- url: DocumentFieldAPIForType<'string'>;
76
- };
77
- export interface APIAsset {
78
- objectId: string;
79
- createdAt: string;
80
- url: string;
81
- title?: string;
82
- fileName?: string;
83
- contentType?: string;
84
- size?: number;
85
- width?: number;
86
- height?: number;
87
- }
88
- export declare type DocumentField = DocumentValueField | DocumentObjectField | DocumentModelField | DocumentReferenceField | DocumentListField | DocumentMarkdownField | DocumentRichTextField;
89
- export declare type DocumentFieldLocalized = DocumentValueFieldLocalized | DocumentObjectFieldLocalized | DocumentModelFieldLocalized | DocumentReferenceFieldLocalized | DocumentMarkdownFieldLocalized | DocumentRichTextFieldLocalized | DocumentListFieldLocalized;
90
- export declare type DocumentFieldNonLocalized = DocumentValueFieldNonLocalized | DocumentObjectFieldNonLocalized | DocumentModelFieldNonLocalized | DocumentReferenceFieldNonLocalized | DocumentMarkdownFieldNonLocalized | DocumentRichTextFieldNonLocalized | DocumentListFieldNonLocalized;
91
- export declare type DocumentFieldAPI = DocumentValueFieldAPI | DocumentObjectFieldAPI | DocumentModelFieldAPI | DocumentReferenceFieldAPI | DocumentMarkdownFieldAPI | DocumentRichTextFieldAPI | DocumentListFieldAPI;
92
- export declare type DocumentFieldBaseProps = DocumentValueFieldBaseProps | DocumentObjectFieldBase | DocumentModelFieldBase | DocumentReferenceFieldBase | DocumentListFieldBase | DocumentRichTextFieldBase;
93
- export declare type DistributiveOmit<T, K extends PropertyKey> = T extends any ? Omit<T, K> : never;
94
- export declare type Simplify<T> = {
95
- [K in keyof T]: T[K];
96
- };
97
- export declare type FindByType<Union extends {
98
- type: FieldType | 'unresolved_reference';
99
- }, Type> = Union extends {
100
- type: Type;
101
- } ? Union : never;
102
- export declare type DocumentFieldForType<Type extends FieldType> = FindByType<DocumentField, Type>;
103
- export declare type DocumentFieldLocalizedForType<Type extends FieldType> = FindByType<DocumentFieldLocalized, Type>;
104
- export declare type DocumentFieldNonLocalizedForType<Type extends FieldType> = FindByType<DocumentFieldNonLocalized, Type>;
105
- export declare type DocumentFieldAPIForType<Type extends FieldType | 'unresolved_reference'> = FindByType<DocumentFieldAPI, Type>;
106
- export declare type DocumentFieldBasePropsForType<Type extends FieldType> = FindByType<DocumentFieldBaseProps, Type>;
107
- export declare type DocumentFieldSpecificPropsForType<Type extends FieldType> = Simplify<DistributiveOmit<DocumentFieldNonLocalizedForType<Type>, keyof DocumentFieldBasePropsForType<Type> | 'label' | 'locale' | 'localized'>>;
108
- export declare type DocumentFieldTypeLocalized<BaseFieldProps, LocalizedFieldProps> = Simplify<BaseFieldProps & {
109
- label?: string;
110
- localized: true;
111
- locales: Record<string, {
112
- locale: string;
113
- } & Omit<LocalizedFieldProps, 'isUnset'>>;
114
- }>;
115
- export declare type DocumentFieldTypeNonLocalized<BaseFieldProps, LocalizedFieldProps> = Simplify<BaseFieldProps & LocalizedFieldProps & {
116
- label?: string;
117
- localized?: false;
118
- locale?: string;
119
- }>;
120
- export declare type DocumentFieldTypeAPI<BaseFieldProps, LocalizedFieldProps> = BaseFieldProps & LocalizedFieldProps & {
121
- label?: string;
122
- description?: string;
123
- locale?: string;
124
- localized?: boolean;
125
- };
126
- export declare type DocumentValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference' | 'markdown' | 'richText' | 'list'>;
127
- export declare type DocumentValueFieldForType<Type> = Type extends DocumentValueFieldType ? DocumentValueFieldLocalizedForType<Type> | DocumentValueFieldNonLocalizedForType<Type> : never;
128
- export declare type DocumentValueField = DocumentValueFieldForType<DocumentValueFieldType>;
129
- export declare type DocumentValueFieldLocalizedForType<Type> = Type extends DocumentValueFieldType ? DocumentFieldTypeLocalized<DocumentValueFieldBase<Type>, DocumentValueFieldProps> : never;
130
- export declare type DocumentValueFieldLocalized = DocumentValueFieldLocalizedForType<DocumentValueFieldType>;
131
- export declare type DocumentValueFieldNonLocalizedForType<Type> = Type extends DocumentValueFieldType ? DocumentFieldTypeNonLocalized<DocumentValueFieldBase<Type>, DocumentValueFieldProps> : never;
132
- export declare type DocumentValueFieldNonLocalized = DocumentValueFieldNonLocalizedForType<DocumentValueFieldType>;
133
- export declare type DocumentValueFieldAPIForType<Type> = Type extends DocumentValueFieldType ? DocumentFieldTypeAPI<DocumentValueFieldBase<Type>, DocumentValueFieldProps> : never;
134
- export declare type DocumentValueFieldAPI = DocumentValueFieldAPIForType<DocumentValueFieldType>;
135
- export declare type DocumentValueFieldBasePropsForType<Type> = Type extends DocumentValueFieldType ? DocumentValueFieldBase<Type> : never;
136
- export declare type DocumentValueFieldBaseProps = DocumentValueFieldBasePropsForType<DocumentValueFieldType>;
137
- export declare type DocumentValueFieldBase<Type extends DocumentValueFieldType> = {
138
- type: Type;
139
- };
140
- export declare type DocumentValueFieldProps = {
141
- value: any;
142
- };
143
- export declare type DocumentObjectField = DocumentObjectFieldLocalized | DocumentObjectFieldNonLocalized;
144
- export declare type DocumentObjectFieldLocalized = DocumentFieldTypeLocalized<DocumentObjectFieldBase, DocumentObjectFieldProps>;
145
- export declare type DocumentObjectFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentObjectFieldBase, DocumentObjectFieldProps>;
146
- export declare type DocumentObjectFieldAPI = DocumentFieldTypeAPI<DocumentObjectFieldBase, DocumentObjectFieldPropsAPI>;
147
- export declare type DocumentObjectFieldBase = {
148
- type: 'object';
149
- };
150
- export declare type DocumentObjectFieldPropsCommon = {
151
- srcObjectLabel: string;
152
- };
153
- export declare type DocumentObjectFieldProps = {
154
- isUnset: true;
155
- } | ({
156
- isUnset?: false;
157
- fields: Record<string, DocumentField>;
158
- } & DocumentObjectFieldPropsCommon);
159
- export declare type DocumentObjectFieldPropsAPI = {
160
- isUnset: true;
161
- } | ({
162
- isUnset?: false;
163
- fields: Record<string, DocumentFieldAPI>;
164
- } & DocumentObjectFieldPropsCommon);
165
- export declare type DocumentModelField = DocumentModelFieldLocalized | DocumentModelFieldNonLocalized;
166
- export declare type DocumentModelFieldLocalized = DocumentFieldTypeLocalized<DocumentModelFieldBase, DocumentModelFieldProps>;
167
- export declare type DocumentModelFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentModelFieldBase, DocumentModelFieldProps>;
168
- export declare type DocumentModelFieldAPI = DocumentFieldTypeAPI<DocumentModelFieldBase, DocumentModelFieldPropsAPI>;
169
- export declare type DocumentModelFieldBase = {
170
- type: 'model';
171
- };
172
- export declare type DocumentModelFieldPropsCommon = {
173
- srcObjectLabel: string;
174
- srcModelName: string;
175
- srcModelLabel: string;
176
- };
177
- export declare type DocumentModelFieldProps = {
178
- isUnset: true;
179
- } | ({
180
- isUnset?: false;
181
- fields: Record<string, DocumentField>;
182
- } & DocumentModelFieldPropsCommon);
183
- export declare type DocumentModelFieldPropsAPI = {
184
- isUnset: true;
185
- } | ({
186
- isUnset?: false;
187
- fields: Record<string, DocumentFieldAPI>;
188
- } & DocumentModelFieldPropsCommon);
189
- export declare type DocumentReferenceField = DocumentReferenceFieldLocalized | DocumentReferenceFieldNonLocalized;
190
- export declare type DocumentReferenceFieldLocalized = DocumentFieldTypeLocalized<DocumentReferenceFieldBase, DocumentReferenceFieldProps>;
191
- export declare type DocumentReferenceFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentReferenceFieldBase, DocumentReferenceFieldProps>;
192
- export declare type DocumentReferenceFieldAPI = DocumentFieldTypeAPI<DocumentReferenceFieldBaseAPI, DocumentReferenceFieldProps>;
193
- export declare type DocumentReferenceFieldBase = {
194
- type: 'reference';
195
- refType: 'document' | 'asset';
196
- };
197
- export declare type DocumentReferenceFieldProps = {
198
- isUnset: true;
199
- } | {
200
- isUnset?: false;
201
- refId: string;
202
- };
203
- export declare type DocumentReferenceFieldBaseAPI = {
204
- type: 'unresolved_reference';
205
- refType: 'object' | 'image';
206
- };
207
- export declare type DocumentMarkdownField = DocumentMarkdownFieldLocalized | DocumentMarkdownFieldNonLocalized;
208
- export declare type DocumentMarkdownFieldLocalized = DocumentFieldTypeLocalized<DocumentMarkdownFieldBase, DocumentMarkdownFieldProps>;
209
- export declare type DocumentMarkdownFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentMarkdownFieldBase, DocumentMarkdownFieldProps>;
210
- export declare type DocumentMarkdownFieldAPI = DocumentFieldTypeAPI<DocumentMarkdownFieldBase, DocumentMarkdownFieldProps>;
211
- export declare type DocumentMarkdownFieldBase = {
212
- type: 'markdown';
213
- };
214
- export declare type DocumentMarkdownFieldProps = {
215
- isUnset?: boolean;
216
- multiElement?: boolean;
217
- value: any;
218
- };
219
- export declare type DocumentRichTextField = DocumentRichTextFieldLocalized | DocumentRichTextFieldNonLocalized;
220
- export declare type DocumentRichTextFieldLocalized = DocumentFieldTypeLocalized<DocumentRichTextFieldBase, DocumentRichTextFieldProps>;
221
- export declare type DocumentRichTextFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentRichTextFieldBase, DocumentRichTextFieldProps>;
222
- export declare type DocumentRichTextFieldAPI = DocumentFieldTypeAPI<DocumentRichTextFieldBase, DocumentRichTextFieldProps>;
223
- export declare type DocumentRichTextFieldBase = {
224
- type: 'richText';
225
- };
226
- export declare type DocumentRichTextFieldProps = {
227
- isUnset?: boolean;
228
- hint?: string;
229
- multiElement?: boolean;
230
- value: any;
231
- };
232
- export declare type DocumentListField = DocumentListFieldLocalized | DocumentListFieldNonLocalized;
233
- export declare type DocumentListFieldLocalized = DocumentFieldTypeLocalized<DocumentListFieldBase, DocumentListFieldProps>;
234
- export declare type DocumentListFieldNonLocalized = DocumentFieldTypeNonLocalized<DocumentListFieldBase, DocumentListFieldProps>;
235
- export declare type DocumentListFieldAPI = DocumentFieldTypeAPI<DocumentListFieldBase, DocumentListFieldPropsAPI>;
236
- export declare type DocumentListFieldBase = {
237
- type: 'list';
238
- };
239
- export declare type DocumentListFieldProps = {
240
- items: DocumentField[];
241
- };
242
- export declare type DocumentListFieldPropsAPI = {
243
- items: DocumentFieldAPI[];
244
- };
245
- export declare type AssetFileField = AssetFileFieldLocalized | AssetFileFieldNonLocalized;
246
- export declare type AssetFileFieldLocalized = DocumentFieldTypeLocalized<AssetFileFieldBase, AssetFileFieldProps>;
247
- export declare type AssetFileFieldNonLocalized = DocumentFieldTypeNonLocalized<AssetFileFieldBase, AssetFileFieldProps>;
248
- export declare type AssetFileFieldBase = {
249
- type: 'assetFile';
250
- };
251
- export declare type AssetFileFieldProps = {
252
- url: string;
253
- fileName?: string;
254
- contentType?: string;
255
- size?: number;
256
- dimensions?: {
257
- width?: number;
258
- height?: number;
259
- };
260
- };
261
- export declare type UpdateOperation = UpdateOperationSet | UpdateOperationUnset | UpdateOperationInsert | UpdateOperationRemove | UpdateOperationReorder;
262
- export declare type UpdateOperationBase = {
263
- opType: string;
264
- fieldPath: (string | number)[];
265
- locale?: string;
266
- };
267
- export declare type UpdateOperationSet = Simplify<UpdateOperationBase & {
268
- opType: 'set';
269
- field: UpdateOperationField;
270
- }>;
271
- export declare type UpdateOperationUnset = Simplify<UpdateOperationBase & {
272
- opType: 'unset';
273
- }>;
274
- export declare type UpdateOperationInsert = Simplify<UpdateOperationBase & {
275
- opType: 'insert';
276
- index?: number;
277
- item: UpdateOperationField;
278
- }>;
279
- export declare type UpdateOperationRemove = Simplify<UpdateOperationBase & {
280
- opType: 'remove';
281
- index: number;
282
- }>;
283
- export declare type UpdateOperationReorder = Simplify<UpdateOperationBase & {
284
- opType: 'reorder';
285
- order: number[];
286
- }>;
287
- export declare type UpdateOperationField = UpdateOperationValueField | UpdateOperationObjectField | UpdateOperationModelField | UpdateOperationReferenceField;
288
- export declare type UpdateOperationValueFieldType = Exclude<FieldType, 'object' | 'model' | 'reference'>;
289
- export declare type UpdateOperationValueField = {
290
- type: UpdateOperationValueFieldType;
291
- value: any;
292
- };
293
- export declare type UpdateOperationObjectField = {
294
- type: 'object';
295
- object: Record<string, any>;
296
- };
297
- export declare type UpdateOperationModelField = {
298
- type: 'model';
299
- modelName: string;
300
- object: Record<string, any>;
301
- };
302
- export declare type UpdateOperationReferenceField = {
303
- type: 'reference';
304
- refType: 'document' | 'asset';
305
- refId: string;
306
- };
307
- export declare type User = {
308
- name: string;
309
- email: string;
310
- connections: {
311
- type: string;
312
- [key: string]: any;
313
- }[];
314
- };
315
- export declare type ValidationError = {
316
- message: string;
317
- srcType: string;
318
- srcProjectId: string;
319
- srcObjectType: string;
320
- srcObjectId: string;
321
- fieldPath: (string | number)[];
322
- isUniqueValidation?: boolean;
323
- };
324
- //# sourceMappingURL=content-store-types.d.ts.map