@wix/data 1.0.73 → 1.0.75

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 (37) hide show
  1. package/build/cjs/src/data-v1-external-database-connection.public.d.ts +4 -7
  2. package/build/cjs/src/data-v1-external-database-connection.public.js +3 -2
  3. package/build/cjs/src/data-v1-external-database-connection.public.js.map +1 -1
  4. package/build/cjs/src/data-v1-external-database-connection.types.d.ts +89 -14
  5. package/build/cjs/src/data-v1-external-database-connection.types.js +19 -1
  6. package/build/cjs/src/data-v1-external-database-connection.types.js.map +1 -1
  7. package/build/cjs/src/data-v1-external-database-connection.universal.d.ts +94 -39
  8. package/build/cjs/src/data-v1-external-database-connection.universal.js +55 -21
  9. package/build/cjs/src/data-v1-external-database-connection.universal.js.map +1 -1
  10. package/build/cjs/src/data-v2-data-collection.public.d.ts +1 -1
  11. package/build/cjs/src/data-v2-data-collection.types.d.ts +67 -0
  12. package/build/cjs/src/data-v2-data-collection.universal.d.ts +67 -0
  13. package/build/cjs/src/data-v2-data-collection.universal.js +33 -16
  14. package/build/cjs/src/data-v2-data-collection.universal.js.map +1 -1
  15. package/build/cjs/src/data-v2-data-item.universal.js +193 -63
  16. package/build/cjs/src/data-v2-data-item.universal.js.map +1 -1
  17. package/build/cjs/src/data-v2-index.universal.js +22 -12
  18. package/build/cjs/src/data-v2-index.universal.js.map +1 -1
  19. package/build/es/src/data-v1-external-database-connection.public.d.ts +4 -7
  20. package/build/es/src/data-v1-external-database-connection.public.js +2 -2
  21. package/build/es/src/data-v1-external-database-connection.public.js.map +1 -1
  22. package/build/es/src/data-v1-external-database-connection.types.d.ts +89 -14
  23. package/build/es/src/data-v1-external-database-connection.types.js +18 -0
  24. package/build/es/src/data-v1-external-database-connection.types.js.map +1 -1
  25. package/build/es/src/data-v1-external-database-connection.universal.d.ts +94 -39
  26. package/build/es/src/data-v1-external-database-connection.universal.js +55 -21
  27. package/build/es/src/data-v1-external-database-connection.universal.js.map +1 -1
  28. package/build/es/src/data-v2-data-collection.public.d.ts +1 -1
  29. package/build/es/src/data-v2-data-collection.types.d.ts +67 -0
  30. package/build/es/src/data-v2-data-collection.universal.d.ts +67 -0
  31. package/build/es/src/data-v2-data-collection.universal.js +34 -17
  32. package/build/es/src/data-v2-data-collection.universal.js.map +1 -1
  33. package/build/es/src/data-v2-data-item.universal.js +193 -63
  34. package/build/es/src/data-v2-data-item.universal.js.map +1 -1
  35. package/build/es/src/data-v2-index.universal.js +23 -13
  36. package/build/es/src/data-v2-index.universal.js.map +1 -1
  37. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '@wix/sdk-types';
2
- import { ExternalDatabaseConnection, UpdateExternalDatabaseConnection, ListExternalDatabaseConnectionsOptions } from './data-v1-external-database-connection.universal';
2
+ import { ExternalDatabaseConnection, UpdateExternalDatabaseConnection, CreateExternalDatabaseConnectionOptions, ListExternalDatabaseConnectionsOptions } from './data-v1-external-database-connection.universal';
3
3
  export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
@@ -10,21 +10,19 @@ export declare function getExternalDatabaseConnection(httpClient: HttpClient): (
10
10
  causeOfFailure: import("./data-v1-external-database-connection.universal").CauseOfFailure;
11
11
  hasCollections: import("./data-v1-external-database-connection.universal").CollectionsFound;
12
12
  } | undefined;
13
- protocolVersion: import("./data-v1-external-database-connection.universal").ProtocolVersion;
14
13
  capabilities?: {
15
14
  collectionModificationsSupported: boolean;
16
15
  fieldTypes: import("./data-v1-external-database-connection.universal").FieldType[];
17
16
  } | undefined;
18
17
  }>;
19
18
  export declare function listExternalDatabaseConnections(httpClient: HttpClient): (options?: ListExternalDatabaseConnectionsOptions) => Promise<import("./data-v1-external-database-connection.universal").ListExternalDatabaseConnectionsResponse & import("./data-v1-external-database-connection.universal").ListExternalDatabaseConnectionsResponseNonNullableFields>;
