@wix/auto_sdk_data_collections 1.0.11 → 1.0.13

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