@wix/data 1.0.89 → 1.0.91
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/context.d.ts +4 -4
- package/build/cjs/context.js +4 -4
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +4 -4
- package/build/cjs/index.js +4 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -4
- package/build/cjs/meta.js +4 -4
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +4 -4
- package/build/es/context.js +4 -4
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +4 -4
- package/build/es/index.js +4 -4
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +4 -4
- package/build/es/meta.js +4 -4
- package/build/es/meta.js.map +1 -1
- package/package.json +14 -9
- package/build/cjs/index.typings.d.ts +0 -4
- package/build/cjs/index.typings.js +0 -31
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.context.d.ts +0 -7
- package/build/cjs/src/data-v1-external-database-connection.context.js +0 -90
- package/build/cjs/src/data-v1-external-database-connection.context.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.http.d.ts +0 -28
- package/build/cjs/src/data-v1-external-database-connection.http.js +0 -393
- package/build/cjs/src/data-v1-external-database-connection.http.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.meta.d.ts +0 -23
- package/build/cjs/src/data-v1-external-database-connection.meta.js +0 -127
- package/build/cjs/src/data-v1-external-database-connection.meta.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.public.d.ts +0 -46
- package/build/cjs/src/data-v1-external-database-connection.public.js +0 -46
- package/build/cjs/src/data-v1-external-database-connection.public.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.types.d.ts +0 -321
- package/build/cjs/src/data-v1-external-database-connection.types.js +0 -88
- package/build/cjs/src/data-v1-external-database-connection.types.js.map +0 -1
- package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +0 -433
- package/build/cjs/src/data-v1-external-database-connection.universal.js +0 -442
- package/build/cjs/src/data-v1-external-database-connection.universal.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.context.d.ts +0 -7
- package/build/cjs/src/data-v2-data-collection.context.js +0 -90
- package/build/cjs/src/data-v2-data-collection.context.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.http.d.ts +0 -36
- package/build/cjs/src/data-v2-data-collection.http.js +0 -494
- package/build/cjs/src/data-v2-data-collection.http.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.meta.d.ts +0 -21
- package/build/cjs/src/data-v2-data-collection.meta.js +0 -123
- package/build/cjs/src/data-v2-data-collection.meta.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.public.d.ts +0 -313
- package/build/cjs/src/data-v2-data-collection.public.js +0 -58
- package/build/cjs/src/data-v2-data-collection.public.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.types.d.ts +0 -1460
- package/build/cjs/src/data-v2-data-collection.types.js +0 -197
- package/build/cjs/src/data-v2-data-collection.types.js.map +0 -1
- package/build/cjs/src/data-v2-data-collection.universal.d.ts +0 -1626
- package/build/cjs/src/data-v2-data-collection.universal.js +0 -622
- package/build/cjs/src/data-v2-data-collection.universal.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.context.d.ts +0 -23
- package/build/cjs/src/data-v2-data-item.context.js +0 -362
- package/build/cjs/src/data-v2-data-item.context.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.http.d.ts +0 -225
- package/build/cjs/src/data-v2-data-item.http.js +0 -936
- package/build/cjs/src/data-v2-data-item.http.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.meta.d.ts +0 -39
- package/build/cjs/src/data-v2-data-item.meta.js +0 -427
- package/build/cjs/src/data-v2-data-item.meta.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.public.d.ts +0 -31
- package/build/cjs/src/data-v2-data-item.public.js +0 -137
- package/build/cjs/src/data-v2-data-item.public.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.types.d.ts +0 -913
- package/build/cjs/src/data-v2-data-item.types.js +0 -27
- package/build/cjs/src/data-v2-data-item.types.js.map +0 -1
- package/build/cjs/src/data-v2-data-item.universal.d.ts +0 -1748
- package/build/cjs/src/data-v2-data-item.universal.js +0 -1639
- package/build/cjs/src/data-v2-data-item.universal.js.map +0 -1
- package/build/cjs/src/data-v2-index.context.d.ts +0 -5
- package/build/cjs/src/data-v2-index.context.js +0 -56
- package/build/cjs/src/data-v2-index.context.js.map +0 -1
- package/build/cjs/src/data-v2-index.http.d.ts +0 -28
- package/build/cjs/src/data-v2-index.http.js +0 -367
- package/build/cjs/src/data-v2-index.http.js.map +0 -1
- package/build/cjs/src/data-v2-index.meta.d.ts +0 -15
- package/build/cjs/src/data-v2-index.meta.js +0 -85
- package/build/cjs/src/data-v2-index.meta.js.map +0 -1
- package/build/cjs/src/data-v2-index.public.d.ts +0 -23
- package/build/cjs/src/data-v2-index.public.js +0 -28
- package/build/cjs/src/data-v2-index.public.js.map +0 -1
- package/build/cjs/src/data-v2-index.types.d.ts +0 -174
- package/build/cjs/src/data-v2-index.types.js +0 -35
- package/build/cjs/src/data-v2-index.types.js.map +0 -1
- package/build/cjs/src/data-v2-index.universal.d.ts +0 -237
- package/build/cjs/src/data-v2-index.universal.js +0 -274
- package/build/cjs/src/data-v2-index.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -4
- package/build/es/index.typings.js +0 -5
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.context.d.ts +0 -7
- package/build/es/src/data-v1-external-database-connection.context.js +0 -82
- package/build/es/src/data-v1-external-database-connection.context.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.http.d.ts +0 -28
- package/build/es/src/data-v1-external-database-connection.http.js +0 -385
- package/build/es/src/data-v1-external-database-connection.http.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.meta.d.ts +0 -23
- package/build/es/src/data-v1-external-database-connection.meta.js +0 -96
- package/build/es/src/data-v1-external-database-connection.meta.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.public.d.ts +0 -46
- package/build/es/src/data-v1-external-database-connection.public.js +0 -30
- package/build/es/src/data-v1-external-database-connection.public.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.types.d.ts +0 -321
- package/build/es/src/data-v1-external-database-connection.types.js +0 -85
- package/build/es/src/data-v1-external-database-connection.types.js.map +0 -1
- package/build/es/src/data-v1-external-database-connection.universal.d.ts +0 -433
- package/build/es/src/data-v1-external-database-connection.universal.js +0 -411
- package/build/es/src/data-v1-external-database-connection.universal.js.map +0 -1
- package/build/es/src/data-v2-data-collection.context.d.ts +0 -7
- package/build/es/src/data-v2-data-collection.context.js +0 -82
- package/build/es/src/data-v2-data-collection.context.js.map +0 -1
- package/build/es/src/data-v2-data-collection.http.d.ts +0 -36
- package/build/es/src/data-v2-data-collection.http.js +0 -486
- package/build/es/src/data-v2-data-collection.http.js.map +0 -1
- package/build/es/src/data-v2-data-collection.meta.d.ts +0 -21
- package/build/es/src/data-v2-data-collection.meta.js +0 -92
- package/build/es/src/data-v2-data-collection.meta.js.map +0 -1
- package/build/es/src/data-v2-data-collection.public.d.ts +0 -313
- package/build/es/src/data-v2-data-collection.public.js +0 -30
- package/build/es/src/data-v2-data-collection.public.js.map +0 -1
- package/build/es/src/data-v2-data-collection.types.d.ts +0 -1460
- package/build/es/src/data-v2-data-collection.types.js +0 -194
- package/build/es/src/data-v2-data-collection.types.js.map +0 -1
- package/build/es/src/data-v2-data-collection.universal.d.ts +0 -1626
- package/build/es/src/data-v2-data-collection.universal.js +0 -591
- package/build/es/src/data-v2-data-collection.universal.js.map +0 -1
- package/build/es/src/data-v2-data-item.context.d.ts +0 -23
- package/build/es/src/data-v2-data-item.context.js +0 -338
- package/build/es/src/data-v2-data-item.context.js.map +0 -1
- package/build/es/src/data-v2-data-item.http.d.ts +0 -225
- package/build/es/src/data-v2-data-item.http.js +0 -912
- package/build/es/src/data-v2-data-item.http.js.map +0 -1
- package/build/es/src/data-v2-data-item.meta.d.ts +0 -39
- package/build/es/src/data-v2-data-item.meta.js +0 -380
- package/build/es/src/data-v2-data-item.meta.js.map +0 -1
- package/build/es/src/data-v2-data-item.public.d.ts +0 -31
- package/build/es/src/data-v2-data-item.public.js +0 -109
- package/build/es/src/data-v2-data-item.public.js.map +0 -1
- package/build/es/src/data-v2-data-item.types.d.ts +0 -913
- package/build/es/src/data-v2-data-item.types.js +0 -24
- package/build/es/src/data-v2-data-item.types.js.map +0 -1
- package/build/es/src/data-v2-data-item.universal.d.ts +0 -1748
- package/build/es/src/data-v2-data-item.universal.js +0 -1592
- package/build/es/src/data-v2-data-item.universal.js.map +0 -1
- package/build/es/src/data-v2-index.context.d.ts +0 -5
- package/build/es/src/data-v2-index.context.js +0 -50
- package/build/es/src/data-v2-index.context.js.map +0 -1
- package/build/es/src/data-v2-index.http.d.ts +0 -28
- package/build/es/src/data-v2-index.http.js +0 -361
- package/build/es/src/data-v2-index.http.js.map +0 -1
- package/build/es/src/data-v2-index.meta.d.ts +0 -15
- package/build/es/src/data-v2-index.meta.js +0 -56
- package/build/es/src/data-v2-index.meta.js.map +0 -1
- package/build/es/src/data-v2-index.public.d.ts +0 -23
- package/build/es/src/data-v2-index.public.js +0 -19
- package/build/es/src/data-v2-index.public.js.map +0 -1
- package/build/es/src/data-v2-index.types.d.ts +0 -174
- package/build/es/src/data-v2-index.types.js +0 -32
- package/build/es/src/data-v2-index.types.js.map +0 -1
- package/build/es/src/data-v2-index.universal.d.ts +0 -237
- package/build/es/src/data-v2-index.universal.js +0 -245
- package/build/es/src/data-v2-index.universal.js.map +0 -1
|
@@ -1,912 +0,0 @@
|
|
|
1
|
-
import { toURLSearchParams } from '@wix/metro-runtime';
|
|
2
|
-
import { resolveUrl } from '@wix/metro-runtime';
|
|
3
|
-
function resolveComWixpressCloudDataApiDataDataItemServiceUrl(opts) {
|
|
4
|
-
const domainToMappings = {
|
|
5
|
-
'api._api_base_domain_': [
|
|
6
|
-
{
|
|
7
|
-
srcPath: '/cloud-data',
|
|
8
|
-
destPath: '',
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
'code._base_domain_': [
|
|
12
|
-
{
|
|
13
|
-
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
14
|
-
destPath: '/v1/data-settings',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
srcPath: '/_api/cloud-data/v1/schemas',
|
|
18
|
-
destPath: '/v1/schemas',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
srcPath: '/_api/cloud-data/v1/connector',
|
|
22
|
-
destPath: '/v1/connector',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
srcPath: '/_api/data/v1/data-settings',
|
|
26
|
-
destPath: '/v1/data-settings',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
srcPath: '/_api/data/v1/schemas',
|
|
30
|
-
destPath: '/v1/schemas',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
srcPath: '/_api/data/v1/connector',
|
|
34
|
-
destPath: '/v1/connector',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
38
|
-
destPath: '/v1/wix-data',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
'cloud-data.wix-code.com': [
|
|
42
|
-
{
|
|
43
|
-
srcPath: '',
|
|
44
|
-
destPath: '',
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
_: [
|
|
48
|
-
{
|
|
49
|
-
srcPath: '/_api/cloud-data',
|
|
50
|
-
destPath: '',
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
'www._base_domain_': [
|
|
54
|
-
{
|
|
55
|
-
srcPath: '/_api/cloud-data',
|
|
56
|
-
destPath: '',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
srcPath: '/_api/data',
|
|
60
|
-
destPath: '',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
'dev._base_domain_': [
|
|
64
|
-
{
|
|
65
|
-
srcPath: '/_api/cloud-data',
|
|
66
|
-
destPath: '',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
'bo._base_domain_': [
|
|
70
|
-
{
|
|
71
|
-
srcPath: '/_api/cloud-data/v1',
|
|
72
|
-
destPath: '/v1',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
srcPath: '/_api/cloud-data/v2',
|
|
76
|
-
destPath: '/v2',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
'wixbo.ai': [
|
|
80
|
-
{
|
|
81
|
-
srcPath: '/_api/cloud-data/v1',
|
|
82
|
-
destPath: '/v1',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
srcPath: '/_api/cloud-data/v2',
|
|
86
|
-
destPath: '/v2',
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
'manage._base_domain_': [
|
|
90
|
-
{
|
|
91
|
-
srcPath: '/_api/cloud-data',
|
|
92
|
-
destPath: '',
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
srcPath: '/_api/data',
|
|
96
|
-
destPath: '',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
'editor._base_domain_': [
|
|
100
|
-
{
|
|
101
|
-
srcPath: '/_api/cloud-data/v1/schemas',
|
|
102
|
-
destPath: '/v1/schemas',
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
106
|
-
destPath: '/dbs/tasks',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
srcPath: '/_api/data/v1/schemas',
|
|
110
|
-
destPath: '/v1/schemas',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
srcPath: '/_api/data/dbs/tasks',
|
|
114
|
-
destPath: '/dbs/tasks',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
118
|
-
destPath: '/v1/wix-data',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
122
|
-
destPath: '/v1/data-settings',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
srcPath: '/_api/data/v2/indexes',
|
|
126
|
-
destPath: '/v2/indexes',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
130
|
-
destPath: '/v1/external-database-connections',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
srcPath: '/_api/data/v1/data-collection-sharing',
|
|
134
|
-
destPath: '/v1/data-collection-sharing',
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
srcPath: '/_api/cloud-data/v2/collections',
|
|
138
|
-
destPath: '/v2/collections',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
srcPath: '/_api/cloud-data/v2/bulk',
|
|
142
|
-
destPath: '/v2/bulk',
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
'blocks._base_domain_': [
|
|
146
|
-
{
|
|
147
|
-
srcPath: '/_api/cloud-data/v1/schemas',
|
|
148
|
-
destPath: '/v1/schemas',
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
152
|
-
destPath: '/dbs/tasks',
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
srcPath: '/_api/data/v1/schemas',
|
|
156
|
-
destPath: '/v1/schemas',
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
srcPath: '/_api/data/dbs/tasks',
|
|
160
|
-
destPath: '/dbs/tasks',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
164
|
-
destPath: '/v1/wix-data',
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
168
|
-
destPath: '/v1/data-settings',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
srcPath: '/_api/data/v2/indexes',
|
|
172
|
-
destPath: '/v2/indexes',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
176
|
-
destPath: '/v1/external-database-connections',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
srcPath: '/_api/data/v1/data-collection-sharing',
|
|
180
|
-
destPath: '/v1/data-collection-sharing',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
srcPath: '/_api/cloud-data/v2/collections',
|
|
184
|
-
destPath: '/v2/collections',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
srcPath: '/_api/cloud-data/v2/bulk',
|
|
188
|
-
destPath: '/v2/bulk',
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
'create.editorx': [
|
|
192
|
-
{
|
|
193
|
-
srcPath: '/_api/cloud-data/v1/schemas',
|
|
194
|
-
destPath: '/v1/schemas',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
srcPath: '/_api/cloud-data/dbs/tasks',
|
|
198
|
-
destPath: '/dbs/tasks',
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
srcPath: '/_api/data/v1/schemas',
|
|
202
|
-
destPath: '/v1/schemas',
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
srcPath: '/_api/data/dbs/tasks',
|
|
206
|
-
destPath: '/dbs/tasks',
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
srcPath: '/_api/cloud-data/v1/wix-data',
|
|
210
|
-
destPath: '/v1/wix-data',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
srcPath: '/_api/cloud-data/v1/data-settings',
|
|
214
|
-
destPath: '/v1/data-settings',
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
srcPath: '/_api/data/v2/indexes',
|
|
218
|
-
destPath: '/v2/indexes',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
srcPath: '/_api/cloud-data/v1/external-database-connections',
|
|
222
|
-
destPath: '/v1/external-database-connections',
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
srcPath: '/_api/data/v1/data-collection-sharing',
|
|
226
|
-
destPath: '/v1/data-collection-sharing',
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
srcPath: '/_api/cloud-data/v2/collections',
|
|
230
|
-
destPath: '/v2/collections',
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
srcPath: '/_api/cloud-data/v2/bulk',
|
|
234
|
-
destPath: '/v2/bulk',
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
'www.wixapis.com': [
|
|
238
|
-
{
|
|
239
|
-
srcPath: '/wix-data/v1/collections',
|
|
240
|
-
destPath: '/v1/wix-data/collections',
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
srcPath: '/wix-data/v1/external-database-connections',
|
|
244
|
-
destPath: '/v1/external-database-connections',
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
srcPath: '/wix-data/v2/indexes',
|
|
248
|
-
destPath: '/v2/indexes',
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
srcPath: '/wix-data/v1/items',
|
|
252
|
-
destPath: '/v1/items',
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
srcPath: '/wix-data/v1/bulk',
|
|
256
|
-
destPath: '/v1/bulk',
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
srcPath: '/wix-data/v1/external-databases',
|
|
260
|
-
destPath: '/v1/external-databases',
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
srcPath: '/wix-data/v2',
|
|
264
|
-
destPath: '/v2',
|
|
265
|
-
},
|
|
266
|
-
],
|
|
267
|
-
'www.wixgateway.com': [
|
|
268
|
-
{
|
|
269
|
-
srcPath: '/wix-data/v1/items',
|
|
270
|
-
destPath: '/v1/items',
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
srcPath: '/wix-data/v1/bulk',
|
|
274
|
-
destPath: '/v1/bulk',
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
'*.dev.wix-code.com': [
|
|
278
|
-
{
|
|
279
|
-
srcPath: '/_api/cloud-data/v2',
|
|
280
|
-
destPath: '/v2',
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
};
|
|
284
|
-
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Adds an item to a collection.
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
* An item can only be inserted into an existing connection.
|
|
291
|
-
* You can create a new collection using the Data Collections API.
|
|
292
|
-
*
|
|
293
|
-
* When an item is inserted into a collection, the item's ID is automatically assigned a random value.
|
|
294
|
-
* You can optionally provide a custom ID in `dataItem.id` when inserting the item.
|
|
295
|
-
* If you specify an ID that already exists in the collection, the insertion will fail.
|
|
296
|
-
*
|
|
297
|
-
* If `options.dataItem.data` is empty, a new item is created with no data fields.
|
|
298
|
-
*/
|
|
299
|
-
export function insertDataItem(payload) {
|
|
300
|
-
function __insertDataItem({ host }) {
|
|
301
|
-
const metadata = {
|
|
302
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
303
|
-
method: 'POST',
|
|
304
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItem',
|
|
305
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
306
|
-
protoPath: '/v2/items',
|
|
307
|
-
data: payload,
|
|
308
|
-
host,
|
|
309
|
-
}),
|
|
310
|
-
data: payload,
|
|
311
|
-
};
|
|
312
|
-
return metadata;
|
|
313
|
-
}
|
|
314
|
-
return __insertDataItem;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Updates an item in a collection.
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* This function replaces the data item's existing data with the payload provided in `options.dataItem.data` in the request.
|
|
321
|
-
*
|
|
322
|
-
* To update an item, you need to specify an item ID and a collection ID.
|
|
323
|
-
* If an item is found in the specified collection with the specified ID, that item is updated.
|
|
324
|
-
* If the collection doesn't contain an item with that ID, the request fails.
|
|
325
|
-
*
|
|
326
|
-
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
327
|
-
*
|
|
328
|
-
* > **Note:**
|
|
329
|
-
* > After an item is updated, it only contains the fields included in the `options.dataItem.data` payload in the `updateDataItem()` call.
|
|
330
|
-
* > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
|
|
331
|
-
*/
|
|
332
|
-
export function updateDataItem(payload) {
|
|
333
|
-
function __updateDataItem({ host }) {
|
|
334
|
-
const metadata = {
|
|
335
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
336
|
-
method: 'PUT',
|
|
337
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.UpdateDataItem',
|
|
338
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
339
|
-
protoPath: '/v2/items/{dataItem.id}',
|
|
340
|
-
data: payload,
|
|
341
|
-
host,
|
|
342
|
-
}),
|
|
343
|
-
data: payload,
|
|
344
|
-
};
|
|
345
|
-
return metadata;
|
|
346
|
-
}
|
|
347
|
-
return __updateDataItem;
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Inserts or updates an item in a collection.
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* The `saveDataItem()` function inserts or updates the specified item, depending on whether it already exists in the collection.
|
|
354
|
-
*
|
|
355
|
-
* + If you don't provide an ID, a new item is created.
|
|
356
|
-
*
|
|
357
|
-
* + If you provide an ID that does not exist in the collection, a new item is created with that ID.
|
|
358
|
-
*
|
|
359
|
-
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
360
|
-
*
|
|
361
|
-
* > **Note:** When you provide an item with an ID that already exists in the collection, the payload you provide in `options.dataItem.data` replaces the existing item with that ID.
|
|
362
|
-
* > This means that the item's previous fields and values are lost.
|
|
363
|
-
*/
|
|
364
|
-
export function saveDataItem(payload) {
|
|
365
|
-
function __saveDataItem({ host }) {
|
|
366
|
-
const metadata = {
|
|
367
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
368
|
-
method: 'POST',
|
|
369
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.SaveDataItem',
|
|
370
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
371
|
-
protoPath: '/v2/items/save',
|
|
372
|
-
data: payload,
|
|
373
|
-
host,
|
|
374
|
-
}),
|
|
375
|
-
data: payload,
|
|
376
|
-
};
|
|
377
|
-
return metadata;
|
|
378
|
-
}
|
|
379
|
-
return __saveDataItem;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Retrieves an item from a collection.
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* > **Note**: When calling `getDataItem()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
386
|
-
*/
|
|
387
|
-
export function getDataItem(payload) {
|
|
388
|
-
function __getDataItem({ host }) {
|
|
389
|
-
const metadata = {
|
|
390
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
391
|
-
method: 'GET',
|
|
392
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.GetDataItem',
|
|
393
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
394
|
-
protoPath: '/v2/items/{dataItemId}',
|
|
395
|
-
data: payload,
|
|
396
|
-
host,
|
|
397
|
-
}),
|
|
398
|
-
params: toURLSearchParams(payload),
|
|
399
|
-
};
|
|
400
|
-
return metadata;
|
|
401
|
-
}
|
|
402
|
-
return __getDataItem;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Removes an item from a collection.
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
* If any items in other collections reference the removed item in reference or multi-reference fields, those fields are cleared.
|
|
409
|
-
*
|
|
410
|
-
* > **Note:**
|
|
411
|
-
* > Once an item has been removed from a collection, it can't be restored.
|
|
412
|
-
*/
|
|
413
|
-
export function removeDataItem(payload) {
|
|
414
|
-
function __removeDataItem({ host }) {
|
|
415
|
-
const metadata = {
|
|
416
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
417
|
-
method: 'DELETE',
|
|
418
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItem',
|
|
419
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
420
|
-
protoPath: '/v2/items/{dataItemId}',
|
|
421
|
-
data: payload,
|
|
422
|
-
host,
|
|
423
|
-
}),
|
|
424
|
-
params: toURLSearchParams(payload),
|
|
425
|
-
};
|
|
426
|
-
return metadata;
|
|
427
|
-
}
|
|
428
|
-
return __removeDataItem;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Removes all items from a collection.
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
435
|
-
*
|
|
436
|
-
* > **Note:**
|
|
437
|
-
* > Once items have been removed from a collection, they can't be restored.
|
|
438
|
-
*/
|
|
439
|
-
export function truncateDataItems(payload) {
|
|
440
|
-
function __truncateDataItems({ host }) {
|
|
441
|
-
const metadata = {
|
|
442
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
443
|
-
method: 'POST',
|
|
444
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.TruncateDataItems',
|
|
445
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
446
|
-
protoPath: '/v2/items/truncate',
|
|
447
|
-
data: payload,
|
|
448
|
-
host,
|
|
449
|
-
}),
|
|
450
|
-
data: payload,
|
|
451
|
-
};
|
|
452
|
-
return metadata;
|
|
453
|
-
}
|
|
454
|
-
return __truncateDataItems;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Creates a query to retrieve items from a database collection.
|
|
458
|
-
*
|
|
459
|
-
* The `queryDataItems()` function builds a query to retrieve data items from a collection and returns a `DataItemsQueryBuilder` object.
|
|
460
|
-
*
|
|
461
|
-
* The returned object contains the query definition which is typically used to run the query using the `find()` function.
|
|
462
|
-
*
|
|
463
|
-
* You can refine the query by chaining `DataItemsQueryBuilder` functions onto the query. `DataItemsQueryBuilder` functions enable you to sort, filter, and control the results that `queryDataItems()` returns.
|
|
464
|
-
*
|
|
465
|
-
* The `queryDataItems()` function runs with the following `DataItemsQueryBuilder` defaults that you can override:
|
|
466
|
-
*
|
|
467
|
-
* + `skip`: 0
|
|
468
|
-
* + `limit`: 50
|
|
469
|
-
* + `descending`: by `_createdDate`
|
|
470
|
-
*
|
|
471
|
-
* The functions that are chained to `queryDataItems()` are applied in the order they are called. For example, if you sort on an `age` field in ascending order and then on a `name` field in descending order, the results are sorted first by the age of the items and then, if there are multiple results with the same age, the items are sorted by name in descending order, per age value.
|
|
472
|
-
*
|
|
473
|
-
* If the collection that you are querying has references to other collections, by default the data from referenced collections is not retrieved. To get the data from referenced items, specify them in the `options.includeReferencedItems` parameter.
|
|
474
|
-
*
|
|
475
|
-
* > **Note**: When calling `queryDataItems()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*/
|
|
479
|
-
export function queryDataItems(payload) {
|
|
480
|
-
function __queryDataItems({ host }) {
|
|
481
|
-
const metadata = {
|
|
482
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
483
|
-
method: 'POST',
|
|
484
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDataItems',
|
|
485
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
486
|
-
protoPath: '/v2/items/query',
|
|
487
|
-
data: payload,
|
|
488
|
-
host,
|
|
489
|
-
}),
|
|
490
|
-
data: payload,
|
|
491
|
-
fallback: [
|
|
492
|
-
{
|
|
493
|
-
method: 'POST',
|
|
494
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
495
|
-
protoPath: '/v2/items/query',
|
|
496
|
-
data: payload,
|
|
497
|
-
host,
|
|
498
|
-
}),
|
|
499
|
-
data: payload,
|
|
500
|
-
},
|
|
501
|
-
],
|
|
502
|
-
};
|
|
503
|
-
return metadata;
|
|
504
|
-
}
|
|
505
|
-
return __queryDataItems;
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* Runs an aggregation on a data collection and returns the resulting list of items.
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
* An aggregation enables you to perform certain calculations on your collection data, or on groups of items that you define, to retrieve meaningful summaries.
|
|
512
|
-
* You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need.
|
|
513
|
-
*/
|
|
514
|
-
export function aggregateDataItems(payload) {
|
|
515
|
-
function __aggregateDataItems({ host }) {
|
|
516
|
-
const metadata = {
|
|
517
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
518
|
-
method: 'POST',
|
|
519
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.AggregateDataItems',
|
|
520
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
521
|
-
protoPath: '/v2/items/aggregate',
|
|
522
|
-
data: payload,
|
|
523
|
-
host,
|
|
524
|
-
}),
|
|
525
|
-
data: payload,
|
|
526
|
-
fallback: [
|
|
527
|
-
{
|
|
528
|
-
method: 'POST',
|
|
529
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
530
|
-
protoPath: '/v2/items/aggregate',
|
|
531
|
-
data: payload,
|
|
532
|
-
host,
|
|
533
|
-
}),
|
|
534
|
-
data: payload,
|
|
535
|
-
},
|
|
536
|
-
],
|
|
537
|
-
};
|
|
538
|
-
return metadata;
|
|
539
|
-
}
|
|
540
|
-
return __aggregateDataItems;
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* Counts the number of items in a data collection that match the provided filtering preferences.
|
|
544
|
-
*
|
|
545
|
-
* > **Note**: When calling `countDataItems()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
546
|
-
*/
|
|
547
|
-
export function countDataItems(payload) {
|
|
548
|
-
function __countDataItems({ host }) {
|
|
549
|
-
const metadata = {
|
|
550
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
551
|
-
method: 'POST',
|
|
552
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.CountDataItems',
|
|
553
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
554
|
-
protoPath: '/v2/items/count',
|
|
555
|
-
data: payload,
|
|
556
|
-
host,
|
|
557
|
-
}),
|
|
558
|
-
data: payload,
|
|
559
|
-
fallback: [
|
|
560
|
-
{
|
|
561
|
-
method: 'POST',
|
|
562
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
563
|
-
protoPath: '/v2/items/count',
|
|
564
|
-
data: payload,
|
|
565
|
-
host,
|
|
566
|
-
}),
|
|
567
|
-
data: payload,
|
|
568
|
-
},
|
|
569
|
-
],
|
|
570
|
-
};
|
|
571
|
-
return metadata;
|
|
572
|
-
}
|
|
573
|
-
return __countDataItems;
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Retrieves a list of distinct values for a given field in all items that match a query, without duplicates.
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
* As with `queryDataItems()`, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide.
|
|
580
|
-
* However, `queryDistinctValues()` doesn't return all of the full items that match the query.
|
|
581
|
-
* Rather, it returns all unique values of the field you specify in `options.fieldName` for items that match the query.
|
|
582
|
-
* If more than one item has the same value for that field, that value appears only once.
|
|
583
|
-
*
|
|
584
|
-
* For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
585
|
-
*
|
|
586
|
-
* > **Note**: When calling `queryDistinctValues()` following an update to your collection, the data retrieved may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
587
|
-
*/
|
|
588
|
-
export function queryDistinctValues(payload) {
|
|
589
|
-
function __queryDistinctValues({ host }) {
|
|
590
|
-
const metadata = {
|
|
591
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
592
|
-
method: 'POST',
|
|
593
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryDistinctValues',
|
|
594
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
595
|
-
protoPath: '/v2/items/query-distinct-values',
|
|
596
|
-
data: payload,
|
|
597
|
-
host,
|
|
598
|
-
}),
|
|
599
|
-
data: payload,
|
|
600
|
-
fallback: [
|
|
601
|
-
{
|
|
602
|
-
method: 'POST',
|
|
603
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
604
|
-
protoPath: '/v2/items/query-distinct-values',
|
|
605
|
-
data: payload,
|
|
606
|
-
host,
|
|
607
|
-
}),
|
|
608
|
-
data: payload,
|
|
609
|
-
},
|
|
610
|
-
],
|
|
611
|
-
};
|
|
612
|
-
return metadata;
|
|
613
|
-
}
|
|
614
|
-
return __queryDistinctValues;
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Adds multiple items to a collection.
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
* When each item is inserted into a collection, its ID is automatically assigned a random value.
|
|
621
|
-
* You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.
|
|
622
|
-
*/
|
|
623
|
-
export function bulkInsertDataItems(payload) {
|
|
624
|
-
function __bulkInsertDataItems({ host }) {
|
|
625
|
-
const metadata = {
|
|
626
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
627
|
-
method: 'POST',
|
|
628
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItems',
|
|
629
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
630
|
-
protoPath: '/v2/bulk/items/insert',
|
|
631
|
-
data: payload,
|
|
632
|
-
host,
|
|
633
|
-
}),
|
|
634
|
-
data: payload,
|
|
635
|
-
};
|
|
636
|
-
return metadata;
|
|
637
|
-
}
|
|
638
|
-
return __bulkInsertDataItems;
|
|
639
|
-
}
|
|
640
|
-
/**
|
|
641
|
-
* Updates multiple items in a collection.
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
* This function replaces each specified data item's existing data with the payload provided in the request.
|
|
645
|
-
*
|
|
646
|
-
* Each item in the request must include an ID. If an item is found in the specified collection with
|
|
647
|
-
* the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
|
|
648
|
-
*
|
|
649
|
-
* When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
650
|
-
*
|
|
651
|
-
* > **Note:**
|
|
652
|
-
* > After each item is updated, it only contains the fields included in the request. If the existing item has fields with values and those fields
|
|
653
|
-
* > aren't included in the updated item, their values are lost.
|
|
654
|
-
*/
|
|
655
|
-
export function bulkUpdateDataItems(payload) {
|
|
656
|
-
function __bulkUpdateDataItems({ host }) {
|
|
657
|
-
const metadata = {
|
|
658
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
659
|
-
method: 'POST',
|
|
660
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkUpdateDataItems',
|
|
661
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
662
|
-
protoPath: '/v2/bulk/items/update',
|
|
663
|
-
data: payload,
|
|
664
|
-
host,
|
|
665
|
-
}),
|
|
666
|
-
data: payload,
|
|
667
|
-
};
|
|
668
|
-
return metadata;
|
|
669
|
-
}
|
|
670
|
-
return __bulkUpdateDataItems;
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* Inserts or updates multiple items in a collection.
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
* This function inserts or updates each item provided, depending on whether it already exists in the collection. For each item:
|
|
677
|
-
*
|
|
678
|
-
* + If you don't provide an ID, a new item is created.
|
|
679
|
-
*
|
|
680
|
-
* + If you provide an ID that doesn't exist in the collection, a new item is created with that ID.
|
|
681
|
-
*
|
|
682
|
-
* + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time.
|
|
683
|
-
*
|
|
684
|
-
* > **Note:** When you provide an item with an ID that already exists in the collection, the item you provide completely replaces the existing item with that ID.
|
|
685
|
-
* > This means that all of the item's previous fields and values are lost.
|
|
686
|
-
*/
|
|
687
|
-
export function bulkSaveDataItems(payload) {
|
|
688
|
-
function __bulkSaveDataItems({ host }) {
|
|
689
|
-
const metadata = {
|
|
690
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
691
|
-
method: 'POST',
|
|
692
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkSaveDataItems',
|
|
693
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
694
|
-
protoPath: '/v2/bulk/items/save',
|
|
695
|
-
data: payload,
|
|
696
|
-
host,
|
|
697
|
-
}),
|
|
698
|
-
data: payload,
|
|
699
|
-
};
|
|
700
|
-
return metadata;
|
|
701
|
-
}
|
|
702
|
-
return __bulkSaveDataItems;
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Removes multiple items from a collection.
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared.
|
|
709
|
-
*
|
|
710
|
-
* > **Note:** Once an item has been removed from a collection, it can't be restored.
|
|
711
|
-
*/
|
|
712
|
-
export function bulkRemoveDataItems(payload) {
|
|
713
|
-
function __bulkRemoveDataItems({ host }) {
|
|
714
|
-
const metadata = {
|
|
715
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
716
|
-
method: 'POST',
|
|
717
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItems',
|
|
718
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
719
|
-
protoPath: '/v2/bulk/items/remove',
|
|
720
|
-
data: payload,
|
|
721
|
-
host,
|
|
722
|
-
}),
|
|
723
|
-
data: payload,
|
|
724
|
-
};
|
|
725
|
-
return metadata;
|
|
726
|
-
}
|
|
727
|
-
return __bulkRemoveDataItems;
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Retrieves the full items referenced in the specified field of an item.
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
* Reference and multi-reference fields refer to items in different collections.
|
|
734
|
-
* Use this function to retrieve the full details of the referenced items themselves.
|
|
735
|
-
*
|
|
736
|
-
* For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection.
|
|
737
|
-
* Querying the **Movies** collection using `queryReferencedDataItems()` returns the relevant **People** items referenced in the **Actors** field of the specified **Movie** item.
|
|
738
|
-
* This gives you information from the **People** collection about each of the actors in the specified movie.
|
|
739
|
-
*
|
|
740
|
-
* > **Note**: When calling `queryReferencedDataItems()` following an update to your collection, the data retrieved may not contain the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
741
|
-
*/
|
|
742
|
-
export function queryReferencedDataItems(payload) {
|
|
743
|
-
function __queryReferencedDataItems({ host }) {
|
|
744
|
-
const metadata = {
|
|
745
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
746
|
-
method: 'POST',
|
|
747
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.QueryReferencedDataItems',
|
|
748
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
749
|
-
protoPath: '/v2/items/query-referenced',
|
|
750
|
-
data: payload,
|
|
751
|
-
host,
|
|
752
|
-
}),
|
|
753
|
-
data: payload,
|
|
754
|
-
fallback: [
|
|
755
|
-
{
|
|
756
|
-
method: 'POST',
|
|
757
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
758
|
-
protoPath: '/v2/items/query-referenced',
|
|
759
|
-
data: payload,
|
|
760
|
-
host,
|
|
761
|
-
}),
|
|
762
|
-
data: payload,
|
|
763
|
-
},
|
|
764
|
-
],
|
|
765
|
-
};
|
|
766
|
-
return metadata;
|
|
767
|
-
}
|
|
768
|
-
return __queryReferencedDataItems;
|
|
769
|
-
}
|
|
770
|
-
/**
|
|
771
|
-
* Checks whether a field in a referring item contains a reference to a specified item.
|
|
772
|
-
*
|
|
773
|
-
* > **Note**: When calling `isReferencedDataItem()` following an update to your collection, the result returned may not reflect the most recent changes. If you need the most up-to-date data, set `options.consistentRead` to `true`.
|
|
774
|
-
*/
|
|
775
|
-
export function isReferencedDataItem(payload) {
|
|
776
|
-
function __isReferencedDataItem({ host }) {
|
|
777
|
-
const metadata = {
|
|
778
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
779
|
-
method: 'POST',
|
|
780
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.IsReferencedDataItem',
|
|
781
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
782
|
-
protoPath: '/v2/items/is-referenced',
|
|
783
|
-
data: payload,
|
|
784
|
-
host,
|
|
785
|
-
}),
|
|
786
|
-
data: payload,
|
|
787
|
-
fallback: [
|
|
788
|
-
{
|
|
789
|
-
method: 'POST',
|
|
790
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
791
|
-
protoPath: '/v2/items/is-referenced',
|
|
792
|
-
data: payload,
|
|
793
|
-
host,
|
|
794
|
-
}),
|
|
795
|
-
data: payload,
|
|
796
|
-
},
|
|
797
|
-
],
|
|
798
|
-
};
|
|
799
|
-
return metadata;
|
|
800
|
-
}
|
|
801
|
-
return __isReferencedDataItem;
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Inserts a reference in the specified field in an item in a collection.
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
* A reference in `options.dataItemReference` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
808
|
-
*/
|
|
809
|
-
export function insertDataItemReference(payload) {
|
|
810
|
-
function __insertDataItemReference({ host }) {
|
|
811
|
-
const metadata = {
|
|
812
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
813
|
-
method: 'POST',
|
|
814
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.InsertDataItemReference',
|
|
815
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
816
|
-
protoPath: '/v2/items/insert-reference',
|
|
817
|
-
data: payload,
|
|
818
|
-
host,
|
|
819
|
-
}),
|
|
820
|
-
data: payload,
|
|
821
|
-
};
|
|
822
|
-
return metadata;
|
|
823
|
-
}
|
|
824
|
-
return __insertDataItemReference;
|
|
825
|
-
}
|
|
826
|
-
/** Removes the specified reference from the specified field. */
|
|
827
|
-
export function removeDataItemReference(payload) {
|
|
828
|
-
function __removeDataItemReference({ host }) {
|
|
829
|
-
const metadata = {
|
|
830
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
831
|
-
method: 'POST',
|
|
832
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.RemoveDataItemReference',
|
|
833
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
834
|
-
protoPath: '/v2/items/remove-reference',
|
|
835
|
-
data: payload,
|
|
836
|
-
host,
|
|
837
|
-
}),
|
|
838
|
-
data: payload,
|
|
839
|
-
};
|
|
840
|
-
return metadata;
|
|
841
|
-
}
|
|
842
|
-
return __removeDataItemReference;
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* Inserts one or more references in the specified fields of items in a collection.
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
* This endpoint adds one or more references to a collection.
|
|
849
|
-
* Each new reference in `options.dataItemReferences` specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item.
|
|
850
|
-
*/
|
|
851
|
-
export function bulkInsertDataItemReferences(payload) {
|
|
852
|
-
function __bulkInsertDataItemReferences({ host }) {
|
|
853
|
-
const metadata = {
|
|
854
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
855
|
-
method: 'POST',
|
|
856
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkInsertDataItemReferences',
|
|
857
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
858
|
-
protoPath: '/v2/bulk/items/insert-references',
|
|
859
|
-
data: payload,
|
|
860
|
-
host,
|
|
861
|
-
}),
|
|
862
|
-
data: payload,
|
|
863
|
-
};
|
|
864
|
-
return metadata;
|
|
865
|
-
}
|
|
866
|
-
return __bulkInsertDataItemReferences;
|
|
867
|
-
}
|
|
868
|
-
/** Removes one or more references. */
|
|
869
|
-
export function bulkRemoveDataItemReferences(payload) {
|
|
870
|
-
function __bulkRemoveDataItemReferences({ host }) {
|
|
871
|
-
const metadata = {
|
|
872
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
873
|
-
method: 'POST',
|
|
874
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.BulkRemoveDataItemReferences',
|
|
875
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
876
|
-
protoPath: '/v2/bulk/items/remove-references',
|
|
877
|
-
data: payload,
|
|
878
|
-
host,
|
|
879
|
-
}),
|
|
880
|
-
data: payload,
|
|
881
|
-
};
|
|
882
|
-
return metadata;
|
|
883
|
-
}
|
|
884
|
-
return __bulkRemoveDataItemReferences;
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* Replaces references in a specified field of a specified data item.
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
* This function replaces the existing reference or references contained in the field specified in `options.referringItemFieldName` within the data item specified in `options.referringItemId`.
|
|
891
|
-
* The function removes existing references and in their place it adds references to the items specified in `options.newReferencedItemIds`.
|
|
892
|
-
*
|
|
893
|
-
* > **Note:** If you pass an empty array in `options.newReferencedItemIds`, all existing references are removed.
|
|
894
|
-
*/
|
|
895
|
-
export function replaceDataItemReferences(payload) {
|
|
896
|
-
function __replaceDataItemReferences({ host }) {
|
|
897
|
-
const metadata = {
|
|
898
|
-
entityFqdn: 'wix.data.v2.data_item',
|
|
899
|
-
method: 'POST',
|
|
900
|
-
methodFqn: 'com.wixpress.cloud.data.api.data.DataItemService.ReplaceDataItemReferences',
|
|
901
|
-
url: resolveComWixpressCloudDataApiDataDataItemServiceUrl({
|
|
902
|
-
protoPath: '/v2/items/replace-references',
|
|
903
|
-
data: payload,
|
|
904
|
-
host,
|
|
905
|
-
}),
|
|
906
|
-
data: payload,
|
|
907
|
-
};
|
|
908
|
-
return metadata;
|
|
909
|
-
}
|
|
910
|
-
return __replaceDataItemReferences;
|
|
911
|
-
}
|
|
912
|
-
//# sourceMappingURL=data-v2-data-item.http.js.map
|