@wix/wix-data-items-common 1.0.52
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/README.md +8 -0
- package/dist/cjs/api/ApiClient.js +186 -0
- package/dist/cjs/api/ApiClient.js.map +1 -0
- package/dist/cjs/api/QueryBase.js +200 -0
- package/dist/cjs/api/QueryBase.js.map +1 -0
- package/dist/cjs/api/QueryValidator.js +36 -0
- package/dist/cjs/api/QueryValidator.js.map +1 -0
- package/dist/cjs/api/WixDataAggregate.js +4 -0
- package/dist/cjs/api/WixDataAggregate.js.map +1 -0
- package/dist/cjs/api/WixDataApi.js +800 -0
- package/dist/cjs/api/WixDataApi.js.map +1 -0
- package/dist/cjs/api/WixDataFilter.js +2 -0
- package/dist/cjs/api/WixDataFilter.js.map +1 -0
- package/dist/cjs/api/WixDataPatch.js +139 -0
- package/dist/cjs/api/WixDataPatch.js.map +1 -0
- package/dist/cjs/api/WixDataQuery.js +4 -0
- package/dist/cjs/api/WixDataQuery.js.map +1 -0
- package/dist/cjs/api/WixDataResult.js +4 -0
- package/dist/cjs/api/WixDataResult.js.map +1 -0
- package/dist/cjs/api/common.js +14 -0
- package/dist/cjs/api/common.js.map +1 -0
- package/dist/cjs/api/errors.js +67 -0
- package/dist/cjs/api/errors.js.map +1 -0
- package/dist/cjs/api/impl/WixDataAggregateImpl.js +193 -0
- package/dist/cjs/api/impl/WixDataAggregateImpl.js.map +1 -0
- package/dist/cjs/api/impl/WixDataQueryImpl.js +116 -0
- package/dist/cjs/api/impl/WixDataQueryImpl.js.map +1 -0
- package/dist/cjs/api/impl/WixDataResultImpl.js +111 -0
- package/dist/cjs/api/impl/WixDataResultImpl.js.map +1 -0
- package/dist/cjs/api/index.js +32 -0
- package/dist/cjs/api/index.js.map +1 -0
- package/dist/cjs/api/types.js +2 -0
- package/dist/cjs/api/types.js.map +1 -0
- package/dist/cjs/errors/base-validator.js +92 -0
- package/dist/cjs/errors/base-validator.js.map +1 -0
- package/dist/cjs/errors/errors.js +155 -0
- package/dist/cjs/errors/errors.js.map +1 -0
- package/dist/cjs/errors/index.js +15 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/errors/validations.js +91 -0
- package/dist/cjs/errors/validations.js.map +1 -0
- package/dist/cjs/external-types.d.js +2 -0
- package/dist/cjs/external-types.d.js.map +1 -0
- package/dist/cjs/filter/FilterTree.js +154 -0
- package/dist/cjs/filter/FilterTree.js.map +1 -0
- package/dist/cjs/filter/WithFilter.js +2 -0
- package/dist/cjs/filter/WithFilter.js.map +1 -0
- package/dist/cjs/filter/filterBuilder.js +53 -0
- package/dist/cjs/filter/filterBuilder.js.map +1 -0
- package/dist/cjs/filter/filterMixin.js +144 -0
- package/dist/cjs/filter/filterMixin.js.map +1 -0
- package/dist/cjs/filter/index.js +16 -0
- package/dist/cjs/filter/index.js.map +1 -0
- package/dist/cjs/index.js +120 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/sort/sortMixin.js +79 -0
- package/dist/cjs/sort/sortMixin.js.map +1 -0
- package/dist/cjs/test-types.d.js +2 -0
- package/dist/cjs/test-types.d.js.map +1 -0
- package/dist/cjs/types/api.js +4 -0
- package/dist/cjs/types/api.js.map +1 -0
- package/dist/cjs/types/data-item-types.js +46 -0
- package/dist/cjs/types/data-item-types.js.map +1 -0
- package/dist/cjs/types/error.js +2 -0
- package/dist/cjs/types/error.js.map +1 -0
- package/dist/cjs/types/index.js +16 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/utils/base64url.js +51 -0
- package/dist/cjs/utils/base64url.js.map +1 -0
- package/dist/cjs/utils/clone.js +21 -0
- package/dist/cjs/utils/clone.js.map +1 -0
- package/dist/cjs/utils/codec.js +64 -0
- package/dist/cjs/utils/codec.js.map +1 -0
- package/dist/cjs/utils/field-key-utils.js +18 -0
- package/dist/cjs/utils/field-key-utils.js.map +1 -0
- package/dist/cjs/utils/index.js +25 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/type-utils.js +54 -0
- package/dist/cjs/utils/type-utils.js.map +1 -0
- package/dist/esm/api/ApiClient.js +174 -0
- package/dist/esm/api/ApiClient.js.map +1 -0
- package/dist/esm/api/QueryBase.js +117 -0
- package/dist/esm/api/QueryBase.js.map +1 -0
- package/dist/esm/api/QueryValidator.js +32 -0
- package/dist/esm/api/QueryValidator.js.map +1 -0
- package/dist/esm/api/WixDataAggregate.js +2 -0
- package/dist/esm/api/WixDataAggregate.js.map +1 -0
- package/dist/esm/api/WixDataApi.js +829 -0
- package/dist/esm/api/WixDataApi.js.map +1 -0
- package/dist/esm/api/WixDataFilter.js +2 -0
- package/dist/esm/api/WixDataFilter.js.map +1 -0
- package/dist/esm/api/WixDataPatch.js +134 -0
- package/dist/esm/api/WixDataPatch.js.map +1 -0
- package/dist/esm/api/WixDataQuery.js +2 -0
- package/dist/esm/api/WixDataQuery.js.map +1 -0
- package/dist/esm/api/WixDataResult.js +2 -0
- package/dist/esm/api/WixDataResult.js.map +1 -0
- package/dist/esm/api/common.js +10 -0
- package/dist/esm/api/common.js.map +1 -0
- package/dist/esm/api/errors.js +52 -0
- package/dist/esm/api/errors.js.map +1 -0
- package/dist/esm/api/impl/WixDataAggregateImpl.js +214 -0
- package/dist/esm/api/impl/WixDataAggregateImpl.js.map +1 -0
- package/dist/esm/api/impl/WixDataQueryImpl.js +119 -0
- package/dist/esm/api/impl/WixDataQueryImpl.js.map +1 -0
- package/dist/esm/api/impl/WixDataResultImpl.js +100 -0
- package/dist/esm/api/impl/WixDataResultImpl.js.map +1 -0
- package/dist/esm/api/index.js +5 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/types.js +2 -0
- package/dist/esm/api/types.js.map +1 -0
- package/dist/esm/errors/base-validator.js +71 -0
- package/dist/esm/errors/base-validator.js.map +1 -0
- package/dist/esm/errors/errors.js +147 -0
- package/dist/esm/errors/errors.js.map +1 -0
- package/dist/esm/errors/index.js +5 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/errors/validations.js +114 -0
- package/dist/esm/errors/validations.js.map +1 -0
- package/dist/esm/filter/FilterTree.js +148 -0
- package/dist/esm/filter/FilterTree.js.map +1 -0
- package/dist/esm/filter/WithFilter.js +2 -0
- package/dist/esm/filter/WithFilter.js.map +1 -0
- package/dist/esm/filter/filterBuilder.js +43 -0
- package/dist/esm/filter/filterBuilder.js.map +1 -0
- package/dist/esm/filter/filterMixin.js +137 -0
- package/dist/esm/filter/filterMixin.js.map +1 -0
- package/dist/esm/filter/index.js +5 -0
- package/dist/esm/filter/index.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/sort/sortMixin.js +74 -0
- package/dist/esm/sort/sortMixin.js.map +1 -0
- package/dist/esm/types/api.js +2 -0
- package/dist/esm/types/api.js.map +1 -0
- package/dist/esm/types/data-item-types.js +35 -0
- package/dist/esm/types/data-item-types.js.map +1 -0
- package/dist/esm/types/error.js +2 -0
- package/dist/esm/types/error.js.map +1 -0
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/utils/base64url.js +57 -0
- package/dist/esm/utils/base64url.js.map +1 -0
- package/dist/esm/utils/clone.js +18 -0
- package/dist/esm/utils/clone.js.map +1 -0
- package/dist/esm/utils/codec.js +60 -0
- package/dist/esm/utils/codec.js.map +1 -0
- package/dist/esm/utils/field-key-utils.js +14 -0
- package/dist/esm/utils/field-key-utils.js.map +1 -0
- package/dist/esm/utils/index.js +7 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/type-utils.js +40 -0
- package/dist/esm/utils/type-utils.js.map +1 -0
- package/dist/types/api/ApiClient.d.ts +30 -0
- package/dist/types/api/ApiClient.d.ts.map +1 -0
- package/dist/types/api/QueryBase.d.ts +111 -0
- package/dist/types/api/QueryBase.d.ts.map +1 -0
- package/dist/types/api/QueryValidator.d.ts +12 -0
- package/dist/types/api/QueryValidator.d.ts.map +1 -0
- package/dist/types/api/WixDataAggregate.d.ts +320 -0
- package/dist/types/api/WixDataAggregate.d.ts.map +1 -0
- package/dist/types/api/WixDataApi.d.ts +52 -0
- package/dist/types/api/WixDataApi.d.ts.map +1 -0
- package/dist/types/api/WixDataFilter.d.ts +424 -0
- package/dist/types/api/WixDataFilter.d.ts.map +1 -0
- package/dist/types/api/WixDataPatch.d.ts +80 -0
- package/dist/types/api/WixDataPatch.d.ts.map +1 -0
- package/dist/types/api/WixDataQuery.d.ts +702 -0
- package/dist/types/api/WixDataQuery.d.ts.map +1 -0
- package/dist/types/api/WixDataResult.d.ts +144 -0
- package/dist/types/api/WixDataResult.d.ts.map +1 -0
- package/dist/types/api/common.d.ts +3 -0
- package/dist/types/api/common.d.ts.map +1 -0
- package/dist/types/api/errors.d.ts +12 -0
- package/dist/types/api/errors.d.ts.map +1 -0
- package/dist/types/api/impl/WixDataAggregateImpl.d.ts +76 -0
- package/dist/types/api/impl/WixDataAggregateImpl.d.ts.map +1 -0
- package/dist/types/api/impl/WixDataQueryImpl.d.ts +72 -0
- package/dist/types/api/impl/WixDataQueryImpl.d.ts.map +1 -0
- package/dist/types/api/impl/WixDataResultImpl.d.ts +34 -0
- package/dist/types/api/impl/WixDataResultImpl.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +11 -0
- package/dist/types/api/index.d.ts.map +1 -0
- package/dist/types/api/types.d.ts +163 -0
- package/dist/types/api/types.d.ts.map +1 -0
- package/dist/types/errors/base-validator.d.ts +28 -0
- package/dist/types/errors/base-validator.d.ts.map +1 -0
- package/dist/types/errors/errors.d.ts +108 -0
- package/dist/types/errors/errors.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +5 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/errors/validations.d.ts +25 -0
- package/dist/types/errors/validations.d.ts.map +1 -0
- package/dist/types/filter/FilterTree.d.ts +56 -0
- package/dist/types/filter/FilterTree.d.ts.map +1 -0
- package/dist/types/filter/WithFilter.d.ts +470 -0
- package/dist/types/filter/WithFilter.d.ts.map +1 -0
- package/dist/types/filter/filterBuilder.d.ts +105 -0
- package/dist/types/filter/filterBuilder.d.ts.map +1 -0
- package/dist/types/filter/filterMixin.d.ts +61 -0
- package/dist/types/filter/filterMixin.d.ts.map +1 -0
- package/dist/types/filter/index.d.ts +8 -0
- package/dist/types/filter/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/sort/sortMixin.d.ts +46 -0
- package/dist/types/sort/sortMixin.d.ts.map +1 -0
- package/dist/types/types/api.d.ts +36 -0
- package/dist/types/types/api.d.ts.map +1 -0
- package/dist/types/types/data-item-types.d.ts +1448 -0
- package/dist/types/types/data-item-types.d.ts.map +1 -0
- package/dist/types/types/error.d.ts +23 -0
- package/dist/types/types/error.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/utils/base64url.d.ts +2 -0
- package/dist/types/utils/base64url.d.ts.map +1 -0
- package/dist/types/utils/clone.d.ts +2 -0
- package/dist/types/utils/clone.d.ts.map +1 -0
- package/dist/types/utils/codec.d.ts +3 -0
- package/dist/types/utils/codec.d.ts.map +1 -0
- package/dist/types/utils/field-key-utils.d.ts +2 -0
- package/dist/types/utils/field-key-utils.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/type-utils.d.ts +11 -0
- package/dist/types/utils/type-utils.d.ts.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,1448 @@
|
|
|
1
|
+
export interface DataItem {
|
|
2
|
+
/** Data item ID. */
|
|
3
|
+
id?: string;
|
|
4
|
+
/**
|
|
5
|
+
* ID of the collection this item belongs to
|
|
6
|
+
* @readonly
|
|
7
|
+
*/
|
|
8
|
+
dataCollectionId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Data item contents.
|
|
11
|
+
*
|
|
12
|
+
* Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:
|
|
13
|
+
*
|
|
14
|
+
* + `_id`: Item ID.
|
|
15
|
+
* + `_createdDate`: Date and time the item was added to the collection.
|
|
16
|
+
* + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.
|
|
17
|
+
* + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.
|
|
18
|
+
*/
|
|
19
|
+
data?: Record<string, any> | null;
|
|
20
|
+
}
|
|
21
|
+
export interface InsertDataItemRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Environment: LIVE or SANDBOX
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
environment?: Environment;
|
|
27
|
+
/** ID of the collection in which to insert the item. */
|
|
28
|
+
dataCollectionId: string;
|
|
29
|
+
/** Item to insert. */
|
|
30
|
+
dataItem: DataItem;
|
|
31
|
+
/**
|
|
32
|
+
* Grid app id. Optional in Live segment.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
appId?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* If true, referenced items will be included.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
includeReferencedItems?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Data access options
|
|
43
|
+
* @internal
|
|
44
|
+
* @deprecated
|
|
45
|
+
* @replacedBy inlined
|
|
46
|
+
* @removalDate 2024-07-12
|
|
47
|
+
*/
|
|
48
|
+
options?: Options;
|
|
49
|
+
/**
|
|
50
|
+
* Should hooks execution be suppressed.
|
|
51
|
+
* This option can only be used with Corvid backend
|
|
52
|
+
* code identity.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
suppressHooks?: boolean;
|
|
56
|
+
/** @internal */
|
|
57
|
+
appOptions?: Record<string, any> | null;
|
|
58
|
+
}
|
|
59
|
+
export declare enum Environment {
|
|
60
|
+
LIVE = "LIVE",
|
|
61
|
+
SANDBOX = "SANDBOX",
|
|
62
|
+
SANDBOX_PREFERRED = "SANDBOX_PREFERRED"
|
|
63
|
+
}
|
|
64
|
+
export interface Options {
|
|
65
|
+
/**
|
|
66
|
+
* Should hooks execution be suppressed.
|
|
67
|
+
* This option can only be used with Corvid backend
|
|
68
|
+
* code identity.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
suppressHooks?: boolean;
|
|
72
|
+
/** @internal */
|
|
73
|
+
appOptions?: Record<string, any> | null;
|
|
74
|
+
/** @internal */
|
|
75
|
+
publishPluginOptions?: PublishPluginOptions;
|
|
76
|
+
}
|
|
77
|
+
export interface PublishPluginOptions {
|
|
78
|
+
showDraftItems?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface InsertDataItemResponse {
|
|
81
|
+
/** Inserted data item. */
|
|
82
|
+
dataItem?: DataItem;
|
|
83
|
+
}
|
|
84
|
+
export interface PatchDataItemRequest {
|
|
85
|
+
/**
|
|
86
|
+
* Environment: LIVE or SANDBOX
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
environment?: Environment;
|
|
90
|
+
/** ID of the collection containing the existing item. */
|
|
91
|
+
dataCollectionId: string;
|
|
92
|
+
/** Patch set applied during item update. */
|
|
93
|
+
patchSet: PatchSet;
|
|
94
|
+
/**
|
|
95
|
+
* Grid app id. Optional in Live segment.
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
appId?: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Data access options
|
|
101
|
+
* @internal
|
|
102
|
+
* @deprecated
|
|
103
|
+
* @replacedBy inlined
|
|
104
|
+
* @removalDate 2024-07-12
|
|
105
|
+
*/
|
|
106
|
+
options?: Options;
|
|
107
|
+
/**
|
|
108
|
+
* Should hooks execution be suppressed.
|
|
109
|
+
* This option can only be used with Corvid backend
|
|
110
|
+
* code identity.
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
suppressHooks?: boolean;
|
|
114
|
+
/** @internal */
|
|
115
|
+
appOptions?: Record<string, any> | null;
|
|
116
|
+
/** @internal */
|
|
117
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
118
|
+
}
|
|
119
|
+
export interface PatchSet {
|
|
120
|
+
/** Data item ID. */
|
|
121
|
+
dataItemId?: string;
|
|
122
|
+
/** Set of field updates to be applied */
|
|
123
|
+
fieldUpdates?: FieldUpdate[];
|
|
124
|
+
}
|
|
125
|
+
export interface FieldUpdate extends FieldUpdateActionOptionsOneOf {
|
|
126
|
+
setField?: SetField;
|
|
127
|
+
incrementField?: IncrementField;
|
|
128
|
+
appendToArray?: AppendToArray;
|
|
129
|
+
removeFromArray?: RemoveFromArray;
|
|
130
|
+
/** Field key to be patched. For ex "title", "address.street" */
|
|
131
|
+
fieldPath?: string;
|
|
132
|
+
/** Action to be applied */
|
|
133
|
+
action?: ACTION;
|
|
134
|
+
}
|
|
135
|
+
/** @oneof */
|
|
136
|
+
export interface FieldUpdateActionOptionsOneOf {
|
|
137
|
+
setField?: SetField;
|
|
138
|
+
incrementField?: IncrementField;
|
|
139
|
+
appendToArray?: AppendToArray;
|
|
140
|
+
removeFromArray?: RemoveFromArray;
|
|
141
|
+
}
|
|
142
|
+
export declare enum ACTION {
|
|
143
|
+
UNKNOWN_ACTION = "UNKNOWN_ACTION",
|
|
144
|
+
SET_FIELD = "SET_FIELD",
|
|
145
|
+
REMOVE_FIELD = "REMOVE_FIELD",
|
|
146
|
+
INCREMENT_FIELD = "INCREMENT_FIELD",
|
|
147
|
+
APPEND_TO_ARRAY = "APPEND_TO_ARRAY",
|
|
148
|
+
REMOVE_FROM_ARRAY = "REMOVE_FROM_ARRAY"
|
|
149
|
+
}
|
|
150
|
+
export interface SetField {
|
|
151
|
+
value?: any;
|
|
152
|
+
}
|
|
153
|
+
export interface IncrementField {
|
|
154
|
+
value?: number;
|
|
155
|
+
}
|
|
156
|
+
export interface AppendToArray {
|
|
157
|
+
value?: any;
|
|
158
|
+
}
|
|
159
|
+
export interface RemoveFromArray {
|
|
160
|
+
value?: any;
|
|
161
|
+
}
|
|
162
|
+
export interface DataPublishPluginOptions {
|
|
163
|
+
includeDraftItems?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface PatchDataItemResponse {
|
|
166
|
+
/** Updated data item. */
|
|
167
|
+
dataItem?: DataItem;
|
|
168
|
+
}
|
|
169
|
+
export interface BulkPatchDataItemsRequest {
|
|
170
|
+
/**
|
|
171
|
+
* Environment: LIVE or SANDBOX
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
environment?: Environment;
|
|
175
|
+
/** ID of the collection in which to update items. */
|
|
176
|
+
dataCollectionId: string;
|
|
177
|
+
/** Patch sets to apply. */
|
|
178
|
+
patchSets: PatchSet[];
|
|
179
|
+
/**
|
|
180
|
+
* Grid app id. Optional in Live segment.
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
183
|
+
appId?: string | null;
|
|
184
|
+
/**
|
|
185
|
+
* Data access options
|
|
186
|
+
* @internal
|
|
187
|
+
* @deprecated
|
|
188
|
+
* @replacedBy inlined
|
|
189
|
+
* @removalDate 2024-07-12
|
|
190
|
+
*/
|
|
191
|
+
options?: Options;
|
|
192
|
+
/**
|
|
193
|
+
* Whether to return the updated data items.
|
|
194
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
195
|
+
*
|
|
196
|
+
* Default: `false`
|
|
197
|
+
*/
|
|
198
|
+
returnEntity?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Should hooks execution be suppressed.
|
|
201
|
+
* This option can only be used with Corvid backend
|
|
202
|
+
* code identity.
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
suppressHooks?: boolean;
|
|
206
|
+
/** @internal */
|
|
207
|
+
appOptions?: Record<string, any> | null;
|
|
208
|
+
/** @internal */
|
|
209
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
210
|
+
}
|
|
211
|
+
export interface BulkPatchDataItemsResponse {
|
|
212
|
+
/** Information about the updated items. */
|
|
213
|
+
results?: BulkDataItemResult[];
|
|
214
|
+
/** Bulk action metadata. */
|
|
215
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
216
|
+
}
|
|
217
|
+
export interface BulkDataItemResult {
|
|
218
|
+
/** The action attempted for the data item. */
|
|
219
|
+
action?: BulkActionType;
|
|
220
|
+
/** Metadata related to the data item for which the action was attempted. */
|
|
221
|
+
itemMetadata?: ItemMetadata;
|
|
222
|
+
/** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
|
|
223
|
+
dataItem?: DataItem;
|
|
224
|
+
}
|
|
225
|
+
export declare enum BulkActionType {
|
|
226
|
+
UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
|
|
227
|
+
INSERT = "INSERT",
|
|
228
|
+
UPDATE = "UPDATE",
|
|
229
|
+
DELETE = "DELETE",
|
|
230
|
+
PATCH = "PATCH"
|
|
231
|
+
}
|
|
232
|
+
export interface ItemMetadata {
|
|
233
|
+
/** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */
|
|
234
|
+
id?: string | null;
|
|
235
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
236
|
+
originalIndex?: number;
|
|
237
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
238
|
+
success?: boolean;
|
|
239
|
+
/** Details about the error in case of failure. */
|
|
240
|
+
error?: ApplicationError;
|
|
241
|
+
}
|
|
242
|
+
export interface ApplicationError {
|
|
243
|
+
/** Error code. */
|
|
244
|
+
code?: string;
|
|
245
|
+
/** Description of the error. */
|
|
246
|
+
description?: string;
|
|
247
|
+
/** Data related to the error. */
|
|
248
|
+
data?: Record<string, any> | null;
|
|
249
|
+
}
|
|
250
|
+
export interface BulkActionMetadata {
|
|
251
|
+
/** Number of items successfully processed. */
|
|
252
|
+
totalSuccesses?: number;
|
|
253
|
+
/** Number of items that couldn't be processed. */
|
|
254
|
+
totalFailures?: number;
|
|
255
|
+
}
|
|
256
|
+
export interface UpdateDataItemRequest {
|
|
257
|
+
/**
|
|
258
|
+
* Environment: LIVE or SANDBOX
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
261
|
+
environment?: Environment;
|
|
262
|
+
/** ID of the collection containing the existing item. */
|
|
263
|
+
dataCollectionId: string;
|
|
264
|
+
/** Updated data item content. The existing data item's content is replaced entirely. */
|
|
265
|
+
dataItem: DataItem;
|
|
266
|
+
/**
|
|
267
|
+
* Grid app id. Optional in Live segment.
|
|
268
|
+
* @internal
|
|
269
|
+
*/
|
|
270
|
+
appId?: string | null;
|
|
271
|
+
/**
|
|
272
|
+
* If true, referenced items will be included.
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
includeReferencedItems?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Data access options
|
|
278
|
+
* @internal
|
|
279
|
+
* @deprecated
|
|
280
|
+
* @replacedBy inlined
|
|
281
|
+
* @removalDate 2024-07-12
|
|
282
|
+
*/
|
|
283
|
+
options?: Options;
|
|
284
|
+
/**
|
|
285
|
+
* Should hooks execution be suppressed.
|
|
286
|
+
* This option can only be used with Corvid backend
|
|
287
|
+
* code identity.
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
290
|
+
suppressHooks?: boolean;
|
|
291
|
+
/** @internal */
|
|
292
|
+
appOptions?: Record<string, any> | null;
|
|
293
|
+
/** @internal */
|
|
294
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
295
|
+
}
|
|
296
|
+
export interface UpdateDataItemResponse {
|
|
297
|
+
/** Updated data item. */
|
|
298
|
+
dataItem?: DataItem;
|
|
299
|
+
}
|
|
300
|
+
export interface SaveDataItemRequest {
|
|
301
|
+
/**
|
|
302
|
+
* Environment: LIVE or SANDBOX
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
environment?: Environment;
|
|
306
|
+
/** ID of the collection in which to insert or update the item. */
|
|
307
|
+
dataCollectionId: string;
|
|
308
|
+
/** Data item to insert or update. */
|
|
309
|
+
dataItem: DataItem;
|
|
310
|
+
/**
|
|
311
|
+
* Grid app id. Optional in Live segment.
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
appId?: string | null;
|
|
315
|
+
/**
|
|
316
|
+
* If true, referenced items will be included.
|
|
317
|
+
* @internal
|
|
318
|
+
*/
|
|
319
|
+
includeReferencedItems?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Data access options
|
|
322
|
+
* @internal
|
|
323
|
+
* @deprecated
|
|
324
|
+
* @replacedBy inlined
|
|
325
|
+
* @removalDate 2024-07-12
|
|
326
|
+
*/
|
|
327
|
+
options?: Options;
|
|
328
|
+
/**
|
|
329
|
+
* Should hooks execution be suppressed.
|
|
330
|
+
* This option can only be used with Corvid backend
|
|
331
|
+
* code identity.
|
|
332
|
+
* @internal
|
|
333
|
+
*/
|
|
334
|
+
suppressHooks?: boolean;
|
|
335
|
+
/** @internal */
|
|
336
|
+
appOptions?: Record<string, any> | null;
|
|
337
|
+
/** @internal */
|
|
338
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
339
|
+
}
|
|
340
|
+
export interface SaveDataItemResponse {
|
|
341
|
+
/**
|
|
342
|
+
* The action carried out for the item.
|
|
343
|
+
*
|
|
344
|
+
* + `INSERTED`: A new item was added to the collection.
|
|
345
|
+
* + `UPDATED`: An existing item in the collection was updated.
|
|
346
|
+
*/
|
|
347
|
+
action?: Action;
|
|
348
|
+
/** Inserted or updated data item. */
|
|
349
|
+
dataItem?: DataItem;
|
|
350
|
+
}
|
|
351
|
+
export declare enum Action {
|
|
352
|
+
UNKNOWN_ACTION = "UNKNOWN_ACTION",
|
|
353
|
+
INSERTED = "INSERTED",
|
|
354
|
+
UPDATED = "UPDATED"
|
|
355
|
+
}
|
|
356
|
+
export interface GetDataItemRequest {
|
|
357
|
+
/**
|
|
358
|
+
* Environment: LIVE or SANDBOX
|
|
359
|
+
* @internal
|
|
360
|
+
*/
|
|
361
|
+
environment?: Environment;
|
|
362
|
+
/** ID of the collection from which to retrieve the data item. */
|
|
363
|
+
dataCollectionId: string;
|
|
364
|
+
/** ID of the data item to retrieve. */
|
|
365
|
+
dataItemId: string;
|
|
366
|
+
/**
|
|
367
|
+
* Grid app id. Optional in Live segment.
|
|
368
|
+
* @internal
|
|
369
|
+
*/
|
|
370
|
+
appId?: string | null;
|
|
371
|
+
/**
|
|
372
|
+
* Data access options
|
|
373
|
+
* @internal
|
|
374
|
+
* @deprecated
|
|
375
|
+
* @replacedBy inlined
|
|
376
|
+
* @removalDate 2024-07-12
|
|
377
|
+
*/
|
|
378
|
+
options?: Options;
|
|
379
|
+
/**
|
|
380
|
+
* Whether to retrieve data from the primary database instance.
|
|
381
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
382
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
383
|
+
*
|
|
384
|
+
* Default: `false`
|
|
385
|
+
*/
|
|
386
|
+
consistentRead?: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
389
|
+
* If provided, the result text is returned in the specified language.
|
|
390
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
391
|
+
*
|
|
392
|
+
* If not provided, result text is not translated.
|
|
393
|
+
*/
|
|
394
|
+
language?: string | null;
|
|
395
|
+
/**
|
|
396
|
+
* Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
|
|
397
|
+
* **Note:** The `_id` system field is always returned.
|
|
398
|
+
*/
|
|
399
|
+
fields?: string[];
|
|
400
|
+
/**
|
|
401
|
+
* Should hooks execution be suppressed.
|
|
402
|
+
* This option can only be used with Corvid backend
|
|
403
|
+
* code identity.
|
|
404
|
+
* @internal
|
|
405
|
+
*/
|
|
406
|
+
suppressHooks?: boolean;
|
|
407
|
+
/** @internal */
|
|
408
|
+
appOptions?: Record<string, any> | null;
|
|
409
|
+
/** @internal */
|
|
410
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
411
|
+
}
|
|
412
|
+
export interface GetDataItemResponse {
|
|
413
|
+
/** Retrieved item. */
|
|
414
|
+
dataItem?: DataItem;
|
|
415
|
+
}
|
|
416
|
+
export interface RemoveDataItemRequest {
|
|
417
|
+
/**
|
|
418
|
+
* Environment: LIVE or SANDBOX
|
|
419
|
+
* @internal
|
|
420
|
+
*/
|
|
421
|
+
environment?: Environment;
|
|
422
|
+
/** ID of the collection from which to remove the item. */
|
|
423
|
+
dataCollectionId: string;
|
|
424
|
+
/** ID of the item to remove. */
|
|
425
|
+
dataItemId: string;
|
|
426
|
+
/**
|
|
427
|
+
* Grid app id. Optional in Live segment.
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
appId?: string | null;
|
|
431
|
+
/**
|
|
432
|
+
* Data access options
|
|
433
|
+
* @internal
|
|
434
|
+
* @deprecated
|
|
435
|
+
* @replacedBy inlined
|
|
436
|
+
* @removalDate 2024-07-12
|
|
437
|
+
*/
|
|
438
|
+
options?: Options;
|
|
439
|
+
/**
|
|
440
|
+
* Should hooks execution be suppressed.
|
|
441
|
+
* This option can only be used with Corvid backend
|
|
442
|
+
* code identity.
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
suppressHooks?: boolean;
|
|
446
|
+
/** @internal */
|
|
447
|
+
appOptions?: Record<string, any> | null;
|
|
448
|
+
/** @internal */
|
|
449
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
450
|
+
}
|
|
451
|
+
export interface RemoveDataItemResponse {
|
|
452
|
+
/** Removed item. */
|
|
453
|
+
dataItem?: DataItem;
|
|
454
|
+
}
|
|
455
|
+
export interface TruncateDataItemsRequest {
|
|
456
|
+
/**
|
|
457
|
+
* Environment: LIVE or SANDBOX
|
|
458
|
+
* @internal
|
|
459
|
+
*/
|
|
460
|
+
environment?: Environment;
|
|
461
|
+
/** ID of the collection to truncate. */
|
|
462
|
+
dataCollectionId: string;
|
|
463
|
+
/**
|
|
464
|
+
* Grid app id. Optional in Live segment.
|
|
465
|
+
* @internal
|
|
466
|
+
*/
|
|
467
|
+
appId?: string | null;
|
|
468
|
+
/**
|
|
469
|
+
* Data access options
|
|
470
|
+
* @internal
|
|
471
|
+
* @deprecated
|
|
472
|
+
* @replacedBy inlined
|
|
473
|
+
* @removalDate 2024-07-12
|
|
474
|
+
*/
|
|
475
|
+
options?: Options;
|
|
476
|
+
}
|
|
477
|
+
export interface TruncateDataItemsResponse {
|
|
478
|
+
}
|
|
479
|
+
export interface QueryDataItemsRequest {
|
|
480
|
+
/**
|
|
481
|
+
* Environment: LIVE or SANDBOX
|
|
482
|
+
* @internal
|
|
483
|
+
*/
|
|
484
|
+
environment?: Environment;
|
|
485
|
+
/** ID of the collection to query. */
|
|
486
|
+
dataCollectionId: string;
|
|
487
|
+
/** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */
|
|
488
|
+
query?: QueryV2;
|
|
489
|
+
/**
|
|
490
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
491
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
492
|
+
*
|
|
493
|
+
* Default: `false`
|
|
494
|
+
*/
|
|
495
|
+
returnTotalCount?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Properties for which to include referenced items in the query's results.
|
|
498
|
+
* Up to 50 referenced items can be included for each item that matches the query.
|
|
499
|
+
* @deprecated
|
|
500
|
+
* @replacedBy referenced_item_options
|
|
501
|
+
* @removalDate 2025-08-01
|
|
502
|
+
*/
|
|
503
|
+
includeReferencedItems?: string[];
|
|
504
|
+
/**
|
|
505
|
+
* Grid app id. Optional in Live segment.
|
|
506
|
+
* @internal
|
|
507
|
+
*/
|
|
508
|
+
appId?: string | null;
|
|
509
|
+
/**
|
|
510
|
+
* Data access options
|
|
511
|
+
* @internal
|
|
512
|
+
* @deprecated
|
|
513
|
+
* @replacedBy inlined
|
|
514
|
+
* @removalDate 2024-07-12
|
|
515
|
+
*/
|
|
516
|
+
options?: Options;
|
|
517
|
+
/**
|
|
518
|
+
* Whether to retrieve data from the primary database instance.
|
|
519
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
520
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
521
|
+
*
|
|
522
|
+
* Default: `false`
|
|
523
|
+
*/
|
|
524
|
+
consistentRead?: boolean;
|
|
525
|
+
/**
|
|
526
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
527
|
+
* If provided, the result text is returned in the specified language.
|
|
528
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
529
|
+
*
|
|
530
|
+
* If not provided, result text is not translated.
|
|
531
|
+
*/
|
|
532
|
+
language?: string | null;
|
|
533
|
+
/**
|
|
534
|
+
* Request information about this collection caching
|
|
535
|
+
* @internal
|
|
536
|
+
*/
|
|
537
|
+
requestCachingInfo?: boolean;
|
|
538
|
+
/**
|
|
539
|
+
* Should hooks execution be suppressed.
|
|
540
|
+
* This option can only be used with Corvid backend
|
|
541
|
+
* code identity.
|
|
542
|
+
* @internal
|
|
543
|
+
*/
|
|
544
|
+
suppressHooks?: boolean;
|
|
545
|
+
/** @internal */
|
|
546
|
+
appOptions?: Record<string, any> | null;
|
|
547
|
+
/** @internal */
|
|
548
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
549
|
+
/** Options for retrieving referenced items. */
|
|
550
|
+
referencedItemOptions?: ReferencedItemOptions[];
|
|
551
|
+
}
|
|
552
|
+
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
553
|
+
/** Paging options to limit and skip the number of items. */
|
|
554
|
+
paging?: Paging;
|
|
555
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
556
|
+
cursorPaging?: CursorPaging;
|
|
557
|
+
/**
|
|
558
|
+
* Filter object in the following format:
|
|
559
|
+
*
|
|
560
|
+
* `"filter" : {
|
|
561
|
+
* "fieldName1": "value1",
|
|
562
|
+
* "fieldName2":{"$operator":"value2"}
|
|
563
|
+
* }`
|
|
564
|
+
*
|
|
565
|
+
* Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
566
|
+
*
|
|
567
|
+
* **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
|
|
568
|
+
*/
|
|
569
|
+
filter?: Record<string, any> | null;
|
|
570
|
+
/**
|
|
571
|
+
* Sort object in the following format:
|
|
572
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
573
|
+
*/
|
|
574
|
+
sort?: Sorting[];
|
|
575
|
+
/**
|
|
576
|
+
* Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
|
|
577
|
+
* **Note:** The `_id` system field is always returned.
|
|
578
|
+
*/
|
|
579
|
+
fields?: string[];
|
|
580
|
+
}
|
|
581
|
+
/** @oneof */
|
|
582
|
+
export interface QueryV2PagingMethodOneOf {
|
|
583
|
+
/** Paging options to limit and skip the number of items. */
|
|
584
|
+
paging?: Paging;
|
|
585
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
586
|
+
cursorPaging?: CursorPaging;
|
|
587
|
+
}
|
|
588
|
+
export interface Sorting {
|
|
589
|
+
/** Name of the field to sort by. */
|
|
590
|
+
fieldName?: string;
|
|
591
|
+
/** Sort order. */
|
|
592
|
+
order?: SortOrder;
|
|
593
|
+
}
|
|
594
|
+
export declare enum SortOrder {
|
|
595
|
+
ASC = "ASC",
|
|
596
|
+
DESC = "DESC"
|
|
597
|
+
}
|
|
598
|
+
export interface Paging {
|
|
599
|
+
/** Number of items to load. */
|
|
600
|
+
limit?: number | null;
|
|
601
|
+
/** Number of items to skip in the current sort order. */
|
|
602
|
+
offset?: number | null;
|
|
603
|
+
}
|
|
604
|
+
export interface CursorPaging {
|
|
605
|
+
/** Number of items to load. */
|
|
606
|
+
limit?: number | null;
|
|
607
|
+
/**
|
|
608
|
+
* Pointer to the next or previous page in the list of results.
|
|
609
|
+
*
|
|
610
|
+
* You can get the relevant cursor token
|
|
611
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
612
|
+
* Not relevant for the first request.
|
|
613
|
+
*/
|
|
614
|
+
cursor?: string | null;
|
|
615
|
+
}
|
|
616
|
+
export interface ReferencedItemOptions {
|
|
617
|
+
/** Field containing references in the queried item. */
|
|
618
|
+
fieldName?: string;
|
|
619
|
+
/** Maximum number of referenced items to include for each queried item. */
|
|
620
|
+
limit?: number | null;
|
|
621
|
+
}
|
|
622
|
+
export interface QueryDataItemsResponse {
|
|
623
|
+
/** Retrieved items. */
|
|
624
|
+
dataItems?: DataItem[];
|
|
625
|
+
/**
|
|
626
|
+
* Caching info, returned if `request_caching_info` is set and caching is allowed
|
|
627
|
+
* @internal
|
|
628
|
+
*/
|
|
629
|
+
cachingInfo?: CachingInfo;
|
|
630
|
+
/** Paging information. */
|
|
631
|
+
pagingMetadata?: PagingMetadataV2;
|
|
632
|
+
}
|
|
633
|
+
export interface CachingInfo {
|
|
634
|
+
/** Caching tags for this collection */
|
|
635
|
+
tags?: string[];
|
|
636
|
+
/** max caching time if set */
|
|
637
|
+
maxAge?: number | null;
|
|
638
|
+
}
|
|
639
|
+
export interface PagingMetadataV2 {
|
|
640
|
+
/** Number of items returned in the response. */
|
|
641
|
+
count?: number | null;
|
|
642
|
+
/** Offset that was requested. */
|
|
643
|
+
offset?: number | null;
|
|
644
|
+
/** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */
|
|
645
|
+
total?: number | null;
|
|
646
|
+
/** Whether the server failed to calculate the `total` field. */
|
|
647
|
+
tooManyToCount?: boolean | null;
|
|
648
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
649
|
+
cursors?: Cursors;
|
|
650
|
+
/**
|
|
651
|
+
* Indicates if there are more results after the current page.
|
|
652
|
+
* If `true`, another page of results can be retrieved.
|
|
653
|
+
* If `false`, this is the last page.
|
|
654
|
+
* @internal
|
|
655
|
+
*/
|
|
656
|
+
hasNext?: boolean | null;
|
|
657
|
+
}
|
|
658
|
+
export interface Cursors {
|
|
659
|
+
/** Cursor pointing to next page in the list of results. */
|
|
660
|
+
next?: string | null;
|
|
661
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
662
|
+
prev?: string | null;
|
|
663
|
+
}
|
|
664
|
+
export interface AggregateDataItemsRequest extends AggregateDataItemsRequestPagingMethodOneOf {
|
|
665
|
+
/** Paging options to limit and skip the number of items. */
|
|
666
|
+
paging?: Paging;
|
|
667
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
668
|
+
cursorPaging?: CursorPaging;
|
|
669
|
+
/**
|
|
670
|
+
* Environment: LIVE or SANDBOX
|
|
671
|
+
* @internal
|
|
672
|
+
*/
|
|
673
|
+
environment?: Environment;
|
|
674
|
+
/** ID of the collection on which to run the aggregation. */
|
|
675
|
+
dataCollectionId: string;
|
|
676
|
+
/**
|
|
677
|
+
* Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
|
|
678
|
+
*
|
|
679
|
+
* **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
|
|
680
|
+
*/
|
|
681
|
+
initialFilter?: Record<string, any> | null;
|
|
682
|
+
/** Aggregation applied to the data. */
|
|
683
|
+
aggregation?: Aggregation;
|
|
684
|
+
/**
|
|
685
|
+
* Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
|
|
686
|
+
* **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
|
|
687
|
+
*/
|
|
688
|
+
finalFilter?: Record<string, any> | null;
|
|
689
|
+
/**
|
|
690
|
+
* Sort object in the following format:
|
|
691
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
692
|
+
*/
|
|
693
|
+
sort?: Sorting[];
|
|
694
|
+
/**
|
|
695
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
696
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
697
|
+
*
|
|
698
|
+
* Default: `false`
|
|
699
|
+
*/
|
|
700
|
+
returnTotalCount?: boolean;
|
|
701
|
+
/**
|
|
702
|
+
* Grid app id. Optional in Live segment.
|
|
703
|
+
* @internal
|
|
704
|
+
*/
|
|
705
|
+
appId?: string | null;
|
|
706
|
+
/**
|
|
707
|
+
* Data access options
|
|
708
|
+
* @internal
|
|
709
|
+
* @deprecated
|
|
710
|
+
* @replacedBy inlined
|
|
711
|
+
* @removalDate 2024-07-12
|
|
712
|
+
*/
|
|
713
|
+
options?: Options;
|
|
714
|
+
/**
|
|
715
|
+
* Whether to retrieve data from the primary database instance.
|
|
716
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
717
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
718
|
+
*
|
|
719
|
+
* Default: `false`
|
|
720
|
+
*/
|
|
721
|
+
consistentRead?: boolean;
|
|
722
|
+
/**
|
|
723
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
724
|
+
* If provided, the result text is returned in the specified language.
|
|
725
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
726
|
+
*
|
|
727
|
+
* If not provided, result text is not translated.
|
|
728
|
+
*/
|
|
729
|
+
language?: string | null;
|
|
730
|
+
/** @internal */
|
|
731
|
+
appOptions?: Record<string, any> | null;
|
|
732
|
+
/** @internal */
|
|
733
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
734
|
+
}
|
|
735
|
+
/** @oneof */
|
|
736
|
+
export interface AggregateDataItemsRequestPagingMethodOneOf {
|
|
737
|
+
/** Paging options to limit and skip the number of items. */
|
|
738
|
+
paging?: Paging;
|
|
739
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
740
|
+
cursorPaging?: CursorPaging;
|
|
741
|
+
}
|
|
742
|
+
export interface Average {
|
|
743
|
+
/** Name of the field for which to calculate the average value. */
|
|
744
|
+
itemFieldName?: string;
|
|
745
|
+
}
|
|
746
|
+
export interface Min {
|
|
747
|
+
/** Name of the field for which to calculate the minimum value. */
|
|
748
|
+
itemFieldName?: string;
|
|
749
|
+
}
|
|
750
|
+
export interface Max {
|
|
751
|
+
/** Name of the field for which to calculate the maximum value. */
|
|
752
|
+
itemFieldName?: string;
|
|
753
|
+
}
|
|
754
|
+
export interface Sum {
|
|
755
|
+
/** Name of the field for which to calculate the sum. */
|
|
756
|
+
itemFieldName?: string;
|
|
757
|
+
}
|
|
758
|
+
export interface Count {
|
|
759
|
+
}
|
|
760
|
+
export interface Operation extends OperationCalculateOneOf {
|
|
761
|
+
/** Calculate the average value of a specified field for all items in the grouping. */
|
|
762
|
+
average?: Average;
|
|
763
|
+
/** Calculate the minimum value of a specified field for all items in the grouping. */
|
|
764
|
+
min?: Min;
|
|
765
|
+
/** Calculate the maximum value of a specified field for all items in the grouping. */
|
|
766
|
+
max?: Max;
|
|
767
|
+
/** Calculate the sum of values of a specified field for all items in the grouping. */
|
|
768
|
+
sum?: Sum;
|
|
769
|
+
/** Calculate the number of items in the grouping. */
|
|
770
|
+
itemCount?: Count;
|
|
771
|
+
/** Name of the field containing results of the operation. */
|
|
772
|
+
resultFieldName?: string;
|
|
773
|
+
}
|
|
774
|
+
/** @oneof */
|
|
775
|
+
export interface OperationCalculateOneOf {
|
|
776
|
+
/** Calculate the average value of a specified field for all items in the grouping. */
|
|
777
|
+
average?: Average;
|
|
778
|
+
/** Calculate the minimum value of a specified field for all items in the grouping. */
|
|
779
|
+
min?: Min;
|
|
780
|
+
/** Calculate the maximum value of a specified field for all items in the grouping. */
|
|
781
|
+
max?: Max;
|
|
782
|
+
/** Calculate the sum of values of a specified field for all items in the grouping. */
|
|
783
|
+
sum?: Sum;
|
|
784
|
+
/** Calculate the number of items in the grouping. */
|
|
785
|
+
itemCount?: Count;
|
|
786
|
+
}
|
|
787
|
+
export interface Aggregation {
|
|
788
|
+
/** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */
|
|
789
|
+
groupingFields?: string[];
|
|
790
|
+
/** Operations to carry out on the data in each grouping. */
|
|
791
|
+
operations?: Operation[];
|
|
792
|
+
}
|
|
793
|
+
export interface AggregateDataItemsResponse {
|
|
794
|
+
/** Aggregation results. */
|
|
795
|
+
results?: Record<string, any>[] | null;
|
|
796
|
+
/** Paging information. */
|
|
797
|
+
pagingMetadata?: PagingMetadataV2;
|
|
798
|
+
}
|
|
799
|
+
export interface CountDataItemsRequest {
|
|
800
|
+
/**
|
|
801
|
+
* Environment: LIVE or SANDBOX
|
|
802
|
+
* @internal
|
|
803
|
+
*/
|
|
804
|
+
environment?: Environment;
|
|
805
|
+
/** ID of the collection for which to count query results. */
|
|
806
|
+
dataCollectionId: string;
|
|
807
|
+
/**
|
|
808
|
+
* Filter object in the following format:
|
|
809
|
+
*
|
|
810
|
+
* `"filter" : {
|
|
811
|
+
* "fieldName1": "value1",
|
|
812
|
+
* "fieldName2":{"$operator":"value2"}
|
|
813
|
+
* }`.
|
|
814
|
+
*
|
|
815
|
+
* Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
|
|
816
|
+
*
|
|
817
|
+
* **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
|
|
818
|
+
*/
|
|
819
|
+
filter?: Record<string, any> | null;
|
|
820
|
+
/**
|
|
821
|
+
* Grid app id. Optional in Live segment.
|
|
822
|
+
* @internal
|
|
823
|
+
*/
|
|
824
|
+
appId?: string | null;
|
|
825
|
+
/**
|
|
826
|
+
* Data access options
|
|
827
|
+
* @internal
|
|
828
|
+
* @deprecated
|
|
829
|
+
* @replacedBy inlined
|
|
830
|
+
* @removalDate 2024-07-12
|
|
831
|
+
*/
|
|
832
|
+
options?: Options;
|
|
833
|
+
/**
|
|
834
|
+
* Whether to retrieve data from the primary database instance.
|
|
835
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
836
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
837
|
+
*
|
|
838
|
+
* Default: `false`
|
|
839
|
+
*/
|
|
840
|
+
consistentRead?: boolean;
|
|
841
|
+
/**
|
|
842
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
843
|
+
* If provided, the result text is returned in the specified language.
|
|
844
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
845
|
+
*
|
|
846
|
+
* If not provided, result text is not translated.
|
|
847
|
+
*/
|
|
848
|
+
language?: string | null;
|
|
849
|
+
/**
|
|
850
|
+
* Should hooks execution be suppressed.
|
|
851
|
+
* This option can only be used with Corvid backend
|
|
852
|
+
* code identity.
|
|
853
|
+
* @internal
|
|
854
|
+
*/
|
|
855
|
+
suppressHooks?: boolean;
|
|
856
|
+
/** @internal */
|
|
857
|
+
appOptions?: Record<string, any> | null;
|
|
858
|
+
/** @internal */
|
|
859
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
860
|
+
}
|
|
861
|
+
export interface CountDataItemsResponse {
|
|
862
|
+
/** Number of items matching the query. */
|
|
863
|
+
totalCount?: number;
|
|
864
|
+
}
|
|
865
|
+
export interface QueryDistinctValuesRequest extends QueryDistinctValuesRequestPagingMethodOneOf {
|
|
866
|
+
/** Paging options to limit and skip the number of items. */
|
|
867
|
+
paging?: Paging;
|
|
868
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
869
|
+
cursorPaging?: CursorPaging;
|
|
870
|
+
/**
|
|
871
|
+
* Environment: LIVE or SANDBOX
|
|
872
|
+
* @internal
|
|
873
|
+
*/
|
|
874
|
+
environment?: Environment;
|
|
875
|
+
/** ID of the collection to query. */
|
|
876
|
+
dataCollectionId: string;
|
|
877
|
+
/** Item field name for which to return all distinct values. */
|
|
878
|
+
fieldName?: string;
|
|
879
|
+
/**
|
|
880
|
+
* Filter object in the following format:
|
|
881
|
+
*
|
|
882
|
+
* `"filter" : {
|
|
883
|
+
* "fieldName1": "value1",
|
|
884
|
+
* "fieldName2":{"$operator":"value2"}
|
|
885
|
+
* }`.
|
|
886
|
+
*
|
|
887
|
+
* Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.
|
|
888
|
+
*
|
|
889
|
+
* **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
|
|
890
|
+
*/
|
|
891
|
+
filter?: Record<string, any> | null;
|
|
892
|
+
/** Sort order. */
|
|
893
|
+
order?: SortOrder;
|
|
894
|
+
/**
|
|
895
|
+
* Whether to return the total count in the response for a query with offset paging.
|
|
896
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
897
|
+
*
|
|
898
|
+
* Default: `false`
|
|
899
|
+
*/
|
|
900
|
+
returnTotalCount?: boolean;
|
|
901
|
+
/**
|
|
902
|
+
* Grid app id. Optional in Live segment.
|
|
903
|
+
* @internal
|
|
904
|
+
*/
|
|
905
|
+
appId?: string | null;
|
|
906
|
+
/**
|
|
907
|
+
* Data access options
|
|
908
|
+
* @internal
|
|
909
|
+
* @deprecated
|
|
910
|
+
* @replacedBy inlined
|
|
911
|
+
* @removalDate 2024-07-12
|
|
912
|
+
*/
|
|
913
|
+
options?: Options;
|
|
914
|
+
/**
|
|
915
|
+
* Whether to retrieve data from the primary database instance.
|
|
916
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
917
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
918
|
+
*
|
|
919
|
+
* Default: `false`
|
|
920
|
+
*/
|
|
921
|
+
consistentRead?: boolean;
|
|
922
|
+
/**
|
|
923
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
924
|
+
* If provided, the result text is returned in the specified language.
|
|
925
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
926
|
+
*
|
|
927
|
+
* If not provided, result text is not translated.
|
|
928
|
+
*/
|
|
929
|
+
language?: string | null;
|
|
930
|
+
/** @internal */
|
|
931
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
932
|
+
}
|
|
933
|
+
/** @oneof */
|
|
934
|
+
export interface QueryDistinctValuesRequestPagingMethodOneOf {
|
|
935
|
+
/** Paging options to limit and skip the number of items. */
|
|
936
|
+
paging?: Paging;
|
|
937
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
938
|
+
cursorPaging?: CursorPaging;
|
|
939
|
+
}
|
|
940
|
+
export interface QueryDistinctValuesResponse {
|
|
941
|
+
/** List of distinct values contained in the field specified in `fieldName`. */
|
|
942
|
+
distinctValues?: any[];
|
|
943
|
+
/** Paging information. */
|
|
944
|
+
pagingMetadata?: PagingMetadataV2;
|
|
945
|
+
}
|
|
946
|
+
export interface BulkInsertDataItemsRequest {
|
|
947
|
+
/**
|
|
948
|
+
* Environment: LIVE or SANDBOX
|
|
949
|
+
* @internal
|
|
950
|
+
*/
|
|
951
|
+
environment?: Environment;
|
|
952
|
+
/** ID of the collection in which to insert the items. */
|
|
953
|
+
dataCollectionId: string;
|
|
954
|
+
/** Data items to insert. */
|
|
955
|
+
dataItems: DataItem[];
|
|
956
|
+
/**
|
|
957
|
+
* Grid app id. Optional in Live segment.
|
|
958
|
+
* @internal
|
|
959
|
+
*/
|
|
960
|
+
appId?: string | null;
|
|
961
|
+
/**
|
|
962
|
+
* Data access options.
|
|
963
|
+
* @internal
|
|
964
|
+
* @deprecated
|
|
965
|
+
* @replacedBy inlined
|
|
966
|
+
* @removalDate 2024-07-12
|
|
967
|
+
*/
|
|
968
|
+
options?: Options;
|
|
969
|
+
/**
|
|
970
|
+
* Whether to return the inserted data items.
|
|
971
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
972
|
+
*
|
|
973
|
+
* Default: `false`
|
|
974
|
+
*/
|
|
975
|
+
returnEntity?: boolean;
|
|
976
|
+
/**
|
|
977
|
+
* Should hooks execution be suppressed.
|
|
978
|
+
* This option can only be used with Corvid backend
|
|
979
|
+
* code identity.
|
|
980
|
+
* @internal
|
|
981
|
+
*/
|
|
982
|
+
suppressHooks?: boolean;
|
|
983
|
+
/** @internal */
|
|
984
|
+
appOptions?: Record<string, any> | null;
|
|
985
|
+
}
|
|
986
|
+
export interface BulkInsertDataItemsResponse {
|
|
987
|
+
/** Information about the inserted items. */
|
|
988
|
+
results?: BulkDataItemResult[];
|
|
989
|
+
/** Bulk action metadata. */
|
|
990
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
991
|
+
}
|
|
992
|
+
export interface BulkUpdateDataItemsRequest {
|
|
993
|
+
/**
|
|
994
|
+
* Environment: LIVE or SANDBOX
|
|
995
|
+
* @internal
|
|
996
|
+
*/
|
|
997
|
+
environment?: Environment;
|
|
998
|
+
/** ID of the collection in which to update items. */
|
|
999
|
+
dataCollectionId: string;
|
|
1000
|
+
/** Data items to update. */
|
|
1001
|
+
dataItems: DataItem[];
|
|
1002
|
+
/**
|
|
1003
|
+
* Grid app id. Optional in Live segment.
|
|
1004
|
+
* @internal
|
|
1005
|
+
*/
|
|
1006
|
+
appId?: string | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* Data access options
|
|
1009
|
+
* @internal
|
|
1010
|
+
* @deprecated
|
|
1011
|
+
* @replacedBy inlined
|
|
1012
|
+
* @removalDate 2024-07-12
|
|
1013
|
+
*/
|
|
1014
|
+
options?: Options;
|
|
1015
|
+
/**
|
|
1016
|
+
* Whether to return the updated data items.
|
|
1017
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
1018
|
+
*
|
|
1019
|
+
* Default: `false`
|
|
1020
|
+
*/
|
|
1021
|
+
returnEntity?: boolean;
|
|
1022
|
+
/**
|
|
1023
|
+
* Should hooks execution be suppressed.
|
|
1024
|
+
* This option can only be used with Corvid backend
|
|
1025
|
+
* code identity.
|
|
1026
|
+
* @internal
|
|
1027
|
+
*/
|
|
1028
|
+
suppressHooks?: boolean;
|
|
1029
|
+
/** @internal */
|
|
1030
|
+
appOptions?: Record<string, any> | null;
|
|
1031
|
+
/** @internal */
|
|
1032
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
1033
|
+
}
|
|
1034
|
+
export interface BulkUpdateDataItemsResponse {
|
|
1035
|
+
/** Information about the updated items. */
|
|
1036
|
+
results?: BulkDataItemResult[];
|
|
1037
|
+
/** Bulk action metadata. */
|
|
1038
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1039
|
+
}
|
|
1040
|
+
export interface BulkSaveDataItemsRequest {
|
|
1041
|
+
/**
|
|
1042
|
+
* Environment: LIVE or SANDBOX
|
|
1043
|
+
* @internal
|
|
1044
|
+
*/
|
|
1045
|
+
environment?: Environment;
|
|
1046
|
+
/** ID of the collection in which to insert or update the items. */
|
|
1047
|
+
dataCollectionId: string;
|
|
1048
|
+
/** Data items to insert or update. */
|
|
1049
|
+
dataItems: DataItem[];
|
|
1050
|
+
/**
|
|
1051
|
+
* Grid app id. Optional in Live segment.
|
|
1052
|
+
* @internal
|
|
1053
|
+
*/
|
|
1054
|
+
appId?: string | null;
|
|
1055
|
+
/**
|
|
1056
|
+
* Data access options
|
|
1057
|
+
* @internal
|
|
1058
|
+
* @deprecated
|
|
1059
|
+
* @replacedBy inlined
|
|
1060
|
+
* @removalDate 2024-07-12
|
|
1061
|
+
*/
|
|
1062
|
+
options?: Options;
|
|
1063
|
+
/**
|
|
1064
|
+
* Whether to return the saved data item.
|
|
1065
|
+
* When `true`, the `results` objects contain a `dataItem` field.
|
|
1066
|
+
*
|
|
1067
|
+
* Default: `false`
|
|
1068
|
+
*/
|
|
1069
|
+
returnEntity?: boolean;
|
|
1070
|
+
/**
|
|
1071
|
+
* Should hooks execution be suppressed.
|
|
1072
|
+
* This option can only be used with Corvid backend
|
|
1073
|
+
* code identity.
|
|
1074
|
+
* @internal
|
|
1075
|
+
*/
|
|
1076
|
+
suppressHooks?: boolean;
|
|
1077
|
+
/** @internal */
|
|
1078
|
+
appOptions?: Record<string, any> | null;
|
|
1079
|
+
/** @internal */
|
|
1080
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
1081
|
+
}
|
|
1082
|
+
export interface BulkSaveDataItemsResponse {
|
|
1083
|
+
/** Information about the saved items. */
|
|
1084
|
+
results?: BulkDataItemResult[];
|
|
1085
|
+
/** Bulk action metadata. */
|
|
1086
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1087
|
+
}
|
|
1088
|
+
export interface BulkRemoveDataItemsRequest {
|
|
1089
|
+
/**
|
|
1090
|
+
* Environment: LIVE or SANDBOX
|
|
1091
|
+
* @internal
|
|
1092
|
+
*/
|
|
1093
|
+
environment?: Environment;
|
|
1094
|
+
/** ID of the collection from which to remove the item. */
|
|
1095
|
+
dataCollectionId: string;
|
|
1096
|
+
/** IDs of data items to remove. */
|
|
1097
|
+
dataItemIds: string[];
|
|
1098
|
+
/**
|
|
1099
|
+
* Grid app id. Optional in Live segment.
|
|
1100
|
+
* @internal
|
|
1101
|
+
*/
|
|
1102
|
+
appId?: string | null;
|
|
1103
|
+
/**
|
|
1104
|
+
* Data access options
|
|
1105
|
+
* @internal
|
|
1106
|
+
* @deprecated
|
|
1107
|
+
* @replacedBy inlined
|
|
1108
|
+
* @removalDate 2024-07-12
|
|
1109
|
+
*/
|
|
1110
|
+
options?: Options;
|
|
1111
|
+
/**
|
|
1112
|
+
* Should hooks execution be suppressed.
|
|
1113
|
+
* This option can only be used with Corvid backend
|
|
1114
|
+
* code identity.
|
|
1115
|
+
* @internal
|
|
1116
|
+
*/
|
|
1117
|
+
suppressHooks?: boolean;
|
|
1118
|
+
/** @internal */
|
|
1119
|
+
appOptions?: Record<string, any> | null;
|
|
1120
|
+
/** @internal */
|
|
1121
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
1122
|
+
}
|
|
1123
|
+
export interface BulkRemoveDataItemsResponse {
|
|
1124
|
+
/** Information about the removed data items. */
|
|
1125
|
+
results?: BulkDataItemResult[];
|
|
1126
|
+
/** Bulk action metadata. */
|
|
1127
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1128
|
+
}
|
|
1129
|
+
export interface QueryReferencedDataItemsRequest extends QueryReferencedDataItemsRequestPagingMethodOneOf {
|
|
1130
|
+
/** Paging options to limit and skip the number of items. */
|
|
1131
|
+
paging?: Paging;
|
|
1132
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1133
|
+
cursorPaging?: CursorPaging;
|
|
1134
|
+
/**
|
|
1135
|
+
* Environment: LIVE or SANDBOX
|
|
1136
|
+
* @internal
|
|
1137
|
+
*/
|
|
1138
|
+
environment?: Environment;
|
|
1139
|
+
/** ID of the collection containing the referring item. */
|
|
1140
|
+
dataCollectionId: string;
|
|
1141
|
+
/** ID of the referring item. */
|
|
1142
|
+
referringItemId?: string;
|
|
1143
|
+
/** Field containing references in the referring item. */
|
|
1144
|
+
referringItemFieldName?: string;
|
|
1145
|
+
/** Order of the returned referenced items. Sorted by the date each item was referenced. */
|
|
1146
|
+
order?: SortOrder;
|
|
1147
|
+
/**
|
|
1148
|
+
* Whether to return the total count in the response.
|
|
1149
|
+
* When `true`, the `pagingMetadata` object in the response contains a `total` field.
|
|
1150
|
+
*
|
|
1151
|
+
* Default: `false`
|
|
1152
|
+
*/
|
|
1153
|
+
returnTotalCount?: boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* Grid app id. Optional in Live segment.
|
|
1156
|
+
* @internal
|
|
1157
|
+
*/
|
|
1158
|
+
appId?: string | null;
|
|
1159
|
+
/**
|
|
1160
|
+
* Data access options
|
|
1161
|
+
* @internal
|
|
1162
|
+
* @deprecated
|
|
1163
|
+
* @replacedBy inlined
|
|
1164
|
+
* @removalDate 2024-07-12
|
|
1165
|
+
*/
|
|
1166
|
+
options?: Options;
|
|
1167
|
+
/**
|
|
1168
|
+
* Whether to retrieve data from the primary database instance.
|
|
1169
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
1170
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
1171
|
+
*
|
|
1172
|
+
* Default: `false`
|
|
1173
|
+
*/
|
|
1174
|
+
consistentRead?: boolean;
|
|
1175
|
+
/**
|
|
1176
|
+
* Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
|
|
1177
|
+
* If provided, the result text is returned in the specified language.
|
|
1178
|
+
* **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
1179
|
+
*
|
|
1180
|
+
* If not provided, result text is not translated.
|
|
1181
|
+
*/
|
|
1182
|
+
language?: string | null;
|
|
1183
|
+
/**
|
|
1184
|
+
* Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.
|
|
1185
|
+
* **Note:** The `_id` system field is always returned.
|
|
1186
|
+
*/
|
|
1187
|
+
fields?: string[];
|
|
1188
|
+
/** @internal */
|
|
1189
|
+
appOptions?: Record<string, any> | null;
|
|
1190
|
+
/** @internal */
|
|
1191
|
+
publishPluginOptions?: DataPublishPluginOptions;
|
|
1192
|
+
}
|
|
1193
|
+
/** @oneof */
|
|
1194
|
+
export interface QueryReferencedDataItemsRequestPagingMethodOneOf {
|
|
1195
|
+
/** Paging options to limit and skip the number of items. */
|
|
1196
|
+
paging?: Paging;
|
|
1197
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1198
|
+
cursorPaging?: CursorPaging;
|
|
1199
|
+
}
|
|
1200
|
+
export interface QueryReferencedDataItemsResponse {
|
|
1201
|
+
/** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */
|
|
1202
|
+
results?: ReferencedResult[];
|
|
1203
|
+
/** Paging information. */
|
|
1204
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1205
|
+
}
|
|
1206
|
+
export interface UnresolvedReference {
|
|
1207
|
+
/** ID of the referring item. */
|
|
1208
|
+
referringItemId?: string;
|
|
1209
|
+
/** Field specified to query for references. */
|
|
1210
|
+
referringItemFieldName?: string;
|
|
1211
|
+
}
|
|
1212
|
+
export interface ReferencedResult extends ReferencedResultEntityOneOf {
|
|
1213
|
+
/** Data item referenced. */
|
|
1214
|
+
dataItem?: DataItem;
|
|
1215
|
+
/** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
|
|
1216
|
+
unresolvedReference?: UnresolvedReference;
|
|
1217
|
+
}
|
|
1218
|
+
/** @oneof */
|
|
1219
|
+
export interface ReferencedResultEntityOneOf {
|
|
1220
|
+
/** Data item referenced. */
|
|
1221
|
+
dataItem?: DataItem;
|
|
1222
|
+
/** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */
|
|
1223
|
+
unresolvedReference?: UnresolvedReference;
|
|
1224
|
+
}
|
|
1225
|
+
export interface IsReferencedDataItemRequest {
|
|
1226
|
+
/**
|
|
1227
|
+
* Environment: LIVE or SANDBOX
|
|
1228
|
+
* @internal
|
|
1229
|
+
*/
|
|
1230
|
+
environment?: Environment;
|
|
1231
|
+
/** ID of the collection containing the referring data item. */
|
|
1232
|
+
dataCollectionId: string;
|
|
1233
|
+
/** Field to check for a reference to the item that may be referenced. */
|
|
1234
|
+
referringItemFieldName: string;
|
|
1235
|
+
/** ID of the referring item. */
|
|
1236
|
+
referringItemId: string;
|
|
1237
|
+
/** ID of the item that may be referenced. */
|
|
1238
|
+
referencedItemId: string;
|
|
1239
|
+
/**
|
|
1240
|
+
* Grid app id. Optional in Live segment.
|
|
1241
|
+
* @internal
|
|
1242
|
+
*/
|
|
1243
|
+
appId?: string | null;
|
|
1244
|
+
/**
|
|
1245
|
+
* Data access options
|
|
1246
|
+
* @internal
|
|
1247
|
+
* @deprecated
|
|
1248
|
+
* @replacedBy inlined
|
|
1249
|
+
* @removalDate 2024-07-12
|
|
1250
|
+
*/
|
|
1251
|
+
options?: Options;
|
|
1252
|
+
/**
|
|
1253
|
+
* Whether to retrieve data from the primary database instance.
|
|
1254
|
+
* This decreases performance but ensures data retrieved is up to date even immediately after an update.
|
|
1255
|
+
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
1256
|
+
*
|
|
1257
|
+
* Default: `false`
|
|
1258
|
+
*/
|
|
1259
|
+
consistentRead?: boolean;
|
|
1260
|
+
/** @internal */
|
|
1261
|
+
appOptions?: Record<string, any> | null;
|
|
1262
|
+
}
|
|
1263
|
+
export interface IsReferencedDataItemResponse {
|
|
1264
|
+
/** Whether the specified reference exists. */
|
|
1265
|
+
isReferenced?: boolean;
|
|
1266
|
+
}
|
|
1267
|
+
export interface InsertDataItemReferenceRequest {
|
|
1268
|
+
/**
|
|
1269
|
+
* Environment: LIVE or SANDBOX
|
|
1270
|
+
* @internal
|
|
1271
|
+
*/
|
|
1272
|
+
environment?: Environment;
|
|
1273
|
+
/** ID of the collection in which to insert the reference. */
|
|
1274
|
+
dataCollectionId: string;
|
|
1275
|
+
/** Reference to insert */
|
|
1276
|
+
dataItemReference?: DataItemReference;
|
|
1277
|
+
/**
|
|
1278
|
+
* Grid app id. Optional in Live segment.
|
|
1279
|
+
* @internal
|
|
1280
|
+
*/
|
|
1281
|
+
appId?: string | null;
|
|
1282
|
+
/**
|
|
1283
|
+
* Data access options
|
|
1284
|
+
* @internal
|
|
1285
|
+
* @deprecated
|
|
1286
|
+
* @replacedBy inlined
|
|
1287
|
+
* @removalDate 2024-07-12
|
|
1288
|
+
*/
|
|
1289
|
+
options?: Options;
|
|
1290
|
+
/** @internal */
|
|
1291
|
+
appOptions?: Record<string, any> | null;
|
|
1292
|
+
}
|
|
1293
|
+
export interface DataItemReference {
|
|
1294
|
+
/** Referring item field containing the references to the referenced items. */
|
|
1295
|
+
referringItemFieldName?: string;
|
|
1296
|
+
/** ID of the referring item. */
|
|
1297
|
+
referringItemId?: string;
|
|
1298
|
+
/** ID of the referenced item. */
|
|
1299
|
+
referencedItemId?: string;
|
|
1300
|
+
}
|
|
1301
|
+
export interface InsertDataItemReferenceResponse {
|
|
1302
|
+
/** Inserted reference. */
|
|
1303
|
+
dataItemReference?: DataItemReference;
|
|
1304
|
+
}
|
|
1305
|
+
export interface RemoveDataItemReferenceRequest {
|
|
1306
|
+
/**
|
|
1307
|
+
* Environment: LIVE or SANDBOX
|
|
1308
|
+
* @internal
|
|
1309
|
+
*/
|
|
1310
|
+
environment?: Environment;
|
|
1311
|
+
/** ID of the collection containing the referring item. */
|
|
1312
|
+
dataCollectionId: string;
|
|
1313
|
+
/** Reference to remove. */
|
|
1314
|
+
dataItemReference: DataItemReference;
|
|
1315
|
+
/**
|
|
1316
|
+
* Grid app id. Optional in Live segment.
|
|
1317
|
+
* @internal
|
|
1318
|
+
*/
|
|
1319
|
+
appId?: string | null;
|
|
1320
|
+
/**
|
|
1321
|
+
* Data access options
|
|
1322
|
+
* @internal
|
|
1323
|
+
* @deprecated
|
|
1324
|
+
* @replacedBy inlined
|
|
1325
|
+
* @removalDate 2024-07-12
|
|
1326
|
+
*/
|
|
1327
|
+
options?: Options;
|
|
1328
|
+
/** @internal */
|
|
1329
|
+
appOptions?: Record<string, any> | null;
|
|
1330
|
+
}
|
|
1331
|
+
export interface RemoveDataItemReferenceResponse {
|
|
1332
|
+
/** Removed reference. */
|
|
1333
|
+
dataItemReference?: DataItemReference;
|
|
1334
|
+
}
|
|
1335
|
+
export interface BulkInsertDataItemReferencesRequest {
|
|
1336
|
+
/**
|
|
1337
|
+
* Environment: LIVE or SANDBOX
|
|
1338
|
+
* @internal
|
|
1339
|
+
*/
|
|
1340
|
+
environment?: Environment;
|
|
1341
|
+
/** ID of the collection containing the referring items. */
|
|
1342
|
+
dataCollectionId: string;
|
|
1343
|
+
/** References to insert. */
|
|
1344
|
+
dataItemReferences: DataItemReference[];
|
|
1345
|
+
/**
|
|
1346
|
+
* Grid app id. Optional in Live segment.
|
|
1347
|
+
* @internal
|
|
1348
|
+
*/
|
|
1349
|
+
appId?: string | null;
|
|
1350
|
+
/**
|
|
1351
|
+
* Data access options
|
|
1352
|
+
* @internal
|
|
1353
|
+
* @deprecated
|
|
1354
|
+
* @replacedBy inlined
|
|
1355
|
+
* @removalDate 2024-07-12
|
|
1356
|
+
*/
|
|
1357
|
+
options?: Options;
|
|
1358
|
+
/**
|
|
1359
|
+
* Whether to return the inserted data item references.
|
|
1360
|
+
* When `true`, the `results` objects contain a `dataItemReference` field.
|
|
1361
|
+
*
|
|
1362
|
+
* Default: `false`
|
|
1363
|
+
*/
|
|
1364
|
+
returnEntity?: boolean;
|
|
1365
|
+
/** @internal */
|
|
1366
|
+
appOptions?: Record<string, any> | null;
|
|
1367
|
+
}
|
|
1368
|
+
export interface BulkInsertDataItemReferencesResponse {
|
|
1369
|
+
/** Information about the inserted references. */
|
|
1370
|
+
results?: BulkDataItemReferenceResult[];
|
|
1371
|
+
/** Bulk action metadata. */
|
|
1372
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1373
|
+
}
|
|
1374
|
+
export interface BulkDataItemReferenceResult {
|
|
1375
|
+
/** The action attempted for the reference. */
|
|
1376
|
+
action?: BulkActionType;
|
|
1377
|
+
/** Metadata related to the reference for which the action was attempted. */
|
|
1378
|
+
referenceMetadata?: ItemMetadata;
|
|
1379
|
+
/** The reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */
|
|
1380
|
+
dataItemReference?: DataItemReference;
|
|
1381
|
+
}
|
|
1382
|
+
export interface BulkRemoveDataItemReferencesRequest {
|
|
1383
|
+
/**
|
|
1384
|
+
* Environment: LIVE or SANDBOX
|
|
1385
|
+
* @internal
|
|
1386
|
+
*/
|
|
1387
|
+
environment?: Environment;
|
|
1388
|
+
/** ID of the collection containing the referring items. */
|
|
1389
|
+
dataCollectionId: string;
|
|
1390
|
+
/** References to remove. */
|
|
1391
|
+
dataItemReferences: DataItemReference[];
|
|
1392
|
+
/**
|
|
1393
|
+
* Grid app id. Optional in Live segment.
|
|
1394
|
+
* @internal
|
|
1395
|
+
*/
|
|
1396
|
+
appId?: string | null;
|
|
1397
|
+
/**
|
|
1398
|
+
* Data access options
|
|
1399
|
+
* @internal
|
|
1400
|
+
* @deprecated
|
|
1401
|
+
* @replacedBy inlined
|
|
1402
|
+
* @removalDate 2024-07-12
|
|
1403
|
+
*/
|
|
1404
|
+
options?: Options;
|
|
1405
|
+
/** @internal */
|
|
1406
|
+
appOptions?: Record<string, any> | null;
|
|
1407
|
+
}
|
|
1408
|
+
export interface BulkRemoveDataItemReferencesResponse {
|
|
1409
|
+
/** Information about the removed references. */
|
|
1410
|
+
results?: BulkDataItemReferenceResult[];
|
|
1411
|
+
/** Bulk action metadata. */
|
|
1412
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1413
|
+
}
|
|
1414
|
+
export interface ReplaceDataItemReferencesRequest {
|
|
1415
|
+
/**
|
|
1416
|
+
* Environment: LIVE or SANDBOX
|
|
1417
|
+
* @internal
|
|
1418
|
+
*/
|
|
1419
|
+
environment?: Environment;
|
|
1420
|
+
/** ID of the collection containing the referring item. */
|
|
1421
|
+
dataCollectionId: string;
|
|
1422
|
+
/** Field containing references in the referring item. */
|
|
1423
|
+
referringItemFieldName: string;
|
|
1424
|
+
/** ID of the referring item. */
|
|
1425
|
+
referringItemId: string;
|
|
1426
|
+
/** List of new referenced item IDs to replace the existing ones. */
|
|
1427
|
+
newReferencedItemIds?: string[];
|
|
1428
|
+
/**
|
|
1429
|
+
* Grid app id. Optional in Live segment.
|
|
1430
|
+
* @internal
|
|
1431
|
+
*/
|
|
1432
|
+
appId?: string | null;
|
|
1433
|
+
/**
|
|
1434
|
+
* Data access options
|
|
1435
|
+
* @internal
|
|
1436
|
+
* @deprecated
|
|
1437
|
+
* @replacedBy inlined
|
|
1438
|
+
* @removalDate 2024-07-12
|
|
1439
|
+
*/
|
|
1440
|
+
options?: Options;
|
|
1441
|
+
/** @internal */
|
|
1442
|
+
appOptions?: Record<string, any> | null;
|
|
1443
|
+
}
|
|
1444
|
+
export interface ReplaceDataItemReferencesResponse {
|
|
1445
|
+
/** Updated references. */
|
|
1446
|
+
dataItemReferences?: DataItemReference[];
|
|
1447
|
+
}
|
|
1448
|
+
//# sourceMappingURL=data-item-types.d.ts.map
|