@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.
- package/build/cjs/index.d.ts +2 -2
- package/build/cjs/{data-v2-data-collection-collections.universal-DFG8hhGA.d.ts → index.typings.d.ts} +96 -1
- package/build/cjs/index.typings.js +1197 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +2 -2
- package/build/es/{data-v2-data-collection-collections.universal-DFG8hhGA.d.mts → index.typings.d.mts} +96 -1
- package/build/es/index.typings.mjs +1146 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/{data-v2-data-collection-collections.universal-DZ3_N2Cv.d.ts → index.typings.d.ts} +156 -1
- package/build/internal/cjs/index.typings.js +1197 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/{data-v2-data-collection-collections.universal-DZ3_N2Cv.d.mts → index.typings.d.mts} +156 -1
- package/build/internal/es/index.typings.mjs +1146 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
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 {
|
package/build/cjs/{data-v2-data-collection-collections.universal-DFG8hhGA.d.ts → index.typings.d.ts}
RENAMED
|
@@ -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 {
|
|
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 };
|