@wix/data 1.0.0
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/build/cjs/index.d.ts +4 -0
- package/build/cjs/index.js +27 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js +397 -0
- package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js +36 -0
- package/build/cjs/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js +3 -0
- package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js +334 -0
- package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/cjs/src/data-v2-data-collection.http.js +458 -0
- package/build/cjs/src/data-v2-data-collection.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/cjs/src/data-v2-data-collection.public.js +48 -0
- package/build/cjs/src/data-v2-data-collection.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/cjs/src/data-v2-data-collection.types.js +143 -0
- package/build/cjs/src/data-v2-data-collection.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/cjs/src/data-v2-data-collection.universal.js +532 -0
- package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.http.d.ts +192 -0
- package/build/cjs/src/data-v2-data-item.http.js +944 -0
- package/build/cjs/src/data-v2-data-item.http.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.public.d.ts +28 -0
- package/build/cjs/src/data-v2-data-item.public.js +137 -0
- package/build/cjs/src/data-v2-data-item.public.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.types.d.ts +656 -0
- package/build/cjs/src/data-v2-data-item.types.js +27 -0
- package/build/cjs/src/data-v2-data-item.types.js.map +1 -0
- package/build/cjs/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/cjs/src/data-v2-data-item.universal.js +1435 -0
- package/build/cjs/src/data-v2-data-item.universal.js.map +1 -0
- package/build/cjs/src/data-v2-index.http.d.ts +29 -0
- package/build/cjs/src/data-v2-index.http.js +349 -0
- package/build/cjs/src/data-v2-index.http.js.map +1 -0
- package/build/cjs/src/data-v2-index.public.d.ts +10 -0
- package/build/cjs/src/data-v2-index.public.js +28 -0
- package/build/cjs/src/data-v2-index.public.js.map +1 -0
- package/build/cjs/src/data-v2-index.types.d.ts +120 -0
- package/build/cjs/src/data-v2-index.types.js +35 -0
- package/build/cjs/src/data-v2-index.types.js.map +1 -0
- package/build/cjs/src/data-v2-index.universal.d.ts +182 -0
- package/build/cjs/src/data-v2-index.universal.js +261 -0
- package/build/cjs/src/data-v2-index.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -0
- package/build/es/index.js +5 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.http.d.ts +29 -0
- package/build/es/src/data-v1-external-database-connection.http.js +389 -0
- package/build/es/src/data-v1-external-database-connection.http.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.public.d.ts +11 -0
- package/build/es/src/data-v1-external-database-connection.public.js +28 -0
- package/build/es/src/data-v1-external-database-connection.public.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.types.d.ts +53 -0
- package/build/es/src/data-v1-external-database-connection.types.js +2 -0
- package/build/es/src/data-v1-external-database-connection.types.js.map +1 -0
- package/build/es/src/data-v1-external-database-connection.universal.d.ts +129 -0
- package/build/es/src/data-v1-external-database-connection.universal.js +307 -0
- package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-collection.http.d.ts +37 -0
- package/build/es/src/data-v2-data-collection.http.js +450 -0
- package/build/es/src/data-v2-data-collection.http.js.map +1 -0
- package/build/es/src/data-v2-data-collection.public.d.ts +12 -0
- package/build/es/src/data-v2-data-collection.public.js +29 -0
- package/build/es/src/data-v2-data-collection.public.js.map +1 -0
- package/build/es/src/data-v2-data-collection.types.d.ts +638 -0
- package/build/es/src/data-v2-data-collection.types.js +140 -0
- package/build/es/src/data-v2-data-collection.types.js.map +1 -0
- package/build/es/src/data-v2-data-collection.universal.d.ts +732 -0
- package/build/es/src/data-v2-data-collection.universal.js +505 -0
- package/build/es/src/data-v2-data-collection.universal.js.map +1 -0
- package/build/es/src/data-v2-data-item.http.d.ts +192 -0
- package/build/es/src/data-v2-data-item.http.js +920 -0
- package/build/es/src/data-v2-data-item.http.js.map +1 -0
- package/build/es/src/data-v2-data-item.public.d.ts +28 -0
- package/build/es/src/data-v2-data-item.public.js +109 -0
- package/build/es/src/data-v2-data-item.public.js.map +1 -0
- package/build/es/src/data-v2-data-item.types.d.ts +656 -0
- package/build/es/src/data-v2-data-item.types.js +24 -0
- package/build/es/src/data-v2-data-item.types.js.map +1 -0
- package/build/es/src/data-v2-data-item.universal.d.ts +1343 -0
- package/build/es/src/data-v2-data-item.universal.js +1392 -0
- package/build/es/src/data-v2-data-item.universal.js.map +1 -0
- package/build/es/src/data-v2-index.http.d.ts +29 -0
- package/build/es/src/data-v2-index.http.js +343 -0
- package/build/es/src/data-v2-index.http.js.map +1 -0
- package/build/es/src/data-v2-index.public.d.ts +10 -0
- package/build/es/src/data-v2-index.public.js +19 -0
- package/build/es/src/data-v2-index.public.js.map +1 -0
- package/build/es/src/data-v2-index.types.d.ts +120 -0
- package/build/es/src/data-v2-index.types.js +32 -0
- package/build/es/src/data-v2-index.types.js.map +1 -0
- package/build/es/src/data-v2-index.universal.d.ts +182 -0
- package/build/es/src/data-v2-index.universal.js +236 -0
- package/build/es/src/data-v2-index.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
/** A data collection determines the structure of data to be stored in a database. */
|
|
2
|
+
export interface DataCollection {
|
|
3
|
+
/** Collection ID. For example, `my-first-collection`. May include a namespace. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Collection type. Indicates how the collection was created and is stored.
|
|
7
|
+
*
|
|
8
|
+
* * `NATIVE`: User-created collection.
|
|
9
|
+
* * `WIX_APP`: [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app, including [starter collections](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-starter-collections) created when a Wix app is installed.
|
|
10
|
+
* * `BLOCKS_APP`: Collection created by a Wix Blocks app.
|
|
11
|
+
* * `EXTERNAL`: Collection located in externally connected storage.
|
|
12
|
+
* @readonly
|
|
13
|
+
*/
|
|
14
|
+
collectionType?: CollectionType;
|
|
15
|
+
/**
|
|
16
|
+
* ID of the app that defined this collection. For user-defined collections, this value is null.
|
|
17
|
+
* @readonly
|
|
18
|
+
*/
|
|
19
|
+
ownerAppId?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of items returned in a single query, based on the underlying storage.
|
|
22
|
+
* Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
|
|
23
|
+
* External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
maxPageSize?: number | null;
|
|
27
|
+
/** Collection's display name as shown in the Content Manager. For example, `My First Collection`. */
|
|
28
|
+
displayName?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates how the collection's items are sorted by default when a query doesn't specify an order.
|
|
31
|
+
* @readonly
|
|
32
|
+
*/
|
|
33
|
+
defaultDisplayOrder?: Sort;
|
|
34
|
+
/**
|
|
35
|
+
* UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
|
|
36
|
+
* Empty for all data collections not owned by internal Wix apps.
|
|
37
|
+
*/
|
|
38
|
+
displayNamespace?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The field whose value the Content Manager displays to represent the collection item when referenced in a different collection.
|
|
41
|
+
* @readonly
|
|
42
|
+
*/
|
|
43
|
+
displayField?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Capabilities the collection supports.
|
|
46
|
+
* @readonly
|
|
47
|
+
*/
|
|
48
|
+
capabilities?: CollectionCapabilities;
|
|
49
|
+
/** Collection's field structure. A collection must have at least 1 field. */
|
|
50
|
+
fields?: Field[];
|
|
51
|
+
/** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
|
|
52
|
+
permissions?: Permissions;
|
|
53
|
+
/**
|
|
54
|
+
* Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must pass the latest revision number.
|
|
55
|
+
* @readonly
|
|
56
|
+
*/
|
|
57
|
+
revision?: string | null;
|
|
58
|
+
/** All plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality. */
|
|
59
|
+
plugins?: Plugin[];
|
|
60
|
+
/**
|
|
61
|
+
* All paging modes the collection supports. In native collections, offset-based paging is supported by default.
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
64
|
+
pagingModes?: PagingMode[];
|
|
65
|
+
/**
|
|
66
|
+
* Date the collection was created.
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
69
|
+
createdDate?: Date;
|
|
70
|
+
/**
|
|
71
|
+
* Date the collection was last updated.
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
74
|
+
updatedDate?: Date;
|
|
75
|
+
}
|
|
76
|
+
export declare enum CollectionType {
|
|
77
|
+
/** User-created collection. */
|
|
78
|
+
NATIVE = "NATIVE",
|
|
79
|
+
/** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
|
|
80
|
+
WIX_APP = "WIX_APP",
|
|
81
|
+
/** Collection created by a Wix Blocks app. */
|
|
82
|
+
BLOCKS_APP = "BLOCKS_APP",
|
|
83
|
+
/** Collection located in externally connected storage. */
|
|
84
|
+
EXTERNAL = "EXTERNAL"
|
|
85
|
+
}
|
|
86
|
+
export interface Sort {
|
|
87
|
+
/** Field to sort by. */
|
|
88
|
+
fieldKey?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Sort order. Use `ASC` for ascending order or `DESC` for descending order.
|
|
91
|
+
*
|
|
92
|
+
* Default: `ASC`
|
|
93
|
+
*/
|
|
94
|
+
direction?: Direction;
|
|
95
|
+
}
|
|
96
|
+
export declare enum Direction {
|
|
97
|
+
ASC = "ASC",
|
|
98
|
+
DESC = "DESC"
|
|
99
|
+
}
|
|
100
|
+
export interface CollectionCapabilities {
|
|
101
|
+
/** Data operations the collection supports. */
|
|
102
|
+
dataOperations?: DataOperation[];
|
|
103
|
+
}
|
|
104
|
+
export declare enum DataOperation {
|
|
105
|
+
AGGREGATE = "AGGREGATE",
|
|
106
|
+
BULK_INSERT = "BULK_INSERT",
|
|
107
|
+
BULK_REMOVE = "BULK_REMOVE",
|
|
108
|
+
BULK_SAVE = "BULK_SAVE",
|
|
109
|
+
BULK_UPDATE = "BULK_UPDATE",
|
|
110
|
+
COUNT = "COUNT",
|
|
111
|
+
DISTINCT = "DISTINCT",
|
|
112
|
+
FIND = "FIND",
|
|
113
|
+
GET = "GET",
|
|
114
|
+
INSERT = "INSERT",
|
|
115
|
+
INSERT_REFERENCE = "INSERT_REFERENCE",
|
|
116
|
+
IS_REFERENCED = "IS_REFERENCED",
|
|
117
|
+
QUERY_REFERENCED = "QUERY_REFERENCED",
|
|
118
|
+
REMOVE = "REMOVE",
|
|
119
|
+
REMOVE_REFERENCE = "REMOVE_REFERENCE",
|
|
120
|
+
REPLACE_REFERENCES = "REPLACE_REFERENCES",
|
|
121
|
+
SAVE = "SAVE",
|
|
122
|
+
TRUNCATE = "TRUNCATE",
|
|
123
|
+
UPDATE = "UPDATE"
|
|
124
|
+
}
|
|
125
|
+
export interface Field extends FieldRangeValidationsOneOf {
|
|
126
|
+
/** Range of possible values for a numerical field. */
|
|
127
|
+
numberRange?: NumberRange;
|
|
128
|
+
/** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
|
|
129
|
+
stringLengthRange?: StringLengthRange;
|
|
130
|
+
/** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
|
|
131
|
+
arraySizeRange?: ArraySizeRange;
|
|
132
|
+
/** Unique identifier for the field. For example, `firstName`. */
|
|
133
|
+
key?: string;
|
|
134
|
+
/** Field's display name when shown in the Content Manager. For example, `First Name`. */
|
|
135
|
+
displayName?: string;
|
|
136
|
+
/** Field's data type. */
|
|
137
|
+
type?: TypeEnum;
|
|
138
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
139
|
+
typeMetadata?: TypeMetadata;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the field is a system field (created automatically).
|
|
142
|
+
* @readonly
|
|
143
|
+
*/
|
|
144
|
+
systemField?: boolean;
|
|
145
|
+
/** Capabilities the field supports. */
|
|
146
|
+
capabilities?: FieldCapabilities;
|
|
147
|
+
/** Indicates if field is encrypted. */
|
|
148
|
+
encrypted?: boolean;
|
|
149
|
+
/** Defines reference to router pattern in the site document. */
|
|
150
|
+
linkedRouterPage?: string | null;
|
|
151
|
+
/** Description of the field. */
|
|
152
|
+
description?: string | null;
|
|
153
|
+
plugin?: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* Whether the field is read-only. A read-only field can't be changed.
|
|
156
|
+
*
|
|
157
|
+
* Default: `false`
|
|
158
|
+
*/
|
|
159
|
+
readOnly?: boolean | null;
|
|
160
|
+
/**
|
|
161
|
+
* Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
|
|
162
|
+
*
|
|
163
|
+
* Default: `false`
|
|
164
|
+
*/
|
|
165
|
+
immutable?: boolean | null;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the field is required.
|
|
168
|
+
*
|
|
169
|
+
* Default: `false`
|
|
170
|
+
*/
|
|
171
|
+
required?: boolean | null;
|
|
172
|
+
}
|
|
173
|
+
/** @oneof */
|
|
174
|
+
export interface FieldRangeValidationsOneOf {
|
|
175
|
+
/** Range of possible values for a numerical field. */
|
|
176
|
+
numberRange?: NumberRange;
|
|
177
|
+
/** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
|
|
178
|
+
stringLengthRange?: StringLengthRange;
|
|
179
|
+
/** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
|
|
180
|
+
arraySizeRange?: ArraySizeRange;
|
|
181
|
+
}
|
|
182
|
+
export declare enum TypeEnum {
|
|
183
|
+
TEXT = "TEXT",
|
|
184
|
+
NUMBER = "NUMBER",
|
|
185
|
+
DATE = "DATE",
|
|
186
|
+
DATETIME = "DATETIME",
|
|
187
|
+
IMAGE = "IMAGE",
|
|
188
|
+
BOOLEAN = "BOOLEAN",
|
|
189
|
+
DOCUMENT = "DOCUMENT",
|
|
190
|
+
URL = "URL",
|
|
191
|
+
RICH_TEXT = "RICH_TEXT",
|
|
192
|
+
VIDEO = "VIDEO",
|
|
193
|
+
ANY = "ANY",
|
|
194
|
+
ARRAY_STRING = "ARRAY_STRING",
|
|
195
|
+
ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
|
|
196
|
+
AUDIO = "AUDIO",
|
|
197
|
+
TIME = "TIME",
|
|
198
|
+
LANGUAGE = "LANGUAGE",
|
|
199
|
+
RICH_CONTENT = "RICH_CONTENT",
|
|
200
|
+
MEDIA_GALLERY = "MEDIA_GALLERY",
|
|
201
|
+
ADDRESS = "ADDRESS",
|
|
202
|
+
PAGE_LINK = "PAGE_LINK",
|
|
203
|
+
REFERENCE = "REFERENCE",
|
|
204
|
+
MULTI_REFERENCE = "MULTI_REFERENCE",
|
|
205
|
+
OBJECT = "OBJECT",
|
|
206
|
+
ARRAY = "ARRAY",
|
|
207
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
208
|
+
LEGACY_TIME = "LEGACY_TIME",
|
|
209
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
210
|
+
LEGACY_BOOK = "LEGACY_BOOK",
|
|
211
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
212
|
+
LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
|
|
213
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
214
|
+
LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
|
|
215
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
216
|
+
LEGACY_IMAGE = "LEGACY_IMAGE",
|
|
217
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
218
|
+
LEGACY_COLOR = "LEGACY_COLOR",
|
|
219
|
+
/** Deprecated - can’t be added to collections. Can only appear in older collections. */
|
|
220
|
+
LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO"
|
|
221
|
+
}
|
|
222
|
+
export interface TypeMetadata extends TypeMetadataMetadataOneOf {
|
|
223
|
+
/** Metadata for a reference field. */
|
|
224
|
+
reference?: Reference;
|
|
225
|
+
/** Metadata for a multi-reference field. */
|
|
226
|
+
multiReference?: MultiReference;
|
|
227
|
+
/** Metadata for an object field. */
|
|
228
|
+
object?: Object;
|
|
229
|
+
/** Metadata for an array field. */
|
|
230
|
+
array?: Array;
|
|
231
|
+
/** Metadata for a page link field. */
|
|
232
|
+
pageLink?: PageLink;
|
|
233
|
+
}
|
|
234
|
+
/** @oneof */
|
|
235
|
+
export interface TypeMetadataMetadataOneOf {
|
|
236
|
+
/** Metadata for a reference field. */
|
|
237
|
+
reference?: Reference;
|
|
238
|
+
/** Metadata for a multi-reference field. */
|
|
239
|
+
multiReference?: MultiReference;
|
|
240
|
+
/** Metadata for an object field. */
|
|
241
|
+
object?: Object;
|
|
242
|
+
/** Metadata for an array field. */
|
|
243
|
+
array?: Array;
|
|
244
|
+
/** Metadata for a page link field. */
|
|
245
|
+
pageLink?: PageLink;
|
|
246
|
+
}
|
|
247
|
+
export interface FieldCapabilities {
|
|
248
|
+
/**
|
|
249
|
+
* Whether the collection can be sorted by this field.
|
|
250
|
+
*
|
|
251
|
+
* Default: `false`
|
|
252
|
+
*/
|
|
253
|
+
sortable?: boolean;
|
|
254
|
+
/** Query operators that can be used for this field. */
|
|
255
|
+
queryOperators?: QueryOperator[];
|
|
256
|
+
}
|
|
257
|
+
export declare enum QueryOperator {
|
|
258
|
+
EQ = "EQ",
|
|
259
|
+
LT = "LT",
|
|
260
|
+
GT = "GT",
|
|
261
|
+
NE = "NE",
|
|
262
|
+
LTE = "LTE",
|
|
263
|
+
GTE = "GTE",
|
|
264
|
+
STARTS_WITH = "STARTS_WITH",
|
|
265
|
+
ENDS_WITH = "ENDS_WITH",
|
|
266
|
+
CONTAINS = "CONTAINS",
|
|
267
|
+
HAS_SOME = "HAS_SOME",
|
|
268
|
+
HAS_ALL = "HAS_ALL",
|
|
269
|
+
EXISTS = "EXISTS",
|
|
270
|
+
URLIZED = "URLIZED"
|
|
271
|
+
}
|
|
272
|
+
export interface ObjectField {
|
|
273
|
+
/** Field key. */
|
|
274
|
+
key?: string;
|
|
275
|
+
/** Display name for the field. */
|
|
276
|
+
displayName?: string;
|
|
277
|
+
/** Field type. */
|
|
278
|
+
type?: TypeEnum;
|
|
279
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
280
|
+
typeMetadata?: TypeMetadata;
|
|
281
|
+
/** Capabilities the object field supports. */
|
|
282
|
+
capabilities?: FieldCapabilities;
|
|
283
|
+
}
|
|
284
|
+
export interface FieldsPattern {
|
|
285
|
+
pattern?: string;
|
|
286
|
+
lowercase?: boolean;
|
|
287
|
+
}
|
|
288
|
+
export interface UrlizedOnlyPattern {
|
|
289
|
+
pattern?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface Calculator extends CalculatorPatternOneOf {
|
|
292
|
+
/** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
|
|
293
|
+
fieldsPattern?: FieldsPattern;
|
|
294
|
+
/** Value is only URL encoded. */
|
|
295
|
+
urlizedOnlyPattern?: UrlizedOnlyPattern;
|
|
296
|
+
id?: string;
|
|
297
|
+
}
|
|
298
|
+
/** @oneof */
|
|
299
|
+
export interface CalculatorPatternOneOf {
|
|
300
|
+
/** Value is calculated according to pattern, whitespaces are replaced with dash [-]. */
|
|
301
|
+
fieldsPattern?: FieldsPattern;
|
|
302
|
+
/** Value is only URL encoded. */
|
|
303
|
+
urlizedOnlyPattern?: UrlizedOnlyPattern;
|
|
304
|
+
}
|
|
305
|
+
export interface Reference {
|
|
306
|
+
/** Referenced collection ID. */
|
|
307
|
+
referencedCollectionId?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface MultiReference {
|
|
310
|
+
/** Referenced collection ID. */
|
|
311
|
+
referencedCollectionId?: string;
|
|
312
|
+
/** Referencing field key. */
|
|
313
|
+
referencingFieldKey?: string;
|
|
314
|
+
/** Display name in the Content Manager for the referenced data. */
|
|
315
|
+
referencingDisplayName?: string;
|
|
316
|
+
}
|
|
317
|
+
export interface Object {
|
|
318
|
+
/** Fields within the object. */
|
|
319
|
+
fields?: ObjectField[];
|
|
320
|
+
}
|
|
321
|
+
export interface Array {
|
|
322
|
+
/** Element's data type. */
|
|
323
|
+
elementType?: TypeEnum;
|
|
324
|
+
/** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
|
|
325
|
+
typeMetadata?: TypeMetadata;
|
|
326
|
+
}
|
|
327
|
+
export interface PageLink {
|
|
328
|
+
calculator?: Calculator;
|
|
329
|
+
}
|
|
330
|
+
export interface NumberRange {
|
|
331
|
+
/**
|
|
332
|
+
* Minimum permitted value for a numerical field.
|
|
333
|
+
*
|
|
334
|
+
* Default: No validation
|
|
335
|
+
*/
|
|
336
|
+
min?: number | null;
|
|
337
|
+
/**
|
|
338
|
+
* Maximum permitted value for a numerical field.
|
|
339
|
+
*
|
|
340
|
+
* Default: No validation
|
|
341
|
+
*/
|
|
342
|
+
max?: number | null;
|
|
343
|
+
}
|
|
344
|
+
export interface StringLengthRange {
|
|
345
|
+
/**
|
|
346
|
+
* Minimum permitted length for a text field.
|
|
347
|
+
*
|
|
348
|
+
* Default: No validation
|
|
349
|
+
*/
|
|
350
|
+
minLength?: number | null;
|
|
351
|
+
/**
|
|
352
|
+
* Maximum permitted length for a text field.
|
|
353
|
+
*
|
|
354
|
+
* Default: No validation
|
|
355
|
+
*/
|
|
356
|
+
maxLength?: number | null;
|
|
357
|
+
}
|
|
358
|
+
export interface ArraySizeRange {
|
|
359
|
+
/**
|
|
360
|
+
* Minimum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
|
|
361
|
+
*
|
|
362
|
+
* Default: No validation
|
|
363
|
+
*/
|
|
364
|
+
minSize?: number | null;
|
|
365
|
+
/**
|
|
366
|
+
* Maximum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
|
|
367
|
+
*
|
|
368
|
+
* Default: No validation
|
|
369
|
+
*/
|
|
370
|
+
maxSize?: number | null;
|
|
371
|
+
}
|
|
372
|
+
/** Permissions defined by the lowest role needed to perform each action. */
|
|
373
|
+
export interface Permissions {
|
|
374
|
+
/** Lowest role needed to add a collection. */
|
|
375
|
+
insert?: Role;
|
|
376
|
+
/** Lowest role needed to update a collection. */
|
|
377
|
+
update?: Role;
|
|
378
|
+
/** Lowest role needed to remove a collection. */
|
|
379
|
+
remove?: Role;
|
|
380
|
+
/** Lowest role needed to read a collection. */
|
|
381
|
+
read?: Role;
|
|
382
|
+
}
|
|
383
|
+
export declare enum Role {
|
|
384
|
+
/** Site administrator. */
|
|
385
|
+
ADMIN = "ADMIN",
|
|
386
|
+
/** Signed-in user who added content to this collection. */
|
|
387
|
+
SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
|
|
388
|
+
/** Any signed-in user. */
|
|
389
|
+
SITE_MEMBER = "SITE_MEMBER",
|
|
390
|
+
/** Any site visitor. */
|
|
391
|
+
ANYONE = "ANYONE"
|
|
392
|
+
}
|
|
393
|
+
export interface Plugin extends PluginOptionsOneOf {
|
|
394
|
+
/** Options for the Publish plugin. */
|
|
395
|
+
publishOptions?: PublishPluginOptions;
|
|
396
|
+
/** Options for the Single Item plugin. */
|
|
397
|
+
singleItemOptions?: SingleItemPluginOptions;
|
|
398
|
+
/** Options for the Urlized plugin. */
|
|
399
|
+
urlizedOptions?: UrlizedPluginOptions;
|
|
400
|
+
/** Options for Gridappless plugin. */
|
|
401
|
+
gridapplessOptions?: GridapplessPluginOptions;
|
|
402
|
+
/**
|
|
403
|
+
* Plugin types. The following plugins are supported:
|
|
404
|
+
*
|
|
405
|
+
* * `PUBLISH`: Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors.
|
|
406
|
+
* * `SINGLE_ITEM`: Ensures the collection can have one item at most. Can only be applied to a new collection.
|
|
407
|
+
* * `URLIZED`: Generates item URLs for collections used by dynamic pages.
|
|
408
|
+
* * `GRIDAPPLESS`: This plugin is read-only and can't be manually added. Indicates the collection structure is shared between sandbox and live environments.
|
|
409
|
+
*/
|
|
410
|
+
type?: Type;
|
|
411
|
+
}
|
|
412
|
+
/** @oneof */
|
|
413
|
+
export interface PluginOptionsOneOf {
|
|
414
|
+
/** Options for the Publish plugin. */
|
|
415
|
+
publishOptions?: PublishPluginOptions;
|
|
416
|
+
/** Options for the Single Item plugin. */
|
|
417
|
+
singleItemOptions?: SingleItemPluginOptions;
|
|
418
|
+
/** Options for the Urlized plugin. */
|
|
419
|
+
urlizedOptions?: UrlizedPluginOptions;
|
|
420
|
+
/** Options for Gridappless plugin. */
|
|
421
|
+
gridapplessOptions?: GridapplessPluginOptions;
|
|
422
|
+
}
|
|
423
|
+
export declare enum Status {
|
|
424
|
+
PUBLISHED = "PUBLISHED",
|
|
425
|
+
DRAFT = "DRAFT"
|
|
426
|
+
}
|
|
427
|
+
export declare enum Format {
|
|
428
|
+
ORIGINAL = "ORIGINAL",
|
|
429
|
+
PLAIN = "PLAIN"
|
|
430
|
+
}
|
|
431
|
+
export declare enum Type {
|
|
432
|
+
/** Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors. */
|
|
433
|
+
PUBLISH = "PUBLISH",
|
|
434
|
+
/** Ensures the collection can have one item at most. Can only be applied to a new collection. */
|
|
435
|
+
SINGLE_ITEM = "SINGLE_ITEM",
|
|
436
|
+
/** Generates item URLs for collections used by dynamic pages. */
|
|
437
|
+
URLIZED = "URLIZED",
|
|
438
|
+
/** This plugin is read-only and can't be manually added. Indicates collection structure is shared between sandbox and live environments. */
|
|
439
|
+
GRIDAPPLESS = "GRIDAPPLESS"
|
|
440
|
+
}
|
|
441
|
+
export interface PublishPluginOptions {
|
|
442
|
+
/** Default status. */
|
|
443
|
+
defaultStatus?: Status;
|
|
444
|
+
}
|
|
445
|
+
export interface SingleItemPluginOptions {
|
|
446
|
+
/** ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this. */
|
|
447
|
+
singleItemId?: string;
|
|
448
|
+
}
|
|
449
|
+
export interface UrlizedPluginOptions {
|
|
450
|
+
/**
|
|
451
|
+
* Encoding method for generating a URL in ASCII characters.
|
|
452
|
+
*
|
|
453
|
+
* * `ORIGINAL`: Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL.
|
|
454
|
+
* * `PLAIN`: No changes are made before generating the encoded URL.
|
|
455
|
+
*/
|
|
456
|
+
format?: Format;
|
|
457
|
+
}
|
|
458
|
+
export interface GridapplessPluginOptions {
|
|
459
|
+
/** indicates if tenant is migrated to gridappless or initially on it */
|
|
460
|
+
migrated?: boolean;
|
|
461
|
+
}
|
|
462
|
+
export declare enum PagingMode {
|
|
463
|
+
/** Offset-based paging. */
|
|
464
|
+
OFFSET = "OFFSET",
|
|
465
|
+
/** Cursor-based paging. */
|
|
466
|
+
CURSOR = "CURSOR"
|
|
467
|
+
}
|
|
468
|
+
export interface DataCollectionClonedEvent {
|
|
469
|
+
/** original instance collection is cloned from */
|
|
470
|
+
originInstanceId?: string;
|
|
471
|
+
/** original collection ID, may be same as current one */
|
|
472
|
+
originId?: string;
|
|
473
|
+
}
|
|
474
|
+
export interface DataCollectionChangedEvent {
|
|
475
|
+
/** list of new fields */
|
|
476
|
+
fieldsAdded?: Field[];
|
|
477
|
+
/** list of changed fields */
|
|
478
|
+
fieldsUpdated?: Field[];
|
|
479
|
+
/** list of removed fields */
|
|
480
|
+
fieldsRemoved?: Field[];
|
|
481
|
+
/** list of new plugins */
|
|
482
|
+
pluginsAdded?: Plugin[];
|
|
483
|
+
/** list of changed plugins */
|
|
484
|
+
pluginsUpdated?: Plugin[];
|
|
485
|
+
/** list of removed plugins */
|
|
486
|
+
pluginsRemoved?: Plugin[];
|
|
487
|
+
}
|
|
488
|
+
export interface CreateDataCollectionRequest {
|
|
489
|
+
/** Collection details. */
|
|
490
|
+
collection?: DataCollection;
|
|
491
|
+
}
|
|
492
|
+
export interface CreateDataCollectionResponse {
|
|
493
|
+
/** Details of collection created. */
|
|
494
|
+
collection?: DataCollection;
|
|
495
|
+
}
|
|
496
|
+
export interface GetDataCollectionRequest {
|
|
497
|
+
/** ID of the collection to retrieve. */
|
|
498
|
+
dataCollectionId: string;
|
|
499
|
+
/**
|
|
500
|
+
* Whether to return all collections referenced by the requested collection.
|
|
501
|
+
*
|
|
502
|
+
* Default: `false`
|
|
503
|
+
*/
|
|
504
|
+
includeReferencedCollections?: boolean;
|
|
505
|
+
}
|
|
506
|
+
export interface GetDataCollectionResponse {
|
|
507
|
+
/** Details of the collection requested. */
|
|
508
|
+
collection?: DataCollection;
|
|
509
|
+
/**
|
|
510
|
+
* Details of collections referenced by the collection requested.
|
|
511
|
+
* Only populated when `includeReferencedCollections` is `true` in the request.
|
|
512
|
+
*/
|
|
513
|
+
referencedCollections?: DataCollection[];
|
|
514
|
+
}
|
|
515
|
+
export interface ListDataCollectionsRequest extends ListDataCollectionsRequestPagingMethodOneOf {
|
|
516
|
+
/** Offset-based paging. */
|
|
517
|
+
paging?: Paging;
|
|
518
|
+
/** Cursor-based paging. */
|
|
519
|
+
cursorPaging?: CursorPaging;
|
|
520
|
+
/**
|
|
521
|
+
* Defines how collections in the response are sorted.
|
|
522
|
+
*
|
|
523
|
+
* Default: Ordered by ID in ascending order.
|
|
524
|
+
*/
|
|
525
|
+
sort?: Sorting;
|
|
526
|
+
}
|
|
527
|
+
/** @oneof */
|
|
528
|
+
export interface ListDataCollectionsRequestPagingMethodOneOf {
|
|
529
|
+
/** Offset-based paging. */
|
|
530
|
+
paging?: Paging;
|
|
531
|
+
/** Cursor-based paging. */
|
|
532
|
+
cursorPaging?: CursorPaging;
|
|
533
|
+
}
|
|
534
|
+
export interface Sorting {
|
|
535
|
+
/** Name of the field to sort by. */
|
|
536
|
+
fieldName?: string;
|
|
537
|
+
/** Sort order. */
|
|
538
|
+
order?: SortOrder;
|
|
539
|
+
}
|
|
540
|
+
export declare enum SortOrder {
|
|
541
|
+
ASC = "ASC",
|
|
542
|
+
DESC = "DESC"
|
|
543
|
+
}
|
|
544
|
+
export interface Paging {
|
|
545
|
+
/** Number of items to load. */
|
|
546
|
+
limit?: number | null;
|
|
547
|
+
/** Number of items to skip in the current sort order. */
|
|
548
|
+
offset?: number | null;
|
|
549
|
+
}
|
|
550
|
+
export interface CursorPaging {
|
|
551
|
+
/** Number of items to load. */
|
|
552
|
+
limit?: number | null;
|
|
553
|
+
/**
|
|
554
|
+
* Pointer to the next or previous page in the list of results.
|
|
555
|
+
*
|
|
556
|
+
* You can get the relevant cursor token
|
|
557
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
558
|
+
* Not relevant for the first request.
|
|
559
|
+
*/
|
|
560
|
+
cursor?: string | null;
|
|
561
|
+
}
|
|
562
|
+
export interface ListDataCollectionsResponse {
|
|
563
|
+
/** List of collections. */
|
|
564
|
+
collections?: DataCollection[];
|
|
565
|
+
/** Paging information. */
|
|
566
|
+
pagingMetadata?: PagingMetadataV2;
|
|
567
|
+
}
|
|
568
|
+
export interface PagingMetadataV2 {
|
|
569
|
+
/** Number of items returned in the response. */
|
|
570
|
+
count?: number | null;
|
|
571
|
+
/** Offset that was requested. */
|
|
572
|
+
offset?: number | null;
|
|
573
|
+
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
|
574
|
+
total?: number | null;
|
|
575
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
576
|
+
tooManyToCount?: boolean | null;
|
|
577
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
578
|
+
cursors?: Cursors;
|
|
579
|
+
}
|
|
580
|
+
export interface Cursors {
|
|
581
|
+
/** Cursor pointing to next page in the list of results. */
|
|
582
|
+
next?: string | null;
|
|
583
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
584
|
+
prev?: string | null;
|
|
585
|
+
}
|
|
586
|
+
export interface BulkGetDataCollectionsRequest {
|
|
587
|
+
/** IDs of the collections to retrieve. */
|
|
588
|
+
dataCollectionIds?: string[];
|
|
589
|
+
/**
|
|
590
|
+
* Whether to include deleted collections.
|
|
591
|
+
*
|
|
592
|
+
* Default: `false`
|
|
593
|
+
*/
|
|
594
|
+
showDeletedCollections?: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Whether the returned collection list should include referenced collections.
|
|
597
|
+
*
|
|
598
|
+
* Default: `false`
|
|
599
|
+
*/
|
|
600
|
+
includeReferencedCollections?: boolean;
|
|
601
|
+
/** Sorting preferences. */
|
|
602
|
+
sort?: Sorting;
|
|
603
|
+
}
|
|
604
|
+
export interface BulkGetDataCollectionsResponse {
|
|
605
|
+
/**
|
|
606
|
+
* List of requested collections.
|
|
607
|
+
* When `include_referenced_collections` is `true` in the request, referenced collections are included here.
|
|
608
|
+
*/
|
|
609
|
+
activeCollections?: DataCollection[];
|
|
610
|
+
/** List of requested deleted collections. Only populated when `showDeletedCollections` is true in the request. */
|
|
611
|
+
deletedCollections?: DataCollection[];
|
|
612
|
+
}
|
|
613
|
+
export interface BulkGetDataCollectionsBySnapshotsRequest {
|
|
614
|
+
/** Ids of schema snapshot */
|
|
615
|
+
snapshotIds?: string[];
|
|
616
|
+
}
|
|
617
|
+
export interface BulkGetDataCollectionsBySnapshotsResponse {
|
|
618
|
+
/** List of snapshot collection map */
|
|
619
|
+
snapshotCollections?: SnapshotDataCollections[];
|
|
620
|
+
}
|
|
621
|
+
export interface SnapshotDataCollections {
|
|
622
|
+
snapshotId?: string;
|
|
623
|
+
collections?: DataCollection[];
|
|
624
|
+
}
|
|
625
|
+
export interface UpdateDataCollectionRequest {
|
|
626
|
+
/** Updated collection details. The existing collection is replaced with this version. */
|
|
627
|
+
collection?: DataCollection;
|
|
628
|
+
}
|
|
629
|
+
export interface UpdateDataCollectionResponse {
|
|
630
|
+
/** Updated collection details. */
|
|
631
|
+
collection?: DataCollection;
|
|
632
|
+
}
|
|
633
|
+
export interface DeleteDataCollectionRequest {
|
|
634
|
+
/** ID of the collection to delete. */
|
|
635
|
+
dataCollectionId: string;
|
|
636
|
+
}
|
|
637
|
+
export interface DeleteDataCollectionResponse {
|
|
638
|
+
}
|