@wix/data 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 (103) hide show
  1. package/build/cjs/index.d.ts +4 -0
  2. package/build/cjs/index.js +27 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/data-v1-external-database-connection.http.d.ts +29 -0
  5. package/build/cjs/src/data-v1-external-database-connection.http.js +397 -0
  6. package/build/cjs/src/data-v1-external-database-connection.http.js.map +1 -0
  7. package/build/cjs/src/data-v1-external-database-connection.public.d.ts +11 -0
  8. package/build/cjs/src/data-v1-external-database-connection.public.js +36 -0
  9. package/build/cjs/src/data-v1-external-database-connection.public.js.map +1 -0
  10. package/build/cjs/src/data-v1-external-database-connection.types.d.ts +53 -0
  11. package/build/cjs/src/data-v1-external-database-connection.types.js +3 -0
  12. package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -0
  13. package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +129 -0
  14. package/build/cjs/src/data-v1-external-database-connection.universal.js +334 -0
  15. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -0
  16. package/build/cjs/src/data-v2-data-collection.http.d.ts +37 -0
  17. package/build/cjs/src/data-v2-data-collection.http.js +458 -0
  18. package/build/cjs/src/data-v2-data-collection.http.js.map +1 -0
  19. package/build/cjs/src/data-v2-data-collection.public.d.ts +12 -0
  20. package/build/cjs/src/data-v2-data-collection.public.js +48 -0
  21. package/build/cjs/src/data-v2-data-collection.public.js.map +1 -0
  22. package/build/cjs/src/data-v2-data-collection.types.d.ts +638 -0
  23. package/build/cjs/src/data-v2-data-collection.types.js +143 -0
  24. package/build/cjs/src/data-v2-data-collection.types.js.map +1 -0
  25. package/build/cjs/src/data-v2-data-collection.universal.d.ts +732 -0
  26. package/build/cjs/src/data-v2-data-collection.universal.js +532 -0
  27. package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -0
  28. package/build/cjs/src/data-v2-data-item.http.d.ts +192 -0
  29. package/build/cjs/src/data-v2-data-item.http.js +944 -0
  30. package/build/cjs/src/data-v2-data-item.http.js.map +1 -0
  31. package/build/cjs/src/data-v2-data-item.public.d.ts +28 -0
  32. package/build/cjs/src/data-v2-data-item.public.js +137 -0
  33. package/build/cjs/src/data-v2-data-item.public.js.map +1 -0
  34. package/build/cjs/src/data-v2-data-item.types.d.ts +656 -0
  35. package/build/cjs/src/data-v2-data-item.types.js +27 -0
  36. package/build/cjs/src/data-v2-data-item.types.js.map +1 -0
  37. package/build/cjs/src/data-v2-data-item.universal.d.ts +1343 -0
  38. package/build/cjs/src/data-v2-data-item.universal.js +1435 -0
  39. package/build/cjs/src/data-v2-data-item.universal.js.map +1 -0
  40. package/build/cjs/src/data-v2-index.http.d.ts +29 -0
  41. package/build/cjs/src/data-v2-index.http.js +349 -0
  42. package/build/cjs/src/data-v2-index.http.js.map +1 -0
  43. package/build/cjs/src/data-v2-index.public.d.ts +10 -0
  44. package/build/cjs/src/data-v2-index.public.js +28 -0
  45. package/build/cjs/src/data-v2-index.public.js.map +1 -0
  46. package/build/cjs/src/data-v2-index.types.d.ts +120 -0
  47. package/build/cjs/src/data-v2-index.types.js +35 -0
  48. package/build/cjs/src/data-v2-index.types.js.map +1 -0
  49. package/build/cjs/src/data-v2-index.universal.d.ts +182 -0
  50. package/build/cjs/src/data-v2-index.universal.js +261 -0
  51. package/build/cjs/src/data-v2-index.universal.js.map +1 -0
  52. package/build/es/index.d.ts +4 -0
  53. package/build/es/index.js +5 -0
  54. package/build/es/index.js.map +1 -0
  55. package/build/es/src/data-v1-external-database-connection.http.d.ts +29 -0
  56. package/build/es/src/data-v1-external-database-connection.http.js +389 -0
  57. package/build/es/src/data-v1-external-database-connection.http.js.map +1 -0
  58. package/build/es/src/data-v1-external-database-connection.public.d.ts +11 -0
  59. package/build/es/src/data-v1-external-database-connection.public.js +28 -0
  60. package/build/es/src/data-v1-external-database-connection.public.js.map +1 -0
  61. package/build/es/src/data-v1-external-database-connection.types.d.ts +53 -0
  62. package/build/es/src/data-v1-external-database-connection.types.js +2 -0
  63. package/build/es/src/data-v1-external-database-connection.types.js.map +1 -0
  64. package/build/es/src/data-v1-external-database-connection.universal.d.ts +129 -0
  65. package/build/es/src/data-v1-external-database-connection.universal.js +307 -0
  66. package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -0
  67. package/build/es/src/data-v2-data-collection.http.d.ts +37 -0
  68. package/build/es/src/data-v2-data-collection.http.js +450 -0
  69. package/build/es/src/data-v2-data-collection.http.js.map +1 -0
  70. package/build/es/src/data-v2-data-collection.public.d.ts +12 -0
  71. package/build/es/src/data-v2-data-collection.public.js +29 -0
  72. package/build/es/src/data-v2-data-collection.public.js.map +1 -0
  73. package/build/es/src/data-v2-data-collection.types.d.ts +638 -0
  74. package/build/es/src/data-v2-data-collection.types.js +140 -0
  75. package/build/es/src/data-v2-data-collection.types.js.map +1 -0
  76. package/build/es/src/data-v2-data-collection.universal.d.ts +732 -0
  77. package/build/es/src/data-v2-data-collection.universal.js +505 -0
  78. package/build/es/src/data-v2-data-collection.universal.js.map +1 -0
  79. package/build/es/src/data-v2-data-item.http.d.ts +192 -0
  80. package/build/es/src/data-v2-data-item.http.js +920 -0
  81. package/build/es/src/data-v2-data-item.http.js.map +1 -0
  82. package/build/es/src/data-v2-data-item.public.d.ts +28 -0
  83. package/build/es/src/data-v2-data-item.public.js +109 -0
  84. package/build/es/src/data-v2-data-item.public.js.map +1 -0
  85. package/build/es/src/data-v2-data-item.types.d.ts +656 -0
  86. package/build/es/src/data-v2-data-item.types.js +24 -0
  87. package/build/es/src/data-v2-data-item.types.js.map +1 -0
  88. package/build/es/src/data-v2-data-item.universal.d.ts +1343 -0
  89. package/build/es/src/data-v2-data-item.universal.js +1392 -0
  90. package/build/es/src/data-v2-data-item.universal.js.map +1 -0
  91. package/build/es/src/data-v2-index.http.d.ts +29 -0
  92. package/build/es/src/data-v2-index.http.js +343 -0
  93. package/build/es/src/data-v2-index.http.js.map +1 -0
  94. package/build/es/src/data-v2-index.public.d.ts +10 -0
  95. package/build/es/src/data-v2-index.public.js +19 -0
  96. package/build/es/src/data-v2-index.public.js.map +1 -0
  97. package/build/es/src/data-v2-index.types.d.ts +120 -0
  98. package/build/es/src/data-v2-index.types.js +32 -0
  99. package/build/es/src/data-v2-index.types.js.map +1 -0
  100. package/build/es/src/data-v2-index.universal.d.ts +182 -0
  101. package/build/es/src/data-v2-index.universal.js +236 -0
  102. package/build/es/src/data-v2-index.universal.js.map +1 -0
  103. package/package.json +37 -0