20
- export declare function createExternalDatabaseConnection(httpClient: HttpClient): (externalDatabaseConnection: ExternalDatabaseConnection) => Promise<ExternalDatabaseConnection & {
19
+ export declare function createExternalDatabaseConnection(httpClient: HttpClient): (externalDatabaseConnection: ExternalDatabaseConnection, options?: CreateExternalDatabaseConnectionOptions) => Promise<ExternalDatabaseConnection & {
21
20
  name: string;
22
21
  connectionStatus?: {
23
22
  successful: boolean;
24
23
  causeOfFailure: import("./data-v1-external-database-connection.universal").CauseOfFailure;
25
24
  hasCollections: import("./data-v1-external-database-connection.universal").CollectionsFound;
26
25
  } | undefined;
27
- protocolVersion: import("./data-v1-external-database-connection.universal").ProtocolVersion;
28
26
  capabilities?: {
29
27
  collectionModificationsSupported: boolean;
30
28
  fieldTypes: import("./data-v1-external-database-connection.universal").FieldType[];
@@ -37,12 +35,11 @@ export declare function updateExternalDatabaseConnection(httpClient: HttpClient)
37
35
  causeOfFailure: import("./data-v1-external-database-connection.universal").CauseOfFailure;
38
36
  hasCollections: import("./data-v1-external-database-connection.universal").CollectionsFound;
39
37
  } | undefined;
40
- protocolVersion: import("./data-v1-external-database-connection.universal").ProtocolVersion;
41
38
  capabilities?: {
42
39
  collectionModificationsSupported: boolean;
43
40
  fieldTypes: import("./data-v1-external-database-connection.universal").FieldType[];
44
41
  } | undefined;
45
42
  }>;
46
43
  export declare function deleteExternalDatabaseConnection(httpClient: HttpClient): (name: string) => Promise<void>;
47
- export { CauseOfFailure, CollectionsFound, FieldType, ProtocolVersion, } from './data-v1-external-database-connection.universal';
48
- export { ExternalDatabaseConnection, ConnectionStatus, Capabilities, GetExternalDatabaseConnectionRequest, GetExternalDatabaseConnectionResponse, ListExternalDatabaseConnectionsRequest, Paging, ListExternalDatabaseConnectionsResponse, PagingMetadata, CreateExternalDatabaseConnectionRequest, CreateExternalDatabaseConnectionResponse, UpdateExternalDatabaseConnectionRequest, UpdateExternalDatabaseConnectionResponse, DeleteExternalDatabaseConnectionRequest, DeleteExternalDatabaseConnectionResponse, GetExternalDatabaseConnectionResponseNonNullableFields, ListExternalDatabaseConnectionsResponseNonNullableFields, CreateExternalDatabaseConnectionResponseNonNullableFields, UpdateExternalDatabaseConnectionResponseNonNullableFields, ListExternalDatabaseConnectionsOptions, UpdateExternalDatabaseConnection, } from './data-v1-external-database-connection.universal';
44
+ export { CauseOfFailure, CollectionsFound, FieldType, ProtocolVersion, ConnectionType, } from './data-v1-external-database-connection.universal';
45
+ export { ExternalDatabaseConnection, ConnectionStatus, Capabilities, GetExternalDatabaseConnectionRequest, GetExternalDatabaseConnectionResponse, ListExternalDatabaseConnectionsRequest, Paging, ListExternalDatabaseConnectionsResponse, PagingMetadata, CreateExternalDatabaseConnectionRequest, CreateExternalDatabaseConnectionResponse, UpdateExternalDatabaseConnectionRequest, UpdateExternalDatabaseConnectionResponse, DeleteExternalDatabaseConnectionRequest, DeleteExternalDatabaseConnectionResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, GetExternalDatabaseConnectionResponseNonNullableFields, ListExternalDatabaseConnectionsResponseNonNullableFields, CreateExternalDatabaseConnectionResponseNonNullableFields, UpdateExternalDatabaseConnectionResponseNonNullableFields, ListExternalDatabaseConnectionsOptions, CreateExternalDatabaseConnectionOptions, UpdateExternalDatabaseConnection, } from './data-v1-external-database-connection.universal';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = exports.deleteExternalDatabaseConnection = exports.updateExternalDatabaseConnection = exports.createExternalDatabaseConnection = exports.listExternalDatabaseConnections = exports.getExternalDatabaseConnection = exports.__metadata = void 0;
3
+ exports.ConnectionType = exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = exports.deleteExternalDatabaseConnection = exports.updateExternalDatabaseConnection = exports.createExternalDatabaseConnection = exports.listExternalDatabaseConnections = exports.getExternalDatabaseConnection = exports.__metadata = void 0;
4
4
  const data_v1_external_database_connection_universal_1 = require("./data-v1-external-database-connection.universal");
5
5
  exports.__metadata = { PACKAGE_NAME: '@wix/data' };
6
6
  function getExternalDatabaseConnection(httpClient) {
@@ -16,7 +16,7 @@ function listExternalDatabaseConnections(httpClient) {
16
16
  }
17
17
  exports.listExternalDatabaseConnections = listExternalDatabaseConnections;
18
18
  function createExternalDatabaseConnection(httpClient) {
19
- return (externalDatabaseConnection) => (0, data_v1_external_database_connection_universal_1.createExternalDatabaseConnection)(externalDatabaseConnection,
19
+ return (externalDatabaseConnection, options) => (0, data_v1_external_database_connection_universal_1.createExternalDatabaseConnection)(externalDatabaseConnection, options,
20
20
  // @ts-ignore
21
21
  { httpClient });
22
22
  }
@@ -38,4 +38,5 @@ Object.defineProperty(exports, "CauseOfFailure", { enumerable: true, get: functi
38
38
  Object.defineProperty(exports, "CollectionsFound", { enumerable: true, get: function () { return data_v1_external_database_connection_universal_2.CollectionsFound; } });
39
39
  Object.defineProperty(exports, "FieldType", { enumerable: true, get: function () { return data_v1_external_database_connection_universal_2.FieldType; } });
40
40
  Object.defineProperty(exports, "ProtocolVersion", { enumerable: true, get: function () { return data_v1_external_database_connection_universal_2.ProtocolVersion; } });
41
+ Object.defineProperty(exports, "ConnectionType", { enumerable: true, get: function () { return data_v1_external_database_connection_universal_2.ConnectionType; } });
41
42
  //# sourceMappingURL=data-v1-external-database-connection.public.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-v1-external-database-connection.public.js","sourceRoot":"","sources":["../../../src/data-v1-external-database-connection.public.ts"],"names":[],"mappings":";;;AACA,qHAS0D;AAE7C,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,SAAgB,6BAA6B,CAAC,UAAsB;IAClE,OAAO,CAAC,IAAY,EAAE,EAAE,CACtB,IAAA,8EAAsC,EACpC,IAAI;IACJ,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sEAOC;AAED,SAAgB,+BAA+B,CAAC,UAAsB;IACpE,OAAO,CAAC,OAAgD,EAAE,EAAE,CAC1D,IAAA,gFAAwC,EACtC,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,0EAOC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CAAC,0BAAsD,EAAE,EAAE,CAChE,IAAA,iFAAyC,EACvC,0BAA0B;IAC1B,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,4EAOC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CACL,IAAY,EACZ,0BAA4D,EAC5D,EAAE,CACF,IAAA,iFAAyC,EACvC,IAAI,EACJ,0BAA0B;IAC1B,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAXD,4EAWC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CAAC,IAAY,EAAE,EAAE,CACtB,IAAA,iFAAyC,EACvC,IAAI;IACJ,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,4EAOC;AAED,mHAK0D;AAJxD,gJAAA,cAAc,OAAA;AACd,kJAAA,gBAAgB,OAAA;AAChB,2IAAA,SAAS,OAAA;AACT,iJAAA,eAAe,OAAA"}
1
+ {"version":3,"file":"data-v1-external-database-connection.public.js","sourceRoot":"","sources":["../../../src/data-v1-external-database-connection.public.ts"],"names":[],"mappings":";;;AACA,qHAU0D;AAE7C,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,SAAgB,6BAA6B,CAAC,UAAsB;IAClE,OAAO,CAAC,IAAY,EAAE,EAAE,CACtB,IAAA,8EAAsC,EACpC,IAAI;IACJ,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,sEAOC;AAED,SAAgB,+BAA+B,CAAC,UAAsB;IACpE,OAAO,CAAC,OAAgD,EAAE,EAAE,CAC1D,IAAA,gFAAwC,EACtC,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,0EAOC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CACL,0BAAsD,EACtD,OAAiD,EACjD,EAAE,CACF,IAAA,iFAAyC,EACvC,0BAA0B,EAC1B,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAXD,4EAWC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CACL,IAAY,EACZ,0BAA4D,EAC5D,EAAE,CACF,IAAA,iFAAyC,EACvC,IAAI,EACJ,0BAA0B;IAC1B,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAXD,4EAWC;AAED,SAAgB,gCAAgC,CAAC,UAAsB;IACrE,OAAO,CAAC,IAAY,EAAE,EAAE,CACtB,IAAA,iFAAyC,EACvC,IAAI;IACJ,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,4EAOC;AAED,mHAM0D;AALxD,gJAAA,cAAc,OAAA;AACd,kJAAA,gBAAgB,OAAA;AAChB,2IAAA,SAAS,OAAA;AACT,iJAAA,eAAe,OAAA;AACf,gJAAA,cAAc,OAAA"}
@@ -19,23 +19,11 @@ export interface ExternalDatabaseConnection {
19
19
  * @readonly
20
20
  */
21
21
  connectionStatus?: ConnectionStatus;
22
- /** The protocol version of the external database connection. */
23
- protocolVersion?: ProtocolVersion;
24
- /**
25
- * The public key used to validate requests to the external database. Applicable only when the protocol version is `V3`.
26
- * @readonly
27
- */
28
- publicKey?: string | null;
29
22
  /**
30
23
  * The external database's capabilities.
31
24
  * @readonly
32
25
  */
33
26
  capabilities?: Capabilities;
34
- /**
35
- * The application ID of the external database. Applicable only when the protocol version is `V3`.
36
- * @readonly
37
- */
38
- applicationId?: string | null;
39
27
  }
40
28
  export declare enum CauseOfFailure {
41
29
  /** No connection failure. */
@@ -45,7 +33,9 @@ export declare enum CauseOfFailure {
45
33
  /** External database host is unreachable. */
46
34
  DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
47
35
  /** Unauthorized to access external database. */
48
- UNAUTHORIZED = "UNAUTHORIZED"
36
+ UNAUTHORIZED = "UNAUTHORIZED",
37
+ /** `Endpoint` property is not set. */
38
+ DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
49
39
  }
50
40
  export declare enum CollectionsFound {
51
41
  UNKNOWN = "UNKNOWN",
@@ -97,11 +87,12 @@ export interface ConnectionStatus {
97
87
  /** Whether the connection was established successfully. */
98
88
  successful?: boolean;
99
89
  /**
100
- * Reason for the failure, if a connection isn't established successfully.
90
+ * If and why a connection attempt failed.
101
91
  * + `NONE`: No connection failure.
102
92
  * + `COMMUNICATION_FAILURE`: General communication failure.
103
93
  * + `DESTINATION_HOST_UNREACHABLE`: External database host is unreachable.
104
94
  * + `UNAUTHORIZED`: Unauthorized to access external database.
95
+ * + `DESTINATION_ENDPOINT_NOT_DEFINED`: `Endpoint` property is not set.
105
96
  */
106
97
  causeOfFailure?: CauseOfFailure;
107
98
  /**
@@ -165,6 +156,23 @@ export interface PagingMetadata {
165
156
  export interface CreateExternalDatabaseConnectionRequest {
166
157
  /** External database connection details. */
167
158
  externalDatabaseConnection: ExternalDatabaseConnection;
159
+ /** Connection type. */
160
+ connectionType?: ConnectionType;
161
+ }
162
+ export declare enum ConnectionType {
163
+ /** Unknown connection type. */
164
+ UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
165
+ /**
166
+ * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
167
+ * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
168
+ */
169
+ STANDALONE = "STANDALONE",
170
+ /**
171
+ * Connection to database adapter that implements External Database SPI (protocol version 3)
172
+ * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
173
+ * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
174
+ */
175
+ WIX_SPI = "WIX_SPI"
168
176
  }
169
177
  export interface CreateExternalDatabaseConnectionResponse {
170
178
  /** Details of external database connection created. */
@@ -184,6 +192,73 @@ export interface DeleteExternalDatabaseConnectionRequest {
184
192
  }
185
193
  export interface DeleteExternalDatabaseConnectionResponse {
186
194
  }
195
+ export interface DomainEvent extends DomainEventBodyOneOf {
196
+ createdEvent?: EntityCreatedEvent;
197
+ updatedEvent?: EntityUpdatedEvent;
198
+ deletedEvent?: EntityDeletedEvent;
199
+ actionEvent?: ActionEvent;
200
+ /**
201
+ * Unique event ID.
202
+ * Allows clients to ignore duplicate webhooks.
203
+ */
204
+ id?: string;
205
+ /**
206
+ * Assumes actions are also always typed to an entity_type
207
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
208
+ */
209
+ entityFqdn?: string;
210
+ /**
211
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
212
+ * This is although the created/updated/deleted notion is duplication of the oneof types
213
+ * Example: created/updated/deleted/started/completed/email_opened
214
+ */
215
+ slug?: string;
216
+ /** ID of the entity associated with the event. */
217
+ entityId?: string;
218
+ /** Event timestamp. */
219
+ eventTime?: Date;
220
+ /**
221
+ * Whether the event was triggered as a result of a privacy regulation application
222
+ * (for example, GDPR).
223
+ */
224
+ triggeredByAnonymizeRequest?: boolean | null;
225
+ /** If present, indicates the action that triggered the event. */
226
+ originatedFrom?: string | null;
227
+ /**
228
+ * A sequence number defining the order of updates to the underlying entity.
229
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
230
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
231
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
232
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
233
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
234
+ */
235
+ entityEventSequence?: string | null;
236
+ }
237
+ /** @oneof */
238
+ export interface DomainEventBodyOneOf {
239
+ createdEvent?: EntityCreatedEvent;
240
+ updatedEvent?: EntityUpdatedEvent;
241
+ deletedEvent?: EntityDeletedEvent;
242
+ actionEvent?: ActionEvent;
243
+ }
244
+ export interface EntityCreatedEvent {
245
+ entityAsJson?: string;
246
+ }
247
+ export interface EntityUpdatedEvent {
248
+ /**
249
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
250
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
251
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
252
+ */
253
+ currentEntityAsJson?: string;
254
+ }
255
+ export interface EntityDeletedEvent {
256
+ /** Entity that was deleted */
257
+ deletedEntityAsJson?: string | null;
258
+ }
259
+ export interface ActionEvent {
260
+ bodyAsJson?: string;
261
+ }
187
262
  export interface GetExternalDatabaseConnectionResponseNonNullableFields {
188
263
  externalDatabaseConnection?: {
189
264
  name: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = void 0;
3
+ exports.ConnectionType = exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = void 0;
4
4
  var CauseOfFailure;
5
5
  (function (CauseOfFailure) {
6
6
  /** No connection failure. */
@@ -11,6 +11,8 @@ var CauseOfFailure;
11
11
  CauseOfFailure["DESTINATION_HOST_UNREACHABLE"] = "DESTINATION_HOST_UNREACHABLE";
12
12
  /** Unauthorized to access external database. */
13
13
  CauseOfFailure["UNAUTHORIZED"] = "UNAUTHORIZED";
14
+ /** `Endpoint` property is not set. */
15
+ CauseOfFailure["DESTINATION_ENDPOINT_NOT_DEFINED"] = "DESTINATION_ENDPOINT_NOT_DEFINED";
14
16
  })(CauseOfFailure || (exports.CauseOfFailure = CauseOfFailure = {}));
15
17
  var CollectionsFound;
16
18
  (function (CollectionsFound) {
@@ -67,4 +69,20 @@ var ProtocolVersion;
67
69
  ProtocolVersion["V2"] = "V2";
68
70
  ProtocolVersion["V3"] = "V3";
69
71
  })(ProtocolVersion || (exports.ProtocolVersion = ProtocolVersion = {}));
72
+ var ConnectionType;
73
+ (function (ConnectionType) {
74
+ /** Unknown connection type. */
75
+ ConnectionType["UNKNOWN_CONNECTION_TYPE"] = "UNKNOWN_CONNECTION_TYPE";
76
+ /**
77
+ * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
78
+ * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
79
+ */
80
+ ConnectionType["STANDALONE"] = "STANDALONE";
81
+ /**
82
+ * Connection to database adapter that implements External Database SPI (protocol version 3)
83
+ * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
84
+ * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
85
+ */
86
+ ConnectionType["WIX_SPI"] = "WIX_SPI";
87
+ })(ConnectionType || (exports.ConnectionType = ConnectionType = {}));
70
88
  //# sourceMappingURL=data-v1-external-database-connection.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-v1-external-database-connection.types.js","sourceRoot":"","sources":["../../../src/data-v1-external-database-connection.types.ts"],"names":[],"mappings":";;;AAwCA,IAAY,cASX;AATD,WAAY,cAAc;IACxB,6BAA6B;IAC7B,+BAAa,CAAA;IACb,qCAAqC;IACrC,iEAA+C,CAAA;IAC/C,6CAA6C;IAC7C,+EAA6D,CAAA;IAC7D,gDAAgD;IAChD,+CAA6B,CAAA;AAC/B,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAED,IAAY,SAwCX;AAxCD,WAAY,SAAS;IACnB,sDAAyC,CAAA;IACzC,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,kCAAqB,CAAA;IACrB,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;IACrB,wBAAW,CAAA;IACX,oCAAuB,CAAA;IACvB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0CAA6B,CAAA;IAC7B,8CAAiC,CAAA;IACjC,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,kCAAqB,CAAA;IACrB,0CAA6B,CAAA;IAC7B,4CAA+B,CAAA;IAC/B,gCAAmB,CAAA;IACnB,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,gDAAmC,CAAA;IACnC,8BAAiB,CAAA;IACjB,4BAAe,CAAA;IACf,wFAAwF;IACxF,wCAA2B,CAAA;IAC3B,wFAAwF;IACxF,wCAA2B,CAAA;IAC3B,wFAAwF;IACxF,wDAA2C,CAAA;IAC3C,wFAAwF;IACxF,gEAAmD,CAAA;IACnD,wFAAwF;IACxF,0CAA6B,CAAA;IAC7B,wFAAwF;IACxF,0CAA6B,CAAA;IAC7B,wFAAwF;IACxF,4DAA+C,CAAA;AACjD,CAAC,EAxCW,SAAS,yBAAT,SAAS,QAwCpB;AAuBD,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;AACX,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
1
+ {"version":3,"file":"data-v1-external-database-connection.types.js","sourceRoot":"","sources":["../../../src/data-v1-external-database-connection.types.ts"],"names":[],"mappings":";;;AA4BA,IAAY,cAWX;AAXD,WAAY,cAAc;IACxB,6BAA6B;IAC7B,+BAAa,CAAA;IACb,qCAAqC;IACrC,iEAA+C,CAAA;IAC/C,6CAA6C;IAC7C,+EAA6D,CAAA;IAC7D,gDAAgD;IAChD,+CAA6B,CAAA;IAC7B,sCAAsC;IACtC,uFAAqE,CAAA;AACvE,CAAC,EAXW,cAAc,8BAAd,cAAc,QAWzB;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,+BAAW,CAAA;IACX,6BAAS,CAAA;AACX,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAED,IAAY,SAwCX;AAxCD,WAAY,SAAS;IACnB,sDAAyC,CAAA;IACzC,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,kCAAqB,CAAA;IACrB,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;IACrB,wBAAW,CAAA;IACX,oCAAuB,CAAA;IACvB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0CAA6B,CAAA;IAC7B,8CAAiC,CAAA;IACjC,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,kCAAqB,CAAA;IACrB,0CAA6B,CAAA;IAC7B,4CAA+B,CAAA;IAC/B,gCAAmB,CAAA;IACnB,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,gDAAmC,CAAA;IACnC,8BAAiB,CAAA;IACjB,4BAAe,CAAA;IACf,wFAAwF;IACxF,wCAA2B,CAAA;IAC3B,wFAAwF;IACxF,wCAA2B,CAAA;IAC3B,wFAAwF;IACxF,wDAA2C,CAAA;IAC3C,wFAAwF;IACxF,gEAAmD,CAAA;IACnD,wFAAwF;IACxF,0CAA6B,CAAA;IAC7B,wFAAwF;IACxF,0CAA6B,CAAA;IAC7B,wFAAwF;IACxF,4DAA+C,CAAA;AACjD,CAAC,EAxCW,SAAS,yBAAT,SAAS,QAwCpB;AAwBD,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;AACX,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AA2DD,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB,+BAA+B;IAC/B,qEAAmD,CAAA;IACnD;;;OAGG;IACH,2CAAyB,CAAA;IACzB;;;;OAIG;IACH,qCAAmB,CAAA;AACrB,CAAC,EAdW,cAAc,8BAAd,cAAc,QAczB"}
@@ -25,27 +25,11 @@ export interface ExternalDatabaseConnection {
25
25
  * @readonly
26
26
  */
27
27
  connectionStatus?: ConnectionStatus;
28
- /**
29
- * The protocol version of the external database connection.
30
- *
31
- * Supported values: `V1`, `V2`, `V3`.
32
- */
33
- protocolVersion?: ProtocolVersion;
34
- /**
35
- * The public key used to validate requests to the external database. Applicable only when the protocol version is `V3`.
36
- * @readonly
37
- */
38
- publicKey?: string | null;
39
28
  /**
40
29
  * The external database's capabilities.
41
30
  * @readonly
42
31
  */
43
32
  capabilities?: Capabilities;
44
- /**
45
- * The application ID of the external database. Applicable only when the protocol version is `V3`.
46
- * @readonly
47
- */
48
- applicationId?: string | null;
49
33
  }
50
34
  export declare enum CauseOfFailure {
51
35
  /** No connection failure. */
@@ -55,7 +39,9 @@ export declare enum CauseOfFailure {
55
39
  /** External database host is unreachable. */
56
40
  DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
57
41
  /** Unauthorized to access external database. */
58
- UNAUTHORIZED = "UNAUTHORIZED"
42
+ UNAUTHORIZED = "UNAUTHORIZED",
43
+ /** `Endpoint` property is not set. */
44
+ DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
59
45
  }
60
46
  export declare enum CollectionsFound {
61
47
  UNKNOWN = "UNKNOWN",
@@ -107,11 +93,12 @@ export interface ConnectionStatus {
107
93
  /** Whether the connection was established successfully. */
108
94
  successful?: boolean;
109
95
  /**
110
- * Reason for the failure, if a connection isn't established successfully.
96
+ * If and why a connection attempt failed.
111
97
  * + `NONE`: No connection failure.
112
98
  * + `COMMUNICATION_FAILURE`: General communication failure.
113
99
  * + `DESTINATION_HOST_UNREACHABLE`: External database host is unreachable.
114
100
  * + `UNAUTHORIZED`: Unauthorized to access external database.
101
+ * + `DESTINATION_ENDPOINT_NOT_DEFINED`: `Endpoint` property is not set.
115
102
  */
116
103
  causeOfFailure?: CauseOfFailure;
117
104
  /**
@@ -175,6 +162,23 @@ export interface PagingMetadata {
175
162
  export interface CreateExternalDatabaseConnectionRequest {
176
163
  /** External database connection details. */
177
164
  externalDatabaseConnection: ExternalDatabaseConnection;
165
+ /** Connection type. */
166
+ connectionType?: ConnectionType;
167
+ }
168
+ export declare enum ConnectionType {
169
+ /** Unknown connection type. */
170
+ UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
171
+ /**
172
+ * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
173
+ * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
174
+ */
175
+ STANDALONE = "STANDALONE",
176
+ /**
177
+ * Connection to database adapter that implements External Database SPI (protocol version 3)
178
+ * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
179
+ * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
180
+ */
181
+ WIX_SPI = "WIX_SPI"
178
182
  }
179
183
  export interface CreateExternalDatabaseConnectionResponse {
180
184
  /** Details of external database connection created. */
@@ -194,6 +198,73 @@ export interface DeleteExternalDatabaseConnectionRequest {
194
198
  }
195
199
  export interface DeleteExternalDatabaseConnectionResponse {
196
200
  }
201
+ export interface DomainEvent extends DomainEventBodyOneOf {
202
+ createdEvent?: EntityCreatedEvent;
203
+ updatedEvent?: EntityUpdatedEvent;
204
+ deletedEvent?: EntityDeletedEvent;
205
+ actionEvent?: ActionEvent;
206
+ /**
207
+ * Unique event ID.
208
+ * Allows clients to ignore duplicate webhooks.
209
+ */
210
+ _id?: string;
211
+ /**
212
+ * Assumes actions are also always typed to an entity_type
213
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
214
+ */
215
+ entityFqdn?: string;
216
+ /**
217
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
218
+ * This is although the created/updated/deleted notion is duplication of the oneof types
219
+ * Example: created/updated/deleted/started/completed/email_opened
220
+ */
221
+ slug?: string;
222
+ /** ID of the entity associated with the event. */
223
+ entityId?: string;
224
+ /** Event timestamp. */
225
+ eventTime?: Date;
226
+ /**
227
+ * Whether the event was triggered as a result of a privacy regulation application
228
+ * (for example, GDPR).
229
+ */
230
+ triggeredByAnonymizeRequest?: boolean | null;
231
+ /** If present, indicates the action that triggered the event. */
232
+ originatedFrom?: string | null;
233
+ /**
234
+ * A sequence number defining the order of updates to the underlying entity.
235
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
236
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
237
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
238
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
239
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
240
+ */
241
+ entityEventSequence?: string | null;
242
+ }
243
+ /** @oneof */
244
+ export interface DomainEventBodyOneOf {
245
+ createdEvent?: EntityCreatedEvent;
246
+ updatedEvent?: EntityUpdatedEvent;
247
+ deletedEvent?: EntityDeletedEvent;
248
+ actionEvent?: ActionEvent;
249
+ }
250
+ export interface EntityCreatedEvent {
251
+ entityAsJson?: string;
252
+ }
253
+ export interface EntityUpdatedEvent {
254
+ /**
255
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
256
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
257
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
258
+ */
259
+ currentEntityAsJson?: string;
260
+ }
261
+ export interface EntityDeletedEvent {
262
+ /** Entity that was deleted */
263
+ deletedEntityAsJson?: string | null;
264
+ }
265
+ export interface ActionEvent {
266
+ bodyAsJson?: string;
267
+ }
197
268
  export interface GetExternalDatabaseConnectionResponseNonNullableFields {
198
269
  externalDatabaseConnection?: {
199
270
  name: string;
@@ -202,7 +273,6 @@ export interface GetExternalDatabaseConnectionResponseNonNullableFields {
202
273
  causeOfFailure: CauseOfFailure;
203
274
  hasCollections: CollectionsFound;
204
275
  };
205
- protocolVersion: ProtocolVersion;
206
276
  capabilities?: {
207
277
  collectionModificationsSupported: boolean;
208
278
  fieldTypes: FieldType[];
@@ -217,7 +287,6 @@ export interface ListExternalDatabaseConnectionsResponseNonNullableFields {
217
287
  causeOfFailure: CauseOfFailure;
218
288
  hasCollections: CollectionsFound;
219
289
  };
220
- protocolVersion: ProtocolVersion;
221
290
  capabilities?: {
222
291
  collectionModificationsSupported: boolean;
223
292
  fieldTypes: FieldType[];
@@ -232,7 +301,6 @@ export interface CreateExternalDatabaseConnectionResponseNonNullableFields {
232
301
  causeOfFailure: CauseOfFailure;
233
302
  hasCollections: CollectionsFound;
234
303
  };
235
- protocolVersion: ProtocolVersion;
236
304
  capabilities?: {
237
305
  collectionModificationsSupported: boolean;
238
306
  fieldTypes: FieldType[];
@@ -247,7 +315,6 @@ export interface UpdateExternalDatabaseConnectionResponseNonNullableFields {
247
315
  causeOfFailure: CauseOfFailure;
248
316
  hasCollections: CollectionsFound;
249
317
  };
250
- protocolVersion: ProtocolVersion;
251
318
  capabilities?: {
252
319
  collectionModificationsSupported: boolean;
253
320
  fieldTypes: FieldType[];
@@ -292,7 +359,11 @@ export interface ListExternalDatabaseConnectionsOptions {
292
359
  * @applicableIdentity APP
293
360
  * @returns Details of external database connection created.
294
361
  */
295
- export declare function createExternalDatabaseConnection(externalDatabaseConnection: ExternalDatabaseConnection): Promise<ExternalDatabaseConnection & NonNullable<CreateExternalDatabaseConnectionResponseNonNullableFields>['externalDatabaseConnection']>;
362
+ export declare function createExternalDatabaseConnection(externalDatabaseConnection: ExternalDatabaseConnection, options?: CreateExternalDatabaseConnectionOptions): Promise<ExternalDatabaseConnection & NonNullable<CreateExternalDatabaseConnectionResponseNonNullableFields>['externalDatabaseConnection']>;
363
+ export interface CreateExternalDatabaseConnectionOptions {
364
+ /** Connection type. */
365
+ connectionType?: ConnectionType;
366
+ }
296
367
  /**
297
368
  * Updates an external database connection.
298
369
  *
@@ -329,27 +400,11 @@ export interface UpdateExternalDatabaseConnection {
329
400
  * @readonly
330
401
  */
331
402
  connectionStatus?: ConnectionStatus;
332
- /**
333
- * The protocol version of the external database connection.
334
- *
335
- * Supported values: `V1`, `V2`, `V3`.
336
- */
337
- protocolVersion?: ProtocolVersion;
338
- /**
339
- * The public key used to validate requests to the external database. Applicable only when the protocol version is `V3`.
340
- * @readonly
341
- */
342
- publicKey?: string | null;
343
403
  /**
344
404
  * The external database's capabilities.
345
405
  * @readonly
346
406
  */
347
407
  capabilities?: Capabilities;
348
- /**
349
- * The application ID of the external database. Applicable only when the protocol version is `V3`.
350
- * @readonly
351
- */
352
- applicationId?: string | null;
353
408
  }
354
409
  /**
355
410
  * Deletes an external database connection.
@@ -32,8 +32,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.deleteExternalDatabaseConnection = exports.updateExternalDatabaseConnection = exports.createExternalDatabaseConnection = exports.listExternalDatabaseConnections = exports.getExternalDatabaseConnection = exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = exports.__debug = void 0;
35
+ exports.deleteExternalDatabaseConnection = exports.updateExternalDatabaseConnection = exports.createExternalDatabaseConnection = exports.listExternalDatabaseConnections = exports.getExternalDatabaseConnection = exports.ConnectionType = exports.ProtocolVersion = exports.FieldType = exports.CollectionsFound = exports.CauseOfFailure = exports.__debug = void 0;
36
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
37
38
  const ambassadorWixDataV1ExternalDatabaseConnection = __importStar(require("./data-v1-external-database-connection.http"));
38
39
  let __verbose = false;
39
40
  function __log(...args) {
@@ -60,6 +61,8 @@ var CauseOfFailure;
60
61
  CauseOfFailure["DESTINATION_HOST_UNREACHABLE"] = "DESTINATION_HOST_UNREACHABLE";
61
62
  /** Unauthorized to access external database. */
62
63
  CauseOfFailure["UNAUTHORIZED"] = "UNAUTHORIZED";
64
+ /** `Endpoint` property is not set. */
65
+ CauseOfFailure["DESTINATION_ENDPOINT_NOT_DEFINED"] = "DESTINATION_ENDPOINT_NOT_DEFINED";
63
66
  })(CauseOfFailure || (exports.CauseOfFailure = CauseOfFailure = {}));
64
67
  var CollectionsFound;
65
68
  (function (CollectionsFound) {
@@ -116,6 +119,22 @@ var ProtocolVersion;
116
119
  ProtocolVersion["V2"] = "V2";
117
120
  ProtocolVersion["V3"] = "V3";
118
121
  })(ProtocolVersion || (exports.ProtocolVersion = ProtocolVersion = {}));
122
+ var ConnectionType;
123
+ (function (ConnectionType) {
124
+ /** Unknown connection type. */
125
+ ConnectionType["UNKNOWN_CONNECTION_TYPE"] = "UNKNOWN_CONNECTION_TYPE";
126
+ /**
127
+ * Connection to database adapter that implements legacy External Database Collections SPI (protocol version 1 or 2)
128
+ * https://www.wix.com/velo/reference/spis/external-database-collections/introduction
129
+ */
130
+ ConnectionType["STANDALONE"] = "STANDALONE";
131
+ /**
132
+ * Connection to database adapter that implements External Database SPI (protocol version 3)
133
+ * https://dev.wix.com/docs/rest/internal-only/wix-data/external-database-spi/introduction
134
+ * https://dev.wix.com/docs/rest/articles/getting-started/service-provider-interface
135
+ */
136
+ ConnectionType["WIX_SPI"] = "WIX_SPI";
137
+ })(ConnectionType || (exports.ConnectionType = ConnectionType = {}));
119
138
  const _createExternalDatabaseConnectionRequest = {};
120
139
  const _createExternalDatabaseConnectionResponse = {};
121
140
  const _deleteExternalDatabaseConnectionRequest = {};
@@ -171,9 +190,11 @@ function getExternalDatabaseConnection(name) {
171
190
  return fromJSON(result.data);
172
191
  }
173
192
  catch (err) {
174
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
175
- 'name',
176
- ]);
193
+ const transformedError = (0, transform_error_1.transformError)(err, {
194
+ spreadPathsToArguments: {},
195
+ explicitPathsToArguments: { name: '$[0]' },
196
+ singleArgumentUnchanged: false,
197
+ }, ['name']);
177
198
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
178
199
  throw transformedError;
179
200
  }
@@ -222,9 +243,11 @@ function listExternalDatabaseConnections(options) {
222
243
  return fromJSON(result.data);
223
244
  }
224
245
  catch (err) {
225
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
226
- 'options',
227
- ]);
246
+ const transformedError = (0, transform_error_1.transformError)(err, {
247
+ spreadPathsToArguments: {},
248
+ explicitPathsToArguments: { paging: '$[0].paging' },
249
+ singleArgumentUnchanged: false,
250
+ }, ['options']);
228
251
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
229
252
  throw transformedError;
230
253
  }
@@ -246,13 +269,16 @@ exports.listExternalDatabaseConnections = listExternalDatabaseConnections;
246
269
  * @applicableIdentity APP
247
270
  * @returns Details of external database connection created.
248
271
  */
249
- function createExternalDatabaseConnection(externalDatabaseConnection) {
272
+ function createExternalDatabaseConnection(externalDatabaseConnection, options) {
250
273
  var _a, _b, _c;
251
274
  return __awaiter(this, arguments, void 0, function* () {
252
- const requestTransformation = { externalDatabaseConnection: '$[0]' };
275
+ const requestTransformation = {
276
+ externalDatabaseConnection: '$[0]',
277
+ connectionType: '$[1].connectionType',
278
+ };
253
279
  const responseTransformation = '$.externalDatabaseConnection';
254
280
  // @ts-ignore
255
- const { httpClient, sideEffects } = arguments[1];
281
+ const { httpClient, sideEffects } = arguments[2];
256
282
  const { toAmbassadorRequest } = (0, velo_1.serializer)({
257
283
  rootSchema: _createExternalDatabaseConnectionRequest,
258
284
  depSchemas: {},
@@ -271,7 +297,7 @@ function createExternalDatabaseConnection(externalDatabaseConnection) {
271
297
  },
272
298
  customTransformation: responseTransformation,
273
299
  });
274
- const payload = toAmbassadorRequest([externalDatabaseConnection]);
300
+ const payload = toAmbassadorRequest([externalDatabaseConnection, options]);
275
301
  const reqOpts = ambassadorWixDataV1ExternalDatabaseConnection.createExternalDatabaseConnection(payload);
276
302
  __log(`"CreateExternalDatabaseConnection" sending request with: ${__inspect(reqOpts)}`);
277
303
  (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
@@ -281,9 +307,14 @@ function createExternalDatabaseConnection(externalDatabaseConnection) {
281
307
  return fromJSON(result.data);
282
308
  }
283
309
  catch (err) {
284
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
285
- 'externalDatabaseConnection',
286
- ]);
310
+ const transformedError = (0, transform_error_1.transformError)(err, {
311
+ spreadPathsToArguments: {},
312
+ explicitPathsToArguments: {
313
+ externalDatabaseConnection: '$[0]',
314
+ connectionType: '$[1].connectionType',
315
+ },
316
+ singleArgumentUnchanged: false,
317
+ }, ['externalDatabaseConnection', 'options']);
287
318
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
288
319
  throw transformedError;
289
320
  }
@@ -348,10 +379,11 @@ function updateExternalDatabaseConnection(name, externalDatabaseConnection) {
348
379
  return fromJSON(result.data);
349
380
  }
350
381
  catch (err) {
351
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
352
- 'name',
353
- 'externalDatabaseConnection',
354
- ]);
382
+ const transformedError = (0, transform_error_1.transformError)(err, {
383
+ spreadPathsToArguments: { externalDatabaseConnection: '$[1]' },
384
+ explicitPathsToArguments: { 'externalDatabaseConnection.name': '$[0]' },
385
+ singleArgumentUnchanged: false,
386
+ }, ['name', 'externalDatabaseConnection']);
355
387
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
356
388
  throw transformedError;
357
389
  }
@@ -403,9 +435,11 @@ function deleteExternalDatabaseConnection(name) {
403
435
  (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
404
436
  }
405
437
  catch (err) {
406
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
407
- 'name',
408
- ]);
438
+ const transformedError = (0, transform_error_1.transformError)(err, {
439
+ spreadPathsToArguments: {},
440
+ explicitPathsToArguments: { name: '$[0]' },
441
+ singleArgumentUnchanged: false,
442
+ }, ['name']);
409
443
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
410
444
  throw transformedError;
411
445
  }