@wix/auto_sdk_data_collections 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/data-v2-data-collection-collections.context.d.ts +9 -0
  11. package/build/cjs/src/data-v2-data-collection-collections.context.js +38 -0
  12. package/build/cjs/src/data-v2-data-collection-collections.context.js.map +1 -0
  13. package/build/cjs/src/data-v2-data-collection-collections.http.d.ts +48 -0
  14. package/build/cjs/src/data-v2-data-collection-collections.http.js +704 -0
  15. package/build/cjs/src/data-v2-data-collection-collections.http.js.map +1 -0
  16. package/build/cjs/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  17. package/build/cjs/src/data-v2-data-collection-collections.meta.js +199 -0
  18. package/build/cjs/src/data-v2-data-collection-collections.meta.js.map +1 -0
  19. package/build/cjs/src/data-v2-data-collection-collections.public.d.ts +69 -0
  20. package/build/cjs/src/data-v2-data-collection-collections.public.js +83 -0
  21. package/build/cjs/src/data-v2-data-collection-collections.public.js.map +1 -0
  22. package/build/cjs/src/data-v2-data-collection-collections.types.d.ts +1238 -0
  23. package/build/cjs/src/data-v2-data-collection-collections.types.js +235 -0
  24. package/build/cjs/src/data-v2-data-collection-collections.types.js.map +1 -0
  25. package/build/cjs/src/data-v2-data-collection-collections.universal.d.ts +1394 -0
  26. package/build/cjs/src/data-v2-data-collection-collections.universal.js +669 -0
  27. package/build/cjs/src/data-v2-data-collection-collections.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/data-v2-data-collection-collections.context.d.ts +9 -0
  39. package/build/es/src/data-v2-data-collection-collections.context.js +17 -0
  40. package/build/es/src/data-v2-data-collection-collections.context.js.map +1 -0
  41. package/build/es/src/data-v2-data-collection-collections.http.d.ts +48 -0
  42. package/build/es/src/data-v2-data-collection-collections.http.js +692 -0
  43. package/build/es/src/data-v2-data-collection-collections.http.js.map +1 -0
  44. package/build/es/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  45. package/build/es/src/data-v2-data-collection-collections.meta.js +164 -0
  46. package/build/es/src/data-v2-data-collection-collections.meta.js.map +1 -0
  47. package/build/es/src/data-v2-data-collection-collections.public.d.ts +69 -0
  48. package/build/es/src/data-v2-data-collection-collections.public.js +53 -0
  49. package/build/es/src/data-v2-data-collection-collections.public.js.map +1 -0
  50. package/build/es/src/data-v2-data-collection-collections.types.d.ts +1238 -0
  51. package/build/es/src/data-v2-data-collection-collections.types.js +232 -0
  52. package/build/es/src/data-v2-data-collection-collections.types.js.map +1 -0
  53. package/build/es/src/data-v2-data-collection-collections.universal.d.ts +1394 -0
  54. package/build/es/src/data-v2-data-collection-collections.universal.js +634 -0
  55. package/build/es/src/data-v2-data-collection-collections.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/data-v2-data-collection-collections.context.d.ts +17 -0
  66. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js +38 -0
  67. package/build/internal/cjs/src/data-v2-data-collection-collections.context.js.map +1 -0
  68. package/build/internal/cjs/src/data-v2-data-collection-collections.http.d.ts +48 -0
  69. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js +704 -0
  70. package/build/internal/cjs/src/data-v2-data-collection-collections.http.js.map +1 -0
  71. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  72. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js +199 -0
  73. package/build/internal/cjs/src/data-v2-data-collection-collections.meta.js.map +1 -0
  74. package/build/internal/cjs/src/data-v2-data-collection-collections.public.d.ts +107 -0
  75. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js +83 -0
  76. package/build/internal/cjs/src/data-v2-data-collection-collections.public.js.map +1 -0
  77. package/build/internal/cjs/src/data-v2-data-collection-collections.types.d.ts +1254 -0
  78. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js +235 -0
  79. package/build/internal/cjs/src/data-v2-data-collection-collections.types.js.map +1 -0
  80. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.d.ts +1504 -0
  81. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js +669 -0
  82. package/build/internal/cjs/src/data-v2-data-collection-collections.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/data-v2-data-collection-collections.context.d.ts +17 -0
  93. package/build/internal/es/src/data-v2-data-collection-collections.context.js +17 -0
  94. package/build/internal/es/src/data-v2-data-collection-collections.context.js.map +1 -0
  95. package/build/internal/es/src/data-v2-data-collection-collections.http.d.ts +48 -0
  96. package/build/internal/es/src/data-v2-data-collection-collections.http.js +692 -0
  97. package/build/internal/es/src/data-v2-data-collection-collections.http.js.map +1 -0
  98. package/build/internal/es/src/data-v2-data-collection-collections.meta.d.ts +27 -0
  99. package/build/internal/es/src/data-v2-data-collection-collections.meta.js +164 -0
  100. package/build/internal/es/src/data-v2-data-collection-collections.meta.js.map +1 -0
  101. package/build/internal/es/src/data-v2-data-collection-collections.public.d.ts +107 -0
  102. package/build/internal/es/src/data-v2-data-collection-collections.public.js +53 -0
  103. package/build/internal/es/src/data-v2-data-collection-collections.public.js.map +1 -0
  104. package/build/internal/es/src/data-v2-data-collection-collections.types.d.ts +1254 -0
  105. package/build/internal/es/src/data-v2-data-collection-collections.types.js +232 -0
  106. package/build/internal/es/src/data-v2-data-collection-collections.types.js.map +1 -0
  107. package/build/internal/es/src/data-v2-data-collection-collections.universal.d.ts +1504 -0
  108. package/build/internal/es/src/data-v2-data-collection-collections.universal.js +634 -0
  109. package/build/internal/es/src/data-v2-data-collection-collections.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,669 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.deleteDataCollectionField = exports.updateDataCollectionField = exports.createDataCollectionField = exports.restoreDataCollection = exports.deleteDataCollection = exports.updateDataCollection = exports.listDataCollections = exports.getDataCollection = exports.createDataCollection = exports.WebhookIdentityType = exports.IndexStatus = exports.Order = exports.SortOrder = exports.Segment = exports.AccessLevel = exports.PagingMode = exports.PluginType = exports.Format = exports.Status = exports.Role = exports.FieldPluginType = exports.QueryOperator = exports.Type = exports.CollectionOperation = exports.DataOperation = exports.Direction = exports.CollectionType = void 0;