@@ -0,0 +1,129 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /** An external database connection defines a connection between an external database and a Wix site. */
8
+ export interface ExternalDatabaseConnection {
9
+ /**
10
+ * Name of the external database connection.
11
+ * An external database connection may connect to one or more external data collections or tables.
12
+ * These are represented as `connectionName/dataCollectionId`.
13
+ */
14
+ name?: string;
15
+ /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
16
+ endpoint?: string;
17
+ /**
18
+ * Settings passed to the external database connection as part of each request.
19
+ * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
20
+ * Their content and structure depend on the specific requirements of the external database's API.
21
+ */
22
+ configuration?: Record<string, any> | null;
23
+ }
24
+ export interface GetExternalDatabaseConnectionRequest {
25
+ /** Name of the external database connection to retrieve. */
26
+ name: string;
27
+ }
28
+ export interface GetExternalDatabaseConnectionResponse {
29
+ /** Details of the external database connection requested. */
30
+ externalDatabaseConnection?: ExternalDatabaseConnection;
31
+ }
32
+ export interface ListExternalDatabaseConnectionsRequest {
33
+ }
34
+ export interface ListExternalDatabaseConnectionsResponse {
35
+ /** List of external database connections. */
36
+ externalDatabaseConnections?: ExternalDatabaseConnection[];
37
+ }
38
+ export interface CreateExternalDatabaseConnectionRequest {
39
+ /** External database connection details. */
40
+ externalDatabaseConnection?: ExternalDatabaseConnection;
41
+ }
42
+ export interface CreateExternalDatabaseConnectionResponse {
43
+ /** Details of external database connection created. */
44
+ externalDatabaseConnection?: ExternalDatabaseConnection;
45
+ }
46
+ export interface UpdateExternalDatabaseConnectionRequest {
47
+ /** Updated external database connection details. The existing collection is replaced with this version. */
48
+ externalDatabaseConnection?: ExternalDatabaseConnection;
49
+ }
50
+ export interface UpdateExternalDatabaseConnectionResponse {
51
+ /** Updated external database connection details. */
52
+ externalDatabaseConnection?: ExternalDatabaseConnection;
53
+ }
54
+ export interface DeleteExternalDatabaseConnectionRequest {
55
+ /** Name of the external database connection to delete. */
56
+ name: string;
57
+ }
58
+ export interface DeleteExternalDatabaseConnectionResponse {
59
+ }
60
+ /**
61
+ * Retrieves an external database connection by name.
62
+ * @param name - Name of the external database connection to retrieve.
63
+ * @public
64
+ * @documentationMaturity preview
65
+ * @requiredField name
66
+ */
67
+ export declare function getExternalDatabaseConnection(name: string): Promise<GetExternalDatabaseConnectionResponse>;
68
+ /**
69
+ * Retrieves a list of all external database collections associated with the site.
70
+ * @public
71
+ * @documentationMaturity preview
72
+ */
73
+ export declare function listExternalDatabaseConnections(): Promise<ListExternalDatabaseConnectionsResponse>;
74
+ /**
75
+ * Creates a new external database connection.
76
+ *
77
+ * The request body must include a name, base URL, and configuration details for the external database within the `externalDatabaseConnection` body parameter.
78
+ * If any of these are missing, the external database connection isn't created.
79
+ * @public
80
+ * @documentationMaturity preview
81
+ * @requiredField options.externalDatabaseConnection.configuration
82
+ * @requiredField options.externalDatabaseConnection.endpoint
83
+ * @requiredField options.externalDatabaseConnection.name
84
+ */
85
+ export declare function createExternalDatabaseConnection(options?: CreateExternalDatabaseConnectionOptions): Promise<CreateExternalDatabaseConnectionResponse>;
86
+ export interface CreateExternalDatabaseConnectionOptions {
87
+ /** External database connection details. */
88
+ externalDatabaseConnection?: ExternalDatabaseConnection;
89
+ }
90
+ /**
91
+ * Updates an external database connection.
92
+ *
93
+ * An external database collection name must be submitted as a path parameter.
94
+ * If an existing external database connection is found with the same name, that connection's details are updated.
95
+ * If no external database connection has that name, the request fails.
96
+ *
97
+ * > **Note:** After an external database connection is updated, it only contains the values provided in the request. All previous values are lost.
98
+ * @param name - Name of the external database connection.
99
+ * An external database connection may connect to one or more external data collections or tables.
100
+ * These are represented as `connectionName/dataCollectionId`.
101
+ * @public
102
+ * @documentationMaturity preview
103
+ * @requiredField name
104
+ * @requiredField options.externalDatabaseConnection.configuration
105
+ * @requiredField options.externalDatabaseConnection.endpoint
106
+ */
107
+ export declare function updateExternalDatabaseConnection(name: string, options?: UpdateExternalDatabaseConnectionOptions): Promise<UpdateExternalDatabaseConnectionResponse>;
108
+ export interface UpdateExternalDatabaseConnectionOptions {
109
+ externalDatabaseConnection: {
110
+ /** Base URL for provisioning and managing data in the external database. For example: `https://example.com/my-external-database`. */
111
+ endpoint?: string;
112
+ /**
113
+ * Settings passed to the external database connection as part of each request.
114
+ * These settings can relate to authentication, tenancy, or provide any other information needed for processing a request.
115
+ * Their content and structure depend on the specific requirements of the external database's API.
116
+ */
117
+ configuration?: Record<string, any> | null;
118
+ };
119
+ }
120
+ /**
121
+ * Deletes an external database connection.
122
+ *
123
+ * > **Note:** Once an external database connection is deleted, it can't be restored. To reconnect the database you need to [create a new external database connection](https://dev.wix.com/api/rest/wix-data/wix-data/external-database-connections/create-external-database-connection).
124
+ * @param name - Name of the external database connection to delete.
125
+ * @public
126
+ * @documentationMaturity preview
127
+ * @requiredField name
128
+ */
129
+ export declare function deleteExternalDatabaseConnection(name: string): Promise<void>;
@@ -0,0 +1,334 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.deleteExternalDatabaseConnection = exports.updateExternalDatabaseConnection = exports.createExternalDatabaseConnection = exports.listExternalDatabaseConnections = exports.getExternalDatabaseConnection = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixDataV1ExternalDatabaseConnection = __importStar(require("./data-v1-external-database-connection.http"));
34
+ let __verbose = false;
35
+ function __log(...args) {
36
+ __verbose && console.log(...args);
37
+ }
38
+ function __inspect(obj) {
39
+ return obj;
40
+ }
41
+ exports.__debug = {
42
+ verboseLogging: {
43
+ on: () => (__verbose = true),
44
+ off: () => (__verbose = false),
45
+ },
46
+ };
47
+ const _toVeloEntity = '$';
48
+ const _fromVeloEntity = '$';
49
+ const _createExternalDatabaseConnectionRequest = {};
50
+ const _createExternalDatabaseConnectionResponse = {};
51
+ const _deleteExternalDatabaseConnectionRequest = {};
52
+ const _deleteExternalDatabaseConnectionResponse = {};
53
+ const _getExternalDatabaseConnectionRequest = {};
54
+ const _getExternalDatabaseConnectionResponse = {};
55
+ const _listExternalDatabaseConnectionsRequest = {};
56
+ const _listExternalDatabaseConnectionsResponse = {};
57
+ const _updateExternalDatabaseConnectionRequest = {};
58
+ const _updateExternalDatabaseConnectionResponse = {};
59
+ /**
60
+ * Retrieves an external database connection by name.
61
+ * @param name - Name of the external database connection to retrieve.
62
+ * @public
63
+ * @documentationMaturity preview
64
+ * @requiredField name
65
+ */
66
+ function getExternalDatabaseConnection(name) {
67
+ var _a, _b, _c;
68
+ return __awaiter(this, arguments, void 0, function* () {
69
+ const requestTransformation = { name: '$[0]' };
70
+ const responseTransformation = '$';
71
+ // @ts-ignore
72
+ const { httpClient, sideEffects } = arguments[1];
73
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
74
+ rootSchema: _getExternalDatabaseConnectionRequest,
75
+ depSchemas: {},
76
+ fqdnTransformation: {
77
+ paths: [],
78
+ transformation: _fromVeloEntity,
79
+ },
80
+ customTransformation: requestTransformation,
81
+ });
82
+ const { fromJSON } = (0, velo_1.serializer)({
83
+ rootSchema: _getExternalDatabaseConnectionResponse,
84
+ depSchemas: {},
85
+ fqdnTransformation: {
86
+ paths: [...['externalDatabaseConnection']],
87
+ transformation: _toVeloEntity,
88
+ },
89
+ customTransformation: responseTransformation,
90
+ });
91
+ const payload = toAmbassadorRequest([name]);
92
+ const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.getExternalDatabaseConnection(payload);
93
+ __log(`"GetExternalDatabaseConnection" sending request with: ${__inspect(reqOpts)}`);
94
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
95
+ try {
96
+ const result = yield httpClient.request(reqOpts);
97
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
98
+ return fromJSON(result.data);
99
+ }
100
+ catch (err) {
101
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
102
+ 'name',
103
+ ]);
104
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
105
+ throw transformedError;
106
+ }
107
+ });
108
+ }
109
+ exports.getExternalDatabaseConnection = getExternalDatabaseConnection;
110
+ /**
111
+ * Retrieves a list of all external database collections associated with the site.
112
+ * @public
113
+ * @documentationMaturity preview
114
+ */
115
+ function listExternalDatabaseConnections() {
116
+ var _a, _b, _c;
117
+ return __awaiter(this, arguments, void 0, function* () {
118
+ const requestTransformation = {};
119
+ const responseTransformation = '$';
120
+ // @ts-ignore
121
+ const { httpClient, sideEffects } = arguments[0];
122
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
123
+ rootSchema: _listExternalDatabaseConnectionsRequest,
124
+ depSchemas: {},
125
+ fqdnTransformation: {
126
+ paths: [],
127
+ transformation: _fromVeloEntity,
128
+ },
129
+ customTransformation: requestTransformation,
130
+ });
131
+ const { fromJSON } = (0, velo_1.serializer)({
132
+ rootSchema: _listExternalDatabaseConnectionsResponse,
133
+ depSchemas: {},
134
+ fqdnTransformation: {
135
+ paths: [...['Array#externalDatabaseConnections']],
136
+ transformation: _toVeloEntity,
137
+ },
138
+ customTransformation: responseTransformation,
139
+ });
140
+ const payload = toAmbassadorRequest([]);
141
+ const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.listExternalDatabaseConnections(payload);
142
+ __log(`"ListExternalDatabaseConnections" sending request with: ${__inspect(reqOpts)}`);
143
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
144
+ try {
145
+ const result = yield httpClient.request(reqOpts);
146
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
147
+ return fromJSON(result.data);
148
+ }
149
+ catch (err) {
150
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, []);
151
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
152
+ throw transformedError;
153
+ }
154
+ });
155
+ }
156
+ exports.listExternalDatabaseConnections = listExternalDatabaseConnections;
157
+ /**
158
+ * Creates a new external database connection.
159
+ *
160
+ * The request body must include a name, base URL, and configuration details for the external database within the `externalDatabaseConnection` body parameter.
161
+ * If any of these are missing, the external database connection isn't created.
162
+ * @public
163
+ * @documentationMaturity preview
164
+ * @requiredField options.externalDatabaseConnection.configuration
165
+ * @requiredField options.externalDatabaseConnection.endpoint
166
+ * @requiredField options.externalDatabaseConnection.name
167
+ */
168
+ function createExternalDatabaseConnection(options) {
169
+ var _a, _b, _c;
170
+ return __awaiter(this, arguments, void 0, function* () {
171
+ const requestTransformation = {
172
+ externalDatabaseConnection: '$[0].externalDatabaseConnection',
173
+ };
174
+ const responseTransformation = '$';
175
+ // @ts-ignore
176
+ const { httpClient, sideEffects } = arguments[1];
177
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
178
+ rootSchema: _createExternalDatabaseConnectionRequest,
179
+ depSchemas: {},
180
+ fqdnTransformation: {
181
+ paths: [...['externalDatabaseConnection']],
182
+ transformation: _fromVeloEntity,
183
+ },
184
+ customTransformation: requestTransformation,
185
+ });
186
+ const { fromJSON } = (0, velo_1.serializer)({
187
+ rootSchema: _createExternalDatabaseConnectionResponse,
188
+ depSchemas: {},
189
+ fqdnTransformation: {
190
+ paths: [...['externalDatabaseConnection']],
191
+ transformation: _toVeloEntity,
192
+ },
193
+ customTransformation: responseTransformation,
194
+ });
195
+ const payload = toAmbassadorRequest([options]);
196
+ const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.createExternalDatabaseConnection(payload);
197
+ __log(`"CreateExternalDatabaseConnection" sending request with: ${__inspect(reqOpts)}`);
198
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
199
+ try {
200
+ const result = yield httpClient.request(reqOpts);
201
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
202
+ return fromJSON(result.data);
203
+ }
204
+ catch (err) {
205
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
206
+ 'options',
207
+ ]);
208
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
209
+ throw transformedError;
210
+ }
211
+ });
212
+ }
213
+ exports.createExternalDatabaseConnection = createExternalDatabaseConnection;
214
+ /**
215
+ * Updates an external database connection.
216
+ *
217
+ * An external database collection name must be submitted as a path parameter.
218
+ * If an existing external database connection is found with the same name, that connection's details are updated.
219
+ * If no external database connection has that name, the request fails.
220
+ *
221
+ * > **Note:** After an external database connection is updated, it only contains the values provided in the request. All previous values are lost.
222
+ * @param name - Name of the external database connection.
223
+ * An external database connection may connect to one or more external data collections or tables.
224
+ * These are represented as `connectionName/dataCollectionId`.
225
+ * @public
226
+ * @documentationMaturity preview
227
+ * @requiredField name
228
+ * @requiredField options.externalDatabaseConnection.configuration
229
+ * @requiredField options.externalDatabaseConnection.endpoint
230
+ */
231
+ function updateExternalDatabaseConnection(name, options) {
232
+ var _a, _b, _c;
233
+ return __awaiter(this, arguments, void 0, function* () {
234
+ const requestTransformation = {
235
+ externalDatabaseConnection: {
236
+ '*': '$[1].externalDatabaseConnection',
237
+ name: '$[0]',
238
+ },
239
+ };
240
+ const responseTransformation = '$';
241
+ // @ts-ignore
242
+ const { httpClient, sideEffects } = arguments[2];
243
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
244
+ rootSchema: _updateExternalDatabaseConnectionRequest,
245
+ depSchemas: {},
246
+ fqdnTransformation: {
247
+ paths: [...['externalDatabaseConnection']],
248
+ transformation: _fromVeloEntity,
249
+ },
250
+ customTransformation: requestTransformation,
251
+ });
252
+ const { fromJSON } = (0, velo_1.serializer)({
253
+ rootSchema: _updateExternalDatabaseConnectionResponse,
254
+ depSchemas: {},
255
+ fqdnTransformation: {
256
+ paths: [...['externalDatabaseConnection']],
257
+ transformation: _toVeloEntity,
258
+ },
259
+ customTransformation: responseTransformation,
260
+ });
261
+ const payload = toAmbassadorRequest([name, options]);
262
+ const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.updateExternalDatabaseConnection(payload);
263
+ __log(`"UpdateExternalDatabaseConnection" sending request with: ${__inspect(reqOpts)}`);
264
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
265
+ try {
266
+ const result = yield httpClient.request(reqOpts);
267
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
268
+ return fromJSON(result.data);
269
+ }
270
+ catch (err) {
271
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
272
+ 'name',
273
+ 'options',
274
+ ]);
275
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
276
+ throw transformedError;
277
+ }
278
+ });
279
+ }
280
+ exports.updateExternalDatabaseConnection = updateExternalDatabaseConnection;
281
+ /**
282
+ * Deletes an external database connection.
283
+ *
284
+ * > **Note:** Once an external database connection is deleted, it can't be restored. To reconnect the database you need to [create a new external database connection](https://dev.wix.com/api/rest/wix-data/wix-data/external-database-connections/create-external-database-connection).
285
+ * @param name - Name of the external database connection to delete.
286
+ * @public
287
+ * @documentationMaturity preview
288
+ * @requiredField name
289
+ */
290
+ function deleteExternalDatabaseConnection(name) {
291
+ var _a, _b, _c;
292
+ return __awaiter(this, arguments, void 0, function* () {
293
+ const requestTransformation = { name: '$[0]' };
294
+ const responseTransformation = '$';
295
+ // @ts-ignore
296
+ const { httpClient, sideEffects } = arguments[1];
297
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
298
+ rootSchema: _deleteExternalDatabaseConnectionRequest,
299
+ depSchemas: {},
300
+ fqdnTransformation: {
301
+ paths: [],
302
+ transformation: _fromVeloEntity,
303
+ },
304
+ customTransformation: requestTransformation,
305
+ });
306
+ const { fromJSON } = (0, velo_1.serializer)({
307
+ rootSchema: _deleteExternalDatabaseConnectionResponse,
308
+ depSchemas: {},
309
+ fqdnTransformation: {
310
+ paths: [],
311
+ transformation: _toVeloEntity,
312
+ },
313
+ customTransformation: responseTransformation,
314
+ });
315
+ const payload = toAmbassadorRequest([name]);
316
+ const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.deleteExternalDatabaseConnection(payload);
317
+ __log(`"DeleteExternalDatabaseConnection" sending request with: ${__inspect(reqOpts)}`);
318
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
319
+ try {
320
+ const result = yield httpClient.request(reqOpts);
321
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
322
+ return fromJSON(result.data);
323
+ }
324
+ catch (err) {
325
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
326
+ 'name',
327
+ ]);
328
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
329
+ throw transformedError;
330
+ }
331
+ });
332
+ }
333
+ exports.deleteExternalDatabaseConnection = deleteExternalDatabaseConnection;
334
+ //# sourceMappingURL=data-v1-external-database-connection.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-v1-external-database-connection.universal.js","sourceRoot":"","sources":["../../../src/data-v1-external-database-connection.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,2HAA6G;AAE7G,IAAI,SAAS,GAAG,KAAK,CAAC;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gB,CAAC;SACxB;;CACF;AA3DD,4EA2DC"}
@@ -0,0 +1,37 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { CreateDataCollectionRequest, CreateDataCollectionResponse, DeleteDataCollectionRequest, DeleteDataCollectionResponse, GetDataCollectionRequest, GetDataCollectionResponse, ListDataCollectionsRequest, ListDataCollectionsResponse, UpdateDataCollectionRequest, UpdateDataCollectionResponse } from './data-v2-data-collection.types';
3
+ /**
4
+ * Creates a new data collection.
5
+ *
6
+ * 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.
7
+ */
8
+ export declare function createDataCollection(payload: CreateDataCollectionRequest): RequestOptionsFactory<CreateDataCollectionResponse>;
9
+ /** Retrieves a data collection by ID. */
10
+ export declare function getDataCollection(payload: GetDataCollectionRequest): RequestOptionsFactory<GetDataCollectionResponse>;
11
+ /**
12
+ * Retrieves a list of all data collections associated with the site.
13
+ *
14
+ * By default, the list is ordered by ID in ascending order.
15
+ */
16
+ export declare function listDataCollections(payload: ListDataCollectionsRequest): RequestOptionsFactory<ListDataCollectionsResponse>;
17
+ /**
18
+ * Updates a data collection.
19
+ *
20
+ * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
21
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
22
+ * Otherwise, the request fails.
23
+ *
24
+ * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
25
+ *
26
+ * > **Note:**
27
+ * > 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
28
+ * > aren't included in the updated collection details, their values are lost.
29
+ */
30
+ export declare function updateDataCollection(payload: UpdateDataCollectionRequest): RequestOptionsFactory<UpdateDataCollectionResponse>;
31
+ /**
32
+ * Deletes a data collection.
33
+ *
34
+ * > **Note:**
35
+ * > Once a collection is deleted, it can't be restored.
36
+ */
37
+ export declare function deleteDataCollection(payload: DeleteDataCollectionRequest): RequestOptionsFactory<DeleteDataCollectionResponse>;