@wix/auto_sdk_data_external-database-connections 1.0.16 → 1.0.17

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { E as ExternalDatabaseConnection, L as ListExternalDatabaseConnectionsOptions, a as ListExternalDatabaseConnectionsResponse, C as ConnectionTypeWithLiterals, U as UpdateExternalDatabaseConnection } from './data-v1-external-database-connection-external-database-connections.universal-DDx0w2iE.js';
3
- export { A as ActionEvent, f as Capabilities, b as CauseOfFailure, c as CollectionsFound, e as ConnectionStatus, d as ConnectionType, k as CreateExternalDatabaseConnectionRequest, l as CreateExternalDatabaseConnectionResponse, D as DeleteExternalDatabaseConnectionRequest, o as DeleteExternalDatabaseConnectionResponse, p as DomainEvent, q as DomainEventBodyOneOf, r as EntityCreatedEvent, t as EntityDeletedEvent, s as EntityUpdatedEvent, F as FieldType, G as GetExternalDatabaseConnectionRequest, g as GetExternalDatabaseConnectionResponse, I as IdentificationData, u as IdentificationDataIdOneOf, h as ListExternalDatabaseConnectionsRequest, M as MessageEnvelope, i as Paging, j as PagingMetadata, P as ProtocolVersion, R as RestoreInfo, m as UpdateExternalDatabaseConnectionRequest, n as UpdateExternalDatabaseConnectionResponse, W as WebhookIdentityType } from './data-v1-external-database-connection-external-database-connections.universal-DDx0w2iE.js';
2
+ import { ExternalDatabaseConnection, ListExternalDatabaseConnectionsOptions, ListExternalDatabaseConnectionsResponse, ConnectionTypeWithLiterals, UpdateExternalDatabaseConnection } from './index.typings.js';
3
+ export { ActionEvent, Capabilities, CauseOfFailure, CollectionsFound, ConnectionStatus, ConnectionType, CreateExternalDatabaseConnectionRequest, CreateExternalDatabaseConnectionResponse, DeleteExternalDatabaseConnectionRequest, DeleteExternalDatabaseConnectionResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FieldType, GetExternalDatabaseConnectionRequest, GetExternalDatabaseConnectionResponse, IdentificationData, IdentificationDataIdOneOf, ListExternalDatabaseConnectionsRequest, MessageEnvelope, Paging, PagingMetadata, ProtocolVersion, RestoreInfo, UpdateExternalDatabaseConnectionRequest, UpdateExternalDatabaseConnectionResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function getExternalDatabaseConnection$1(httpClient: HttpClient): GetExternalDatabaseConnectionSignature;
6
6
  interface GetExternalDatabaseConnectionSignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /** An external database connection defines a connection between an external database and a Wix site. */
2
4
  interface ExternalDatabaseConnection {
3
5
  /**
@@ -121,6 +123,8 @@ declare enum ProtocolVersion {
121
123
  V2 = "V2",
122
124
  V3 = "V3"
123
125
  }
126
+ /** @enumType */
127
+ type ProtocolVersionWithLiterals = ProtocolVersion | 'UNKNOWN_PROTOCOL_VERSION' | 'V1' | 'V2' | 'V3';
124
128
  interface Capabilities {
125
129
  /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
126
130
  collectionModificationsSupported?: boolean;
@@ -338,10 +342,67 @@ declare enum WebhookIdentityType {
338
342
  }
339
343
  /** @enumType */
340
344
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
345
+ type ExternalDatabaseConnectionNonNullablePaths = `name` | `connectionStatus.successful` | `connectionStatus.causeOfFailure` | `connectionStatus.hasCollections` | `capabilities.collectionModificationsSupported` | `capabilities.fieldTypes`;
346
+ /**
347
+ * Retrieves the specified external database connection.
348
+ * @param name - Name of the external database connection to retrieve.
349
+ * @public
350
+ * @requiredField name
351
+ * @permissionId WIX_DATA.GET_EXTERNAL_DATABASE_CONNECTION
352
+ * @applicableIdentity APP
353
+ * @returns Details of the retrieved external database connection.
354
+ * @fqn com.wixpress.cloud.data.api.externaldatabase.ExternalDatabaseConnectionService.GetExternalDatabaseConnection
355
+ */
356
+ declare function getExternalDatabaseConnection(name: string): Promise<NonNullablePaths<ExternalDatabaseConnection, ExternalDatabaseConnectionNonNullablePaths>>;
357
+ /**
358
+ * Lists all of the site's external database connections of all adaptor types.
359
+ * @public
360
+ * @permissionId WIX_DATA.LIST_EXTERNAL_DATABASE_CONNECTIONS
361
+ * @applicableIdentity APP
362
+ * @fqn com.wixpress.cloud.data.api.externaldatabase.ExternalDatabaseConnectionService.ListExternalDatabaseConnections
363
+ */
364
+ declare function listExternalDatabaseConnections(options?: ListExternalDatabaseConnectionsOptions): Promise<NonNullablePaths<ListExternalDatabaseConnectionsResponse, {
365
+ [P in ExternalDatabaseConnectionNonNullablePaths]: `externalDatabaseConnections.${number}.${P}`;
366
+ }[ExternalDatabaseConnectionNonNullablePaths]>>;
341
367
  interface ListExternalDatabaseConnectionsOptions {
342
368
  /** Paging metadata. */
343
369
  paging?: Paging;
344
370
  }
371
+ /**
372
+ * Creates a new external database connection.
373
+ *
374
+ * Before you can establish a connection between a site and an external database, you must prepare an external database adaptor.
375
+ * @param externalDatabaseConnection - External database connection details.
376
+ * @param connectionType - Connection type. The connection type specifies the type of adaptor by which the external collection is integrated with the site.
377
+ * @public
378
+ * @requiredField connectionType
379
+ * @requiredField externalDatabaseConnection
380
+ * @requiredField externalDatabaseConnection.name
381
+ * @param options - Options for creating an external database connection.
382
+ * @permissionId WIX_DATA.CREATE_EXTERNAL_DATABASE_CONNECTION
383
+ * @applicableIdentity APP
384
+ * @returns Details of the created external database connection.
385
+ * @fqn com.wixpress.cloud.data.api.externaldatabase.ExternalDatabaseConnectionService.CreateExternalDatabaseConnection
386
+ */
387
+ declare function createExternalDatabaseConnection(externalDatabaseConnection: NonNullablePaths<ExternalDatabaseConnection, `name`>, connectionType: ConnectionTypeWithLiterals): Promise<NonNullablePaths<ExternalDatabaseConnection, ExternalDatabaseConnectionNonNullablePaths>>;
388
+ /**
389
+ * Updates an external database connection.
390
+ *
391
+ * > **Note:** After an external database connection is updated, it only contains the values provided in the request. All previous values are lost.
392
+ * @param name - Name of the external database connection.
393
+ *
394
+ * An external database connection can connect to one or more external data collections or tables. These appear as `connectionName/dataCollectionId`.
395
+ * @public
396
+ * @requiredField externalDatabaseConnection
397
+ * @requiredField name
398
+ * @param options - Options for updating an external database connection.
399
+ * @param externalDatabaseConnection - Updated external database connection details. The existing connection is replaced with this version.
400
+ * @permissionId WIX_DATA.UPDATE_EXTERNAL_DATABASE_CONNECTION
401
+ * @applicableIdentity APP
402
+ * @returns Details of the updated external database connection.
403
+ * @fqn com.wixpress.cloud.data.api.externaldatabase.ExternalDatabaseConnectionService.UpdateExternalDatabaseConnection
404
+ */
405
+ declare function updateExternalDatabaseConnection(name: string, externalDatabaseConnection: UpdateExternalDatabaseConnection): Promise<NonNullablePaths<ExternalDatabaseConnection, ExternalDatabaseConnectionNonNullablePaths>>;
345
406
  interface UpdateExternalDatabaseConnection {
346
407
  /**
347
408
  * Base URL for accessing and managing data in the external database. For example: `https://example.com/my-external-database`.
@@ -371,5 +432,17 @@ interface UpdateExternalDatabaseConnection {
371
432
  */
372
433
  capabilities?: Capabilities;
373
434
  }
435
+ /**
436
+ * Deletes an external database connection.
437
+ *
438
+ * > **Note:** Once an external database connection is deleted, it can't be restored. To reconnect the database, create a new external database connection.
439
+ * @param name - Name of the external database connection to delete.
440
+ * @public
441
+ * @requiredField name
442
+ * @permissionId WIX_DATA.DELETE_EXTERNAL_DATABASE_CONNECTION
443
+ * @applicableIdentity APP
444
+ * @fqn com.wixpress.cloud.data.api.externaldatabase.ExternalDatabaseConnectionService.DeleteExternalDatabaseConnection
445
+ */
446
+ declare function deleteExternalDatabaseConnection(name: string): Promise<void>;
374
447
 
375
- export { type ActionEvent as A, type ConnectionTypeWithLiterals as C, type DeleteExternalDatabaseConnectionRequest as D, type ExternalDatabaseConnection as E, FieldType as F, type GetExternalDatabaseConnectionRequest as G, type IdentificationData as I, type ListExternalDatabaseConnectionsOptions as L, type MessageEnvelope as M, ProtocolVersion as P, type RestoreInfo as R, type UpdateExternalDatabaseConnection as U, WebhookIdentityType as W, type ListExternalDatabaseConnectionsResponse as a, CauseOfFailure as b, CollectionsFound as c, ConnectionType as d, type ConnectionStatus as e, type Capabilities as f, type GetExternalDatabaseConnectionResponse as g, type ListExternalDatabaseConnectionsRequest as h, type Paging as i, type PagingMetadata as j, type CreateExternalDatabaseConnectionRequest as k, type CreateExternalDatabaseConnectionResponse as l, type UpdateExternalDatabaseConnectionRequest as m, type UpdateExternalDatabaseConnectionResponse as n, type DeleteExternalDatabaseConnectionResponse as o, type DomainEvent as p, type DomainEventBodyOneOf as q, type EntityCreatedEvent as r, type EntityUpdatedEvent as s, type EntityDeletedEvent as t, type IdentificationDataIdOneOf as u };
448
+ export { type ActionEvent, type Capabilities, CauseOfFailure, type CauseOfFailureWithLiterals, CollectionsFound, type CollectionsFoundWithLiterals, type ConnectionStatus, ConnectionType, type ConnectionTypeWithLiterals, type CreateExternalDatabaseConnectionRequest, type CreateExternalDatabaseConnectionResponse, type DeleteExternalDatabaseConnectionRequest, type DeleteExternalDatabaseConnectionResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExternalDatabaseConnection, FieldType, type FieldTypeWithLiterals, type GetExternalDatabaseConnectionRequest, type GetExternalDatabaseConnectionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListExternalDatabaseConnectionsOptions, type ListExternalDatabaseConnectionsRequest, type ListExternalDatabaseConnectionsResponse, type MessageEnvelope, type Paging, type PagingMetadata, ProtocolVersion, type ProtocolVersionWithLiterals, type RestoreInfo, type UpdateExternalDatabaseConnection, type UpdateExternalDatabaseConnectionRequest, type UpdateExternalDatabaseConnectionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createExternalDatabaseConnection, deleteExternalDatabaseConnection, getExternalDatabaseConnection, listExternalDatabaseConnections, updateExternalDatabaseConnection };