@wix/data 1.0.90 → 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.
Files changed (169) hide show
  1. package/build/cjs/context.d.ts +4 -4
  2. package/build/cjs/context.js +4 -4
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +4 -4
  5. package/build/cjs/index.js +4 -4
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +4 -4
  8. package/build/cjs/meta.js +4 -4
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +4 -4
  11. package/build/es/context.js +4 -4
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +4 -4
  14. package/build/es/index.js +4 -4
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +4 -4
  17. package/build/es/meta.js +4 -4
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +14 -9
  20. package/build/cjs/index.typings.d.ts +0 -4
  21. package/build/cjs/index.typings.js +0 -31
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/data-v1-external-database-connection.context.d.ts +0 -7
  24. package/build/cjs/src/data-v1-external-database-connection.context.js +0 -90
  25. package/build/cjs/src/data-v1-external-database-connection.context.js.map +0 -1
  26. package/build/cjs/src/data-v1-external-database-connection.http.d.ts +0 -28
  27. package/build/cjs/src/data-v1-external-database-connection.http.js +0 -393
  28. package/build/cjs/src/data-v1-external-database-connection.http.js.map +0 -1
  29. package/build/cjs/src/data-v1-external-database-connection.meta.d.ts +0 -23
  30. package/build/cjs/src/data-v1-external-database-connection.meta.js +0 -127
  31. package/build/cjs/src/data-v1-external-database-connection.meta.js.map +0 -1
  32. package/build/cjs/src/data-v1-external-database-connection.public.d.ts +0 -46
  33. package/build/cjs/src/data-v1-external-database-connection.public.js +0 -46
  34. package/build/cjs/src/data-v1-external-database-connection.public.js.map +0 -1
  35. package/build/cjs/src/data-v1-external-database-connection.types.d.ts +0 -321
  36. package/build/cjs/src/data-v1-external-database-connection.types.js +0 -88
  37. package/build/cjs/src/data-v1-external-database-connection.types.js.map +0 -1
  38. package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +0 -433
  39. package/build/cjs/src/data-v1-external-database-connection.universal.js +0 -452
  40. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +0 -1
  41. package/build/cjs/src/data-v2-data-collection.context.d.ts +0 -7
  42. package/build/cjs/src/data-v2-data-collection.context.js +0 -90
  43. package/build/cjs/src/data-v2-data-collection.context.js.map +0 -1
  44. package/build/cjs/src/data-v2-data-collection.http.d.ts +0 -36
  45. package/build/cjs/src/data-v2-data-collection.http.js +0 -494
  46. package/build/cjs/src/data-v2-data-collection.http.js.map +0 -1
  47. package/build/cjs/src/data-v2-data-collection.meta.d.ts +0 -21
  48. package/build/cjs/src/data-v2-data-collection.meta.js +0 -123
  49. package/build/cjs/src/data-v2-data-collection.meta.js.map +0 -1
  50. package/build/cjs/src/data-v2-data-collection.public.d.ts +0 -313
  51. package/build/cjs/src/data-v2-data-collection.public.js +0 -58
  52. package/build/cjs/src/data-v2-data-collection.public.js.map +0 -1
  53. package/build/cjs/src/data-v2-data-collection.types.d.ts +0 -1460
  54. package/build/cjs/src/data-v2-data-collection.types.js +0 -197
  55. package/build/cjs/src/data-v2-data-collection.types.js.map +0 -1
  56. package/build/cjs/src/data-v2-data-collection.universal.d.ts +0 -1626
  57. package/build/cjs/src/data-v2-data-collection.universal.js +0 -677
  58. package/build/cjs/src/data-v2-data-collection.universal.js.map +0 -1
  59. package/build/cjs/src/data-v2-data-item.context.d.ts +0 -23
  60. package/build/cjs/src/data-v2-data-item.context.js +0 -362
  61. package/build/cjs/src/data-v2-data-item.context.js.map +0 -1
  62. package/build/cjs/src/data-v2-data-item.http.d.ts +0 -225
  63. package/build/cjs/src/data-v2-data-item.http.js +0 -948
  64. package/build/cjs/src/data-v2-data-item.http.js.map +0 -1
  65. package/build/cjs/src/data-v2-data-item.meta.d.ts +0 -39
  66. package/build/cjs/src/data-v2-data-item.meta.js +0 -427
  67. package/build/cjs/src/data-v2-data-item.meta.js.map +0 -1
  68. package/build/cjs/src/data-v2-data-item.public.d.ts +0 -31
  69. package/build/cjs/src/data-v2-data-item.public.js +0 -137
  70. package/build/cjs/src/data-v2-data-item.public.js.map +0 -1
  71. package/build/cjs/src/data-v2-data-item.types.d.ts +0 -980
  72. package/build/cjs/src/data-v2-data-item.types.js +0 -27
  73. package/build/cjs/src/data-v2-data-item.types.js.map +0 -1
  74. package/build/cjs/src/data-v2-data-item.universal.d.ts +0 -1823
  75. package/build/cjs/src/data-v2-data-item.universal.js +0 -1639
  76. package/build/cjs/src/data-v2-data-item.universal.js.map +0 -1
  77. package/build/cjs/src/data-v2-index.context.d.ts +0 -5
  78. package/build/cjs/src/data-v2-index.context.js +0 -56
  79. package/build/cjs/src/data-v2-index.context.js.map +0 -1
  80. package/build/cjs/src/data-v2-index.http.d.ts +0 -28
  81. package/build/cjs/src/data-v2-index.http.js +0 -367
  82. package/build/cjs/src/data-v2-index.http.js.map +0 -1
  83. package/build/cjs/src/data-v2-index.meta.d.ts +0 -15
  84. package/build/cjs/src/data-v2-index.meta.js +0 -85
  85. package/build/cjs/src/data-v2-index.meta.js.map +0 -1
  86. package/build/cjs/src/data-v2-index.public.d.ts +0 -23
  87. package/build/cjs/src/data-v2-index.public.js +0 -28
  88. package/build/cjs/src/data-v2-index.public.js.map +0 -1
  89. package/build/cjs/src/data-v2-index.types.d.ts +0 -174
  90. package/build/cjs/src/data-v2-index.types.js +0 -35
  91. package/build/cjs/src/data-v2-index.types.js.map +0 -1
  92. package/build/cjs/src/data-v2-index.universal.d.ts +0 -237
  93. package/build/cjs/src/data-v2-index.universal.js +0 -274
  94. package/build/cjs/src/data-v2-index.universal.js.map +0 -1
  95. package/build/es/index.typings.d.ts +0 -4
  96. package/build/es/index.typings.js +0 -5
  97. package/build/es/index.typings.js.map +0 -1
  98. package/build/es/src/data-v1-external-database-connection.context.d.ts +0 -7
  99. package/build/es/src/data-v1-external-database-connection.context.js +0 -82
  100. package/build/es/src/data-v1-external-database-connection.context.js.map +0 -1
  101. package/build/es/src/data-v1-external-database-connection.http.d.ts +0 -28
  102. package/build/es/src/data-v1-external-database-connection.http.js +0 -385
  103. package/build/es/src/data-v1-external-database-connection.http.js.map +0 -1
  104. package/build/es/src/data-v1-external-database-connection.meta.d.ts +0 -23
  105. package/build/es/src/data-v1-external-database-connection.meta.js +0 -96
  106. package/build/es/src/data-v1-external-database-connection.meta.js.map +0 -1
  107. package/build/es/src/data-v1-external-database-connection.public.d.ts +0 -46
  108. package/build/es/src/data-v1-external-database-connection.public.js +0 -30
  109. package/build/es/src/data-v1-external-database-connection.public.js.map +0 -1
  110. package/build/es/src/data-v1-external-database-connection.types.d.ts +0 -321
  111. package/build/es/src/data-v1-external-database-connection.types.js +0 -85
  112. package/build/es/src/data-v1-external-database-connection.types.js.map +0 -1
  113. package/build/es/src/data-v1-external-database-connection.universal.d.ts +0 -433
  114. package/build/es/src/data-v1-external-database-connection.universal.js +0 -421
  115. package/build/es/src/data-v1-external-database-connection.universal.js.map +0 -1
  116. package/build/es/src/data-v2-data-collection.context.d.ts +0 -7
  117. package/build/es/src/data-v2-data-collection.context.js +0 -82
  118. package/build/es/src/data-v2-data-collection.context.js.map +0 -1
  119. package/build/es/src/data-v2-data-collection.http.d.ts +0 -36
  120. package/build/es/src/data-v2-data-collection.http.js +0 -486
  121. package/build/es/src/data-v2-data-collection.http.js.map +0 -1
  122. package/build/es/src/data-v2-data-collection.meta.d.ts +0 -21
  123. package/build/es/src/data-v2-data-collection.meta.js +0 -92
  124. package/build/es/src/data-v2-data-collection.meta.js.map +0 -1
  125. package/build/es/src/data-v2-data-collection.public.d.ts +0 -313
  126. package/build/es/src/data-v2-data-collection.public.js +0 -30
  127. package/build/es/src/data-v2-data-collection.public.js.map +0 -1
  128. package/build/es/src/data-v2-data-collection.types.d.ts +0 -1460
  129. package/build/es/src/data-v2-data-collection.types.js +0 -194
  130. package/build/es/src/data-v2-data-collection.types.js.map +0 -1
  131. package/build/es/src/data-v2-data-collection.universal.d.ts +0 -1626
  132. package/build/es/src/data-v2-data-collection.universal.js +0 -646
  133. package/build/es/src/data-v2-data-collection.universal.js.map +0 -1
  134. package/build/es/src/data-v2-data-item.context.d.ts +0 -23
  135. package/build/es/src/data-v2-data-item.context.js +0 -338
  136. package/build/es/src/data-v2-data-item.context.js.map +0 -1
  137. package/build/es/src/data-v2-data-item.http.d.ts +0 -225
  138. package/build/es/src/data-v2-data-item.http.js +0 -924
  139. package/build/es/src/data-v2-data-item.http.js.map +0 -1
  140. package/build/es/src/data-v2-data-item.meta.d.ts +0 -39
  141. package/build/es/src/data-v2-data-item.meta.js +0 -380
  142. package/build/es/src/data-v2-data-item.meta.js.map +0 -1
  143. package/build/es/src/data-v2-data-item.public.d.ts +0 -31
  144. package/build/es/src/data-v2-data-item.public.js +0 -109
  145. package/build/es/src/data-v2-data-item.public.js.map +0 -1
  146. package/build/es/src/data-v2-data-item.types.d.ts +0 -980
  147. package/build/es/src/data-v2-data-item.types.js +0 -24
  148. package/build/es/src/data-v2-data-item.types.js.map +0 -1
  149. package/build/es/src/data-v2-data-item.universal.d.ts +0 -1823
  150. package/build/es/src/data-v2-data-item.universal.js +0 -1592
  151. package/build/es/src/data-v2-data-item.universal.js.map +0 -1
  152. package/build/es/src/data-v2-index.context.d.ts +0 -5
  153. package/build/es/src/data-v2-index.context.js +0 -50
  154. package/build/es/src/data-v2-index.context.js.map +0 -1
  155. package/build/es/src/data-v2-index.http.d.ts +0 -28
  156. package/build/es/src/data-v2-index.http.js +0 -361
  157. package/build/es/src/data-v2-index.http.js.map +0 -1
  158. package/build/es/src/data-v2-index.meta.d.ts +0 -15
  159. package/build/es/src/data-v2-index.meta.js +0 -56
  160. package/build/es/src/data-v2-index.meta.js.map +0 -1
  161. package/build/es/src/data-v2-index.public.d.ts +0 -23
  162. package/build/es/src/data-v2-index.public.js +0 -19
  163. package/build/es/src/data-v2-index.public.js.map +0 -1
  164. package/build/es/src/data-v2-index.types.d.ts +0 -174
  165. package/build/es/src/data-v2-index.types.js +0 -32
  166. package/build/es/src/data-v2-index.types.js.map +0 -1
  167. package/build/es/src/data-v2-index.universal.d.ts +0 -237
  168. package/build/es/src/data-v2-index.universal.js +0 -245
  169. package/build/es/src/data-v2-index.universal.js.map +0 -1
