@wix/auto_sdk_data_collections 1.0.23 → 1.0.25

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.
@@ -686,6 +686,38 @@ interface PluginCmsOptions {
686
686
  /** CMS sort, applied when a collection is displayed on a site. */
687
687
  siteSort?: SiteSort;
688
688
  }
689
+ interface CatalogOptions {
690
+ /**
691
+ * *Required** - the field key that contains the catalog item name - field must be of type TEXT.
692
+ * @maxLength 1000
693
+ */
694
+ name?: string;
695
+ /**
696
+ * *Required** - the field key that contains the catalog item price - field must be of type NUMBER.
697
+ * @maxLength 1000
698
+ */
699
+ price?: string;
700
+ /**
701
+ * the field key that contains the catalog item URL - field must be of type URL.
702
+ * @maxLength 1000
703
+ */
704
+ url?: string | null;
705
+ /**
706
+ * the field key that contains the catalog item description - field must be of type TEXT.
707
+ * @maxLength 1000
708
+ */
709
+ description?: string | null;
710
+ /**
711
+ * the field key that contains the catalog item image - field must be of type IMAGE.
712
+ * @maxLength 1000
713
+ */
714
+ image?: string | null;
715
+ /**
716
+ * the field key that contains the catalog item quantity - field must be of type NUMBER.
717
+ * @maxLength 1000
718
+ */
719
+ quantity?: string | null;
720
+ }
689
721
  declare enum PagingMode {
690
722
  /** Offset-based paging. */
691
723
  OFFSET = "OFFSET",
@@ -1003,44 +1035,44 @@ interface RestoreDataCollectionResponse {
1003
1035
  }
1004
1036
  interface CreateDataCollectionFieldRequest {
1005
1037
  /**
1006
- * ID of data collection to update
1038
+ * ID of the data collection to update.
1007
1039
  * @maxLength 256
1008
1040
  */
1009
1041
  dataCollectionId: string;
1010
- /** field to create */
1042
+ /** New field to add. */
1011
1043
  field: Field;
1012
1044
  }
1013
1045
  interface CreateDataCollectionFieldResponse {
1014
- /** updated data collection */
1046
+ /** Updated data collection. */
1015
1047
  dataCollection?: DataCollection;
1016
1048
  }
1017
1049
  interface UpdateDataCollectionFieldRequest {
1018
1050
  /**
1019
- * ID of data collection to update
1051
+ * ID of the data collection to update.
1020
1052
  * @maxLength 256
1021
1053
  */
1022
1054
  dataCollectionId: string;
1023
- /** Field to update */
1055
+ /** Field to update. */
1024
1056
  field: Field;
1025
1057
  }
1026
1058
  interface UpdateDataCollectionFieldResponse {
1027
- /** updated data collection */
1059
+ /** Updated data collection. */
1028
1060
  dataCollection?: DataCollection;
1029
1061
  }
1030
1062
  interface DeleteDataCollectionFieldRequest {
1031
1063
  /**
1032
- * ID of data collection to update
1064
+ * ID of the data collection to update.
1033
1065
  * @maxLength 256
1034
1066
  */
1035
1067
  dataCollectionId: string;
1036
1068
  /**
1037
- * Field ID to delete
1069
+ * ID of the field to delete.
1038
1070
  * @maxLength 1000
1039
1071
  */
1040
1072
  fieldKey: string;
1041
1073
  }
1042
1074
  interface DeleteDataCollectionFieldResponse {
1043
- /** updated data collection */
1075
+ /** Updated data collection. */
1044
1076
  dataCollection?: DataCollection;
1045
1077
  }
1046
1078
  interface UpdateDataPermissionsRequest {
@@ -1511,14 +1543,18 @@ interface ListDataCollectionsOptions {
1511
1543
  * Updates a data collection.
1512
1544
  *
1513
1545
  * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
1514
- * If a collection with that ID exists, and if its current `revision` number matches the one provided, it is updated.
1546
+ * If a collection with that ID exists, and if its current `revision` number matches the one provided, it's updated.
1515
1547
  * Otherwise, the request fails.
1516
1548
  *
1517
1549
  * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
1518
1550
  *
1519
- * > **Note:**
1520
- * > 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
1521
- * > aren't included in the updated collection details, their values are lost.
1551
+ * <blockquote class="important">
1552
+ * <strong>Important:</strong>
1553
+ * After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection
1554
+ * has properties with values and those properties aren't included in the updated collection details, their values are lost.<br/><br/>
1555
+ *
1556
+ * To update a single field, use the Update Data Collection Field method.
1557
+ * </blockquote>
1522
1558
  * @param collection - Updated collection details. The existing collection is replaced with this version.
1523
1559
  * @public
1524
1560
  * @requiredField collection
@@ -1540,8 +1576,13 @@ declare function updateDataCollection(collection: NonNullablePaths<DataCollectio
1540
1576
  /**
1541
1577
  * Deletes a data collection.
1542
1578
  *
1579
+ * Before deleting a collection:
1580
+ * - Make sure the collection isn't connected to any site pages or elements.
1581
+ * - You can create a manual backup of a collections with the Backups API, in case you need to restore them later.
1582
+ * - You can also export a collection to a CSV file with the Data Movement Jobs API, if you want to save the data outside of Wix.
1583
+ *
1543
1584
  * > **Note:**
1544
- * > Once a collection is deleted, it can only be restored for limited amount of time.
1585
+ * > Once a collection is deleted, it can only be restored for a limited amount of time.
1545
1586
  * @param dataCollectionId - ID of the collection to delete.
1546
1587
  * @public
1547
1588
  * @requiredField dataCollectionId
@@ -1551,8 +1592,8 @@ declare function updateDataCollection(collection: NonNullablePaths<DataCollectio
1551
1592
  */
1552
1593
  declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1553
1594
  /**
1554
- * Adds new field to data collection schema
1555
- * @param dataCollectionId - ID of data collection to update
1595
+ * Adds a new field to the structure of a data collection.
1596
+ * @param dataCollectionId - ID of the data collection to update.
1556
1597
  * @public
1557
1598
  * @documentationMaturity preview
1558
1599
  * @requiredField dataCollectionId
@@ -1566,12 +1607,12 @@ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1566
1607
  */
1567
1608
  declare function createDataCollectionField(dataCollectionId: string, options: NonNullablePaths<CreateDataCollectionFieldOptions, `field` | `field.key` | `field.type`, 3>): Promise<NonNullablePaths<CreateDataCollectionFieldResponse, `dataCollection._id` | `dataCollection.collectionType` | `dataCollection.defaultDisplayOrder.fieldKey` | `dataCollection.defaultDisplayOrder.direction` | `dataCollection.capabilities.dataOperations` | `dataCollection.capabilities.collectionOperations` | `dataCollection.capabilities.indexLimits.regular` | `dataCollection.capabilities.indexLimits.unique` | `dataCollection.capabilities.indexLimits.total` | `dataCollection.fields` | `dataCollection.fields.${number}.key` | `dataCollection.fields.${number}.type` | `dataCollection.fields.${number}.typeMetadata.reference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingFieldKey` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingDisplayName` | `dataCollection.fields.${number}.typeMetadata.array.elementType` | `dataCollection.fields.${number}.systemField` | `dataCollection.fields.${number}.capabilities.sortable` | `dataCollection.fields.${number}.encrypted` | `dataCollection.permissions.insert` | `dataCollection.permissions.update` | `dataCollection.permissions.remove` | `dataCollection.permissions.read` | `dataCollection.plugins` | `dataCollection.plugins.${number}.publishOptions.defaultStatus` | `dataCollection.plugins.${number}.singleItemOptions.singleItemId` | `dataCollection.plugins.${number}.urlizedOptions.format` | `dataCollection.plugins.${number}.editablePageLinkOptions.isPersisted` | `dataCollection.plugins.${number}.editablePageLinkOptions.isMutable` | `dataCollection.plugins.${number}.type` | `dataCollection.pagingModes`, 7>>;
1568
1609
  interface CreateDataCollectionFieldOptions {
1569
- /** field to create */
1610
+ /** New field to add. */
1570
1611
  field: Field;
1571
1612
  }
1572
1613
  /**
1573
- * Updates data collection field
1574
- * @param dataCollectionId - ID of data collection to update
1614
+ * Updates a field in the structure of a data collection.
1615
+ * @param dataCollectionId - ID of the data collection to update.
1575
1616
  * @public
1576
1617
  * @documentationMaturity preview
1577
1618
  * @requiredField dataCollectionId
@@ -1585,12 +1626,15 @@ interface CreateDataCollectionFieldOptions {
1585
1626
  */
1586
1627
  declare function updateDataCollectionField(dataCollectionId: string, options: NonNullablePaths<UpdateDataCollectionFieldOptions, `field` | `field.key` | `field.type`, 3>): Promise<NonNullablePaths<UpdateDataCollectionFieldResponse, `dataCollection._id` | `dataCollection.collectionType` | `dataCollection.defaultDisplayOrder.fieldKey` | `dataCollection.defaultDisplayOrder.direction` | `dataCollection.capabilities.dataOperations` | `dataCollection.capabilities.collectionOperations` | `dataCollection.capabilities.indexLimits.regular` | `dataCollection.capabilities.indexLimits.unique` | `dataCollection.capabilities.indexLimits.total` | `dataCollection.fields` | `dataCollection.fields.${number}.key` | `dataCollection.fields.${number}.type` | `dataCollection.fields.${number}.typeMetadata.reference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingFieldKey` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingDisplayName` | `dataCollection.fields.${number}.typeMetadata.array.elementType` | `dataCollection.fields.${number}.systemField` | `dataCollection.fields.${number}.capabilities.sortable` | `dataCollection.fields.${number}.encrypted` | `dataCollection.permissions.insert` | `dataCollection.permissions.update` | `dataCollection.permissions.remove` | `dataCollection.permissions.read` | `dataCollection.plugins` | `dataCollection.plugins.${number}.publishOptions.defaultStatus` | `dataCollection.plugins.${number}.singleItemOptions.singleItemId` | `dataCollection.plugins.${number}.urlizedOptions.format` | `dataCollection.plugins.${number}.editablePageLinkOptions.isPersisted` | `dataCollection.plugins.${number}.editablePageLinkOptions.isMutable` | `dataCollection.plugins.${number}.type` | `dataCollection.pagingModes`, 7>>;
1587
1628
  interface UpdateDataCollectionFieldOptions {
1588
- /** Field to update */
1629
+ /** Field to update. */
1589
1630
  field: Field;
1590
1631
  }
1591
1632
  /**
1592
- * Deletes data collection field
1593
- * @param dataCollectionId - ID of data collection to update
1633
+ * Deletes a field from the structure of a data collection.
1634
+ *
1635
+ * When a field is deleted, all values associated with that field are also deleted
1636
+ * from all items in the collection.
1637
+ * @param dataCollectionId - ID of the data collection to update.
1594
1638
  * @public
1595
1639
  * @documentationMaturity preview
1596
1640
  * @requiredField dataCollectionId
@@ -1603,10 +1647,10 @@ interface UpdateDataCollectionFieldOptions {
1603
1647
  declare function deleteDataCollectionField(dataCollectionId: string, options: NonNullablePaths<DeleteDataCollectionFieldOptions, `fieldKey`, 2>): Promise<NonNullablePaths<DeleteDataCollectionFieldResponse, `dataCollection._id` | `dataCollection.collectionType` | `dataCollection.defaultDisplayOrder.fieldKey` | `dataCollection.defaultDisplayOrder.direction` | `dataCollection.capabilities.dataOperations` | `dataCollection.capabilities.collectionOperations` | `dataCollection.capabilities.indexLimits.regular` | `dataCollection.capabilities.indexLimits.unique` | `dataCollection.capabilities.indexLimits.total` | `dataCollection.fields` | `dataCollection.fields.${number}.key` | `dataCollection.fields.${number}.type` | `dataCollection.fields.${number}.typeMetadata.reference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencedCollectionId` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingFieldKey` | `dataCollection.fields.${number}.typeMetadata.multiReference.referencingDisplayName` | `dataCollection.fields.${number}.typeMetadata.array.elementType` | `dataCollection.fields.${number}.systemField` | `dataCollection.fields.${number}.capabilities.sortable` | `dataCollection.fields.${number}.encrypted` | `dataCollection.permissions.insert` | `dataCollection.permissions.update` | `dataCollection.permissions.remove` | `dataCollection.permissions.read` | `dataCollection.plugins` | `dataCollection.plugins.${number}.publishOptions.defaultStatus` | `dataCollection.plugins.${number}.singleItemOptions.singleItemId` | `dataCollection.plugins.${number}.urlizedOptions.format` | `dataCollection.plugins.${number}.editablePageLinkOptions.isPersisted` | `dataCollection.plugins.${number}.editablePageLinkOptions.isMutable` | `dataCollection.plugins.${number}.type` | `dataCollection.pagingModes`, 7>>;
1604
1648
  interface DeleteDataCollectionFieldOptions {
1605
1649
  /**
1606
- * Field ID to delete
1650
+ * ID of the field to delete.
1607
1651
  * @maxLength 1000
1608
1652
  */
1609
1653
  fieldKey: string;
1610
1654
  }
1611
1655
 
1612
- export { AccessLevel, type AccessLevelWithLiterals, type ActionEvent, type AllowedDataPermissions, type ApplicationError, 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 FailedCollection, 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, createDataCollectionField, deleteDataCollection, deleteDataCollectionField, getDataCollection, listDataCollections, updateDataCollection, updateDataCollectionField };
1656
+ export { AccessLevel, type AccessLevelWithLiterals, type ActionEvent, type AllowedDataPermissions, type ApplicationError, type ArraySizeRange, type BulkGetDataCollectionsPageBySnapshotsRequest, type BulkGetDataCollectionsPageBySnapshotsResponse, type BulkGetDataCollectionsRequest, type BulkGetDataCollectionsResponse, type Calculator, type CalculatorPatternOneOf, type CatalogOptions, 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 FailedCollection, 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, createDataCollectionField, deleteDataCollection, deleteDataCollectionField, getDataCollection, listDataCollections, updateDataCollection, updateDataCollectionField };
@@ -897,6 +897,7 @@ async function getDataCollection2(dataCollectionId, options) {
897
897
  const payload = renameKeysFromSDKRequestToRESTRequest({
898
898
  dataCollectionId,
899
899
  consistentRead: options?.consistentRead,
900
+ includeAllowedDataPermissions: options?.includeAllowedDataPermissions,
900
901
  fields: options?.fields
901
902
  });
902
903
  const reqOpts = getDataCollection(payload);
@@ -913,6 +914,7 @@ async function getDataCollection2(dataCollectionId, options) {
913
914
  explicitPathsToArguments: {
914
915
  dataCollectionId: "$[0]",
915
916
  consistentRead: "$[1].consistentRead",
917
+ includeAllowedDataPermissions: "$[1].includeAllowedDataPermissions",
916
918
  fields: "$[1].fields"
917
919
  },
918
920
  singleArgumentUnchanged: false
@@ -929,6 +931,7 @@ async function listDataCollections2(options) {
929
931
  sort: options?.sort,
930
932
  paging: options?.paging,
931
933
  consistentRead: options?.consistentRead,
934
+ includeAllowedDataPermissions: options?.includeAllowedDataPermissions,
932
935
  fields: options?.fields
933
936
  });
934
937
  const reqOpts = listDataCollections(payload);
@@ -946,6 +949,7 @@ async function listDataCollections2(options) {
946
949
  sort: "$[0].sort",
947
950
  paging: "$[0].paging",
948
951
  consistentRead: "$[0].consistentRead",
952
+ includeAllowedDataPermissions: "$[0].includeAllowedDataPermissions",
949
953
  fields: "$[0].fields"
950
954
  },
951
955
  singleArgumentUnchanged: false