@wix/auto_sdk_data_collections 1.0.13 → 1.0.15

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 { D as DataCollection, G as GetDataCollectionOptions, L as ListDataCollectionsOptions, a as ListDataCollectionsResponse } from './data-v2-data-collection-collections.universal-DFG8hhGA.js';
3
- export { A as AccessLevel, aV as ActionEvent, a5 as AllowedDataPermissions, B as ArraySizeRange, az as BulkGetDataCollectionsPageBySnapshotsRequest, aA as BulkGetDataCollectionsPageBySnapshotsResponse, aj as BulkGetDataCollectionsRequest, ak as BulkGetDataCollectionsResponse, u as Calculator, v as CalculatorPatternOneOf, J as CmsOptions, k as CollectionCapabilities, d as CollectionOperation, C as CollectionType, aZ as CreateDataCollectionFieldOptions, ar as CreateDataCollectionFieldRequest, as as CreateDataCollectionFieldResponse, ab as CreateDataCollectionRequest, ac as CreateDataCollectionResponse, aF as CreateDataCollectionsSnapshotRequest, aG as CreateDataCollectionsSnapshotResponse, aN as CreateMigratedCollectionsSnapshotRequest, aO as CreateMigratedCollectionsSnapshotResponse, a7 as DataCollectionChangedEvent, a6 as DataCollectionClonedEvent, aa as DataCollectionEvictedEvent, c as DataOperation, a4 as DataPermissions, a$ as DeleteDataCollectionFieldOptions, av as DeleteDataCollectionFieldRequest, aw as DeleteDataCollectionFieldResponse, an as DeleteDataCollectionRequest, ao as DeleteDataCollectionResponse, aL as DeleteDataCollectionsSnapshotRequest, aM as DeleteDataCollectionsSnapshotResponse, aI as Destination, b as Direction, aP as DomainEvent, aQ as DomainEventBodyOneOf, aR as EntityCreatedEvent, aU as EntityDeletedEvent, aT as EntityUpdatedEvent, aE as Failure, n as Field, r as FieldCapabilities, E as FieldPlugin, H as FieldPluginOptionsOneOf, F as FieldPluginType, o as FieldRangeValidationsOneOf, a8 as FieldUpdate, t as FieldsPattern, e as Format, ad as GetDataCollectionRequest, ae as GetDataCollectionResponse, aX as IdentificationData, aY as IdentificationDataIdOneOf, aC as Index, aD as IndexField, l as IndexLimits, m as IndexQuotaLimits, i as IndexSource, I as IndexStatus, af as ListDataCollectionsRequest, aW as MessageEnvelope, M as MultiReference, a1 as MultilingualOptions, N as NumberRange, s as ObjectField, O as Order, y as PageLink, a2 as PageLinkPluginOptions, ah as Paging, ai as PagingMetadataV2, f as PagingMode, K as Permissions, V as Plugin, a3 as PluginCmsOptions, X as PluginOptionsOneOf, P as PluginType, a9 as PluginUpdate, Z as PublishPluginOptions, Q as QueryOperator, w as Reference, aJ as RestorationCollection, ap as RestoreDataCollectionRequest, aq as RestoreDataCollectionResponse, aH as RestoreDataCollectionsFromSnapshotRequest, aK as RestoreDataCollectionsFromSnapshotResponse, aS as RestoreInfo, R as Role, g as Segment, $ as SingleItemPluginOptions, Y as SiteSort, aB as SnapshotCollection, j as Sort, h as SortOrder, ag as Sorting, S as Status, z as StringLengthRange, T as Type, p as TypeMetadata, q as TypeMetadataMetadataOneOf, a_ as UpdateDataCollectionFieldOptions, at as UpdateDataCollectionFieldRequest, au as UpdateDataCollectionFieldResponse, al as UpdateDataCollectionRequest, am as UpdateDataCollectionResponse, ax as UpdateDataPermissionsRequest, ay as UpdateDataPermissionsResponse, U as UrlizedOnlyPattern, a0 as UrlizedPluginOptions, W as WebhookIdentityType, x as _Array, _ as _Object } from './data-v2-data-collection-collections.universal-DFG8hhGA.js';
2
+ import { DataCollection, GetDataCollectionOptions, ListDataCollectionsOptions, ListDataCollectionsResponse } from './index.typings.js';
3
+ export { AccessLevel, ActionEvent, AllowedDataPermissions, ArraySizeRange, BulkGetDataCollectionsPageBySnapshotsRequest, BulkGetDataCollectionsPageBySnapshotsResponse, BulkGetDataCollectionsRequest, BulkGetDataCollectionsResponse, Calculator, CalculatorPatternOneOf, CmsOptions, CollectionCapabilities, CollectionOperation, CollectionType, CreateDataCollectionFieldOptions, CreateDataCollectionFieldRequest, CreateDataCollectionFieldResponse, CreateDataCollectionRequest, CreateDataCollectionResponse, CreateDataCollectionsSnapshotRequest, CreateDataCollectionsSnapshotResponse, CreateMigratedCollectionsSnapshotRequest, CreateMigratedCollectionsSnapshotResponse, DataCollectionChangedEvent, DataCollectionClonedEvent, DataCollectionEvictedEvent, DataOperation, DataPermissions, DeleteDataCollectionFieldOptions, DeleteDataCollectionFieldRequest, DeleteDataCollectionFieldResponse, DeleteDataCollectionRequest, DeleteDataCollectionResponse, DeleteDataCollectionsSnapshotRequest, DeleteDataCollectionsSnapshotResponse, Destination, Direction, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, Failure, Field, FieldCapabilities, FieldPlugin, FieldPluginOptionsOneOf, FieldPluginType, FieldRangeValidationsOneOf, FieldUpdate, FieldsPattern, Format, GetDataCollectionRequest, GetDataCollectionResponse, IdentificationData, IdentificationDataIdOneOf, Index, IndexField, IndexLimits, IndexQuotaLimits, IndexSource, IndexStatus, ListDataCollectionsRequest, MessageEnvelope, MultiReference, MultilingualOptions, NumberRange, ObjectField, Order, PageLink, PageLinkPluginOptions, Paging, PagingMetadataV2, PagingMode, Permissions, Plugin, PluginCmsOptions, PluginOptionsOneOf, PluginType, PluginUpdate, PublishPluginOptions, QueryOperator, Reference, RestorationCollection, RestoreDataCollectionRequest, RestoreDataCollectionResponse, RestoreDataCollectionsFromSnapshotRequest, RestoreDataCollectionsFromSnapshotResponse, RestoreInfo, Role, Segment, SingleItemPluginOptions, SiteSort, SnapshotCollection, Sort, SortOrder, Sorting, Status, StringLengthRange, Type, TypeMetadata, TypeMetadataMetadataOneOf, UpdateDataCollectionFieldOptions, UpdateDataCollectionFieldRequest, UpdateDataCollectionFieldResponse, UpdateDataCollectionRequest, UpdateDataCollectionResponse, UpdateDataPermissionsRequest, UpdateDataPermissionsResponse, UrlizedOnlyPattern, UrlizedPluginOptions, WebhookIdentityType, _Array, _Object } from './index.typings.js';
4
4
 