27
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
+ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
+ const ambassadorWixDataV2DataCollection = __importStar(require("./data-v2-data-collection-collections.http.js"));
30
+ var CollectionType;
31
+ (function (CollectionType) {
32
+ /** User-created collection. */
33
+ CollectionType["NATIVE"] = "NATIVE";
34
+ /** [Collection](https://support.wix.com/en/article/velo-working-with-wix-app-collections-and-code#what-are-wix-app-collections) created by a Wix app when it is installed. This type of collection can be modified dynamically by that app (for example, Wix Forms). */
35
+ CollectionType["WIX_APP"] = "WIX_APP";
36
+ /** Collection created by a Wix Blocks app. */
37
+ CollectionType["BLOCKS_APP"] = "BLOCKS_APP";
38
+ /** Collection located in externally connected storage. */
39
+ CollectionType["EXTERNAL"] = "EXTERNAL";
40
+ })(CollectionType || (exports.CollectionType = CollectionType = {}));
41
+ var Direction;
42
+ (function (Direction) {
43
+ Direction["ASC"] = "ASC";
44
+ Direction["DESC"] = "DESC";
45
+ })(Direction || (exports.Direction = Direction = {}));
46
+ var DataOperation;
47
+ (function (DataOperation) {
48
+ DataOperation["AGGREGATE"] = "AGGREGATE";
49
+ DataOperation["BULK_INSERT"] = "BULK_INSERT";
50
+ DataOperation["BULK_REMOVE"] = "BULK_REMOVE";
51
+ DataOperation["BULK_SAVE"] = "BULK_SAVE";
52
+ DataOperation["BULK_UPDATE"] = "BULK_UPDATE";
53
+ DataOperation["COUNT"] = "COUNT";
54
+ DataOperation["DISTINCT"] = "DISTINCT";
55
+ DataOperation["FIND"] = "FIND";
56
+ DataOperation["GET"] = "GET";
57
+ DataOperation["INSERT"] = "INSERT";
58
+ DataOperation["INSERT_REFERENCE"] = "INSERT_REFERENCE";
59
+ DataOperation["IS_REFERENCED"] = "IS_REFERENCED";
60
+ DataOperation["QUERY_REFERENCED"] = "QUERY_REFERENCED";
61
+ DataOperation["REMOVE"] = "REMOVE";
62
+ DataOperation["REMOVE_REFERENCE"] = "REMOVE_REFERENCE";
63
+ DataOperation["REPLACE_REFERENCES"] = "REPLACE_REFERENCES";
64
+ DataOperation["SAVE"] = "SAVE";
65
+ DataOperation["TRUNCATE"] = "TRUNCATE";
66
+ DataOperation["UPDATE"] = "UPDATE";
67
+ DataOperation["PATCH"] = "PATCH";
68
+ DataOperation["BULK_PATCH"] = "BULK_PATCH";
69
+ })(DataOperation || (exports.DataOperation = DataOperation = {}));
70
+ var CollectionOperation;
71
+ (function (CollectionOperation) {
72
+ /** Allows updating the collection's structure, for example adding, updating, or deleting fields. If not included, the collection's structure can't be changed. */
73
+ CollectionOperation["UPDATE"] = "UPDATE";
74
+ /** Allows deleting the entire collection. If not included, the collection can't be deleted. */
75
+ CollectionOperation["REMOVE"] = "REMOVE";
76
+ })(CollectionOperation || (exports.CollectionOperation = CollectionOperation = {}));
77
+ var Type;
78
+ (function (Type) {
79
+ Type["UNKNOWN_FIELD_TYPE"] = "UNKNOWN_FIELD_TYPE";
80
+ Type["TEXT"] = "TEXT";
81
+ Type["NUMBER"] = "NUMBER";
82
+ Type["DATE"] = "DATE";
83
+ Type["DATETIME"] = "DATETIME";
84
+ Type["IMAGE"] = "IMAGE";
85
+ Type["BOOLEAN"] = "BOOLEAN";
86
+ Type["DOCUMENT"] = "DOCUMENT";
87
+ Type["URL"] = "URL";
88
+ Type["RICH_TEXT"] = "RICH_TEXT";
89
+ Type["VIDEO"] = "VIDEO";
90
+ Type["ANY"] = "ANY";
91
+ Type["ARRAY_STRING"] = "ARRAY_STRING";
92
+ Type["ARRAY_DOCUMENT"] = "ARRAY_DOCUMENT";
93
+ Type["AUDIO"] = "AUDIO";
94
+ Type["TIME"] = "TIME";
95
+ Type["LANGUAGE"] = "LANGUAGE";
96
+ Type["RICH_CONTENT"] = "RICH_CONTENT";
97
+ Type["MEDIA_GALLERY"] = "MEDIA_GALLERY";
98
+ Type["ADDRESS"] = "ADDRESS";
99
+ Type["PAGE_LINK"] = "PAGE_LINK";
100
+ Type["REFERENCE"] = "REFERENCE";
101
+ Type["MULTI_REFERENCE"] = "MULTI_REFERENCE";
102
+ Type["OBJECT"] = "OBJECT";
103
+ Type["ARRAY"] = "ARRAY";
104
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
105
+ Type["LEGACY_TIME"] = "LEGACY_TIME";
106
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
107
+ Type["LEGACY_BOOK"] = "LEGACY_BOOK";
108
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
109
+ Type["LEGACY_EXTERNAL_URL"] = "LEGACY_EXTERNAL_URL";
110
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
111
+ Type["LEGACY_BROKEN_REFERENCE"] = "LEGACY_BROKEN_REFERENCE";
112
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
113
+ Type["LEGACY_IMAGE"] = "LEGACY_IMAGE";
114
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
115
+ Type["LEGACY_COLOR"] = "LEGACY_COLOR";
116
+ /** Deprecated - can’t be added to collections. Can only appear in older collections. */
117
+ Type["LEGACY_EXTERNAL_VIDEO"] = "LEGACY_EXTERNAL_VIDEO";
118
+ })(Type || (exports.Type = Type = {}));
119
+ var QueryOperator;
120
+ (function (QueryOperator) {
121
+ QueryOperator["EQ"] = "EQ";
122
+ QueryOperator["LT"] = "LT";
123
+ QueryOperator["GT"] = "GT";
124
+ QueryOperator["NE"] = "NE";
125
+ QueryOperator["LTE"] = "LTE";
126
+ QueryOperator["GTE"] = "GTE";
127
+ QueryOperator["STARTS_WITH"] = "STARTS_WITH";
128
+ QueryOperator["ENDS_WITH"] = "ENDS_WITH";
129
+ QueryOperator["CONTAINS"] = "CONTAINS";
130
+ QueryOperator["HAS_SOME"] = "HAS_SOME";
131
+ QueryOperator["HAS_ALL"] = "HAS_ALL";
132
+ QueryOperator["EXISTS"] = "EXISTS";
133
+ QueryOperator["URLIZED"] = "URLIZED";
134
+ })(QueryOperator || (exports.QueryOperator = QueryOperator = {}));
135
+ var FieldPluginType;
136
+ (function (FieldPluginType) {
137
+ /** Uknown plugin type. */
138
+ FieldPluginType["UNKNOWN"] = "UNKNOWN";
139
+ /** CMS-related field attributes */
140
+ FieldPluginType["CMS"] = "CMS";
141
+ })(FieldPluginType || (exports.FieldPluginType = FieldPluginType = {}));
142
+ var Role;
143
+ (function (Role) {
144
+ /** Unknown role. */
145
+ Role["UNKNOWN_ROLE"] = "UNKNOWN_ROLE";
146
+ /** Site administrator. */
147
+ Role["ADMIN"] = "ADMIN";
148
+ /** Signed-in user who added content to this collection. */
149
+ Role["SITE_MEMBER_AUTHOR"] = "SITE_MEMBER_AUTHOR";
150
+ /** Any signed-in user. */
151
+ Role["SITE_MEMBER"] = "SITE_MEMBER";
152
+ /** Any site visitor. */
153
+ Role["ANYONE"] = "ANYONE";
154
+ })(Role || (exports.Role = Role = {}));
155
+ var Status;
156
+ (function (Status) {
157
+ Status["UNKNOWN_PUBLISH_PLUGIN_STATUS"] = "UNKNOWN_PUBLISH_PLUGIN_STATUS";
158
+ Status["PUBLISHED"] = "PUBLISHED";
159
+ Status["DRAFT"] = "DRAFT";
160
+ })(Status || (exports.Status = Status = {}));
161
+ var Format;
162
+ (function (Format) {
163
+ Format["UNKNOWN_URLIZED_PLUGIN_FORMAT"] = "UNKNOWN_URLIZED_PLUGIN_FORMAT";
164
+ /** Letters are converted to lower case and spaces are replaced with dashes before generating the encoded URL. */
165
+ Format["ORIGINAL"] = "ORIGINAL";
166
+ /** No changes are made before generating the encoded URL. */
167
+ Format["PLAIN"] = "PLAIN";
168
+ })(Format || (exports.Format = Format = {}));
169
+ var PluginType;
170
+ (function (PluginType) {
171
+ /** Unknown plugin type. */
172
+ PluginType["UNKNOWN_PLUGIN_TYPE"] = "UNKNOWN_PLUGIN_TYPE";
173
+ /** Allows items to be marked as either draft or published. For each item you can set a publishing time when the item will become visible to site visitors. */
174
+ PluginType["PUBLISH"] = "PUBLISH";
175
+ /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
176
+ PluginType["SINGLE_ITEM"] = "SINGLE_ITEM";
177
+ /** Generates item URLs for collections used by dynamic pages. */
178
+ PluginType["URLIZED"] = "URLIZED";
179
+ /** Deprecated. Will be removed in the future. */
180
+ PluginType["GRIDAPPLESS"] = "GRIDAPPLESS";
181
+ /** Indicates that the collection is translatable. This allows you to manage translation for selected fields using [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). */
182
+ PluginType["MULTILINGUAL"] = "MULTILINGUAL";
183
+ /** Indicates that collection is shared with current site. */
184
+ PluginType["SHARED"] = "SHARED";
185
+ /** Indicates that page link fields are persisted and can be updated. */
186
+ PluginType["EDITABLE_PAGE_LINK"] = "EDITABLE_PAGE_LINK";
187
+ /** CMS-specific collection properties. */
188
+ PluginType["CMS"] = "CMS";
189
+ })(PluginType || (exports.PluginType = PluginType = {}));
190
+ var PagingMode;
191
+ (function (PagingMode) {
192
+ /** Offset-based paging. */
193
+ PagingMode["OFFSET"] = "OFFSET";
194
+ /** Cursor-based paging. */
195
+ PagingMode["CURSOR"] = "CURSOR";
196
+ })(PagingMode || (exports.PagingMode = PagingMode = {}));
197
+ /**
198
+ * Describes who can perform certain action.
199
+ * Each level includes all levels below it (except UNDEFINED).
200
+ */
201
+ var AccessLevel;
202
+ (function (AccessLevel) {
203
+ /** Not set. */
204
+ AccessLevel["UNDEFINED"] = "UNDEFINED";
205
+ /** Any subject, including visitors. */
206
+ AccessLevel["ANYONE"] = "ANYONE";
207
+ /** Any signed-in user (both site members and collaborators). */
208
+ AccessLevel["SITE_MEMBER"] = "SITE_MEMBER";
209
+ /** Any signed-in user, but site members only have access to own items. */
210
+ AccessLevel["SITE_MEMBER_AUTHOR"] = "SITE_MEMBER_AUTHOR";
211
+ /** Site collaborator that has a role with CMS Access permission. */
212
+ AccessLevel["CMS_EDITOR"] = "CMS_EDITOR";
213
+ /** CMS administrators and users or roles granted with special access. */
214
+ AccessLevel["PRIVILEGED"] = "PRIVILEGED";
215
+ })(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
216
+ var Segment;
217
+ (function (Segment) {
218
+ Segment["UNKNOWN_SEGMENT"] = "UNKNOWN_SEGMENT";
219
+ Segment["PUBLIC"] = "PUBLIC";
220
+ Segment["DEV"] = "DEV";
221
+ })(Segment || (exports.Segment = Segment = {}));
222
+ var SortOrder;
223
+ (function (SortOrder) {
224
+ SortOrder["ASC"] = "ASC";
225
+ SortOrder["DESC"] = "DESC";
226
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
227
+ /**
228
+ * Order determines how values are ordered in the index. This is important when
229
+ * ordering and/or range querying by indexed fields.
230
+ */
231
+ var Order;
232
+ (function (Order) {
233
+ Order["ASC"] = "ASC";
234
+ Order["DESC"] = "DESC";
235
+ })(Order || (exports.Order = Order = {}));
236
+ var IndexStatus;
237
+ (function (IndexStatus) {
238
+ /** Place holder. Never returned by the service. */
239
+ IndexStatus["UNKNOWN"] = "UNKNOWN";
240
+ /** Index creation is in progress. */
241
+ IndexStatus["BUILDING"] = "BUILDING";
242
+ /** Index has been successfully created and can be used in queries. */
243
+ IndexStatus["ACTIVE"] = "ACTIVE";
244
+ /** Index is in the process of being dropped. */
245
+ IndexStatus["DROPPING"] = "DROPPING";
246
+ /** Index has been dropped successfully. */
247
+ IndexStatus["DROPPED"] = "DROPPED";
248
+ /** Index creation has failed. */
249
+ IndexStatus["FAILED"] = "FAILED";
250
+ /** Index contains incorrectly indexed data. */
251
+ IndexStatus["INVALID"] = "INVALID";
252
+ })(IndexStatus || (exports.IndexStatus = IndexStatus = {}));
253
+ var WebhookIdentityType;
254
+ (function (WebhookIdentityType) {
255
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
256
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
257
+ WebhookIdentityType["MEMBER"] = "MEMBER";
258
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
259
+ WebhookIdentityType["APP"] = "APP";
260
+ })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
261
+ /**
262
+ * Creates a new data collection.
263
+ *
264
+ * The request body must include an ID, details for at least 1 field, and a permissions object. If any of these are missing, the collection isn't created.
265
+ * @param collection - Collection details.
266
+ * @public
267
+ * @requiredField collection
268
+ * @requiredField collection._id
269
+ * @requiredField collection.fields.key
270
+ * @requiredField collection.fields.type
271
+ * @requiredField collection.permissions.insert
272
+ * @requiredField collection.permissions.read
273
+ * @requiredField collection.permissions.remove
274
+ * @requiredField collection.permissions.update
275
+ * @param options - Options for creating a data collection.
276
+ * @permissionId WIX_DATA.CREATE_COLLECTION
277
+ * @permissionScope Manage All Data Resources
278
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
279
+ * @permissionScope Manage Data Collections
280
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
281
+ * @applicableIdentity APP
282
+ * @returns Details of collection created.
283
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollection
284
+ */
285
+ async function createDataCollection(collection) {
286
+ // @ts-ignore
287
+ const { httpClient, sideEffects } = arguments[1];
288
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
289
+ collection: collection,
290
+ });
291
+ const reqOpts = ambassadorWixDataV2DataCollection.createDataCollection(payload);
292
+ sideEffects?.onSiteCall?.();
293
+ try {
294
+ const result = await httpClient.request(reqOpts);
295
+ sideEffects?.onSuccess?.(result);
296
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.collection;
297
+ }
298
+ catch (err) {
299
+ const transformedError = (0, transform_error_1.transformError)(err, {
300
+ spreadPathsToArguments: {},
301
+ explicitPathsToArguments: { collection: '$[0]' },
302
+ singleArgumentUnchanged: false,
303
+ }, ['collection']);
304
+ sideEffects?.onError?.(err);
305
+ throw transformedError;
306
+ }
307
+ }
308
+ exports.createDataCollection = createDataCollection;
309
+ /**
310
+ * Retrieves a data collection by ID.
311
+ * @param dataCollectionId - ID of the collection to retrieve.
312
+ * @public
313
+ * @requiredField dataCollectionId
314
+ * @param options - Options for retrieving a data collection.
315
+ * @permissionId WIX_DATA.GET_COLLECTION
316
+ * @permissionScope Manage All Data Resources
317
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
318
+ * @permissionScope Manage Data Collections
319
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
320
+ * @applicableIdentity APP
321
+ * @applicableIdentity VISITOR
322
+ * @returns Details of the collection requested.
323
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.GetDataCollection
324
+ */
325
+ async function getDataCollection(dataCollectionId, options) {
326
+ // @ts-ignore
327
+ const { httpClient, sideEffects } = arguments[2];
328
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
329
+ dataCollectionId: dataCollectionId,
330
+ consistentRead: options?.consistentRead,
331
+ fields: options?.fields,
332
+ });
333
+ const reqOpts = ambassadorWixDataV2DataCollection.getDataCollection(payload);
334
+ sideEffects?.onSiteCall?.();
335
+ try {
336
+ const result = await httpClient.request(reqOpts);
337
+ sideEffects?.onSuccess?.(result);
338
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.collection;
339
+ }
340
+ catch (err) {
341
+ const transformedError = (0, transform_error_1.transformError)(err, {
342
+ spreadPathsToArguments: {},
343
+ explicitPathsToArguments: {
344
+ dataCollectionId: '$[0]',
345
+ consistentRead: '$[1].consistentRead',
346
+ fields: '$[1].fields',
347
+ },
348
+ singleArgumentUnchanged: false,
349
+ }, ['dataCollectionId', 'options']);
350
+ sideEffects?.onError?.(err);
351
+ throw transformedError;
352
+ }
353
+ }
354
+ exports.getDataCollection = getDataCollection;
355
+ /**
356
+ * Retrieves a list of all data collections associated with the site or project.
357
+ *
358
+ * By default, the list is ordered by ID in ascending order.
359
+ * @public
360
+ * @param options - Options for retrieving a list of data collections.
361
+ * @permissionId WIX_DATA.LIST_COLLECTIONS
362
+ * @permissionScope Manage All Data Resources
363
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
364
+ * @permissionScope Manage Data Collections
365
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
366
+ * @applicableIdentity APP
367
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections
368
+ */
369
+ async function listDataCollections(options) {
370
+ // @ts-ignore
371
+ const { httpClient, sideEffects } = arguments[1];
372
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
373
+ sort: options?.sort,
374
+ paging: options?.paging,
375
+ consistentRead: options?.consistentRead,
376
+ fields: options?.fields,
377
+ });
378
+ const reqOpts = ambassadorWixDataV2DataCollection.listDataCollections(payload);
379
+ sideEffects?.onSiteCall?.();
380
+ try {
381
+ const result = await httpClient.request(reqOpts);
382
+ sideEffects?.onSuccess?.(result);
383
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
384
+ }
385
+ catch (err) {
386
+ const transformedError = (0, transform_error_1.transformError)(err, {
387
+ spreadPathsToArguments: {},
388
+ explicitPathsToArguments: {
389
+ sort: '$[0].sort',
390
+ paging: '$[0].paging',
391
+ consistentRead: '$[0].consistentRead',
392
+ fields: '$[0].fields',
393
+ },
394
+ singleArgumentUnchanged: false,
395
+ }, ['options']);
396
+ sideEffects?.onError?.(err);
397
+ throw transformedError;
398
+ }
399
+ }
400
+ exports.listDataCollections = listDataCollections;
401
+ /**
402
+ * Updates a data collection.
403
+ *
404
+ * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
405
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
406
+ * Otherwise, the request fails.
407
+ *
408
+ * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
409
+ *
410
+ * > **Note:**
411
+ * > After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection has properties with values and those properties
412
+ * > aren't included in the updated collection details, their values are lost.
413
+ * @param collection - Updated collection details. The existing collection is replaced with this version.
414
+ * @public
415
+ * @requiredField collection
416
+ * @requiredField collection._id
417
+ * @requiredField collection.fields.key
418
+ * @requiredField collection.fields.type
419
+ * @requiredField collection.permissions.insert
420
+ * @requiredField collection.permissions.read
421
+ * @requiredField collection.permissions.remove
422
+ * @requiredField collection.permissions.update
423
+ * @requiredField collection.revision
424
+ * @param options - Options for updating a data collection.
425
+ * @permissionId WIX_DATA.UPDATE_COLLECTION
426
+ * @permissionScope Manage All Data Resources
427
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
428
+ * @permissionScope Manage Data Collections
429
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
430
+ * @applicableIdentity APP
431
+ * @returns Updated collection details.
432
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection
433
+ */
434
+ async function updateDataCollection(collection) {
435
+ // @ts-ignore
436
+ const { httpClient, sideEffects } = arguments[1];
437
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
438
+ collection: collection,
439
+ });
440
+ const reqOpts = ambassadorWixDataV2DataCollection.updateDataCollection(payload);
441
+ sideEffects?.onSiteCall?.();
442
+ try {
443
+ const result = await httpClient.request(reqOpts);
444
+ sideEffects?.onSuccess?.(result);
445
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.collection;
446
+ }
447
+ catch (err) {
448
+ const transformedError = (0, transform_error_1.transformError)(err, {
449
+ spreadPathsToArguments: {},
450
+ explicitPathsToArguments: { collection: '$[0]' },
451
+ singleArgumentUnchanged: false,
452
+ }, ['collection']);
453
+ sideEffects?.onError?.(err);
454
+ throw transformedError;
455
+ }
456
+ }
457
+ exports.updateDataCollection = updateDataCollection;
458
+ /**
459
+ * Deletes a data collection.
460
+ *
461
+ * > **Note:**
462
+ * > Once a collection is deleted, it can only be restored for limited amount of time.
463
+ * @param dataCollectionId - ID of the collection to delete.
464
+ * @public
465
+ * @requiredField dataCollectionId
466
+ * @permissionId WIX_DATA.DELETE_COLLECTION
467
+ * @permissionScope Manage All Data Resources
468
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
469
+ * @permissionScope Manage Data Collections
470
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
471
+ * @applicableIdentity APP
472
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection
473
+ */
474
+ async function deleteDataCollection(dataCollectionId) {
475
+ // @ts-ignore
476
+ const { httpClient, sideEffects } = arguments[1];
477
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
478
+ dataCollectionId: dataCollectionId,
479
+ });
480
+ const reqOpts = ambassadorWixDataV2DataCollection.deleteDataCollection(payload);
481
+ sideEffects?.onSiteCall?.();
482
+ try {
483
+ const result = await httpClient.request(reqOpts);
484
+ sideEffects?.onSuccess?.(result);
485
+ }
486
+ catch (err) {
487
+ const transformedError = (0, transform_error_1.transformError)(err, {
488
+ spreadPathsToArguments: {},
489
+ explicitPathsToArguments: { dataCollectionId: '$[0]' },
490
+ singleArgumentUnchanged: false,
491
+ }, ['dataCollectionId']);
492
+ sideEffects?.onError?.(err);
493
+ throw transformedError;
494
+ }
495
+ }
496
+ exports.deleteDataCollection = deleteDataCollection;
497
+ /**
498
+ * Restores recently deleted collection.
499
+ *
500
+ * Fails with `WDE0025` if collection was deleted too long ago or has never existed.
501
+ * @param dataCollectionId - Data Collection ID to restore
502
+ * @internal
503
+ * @documentationMaturity preview
504
+ * @requiredField dataCollectionId
505
+ * @permissionId WIX_DATA.CREATE_COLLECTION
506
+ * @permissionScope Manage All Data Resources
507
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
508
+ * @permissionScope Manage Data Collections
509
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
510
+ * @applicableIdentity APP
511
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.RestoreDataCollection
512
+ */
513
+ async function restoreDataCollection(dataCollectionId) {
514
+ // @ts-ignore
515
+ const { httpClient, sideEffects } = arguments[1];
516
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
517
+ dataCollectionId: dataCollectionId,
518
+ });
519
+ const reqOpts = ambassadorWixDataV2DataCollection.restoreDataCollection(payload);
520
+ sideEffects?.onSiteCall?.();
521
+ try {
522
+ const result = await httpClient.request(reqOpts);
523
+ sideEffects?.onSuccess?.(result);
524
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
525
+ }
526
+ catch (err) {
527
+ const transformedError = (0, transform_error_1.transformError)(err, {
528
+ spreadPathsToArguments: {},
529
+ explicitPathsToArguments: { dataCollectionId: '$[0]' },
530
+ singleArgumentUnchanged: false,
531
+ }, ['dataCollectionId']);
532
+ sideEffects?.onError?.(err);
533
+ throw transformedError;
534
+ }
535
+ }
536
+ exports.restoreDataCollection = restoreDataCollection;
537
+ /**
538
+ * Adds new field to data collection schema
539
+ * @param dataCollectionId - ID of data collection to update
540
+ * @internal
541
+ * @documentationMaturity preview
542
+ * @requiredField dataCollectionId
543
+ * @requiredField options
544
+ * @requiredField options.field
545
+ * @permissionId WIX_DATA.CREATE_COLLECTION_FIELD
546
+ * @permissionScope Manage All Data Resources
547
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
548
+ * @permissionScope Manage Data Collections
549
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
550
+ * @applicableIdentity APP
551
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollectionField
552
+ */
553
+ async function createDataCollectionField(dataCollectionId, options) {
554
+ // @ts-ignore
555
+ const { httpClient, sideEffects } = arguments[2];
556
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
557
+ dataCollectionId: dataCollectionId,
558
+ field: options?.field,
559
+ });
560
+ const reqOpts = ambassadorWixDataV2DataCollection.createDataCollectionField(payload);
561
+ sideEffects?.onSiteCall?.();
562
+ try {
563
+ const result = await httpClient.request(reqOpts);
564
+ sideEffects?.onSuccess?.(result);
565
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
566
+ }
567
+ catch (err) {
568
+ const transformedError = (0, transform_error_1.transformError)(err, {
569
+ spreadPathsToArguments: {},
570
+ explicitPathsToArguments: {
571
+ dataCollectionId: '$[0]',
572
+ field: '$[1].field',
573
+ },
574
+ singleArgumentUnchanged: false,
575
+ }, ['dataCollectionId', 'options']);
576
+ sideEffects?.onError?.(err);
577
+ throw transformedError;
578
+ }
579
+ }
580
+ exports.createDataCollectionField = createDataCollectionField;
581
+ /**
582
+ * Updates data collection field
583
+ * @param dataCollectionId - ID of data collection to update
584
+ * @internal
585
+ * @documentationMaturity preview
586
+ * @requiredField dataCollectionId
587
+ * @requiredField options
588
+ * @requiredField options.field
589
+ * @permissionId WIX_DATA.UPDATE_COLLECTION_FIELD
590
+ * @permissionScope Manage All Data Resources
591
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
592
+ * @permissionScope Manage Data Collections
593
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
594
+ * @applicableIdentity APP
595
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollectionField
596
+ */
597
+ async function updateDataCollectionField(dataCollectionId, options) {
598
+ // @ts-ignore
599
+ const { httpClient, sideEffects } = arguments[2];
600
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
601
+ dataCollectionId: dataCollectionId,
602
+ field: options?.field,
603
+ });
604
+ const reqOpts = ambassadorWixDataV2DataCollection.updateDataCollectionField(payload);
605
+ sideEffects?.onSiteCall?.();
606
+ try {
607
+ const result = await httpClient.request(reqOpts);
608
+ sideEffects?.onSuccess?.(result);
609
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
610
+ }
611
+ catch (err) {
612
+ const transformedError = (0, transform_error_1.transformError)(err, {
613
+ spreadPathsToArguments: {},
614
+ explicitPathsToArguments: {
615
+ dataCollectionId: '$[0]',
616
+ field: '$[1].field',
617
+ },
618
+ singleArgumentUnchanged: false,
619
+ }, ['dataCollectionId', 'options']);
620
+ sideEffects?.onError?.(err);
621
+ throw transformedError;
622
+ }
623
+ }
624
+ exports.updateDataCollectionField = updateDataCollectionField;
625
+ /**
626
+ * Deletes data collection field
627
+ * @param dataCollectionId - ID of data collection to update
628
+ * @internal
629
+ * @documentationMaturity preview
630
+ * @requiredField dataCollectionId
631
+ * @requiredField options
632
+ * @requiredField options.fieldKey
633
+ * @permissionId WIX_DATA.DELETE_COLLECTION_FIELD
634
+ * @permissionScope Manage All Data Resources
635
+ * @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
636
+ * @permissionScope Manage Data Collections
637
+ * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
638
+ * @applicableIdentity APP
639
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollectionField
640
+ */
641
+ async function deleteDataCollectionField(dataCollectionId, options) {
642
+ // @ts-ignore
643
+ const { httpClient, sideEffects } = arguments[2];
644
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
645
+ dataCollectionId: dataCollectionId,
646
+ fieldKey: options?.fieldKey,
647
+ });
648
+ const reqOpts = ambassadorWixDataV2DataCollection.deleteDataCollectionField(payload);
649
+ sideEffects?.onSiteCall?.();
650
+ try {
651
+ const result = await httpClient.request(reqOpts);
652
+ sideEffects?.onSuccess?.(result);
653
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
654
+ }
655
+ catch (err) {
656
+ const transformedError = (0, transform_error_1.transformError)(err, {
657
+ spreadPathsToArguments: {},
658
+ explicitPathsToArguments: {
659
+ dataCollectionId: '$[0]',
660
+ fieldKey: '$[1].fieldKey',
661
+ },
662
+ singleArgumentUnchanged: false,
663
+ }, ['dataCollectionId', 'options']);
664
+ sideEffects?.onError?.(err);
665
+ throw transformedError;
666
+ }
667
+ }
668
+ exports.deleteDataCollectionField = deleteDataCollectionField;
669
+ //# sourceMappingURL=data-v2-data-collection-collections.universal.js.map