@@ -1,677 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.deleteDataCollection = exports.updateDataCollection = exports.listDataCollections = exports.getDataCollection = exports.createDataCollection = exports.onDataCollectionDeleted = exports.onDataCollectionUpdated = exports.onDataCollectionCreated = exports.onDataCollectionChangedEvent = exports.onDataCollectionClonedEvent = exports.IndexStatus = exports.Order = exports.SortOrder = exports.PagingMode = exports.Type = exports.Format = exports.Status = exports.Role = exports.FieldPluginType = exports.QueryOperator = exports.FieldType = exports.CollectionOperation = exports.DataOperation = exports.Direction = exports.CollectionType = void 0;
36
- const velo_1 = require("@wix/metro-runtime/velo");
37
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
38
- const sdk_types_1 = require("@wix/sdk-types");
39
- const ambassadorWixDataV2DataCollection = __importStar(require("./data-v2-data-collection.http"));
40
- const _toVeloEntity = '$';
41
- const _fromVeloEntity = '$';
42
- var CollectionType;
43
- (function (CollectionType) {
44
- /** User-created collection. */
45
- CollectionType["NATIVE"] = "NATIVE";
46
- /** [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). */
47
- CollectionType["WIX_APP"] = "WIX_APP";
48
- /** Collection created by a Wix Blocks app. */
49
- CollectionType["BLOCKS_APP"] = "BLOCKS_APP";
50
- /** Collection located in externally connected storage. */
51
- CollectionType["EXTERNAL"] = "EXTERNAL";
52
- })(CollectionType || (exports.CollectionType = CollectionType = {}));
53
- var Direction;
54
- (function (Direction) {
55
- Direction["ASC"] = "ASC";
56
- Direction["DESC"] = "DESC";
57
- })(Direction || (exports.Direction = Direction = {}));
58
- var DataOperation;
59
- (function (DataOperation) {
60
- DataOperation["AGGREGATE"] = "AGGREGATE";
61
- DataOperation["BULK_INSERT"] = "BULK_INSERT";
62
- DataOperation["BULK_REMOVE"] = "BULK_REMOVE";
63
- DataOperation["BULK_SAVE"] = "BULK_SAVE";
64
- DataOperation["BULK_UPDATE"] = "BULK_UPDATE";
65
- DataOperation["COUNT"] = "COUNT";
66
- DataOperation["DISTINCT"] = "DISTINCT";
67
- DataOperation["FIND"] = "FIND";
68
- DataOperation["GET"] = "GET";
69
- DataOperation["INSERT"] = "INSERT";
70
- DataOperation["INSERT_REFERENCE"] = "INSERT_REFERENCE";
71
- DataOperation["IS_REFERENCED"] = "IS_REFERENCED";
72
- DataOperation["QUERY_REFERENCED"] = "QUERY_REFERENCED";
73
- DataOperation["REMOVE"] = "REMOVE";
74
- DataOperation["REMOVE_REFERENCE"] = "REMOVE_REFERENCE";
75
- DataOperation["REPLACE_REFERENCES"] = "REPLACE_REFERENCES";
76
- DataOperation["SAVE"] = "SAVE";
77
- DataOperation["TRUNCATE"] = "TRUNCATE";
78
- DataOperation["UPDATE"] = "UPDATE";
79
- })(DataOperation || (exports.DataOperation = DataOperation = {}));
80
- var CollectionOperation;
81
- (function (CollectionOperation) {
82
- /** Supports updating this collection. */
83
- CollectionOperation["UPDATE"] = "UPDATE";
84
- /** Supports removing this collections. */
85
- CollectionOperation["REMOVE"] = "REMOVE";
86
- })(CollectionOperation || (exports.CollectionOperation = CollectionOperation = {}));
87
- var FieldType;
88
- (function (FieldType) {
89
- FieldType["UNKNOWN_FIELD_TYPE"] = "UNKNOWN_FIELD_TYPE";
90
- FieldType["TEXT"] = "TEXT";
91
- FieldType["NUMBER"] = "NUMBER";
92
- FieldType["DATE"] = "DATE";
93
- FieldType["DATETIME"] = "DATETIME";
94
- FieldType["IMAGE"] = "IMAGE";
95
- FieldType["BOOLEAN"] = "BOOLEAN";
96
- FieldType["DOCUMENT"] = "DOCUMENT";
97
- FieldType["URL"] = "URL";
98
- FieldType["RICH_TEXT"] = "RICH_TEXT";
99
- FieldType["VIDEO"] = "VIDEO";
100
- FieldType["ANY"] = "ANY";
101
- FieldType["ARRAY_STRING"] = "ARRAY_STRING";
102
- FieldType["ARRAY_DOCUMENT"] = "ARRAY_DOCUMENT";
103
- FieldType["AUDIO"] = "AUDIO";
104
- FieldType["TIME"] = "TIME";
105
- FieldType["LANGUAGE"] = "LANGUAGE";
106
- FieldType["RICH_CONTENT"] = "RICH_CONTENT";
107
- FieldType["MEDIA_GALLERY"] = "MEDIA_GALLERY";
108
- FieldType["ADDRESS"] = "ADDRESS";
109
- FieldType["PAGE_LINK"] = "PAGE_LINK";
110
- FieldType["REFERENCE"] = "REFERENCE";
111
- FieldType["MULTI_REFERENCE"] = "MULTI_REFERENCE";
112
- FieldType["OBJECT"] = "OBJECT";
113
- FieldType["ARRAY"] = "ARRAY";
114
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
115
- FieldType["LEGACY_TIME"] = "LEGACY_TIME";
116
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
117
- FieldType["LEGACY_BOOK"] = "LEGACY_BOOK";
118
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
119
- FieldType["LEGACY_EXTERNAL_URL"] = "LEGACY_EXTERNAL_URL";
120
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
121
- FieldType["LEGACY_BROKEN_REFERENCE"] = "LEGACY_BROKEN_REFERENCE";
122
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
123
- FieldType["LEGACY_IMAGE"] = "LEGACY_IMAGE";
124
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
125
- FieldType["LEGACY_COLOR"] = "LEGACY_COLOR";
126
- /** Deprecated - can’t be added to collections. Can only appear in older collections. */
127
- FieldType["LEGACY_EXTERNAL_VIDEO"] = "LEGACY_EXTERNAL_VIDEO";
128
- })(FieldType || (exports.FieldType = FieldType = {}));
129
- var QueryOperator;
130
- (function (QueryOperator) {
131
- QueryOperator["EQ"] = "EQ";
132
- QueryOperator["LT"] = "LT";
133
- QueryOperator["GT"] = "GT";
134
- QueryOperator["NE"] = "NE";
135
- QueryOperator["LTE"] = "LTE";
136
- QueryOperator["GTE"] = "GTE";
137
- QueryOperator["STARTS_WITH"] = "STARTS_WITH";
138
- QueryOperator["ENDS_WITH"] = "ENDS_WITH";
139
- QueryOperator["CONTAINS"] = "CONTAINS";
140
- QueryOperator["HAS_SOME"] = "HAS_SOME";
141
- QueryOperator["HAS_ALL"] = "HAS_ALL";
142
- QueryOperator["EXISTS"] = "EXISTS";
143
- QueryOperator["URLIZED"] = "URLIZED";
144
- })(QueryOperator || (exports.QueryOperator = QueryOperator = {}));
145
- var FieldPluginType;
146
- (function (FieldPluginType) {
147
- FieldPluginType["UNKNOWN"] = "UNKNOWN";
148
- /** CMS-related field attributes */
149
- FieldPluginType["CMS"] = "CMS";
150
- })(FieldPluginType || (exports.FieldPluginType = FieldPluginType = {}));
151
- var Role;
152
- (function (Role) {
153
- /** Unknown. */
154
- Role["UNKNOWN_ROLE"] = "UNKNOWN_ROLE";
155
- /** Site administrator. */
156
- Role["ADMIN"] = "ADMIN";
157
- /** Signed-in user who added content to this collection. */
158
- Role["SITE_MEMBER_AUTHOR"] = "SITE_MEMBER_AUTHOR";
159
- /** Any signed-in user. */
160
- Role["SITE_MEMBER"] = "SITE_MEMBER";
161
- /** Any site visitor. */
162
- Role["ANYONE"] = "ANYONE";
163
- })(Role || (exports.Role = Role = {}));
164
- var Status;
165
- (function (Status) {
166
- Status["UNKNOWN_PUBLISH_PLUGIN_STATUS"] = "UNKNOWN_PUBLISH_PLUGIN_STATUS";
167
- Status["PUBLISHED"] = "PUBLISHED";
168
- Status["DRAFT"] = "DRAFT";
169
- })(Status || (exports.Status = Status = {}));
170
- var Format;
171
- (function (Format) {
172
- Format["UNKNOWN_URLIZED_PLUGIN_FORMAT"] = "UNKNOWN_URLIZED_PLUGIN_FORMAT";
173
- Format["ORIGINAL"] = "ORIGINAL";
174
- Format["PLAIN"] = "PLAIN";
175
- })(Format || (exports.Format = Format = {}));
176
- var Type;
177
- (function (Type) {
178
- /** Unknown plugin type. */
179
- Type["UNKNOWN_PLUGIN_TYPE"] = "UNKNOWN_PLUGIN_TYPE";
180
- /** 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. */
181
- Type["PUBLISH"] = "PUBLISH";
182
- /** Ensures the collection can have one item at most. Can only be applied to a new collection. */
183
- Type["SINGLE_ITEM"] = "SINGLE_ITEM";
184
- /** Generates item URLs for collections used by dynamic pages. */
185
- Type["URLIZED"] = "URLIZED";
186
- /** Deprecated. Will be removed in the future. */
187
- Type["GRIDAPPLESS"] = "GRIDAPPLESS";
188
- /** 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). */
189
- Type["MULTILINGUAL"] = "MULTILINGUAL";
190
- /** Indicates that collection is shared with current site */
191
- Type["SHARED"] = "SHARED";
192
- /** Indicates that page link fields are persisted and can be updated */
193
- Type["EDITABLE_PAGE_LINK"] = "EDITABLE_PAGE_LINK";
194
- /** CMS-specific collection properties */
195
- Type["CMS"] = "CMS";
196
- })(Type || (exports.Type = Type = {}));
197
- var PagingMode;
198
- (function (PagingMode) {
199
- /** Offset-based paging. */
200
- PagingMode["OFFSET"] = "OFFSET";
201
- /** Cursor-based paging. */
202
- PagingMode["CURSOR"] = "CURSOR";
203
- })(PagingMode || (exports.PagingMode = PagingMode = {}));
204
- var SortOrder;
205
- (function (SortOrder) {
206
- SortOrder["ASC"] = "ASC";
207
- SortOrder["DESC"] = "DESC";
208
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
209
- /**
210
- * Order determines how values are ordered in the index. This is important when
211
- * ordering and/or range querying by indexed fields.
212
- */
213
- var Order;
214
- (function (Order) {
215
- Order["ASC"] = "ASC";
216
- Order["DESC"] = "DESC";
217
- })(Order || (exports.Order = Order = {}));
218
- var IndexStatus;
219
- (function (IndexStatus) {
220
- /** Place holder. Never returned by the service. */
221
- IndexStatus["UNKNOWN"] = "UNKNOWN";
222
- /** Index creation is in progress. */
223
- IndexStatus["BUILDING"] = "BUILDING";
224
- /** Index has been successfully created and can be used in queries. */
225
- IndexStatus["ACTIVE"] = "ACTIVE";
226
- /** Index is in the process of being dropped. */
227
- IndexStatus["DROPPING"] = "DROPPING";
228
- /** Index has been dropped successfully. */
229
- IndexStatus["DROPPED"] = "DROPPED";
230
- /** Index creation has failed. */
231
- IndexStatus["FAILED"] = "FAILED";
232
- /** Index contains incorrectly indexed data. */
233
- IndexStatus["INVALID"] = "INVALID";
234
- })(IndexStatus || (exports.IndexStatus = IndexStatus = {}));
235
- const _array = { typeMetadata: '_typeMetadata' };
236
- const _createDataCollectionRequest = { collection: '_dataCollection' };
237
- const _createDataCollectionResponse = { collection: '_dataCollection' };
238
- const _dataCollection = { fields: '_field' };
239
- const _dataCollectionChangedEvent = {
240
- fieldsAdded: '_field',
241
- fieldsUpdated: '_fieldUpdate',
242
- fieldsRemoved: '_field',
243
- };
244
- const _deleteDataCollectionRequest = {};
245
- const _deleteDataCollectionResponse = {};
246
- const _field = { typeMetadata: '_typeMetadata' };
247
- const _fieldUpdate = { previous: '_field', current: '_field' };
248
- const _getDataCollectionRequest = {};
249
- const _getDataCollectionResponse = {
250
- collection: '_dataCollection',
251
- referencedCollections: '_dataCollection',
252
- };
253
- const _listDataCollectionsRequest = {};
254
- const _listDataCollectionsResponse = { collections: '_dataCollection' };
255
- const _object = { fields: '_objectField' };
256
- const _objectField = { typeMetadata: '_typeMetadata' };
257
- const _typeMetadata = { object: '_object', array: '_array' };
258
- const _updateDataCollectionRequest = { collection: '_dataCollection' };
259
- const _updateDataCollectionResponse = { collection: '_dataCollection' };
260
- const _dataCollectionClonedEvent = {};
261
- const _numberRange = {
262
- min: 'google.protobuf.DoubleValue',
263
- max: 'google.protobuf.DoubleValue',
264
- };
265
- exports.onDataCollectionClonedEvent = (0, sdk_types_1.EventDefinition)('wix.data.v2.data_collection_data_collection_cloned_event', true, {
266
- rootSchema: _dataCollectionClonedEvent,
267
- depSchemas: {},
268
- })();
269
- exports.onDataCollectionChangedEvent = (0, sdk_types_1.EventDefinition)('wix.data.v2.data_collection_data_collection_changed_event', true, {
270
- rootSchema: _dataCollectionChangedEvent,
271
- depSchemas: {
272
- _array,
273
- _field,
274
- _fieldUpdate,
275
- _numberRange,
276
- _object,
277
- _objectField,
278
- _typeMetadata,
279
- },
280
- })();
281
- exports.onDataCollectionCreated = (0, sdk_types_1.EventDefinition)('wix.data.v2.data_collection_created', true, {
282
- rootSchema: _dataCollection,
283
- depSchemas: {
284
- _array,
285
- _field,
286
- _numberRange,
287
- _object,
288
- _objectField,
289
- _typeMetadata,
290
- },
291
- })();
292
- exports.onDataCollectionUpdated = (0, sdk_types_1.EventDefinition)('wix.data.v2.data_collection_updated', true, {
293
- rootSchema: _dataCollection,
294
- depSchemas: {
295
- _array,
296
- _field,
297
- _numberRange,
298
- _object,
299
- _objectField,
300
- _typeMetadata,
301
- },
302
- })();
303
- exports.onDataCollectionDeleted = (0, sdk_types_1.EventDefinition)('wix.data.v2.data_collection_deleted', true, {
304
- rootSchema: _dataCollection,
305
- depSchemas: {
306
- _array,
307
- _field,
308
- _numberRange,
309
- _object,
310
- _objectField,
311
- _typeMetadata,
312
- },
313
- })();
314
- /**
315
- * Creates a new data collection.
316
- *
317
- * 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.
318
- * @param collection - Collection details.
319
- * @public
320
- * @requiredField collection
321
- * @requiredField collection._id
322
- * @requiredField collection.fields.key
323
- * @requiredField collection.fields.type
324
- * @requiredField collection.permissions.insert
325
- * @requiredField collection.permissions.read
326
- * @requiredField collection.permissions.remove
327
- * @requiredField collection.permissions.update
328
- * @param options - Options for creating a data collection.
329
- * @permissionScope Manage Data Collections
330
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
331
- * @applicableIdentity APP
332
- * @returns Details of collection created.
333
- */
334
- function createDataCollection(collection) {
335
- var _a, _b, _c;
336
- return __awaiter(this, arguments, void 0, function* () {
337
- const requestTransformation = { collection: '$[0]' };
338
- const responseTransformation = '$.collection';
339
- // @ts-ignore
340
- const { httpClient, sideEffects } = arguments[1];
341
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
342
- rootSchema: _createDataCollectionRequest,
343
- depSchemas: {
344
- _array,
345
- _dataCollection,
346
- _field,
347
- _object,
348
- _objectField,
349
- _typeMetadata,
350
- },
351
- fqdnTransformation: {
352
- paths: [...['collection']],
353
- transformation: _fromVeloEntity,
354
- },
355
- customTransformation: requestTransformation,
356
- });
357
- const { fromJSON } = (0, velo_1.serializer)({
358
- rootSchema: _createDataCollectionResponse,
359
- depSchemas: {
360
- _array,
361
- _dataCollection,
362
- _field,
363
- _object,
364
- _objectField,
365
- _typeMetadata,
366
- },
367
- fqdnTransformation: {
368
- paths: [...['collection']],
369
- transformation: _toVeloEntity,
370
- },
371
- customTransformation: responseTransformation,
372
- });
373
- const payload = toAmbassadorRequest([collection]);
374
- const reqOpts = ambassadorWixDataV2DataCollection.createDataCollection(payload);
375
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
376
- try {
377
- const result = yield httpClient.request(reqOpts);
378
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
379
- return fromJSON(result.data);
380
- }
381
- catch (err) {
382
- const transformedError = (0, transform_error_1.transformError)(err, {
383
- spreadPathsToArguments: {},
384
- explicitPathsToArguments: { collection: '$[0]' },
385
- singleArgumentUnchanged: false,
386
- }, ['collection']);
387
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
388
- throw transformedError;
389
- }
390
- });
391
- }
392
- exports.createDataCollection = createDataCollection;
393
- /**
394
- * Retrieves a data collection by ID.
395
- * @param dataCollectionId - ID of the collection to retrieve.
396
- * @public
397
- * @requiredField dataCollectionId
398
- * @param options - Options for retrieving a data collection.
399
- * @permissionScope Manage Data Collections
400
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
401
- * @applicableIdentity APP
402
- * @applicableIdentity VISITOR
403
- * @returns Details of the collection requested.
404
- */
405
- function getDataCollection(dataCollectionId, options) {
406
- var _a, _b, _c;
407
- return __awaiter(this, arguments, void 0, function* () {
408
- const requestTransformation = {
409
- dataCollectionId: '$[0]',
410
- consistentRead: '$[1].consistentRead',
411
- };
412
- const responseTransformation = '$.collection';
413
- // @ts-ignore
414
- const { httpClient, sideEffects } = arguments[2];
415
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
416
- rootSchema: _getDataCollectionRequest,
417
- depSchemas: {},
418
- fqdnTransformation: {
419
- paths: [],
420
- transformation: _fromVeloEntity,
421
- },
422
- customTransformation: requestTransformation,
423
- });
424
- const { fromJSON } = (0, velo_1.serializer)({
425
- rootSchema: _getDataCollectionResponse,
426
- depSchemas: {
427
- _array,
428
- _dataCollection,
429
- _field,
430
- _object,
431
- _objectField,
432
- _typeMetadata,
433
- },
434
- fqdnTransformation: {
435
- paths: [...['collection', 'Array#referencedCollections']],
436
- transformation: _toVeloEntity,
437
- },
438
- customTransformation: responseTransformation,
439
- });
440
- const payload = toAmbassadorRequest([dataCollectionId, options]);
441
- const reqOpts = ambassadorWixDataV2DataCollection.getDataCollection(payload);
442
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
443
- try {
444
- const result = yield httpClient.request(reqOpts);
445
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
446
- return fromJSON(result.data);
447
- }
448
- catch (err) {
449
- const transformedError = (0, transform_error_1.transformError)(err, {
450
- spreadPathsToArguments: {},
451
- explicitPathsToArguments: {
452
- dataCollectionId: '$[0]',
453
- consistentRead: '$[1].consistentRead',
454
- },
455
- singleArgumentUnchanged: false,
456
- }, ['dataCollectionId', 'options']);
457
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
458
- throw transformedError;
459
- }
460
- });
461
- }
462
- exports.getDataCollection = getDataCollection;
463
- /**
464
- * Retrieves a list of all data collections associated with the site or project.
465
- *
466
- * By default, the list is ordered by ID in ascending order.
467
- * @public
468
- * @param options - Options for retrieving a list of data collections.
469
- * @permissionScope Manage Data Collections
470
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
471
- * @applicableIdentity APP
472
- */
473
- function listDataCollections(options) {
474
- var _a, _b, _c;
475
- return __awaiter(this, arguments, void 0, function* () {
476
- const requestTransformation = {
477
- sort: '$[0].sort',
478
- paging: '$[0].paging',
479
- consistentRead: '$[0].consistentRead',
480
- };
481
- const responseTransformation = '$';
482
- // @ts-ignore
483
- const { httpClient, sideEffects } = arguments[1];
484
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
485
- rootSchema: _listDataCollectionsRequest,
486
- depSchemas: {},
487
- fqdnTransformation: {
488
- paths: [],
489
- transformation: _fromVeloEntity,
490
- },
491
- customTransformation: requestTransformation,
492
- });
493
- const { fromJSON } = (0, velo_1.serializer)({
494
- rootSchema: _listDataCollectionsResponse,
495
- depSchemas: {
496
- _array,
497
- _dataCollection,
498
- _field,
499
- _object,
500
- _objectField,
501
- _typeMetadata,
502
- },
503
- fqdnTransformation: {
504
- paths: [...['Array#collections']],
505
- transformation: _toVeloEntity,
506
- },
507
- customTransformation: responseTransformation,
508
- });
509
- const payload = toAmbassadorRequest([options]);
510
- const reqOpts = ambassadorWixDataV2DataCollection.listDataCollections(payload);
511
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
512
- try {
513
- const result = yield httpClient.request(reqOpts);
514
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
515
- return fromJSON(result.data);
516
- }
517
- catch (err) {
518
- const transformedError = (0, transform_error_1.transformError)(err, {
519
- spreadPathsToArguments: {},
520
- explicitPathsToArguments: {
521
- sort: '$[0].sort',
522
- paging: '$[0].paging',
523
- consistentRead: '$[0].consistentRead',
524
- },
525
- singleArgumentUnchanged: false,
526
- }, ['options']);
527
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
528
- throw transformedError;
529
- }
530
- });
531
- }
532
- exports.listDataCollections = listDataCollections;
533
- /**
534
- * Updates a data collection.
535
- *
536
- * A collection ID, revision number, permissions, and at least 1 field must be provided within `options.collection`.
537
- * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
538
- * Otherwise, the request fails.
539
- *
540
- * When a collection is updated, its `_updatedDate` property is changed to the current date and its `revision` property is incremented.
541
- *
542
- * > **Note:**
543
- * > After a collection is updated, it only contains the properties included in the `updateDataCollection()` call. If the existing collection has properties with values and those properties
544
- * > aren't included in the updated collection details, their values are lost.
545
- * @param collection - Updated collection details. The existing collection is replaced with this version.
546
- * @public
547
- * @requiredField collection
548
- * @requiredField collection._id
549
- * @requiredField collection.fields.key
550
- * @requiredField collection.fields.type
551
- * @requiredField collection.permissions.insert
552
- * @requiredField collection.permissions.read
553
- * @requiredField collection.permissions.remove
554
- * @requiredField collection.permissions.update
555
- * @requiredField collection.revision
556
- * @param options - Options for updating a data collection.
557
- * @permissionScope Manage Data Collections
558
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
559
- * @applicableIdentity APP
560
- * @returns Updated collection details.
561
- */
562
- function updateDataCollection(collection) {
563
- var _a, _b, _c;
564
- return __awaiter(this, arguments, void 0, function* () {
565
- const requestTransformation = { collection: '$[0]' };
566
- const responseTransformation = '$.collection';
567
- // @ts-ignore
568
- const { httpClient, sideEffects } = arguments[1];
569
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
570
- rootSchema: _updateDataCollectionRequest,
571
- depSchemas: {
572
- _array,
573
- _dataCollection,
574
- _field,
575
- _object,
576
- _objectField,
577
- _typeMetadata,
578
- },
579
- fqdnTransformation: {
580
- paths: [...['collection']],
581
- transformation: _fromVeloEntity,
582
- },
583
- customTransformation: requestTransformation,
584
- });
585
- const { fromJSON } = (0, velo_1.serializer)({
586
- rootSchema: _updateDataCollectionResponse,
587
- depSchemas: {
588
- _array,
589
- _dataCollection,
590
- _field,
591
- _object,
592
- _objectField,
593
- _typeMetadata,
594
- },
595
- fqdnTransformation: {
596
- paths: [...['collection']],
597
- transformation: _toVeloEntity,
598
- },
599
- customTransformation: responseTransformation,
600
- });
601
- const payload = toAmbassadorRequest([collection]);
602
- const reqOpts = ambassadorWixDataV2DataCollection.updateDataCollection(payload);
603
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
604
- try {
605
- const result = yield httpClient.request(reqOpts);
606
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
607
- return fromJSON(result.data);
608
- }
609
- catch (err) {
610
- const transformedError = (0, transform_error_1.transformError)(err, {
611
- spreadPathsToArguments: {},
612
- explicitPathsToArguments: { collection: '$[0]' },
613
- singleArgumentUnchanged: false,
614
- }, ['collection']);
615
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
616
- throw transformedError;
617
- }
618
- });
619
- }
620
- exports.updateDataCollection = updateDataCollection;
621
- /**
622
- * Deletes a data collection.
623
- *
624
- * > **Note:**
625
- * > Once a collection is deleted, it can't be restored.
626
- * @param dataCollectionId - ID of the collection to delete.
627
- * @public
628
- * @requiredField dataCollectionId
629
- * @permissionScope Manage Data Collections
630
- * @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
631
- * @applicableIdentity APP
632
- */
633
- function deleteDataCollection(dataCollectionId) {
634
- var _a, _b, _c;
635
- return __awaiter(this, arguments, void 0, function* () {
636
- const requestTransformation = { dataCollectionId: '$[0]' };
637
- const responseTransformation = '$';
638
- // @ts-ignore
639
- const { httpClient, sideEffects } = arguments[1];
640
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
641
- rootSchema: _deleteDataCollectionRequest,
642
- depSchemas: {},
643
- fqdnTransformation: {
644
- paths: [],
645
- transformation: _fromVeloEntity,
646
- },
647
- customTransformation: requestTransformation,
648
- });
649
- const { fromJSON } = (0, velo_1.serializer)({
650
- rootSchema: _deleteDataCollectionResponse,
651
- depSchemas: {},
652
- fqdnTransformation: {
653
- paths: [],
654
- transformation: _toVeloEntity,
655
- },
656
- customTransformation: responseTransformation,
657
- });
658
- const payload = toAmbassadorRequest([dataCollectionId]);
659
- const reqOpts = ambassadorWixDataV2DataCollection.deleteDataCollection(payload);
660
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
661
- try {
662
- const result = yield httpClient.request(reqOpts);
663
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
664
- }
665
- catch (err) {
666
- const transformedError = (0, transform_error_1.transformError)(err, {
667
- spreadPathsToArguments: {},
668
- explicitPathsToArguments: { dataCollectionId: '$[0]' },
669
- singleArgumentUnchanged: false,
670
- }, ['dataCollectionId']);
671
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
672
- throw transformedError;
673
- }
674
- });
675
- }
676
- exports.deleteDataCollection = deleteDataCollection;
677
- //# sourceMappingURL=data-v2-data-collection.universal.js.map