5
5
  declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
6
6
  interface CreateDataCollectionSignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  /** A data collection determines the structure of data to be stored in a database. */
2
4
  interface DataCollection {
3
5
  /**
@@ -832,6 +834,8 @@ declare enum Segment {
832
834
  PUBLIC = "PUBLIC",
833
835
  DEV = "DEV"
834
836
  }
837
+ /** @enumType */
838
+ type SegmentWithLiterals = Segment | 'UNKNOWN_SEGMENT' | 'PUBLIC' | 'DEV';
835
839
  interface GetDataCollectionResponse {
836
840
  /** Details of the collection requested. */
837
841
  collection?: DataCollection;
@@ -1398,6 +1402,41 @@ declare enum WebhookIdentityType {
1398
1402
  }
1399
1403
  /** @enumType */
1400
1404
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1405
+ type DataCollectionNonNullablePaths = `_id` | `collectionType` | `defaultDisplayOrder.fieldKey` | `defaultDisplayOrder.direction` | `capabilities.dataOperations` | `capabilities.collectionOperations` | `capabilities.indexLimits.regular` | `capabilities.indexLimits.unique` | `capabilities.indexLimits.total` | `fields` | `fields.${number}.key` | `fields.${number}.type` | `fields.${number}.typeMetadata.reference.referencedCollectionId` | `fields.${number}.typeMetadata.multiReference.referencedCollectionId` | `fields.${number}.typeMetadata.multiReference.referencingFieldKey` | `fields.${number}.typeMetadata.multiReference.referencingDisplayName` | `fields.${number}.typeMetadata.array.elementType` | `fields.${number}.typeMetadata.pageLink.calculator.fieldsPattern.pattern` | `fields.${number}.typeMetadata.pageLink.calculator.fieldsPattern.lowercase` | `fields.${number}.typeMetadata.pageLink.calculator.urlizedOnlyPattern.pattern` | `fields.${number}.systemField` | `fields.${number}.encrypted` | `permissions.insert` | `permissions.update` | `permissions.remove` | `permissions.read` | `plugins` | `plugins.${number}.publishOptions.defaultStatus` | `plugins.${number}.singleItemOptions.singleItemId` | `plugins.${number}.urlizedOptions.format` | `plugins.${number}.editablePageLinkOptions.isPersisted` | `plugins.${number}.editablePageLinkOptions.isMutable` | `plugins.${number}.type` | `pagingModes`;
1406
+ /**
1407
+ * Creates a new data collection.
1408
+ *
1409
+ * 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.
1410
+ * @param collection - Collection details.
1411
+ * @public
1412
+ * @requiredField collection
1413
+ * @requiredField collection._id
1414
+ * @requiredField collection.fields.key
1415
+ * @requiredField collection.fields.type
1416
+ * @requiredField collection.permissions.insert
1417
+ * @requiredField collection.permissions.read
1418
+ * @requiredField collection.permissions.remove
1419
+ * @requiredField collection.permissions.update
1420
+ * @param options - Options for creating a data collection.
1421
+ * @permissionId WIX_DATA.CREATE_COLLECTION
1422
+ * @applicableIdentity APP
1423
+ * @returns Details of collection created.
1424
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.CreateDataCollection
1425
+ */
1426
+ declare function createDataCollection(collection: NonNullablePaths<DataCollection, `_id` | `fields.${number}.key` | `fields.${number}.type` | `permissions.insert` | `permissions.read` | `permissions.remove` | `permissions.update`>): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1427
+ /**
1428
+ * Retrieves a data collection by ID.
1429
+ * @param dataCollectionId - ID of the collection to retrieve.
1430
+ * @public
1431
+ * @requiredField dataCollectionId
1432
+ * @param options - Options for retrieving a data collection.
1433
+ * @permissionId WIX_DATA.GET_COLLECTION
1434
+ * @applicableIdentity APP
1435
+ * @applicableIdentity VISITOR
1436
+ * @returns Details of the collection requested.
1437
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.GetDataCollection
1438
+ */
1439
+ declare function getDataCollection(dataCollectionId: string, options?: GetDataCollectionOptions): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1401
1440
  interface GetDataCollectionOptions {
1402
1441
  /**
1403
1442
  * Whether to retrieve data from the primary database instance.
@@ -1415,6 +1454,19 @@ interface GetDataCollectionOptions {
1415
1454
  */
1416
1455
  fields?: string[];
1417
1456
  }
1457
+ /**
1458
+ * Retrieves a list of all data collections associated with the site or project.
1459
+ *
1460
+ * By default, the list is ordered by ID in ascending order.
1461
+ * @public
1462
+ * @param options - Options for retrieving a list of data collections.
1463
+ * @permissionId WIX_DATA.LIST_COLLECTIONS
1464
+ * @applicableIdentity APP
1465
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.ListDataCollections
1466
+ */
1467
+ declare function listDataCollections(options?: ListDataCollectionsOptions): Promise<NonNullablePaths<ListDataCollectionsResponse, {
1468
+ [P in DataCollectionNonNullablePaths]: `collections.${number}.${P}`;
1469
+ }[DataCollectionNonNullablePaths]>>;
1418
1470
  interface ListDataCollectionsOptions {
1419
1471
  /**
1420
1472
  * Defines how collections in the response are sorted.
@@ -1440,6 +1492,49 @@ interface ListDataCollectionsOptions {
1440
1492
  */
1441
1493
  fields?: string[];
1442
1494
  }
1495
+ /**
1496
+ * Updates a data collection.
1497
+ *
1498
+ * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
1499
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
1500
+ * Otherwise, the request fails.
1501
+ *
1502
+ * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
1503
+ *
1504
+ * > **Note:**
1505
+ * > 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
1506
+ * > aren't included in the updated collection details, their values are lost.
1507
+ * @param collection - Updated collection details. The existing collection is replaced with this version.
1508
+ * @public
1509
+ * @requiredField collection
1510
+ * @requiredField collection._id
1511
+ * @requiredField collection.fields.key
1512
+ * @requiredField collection.fields.type
1513
+ * @requiredField collection.permissions.insert
1514
+ * @requiredField collection.permissions.read
1515
+ * @requiredField collection.permissions.remove
1516
+ * @requiredField collection.permissions.update
1517
+ * @requiredField collection.revision
1518
+ * @param options - Options for updating a data collection.
1519
+ * @permissionId WIX_DATA.UPDATE_COLLECTION
1520
+ * @applicableIdentity APP
1521
+ * @returns Updated collection details.
1522
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.UpdateDataCollection
1523
+ */
1524
+ declare function updateDataCollection(collection: NonNullablePaths<DataCollection, `_id` | `fields.${number}.key` | `fields.${number}.type` | `permissions.insert` | `permissions.read` | `permissions.remove` | `permissions.update` | `revision`>): Promise<NonNullablePaths<DataCollection, DataCollectionNonNullablePaths>>;
1525
+ /**
1526
+ * Deletes a data collection.
1527
+ *
1528
+ * > **Note:**
1529
+ * > Once a collection is deleted, it can only be restored for limited amount of time.
1530
+ * @param dataCollectionId - ID of the collection to delete.
1531
+ * @public
1532
+ * @requiredField dataCollectionId
1533
+ * @permissionId WIX_DATA.DELETE_COLLECTION
1534
+ * @applicableIdentity APP
1535
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.DeleteDataCollection
1536
+ */
1537
+ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1443
1538
  interface CreateDataCollectionFieldOptions {
1444
1539
  /** field to create */
1445
1540
  field: Field;
@@ -1456,4 +1551,4 @@ interface DeleteDataCollectionFieldOptions {
1456
1551
  fieldKey: string;
1457
1552
  }
1458
1553
 
1459
- export { type SingleItemPluginOptions as $, AccessLevel as A, type ArraySizeRange as B, CollectionType as C, type DataCollection as D, type FieldPlugin as E, FieldPluginType as F, type GetDataCollectionOptions as G, type FieldPluginOptionsOneOf as H, IndexStatus as I, type CmsOptions as J, type Permissions as K, type ListDataCollectionsOptions as L, type MultiReference as M, type NumberRange as N, Order as O, PluginType as P, QueryOperator as Q, Role as R, Status as S, Type as T, type UrlizedOnlyPattern as U, type Plugin as V, WebhookIdentityType as W, type PluginOptionsOneOf as X, type SiteSort as Y, type PublishPluginOptions as Z, type _Object as _, type ListDataCollectionsResponse as a, type DeleteDataCollectionFieldOptions as a$, type UrlizedPluginOptions as a0, type MultilingualOptions as a1, type PageLinkPluginOptions as a2, type PluginCmsOptions as a3, type DataPermissions as a4, type AllowedDataPermissions as a5, type DataCollectionClonedEvent as a6, type DataCollectionChangedEvent as a7, type FieldUpdate as a8, type PluginUpdate as a9, type BulkGetDataCollectionsPageBySnapshotsResponse as aA, type SnapshotCollection as aB, type Index as aC, type IndexField as aD, type Failure as aE, type CreateDataCollectionsSnapshotRequest as aF, type CreateDataCollectionsSnapshotResponse as aG, type RestoreDataCollectionsFromSnapshotRequest as aH, type Destination as aI, type RestorationCollection as aJ, type RestoreDataCollectionsFromSnapshotResponse as aK, type DeleteDataCollectionsSnapshotRequest as aL, type DeleteDataCollectionsSnapshotResponse as aM, type CreateMigratedCollectionsSnapshotRequest as aN, type CreateMigratedCollectionsSnapshotResponse as aO, type DomainEvent as aP, type DomainEventBodyOneOf as aQ, type EntityCreatedEvent as aR, type RestoreInfo as aS, type EntityUpdatedEvent as aT, type EntityDeletedEvent as aU, type ActionEvent as aV, type MessageEnvelope as aW, type IdentificationData as aX, type IdentificationDataIdOneOf as aY, type CreateDataCollectionFieldOptions as aZ, type UpdateDataCollectionFieldOptions as a_, type DataCollectionEvictedEvent as aa, type CreateDataCollectionRequest as ab, type CreateDataCollectionResponse as ac, type GetDataCollectionRequest as ad, type GetDataCollectionResponse as ae, type ListDataCollectionsRequest as af, type Sorting as ag, type Paging as ah, type PagingMetadataV2 as ai, type BulkGetDataCollectionsRequest as aj, type BulkGetDataCollectionsResponse as ak, type UpdateDataCollectionRequest as al, type UpdateDataCollectionResponse as am, type DeleteDataCollectionRequest as an, type DeleteDataCollectionResponse as ao, type RestoreDataCollectionRequest as ap, type RestoreDataCollectionResponse as aq, type CreateDataCollectionFieldRequest as ar, type CreateDataCollectionFieldResponse as as, type UpdateDataCollectionFieldRequest as at, type UpdateDataCollectionFieldResponse as au, type DeleteDataCollectionFieldRequest as av, type DeleteDataCollectionFieldResponse as aw, type UpdateDataPermissionsRequest as ax, type UpdateDataPermissionsResponse as ay, type BulkGetDataCollectionsPageBySnapshotsRequest as az, Direction as b, DataOperation as c, CollectionOperation as d, Format as e, PagingMode as f, Segment as g, SortOrder as h, IndexSource as i, type Sort as j, type CollectionCapabilities as k, type IndexLimits as l, type IndexQuotaLimits as m, type Field as n, type FieldRangeValidationsOneOf as o, type TypeMetadata as p, type TypeMetadataMetadataOneOf as q, type FieldCapabilities as r, type ObjectField as s, type FieldsPattern as t, type Calculator as u, type CalculatorPatternOneOf as v, type Reference as w, type _Array as x, type PageLink as y, type StringLengthRange as z };
1554
+ export { AccessLevel, type AccessLevelWithLiterals, type ActionEvent, type AllowedDataPermissions, type ArraySizeRange, type BulkGetDataCollectionsPageBySnapshotsRequest, type BulkGetDataCollectionsPageBySnapshotsResponse, type BulkGetDataCollectionsRequest, type BulkGetDataCollectionsResponse, type Calculator, type CalculatorPatternOneOf, type CmsOptions, type CollectionCapabilities, CollectionOperation, type CollectionOperationWithLiterals, CollectionType, type CollectionTypeWithLiterals, type CreateDataCollectionFieldOptions, type CreateDataCollectionFieldRequest, type CreateDataCollectionFieldResponse, type CreateDataCollectionRequest, type CreateDataCollectionResponse, type CreateDataCollectionsSnapshotRequest, type CreateDataCollectionsSnapshotResponse, type CreateMigratedCollectionsSnapshotRequest, type CreateMigratedCollectionsSnapshotResponse, type DataCollection, type DataCollectionChangedEvent, type DataCollectionClonedEvent, type DataCollectionEvictedEvent, DataOperation, type DataOperationWithLiterals, type DataPermissions, type DeleteDataCollectionFieldOptions, type DeleteDataCollectionFieldRequest, type DeleteDataCollectionFieldResponse, type DeleteDataCollectionRequest, type DeleteDataCollectionResponse, type DeleteDataCollectionsSnapshotRequest, type DeleteDataCollectionsSnapshotResponse, type Destination, Direction, type DirectionWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type Failure, type Field, type FieldCapabilities, type FieldPlugin, type FieldPluginOptionsOneOf, FieldPluginType, type FieldPluginTypeWithLiterals, type FieldRangeValidationsOneOf, type FieldUpdate, type FieldsPattern, Format, type FormatWithLiterals, type GetDataCollectionOptions, type GetDataCollectionRequest, type GetDataCollectionResponse, type IdentificationData, type IdentificationDataIdOneOf, type Index, type IndexField, type IndexLimits, type IndexQuotaLimits, IndexSource, type IndexSourceWithLiterals, IndexStatus, type IndexStatusWithLiterals, type ListDataCollectionsOptions, type ListDataCollectionsRequest, type ListDataCollectionsResponse, type MessageEnvelope, type MultiReference, type MultilingualOptions, type NumberRange, type ObjectField, Order, type OrderWithLiterals, type PageLink, type PageLinkPluginOptions, type Paging, type PagingMetadataV2, PagingMode, type PagingModeWithLiterals, type Permissions, type Plugin, type PluginCmsOptions, type PluginOptionsOneOf, PluginType, type PluginTypeWithLiterals, type PluginUpdate, type PublishPluginOptions, QueryOperator, type QueryOperatorWithLiterals, type Reference, type RestorationCollection, type RestoreDataCollectionRequest, type RestoreDataCollectionResponse, type RestoreDataCollectionsFromSnapshotRequest, type RestoreDataCollectionsFromSnapshotResponse, type RestoreInfo, Role, type RoleWithLiterals, Segment, type SegmentWithLiterals, type SingleItemPluginOptions, type SiteSort, type SnapshotCollection, type Sort, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, type StringLengthRange, Type, type TypeMetadata, type TypeMetadataMetadataOneOf, type TypeWithLiterals, type UpdateDataCollectionFieldOptions, type UpdateDataCollectionFieldRequest, type UpdateDataCollectionFieldResponse, type UpdateDataCollectionRequest, type UpdateDataCollectionResponse, type UpdateDataPermissionsRequest, type UpdateDataPermissionsResponse, type UrlizedOnlyPattern, type UrlizedPluginOptions, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type _Array, type _Object, createDataCollection, deleteDataCollection, getDataCollection, listDataCollections, updateDataCollection };