@wix/auto_sdk_data_collections 1.0.24 → 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.
@@ -1035,44 +1035,44 @@ interface RestoreDataCollectionResponse {
1035
1035
  }
1036
1036
  interface CreateDataCollectionFieldRequest {
1037
1037
  /**
1038
- * ID of data collection to update
1038
+ * ID of the data collection to update.
1039
1039
  * @maxLength 256
1040
1040
  */
1041
1041
  dataCollectionId: string;
1042
- /** field to create */
1042
+ /** New field to add. */
1043
1043
  field: Field;
1044
1044
  }
1045
1045
  interface CreateDataCollectionFieldResponse {
1046
- /** updated data collection */
1046
+ /** Updated data collection. */
1047
1047
  dataCollection?: DataCollection;
1048
1048
  }
1049
1049
  interface UpdateDataCollectionFieldRequest {
1050
1050
  /**
1051
- * ID of data collection to update
1051
+ * ID of the data collection to update.
1052
1052
  * @maxLength 256
1053
1053
  */
1054
1054
  dataCollectionId: string;
1055
- /** Field to update */
1055
+ /** Field to update. */
1056
1056
  field: Field;
1057
1057
  }
1058
1058
  interface UpdateDataCollectionFieldResponse {
1059
- /** updated data collection */
1059
+ /** Updated data collection. */
1060
1060
  dataCollection?: DataCollection;
1061
1061
  }
1062
1062
  interface DeleteDataCollectionFieldRequest {
1063
1063
  /**
1064
- * ID of data collection to update
1064
+ * ID of the data collection to update.
1065
1065
  * @maxLength 256
1066
1066
  */
1067
1067
  dataCollectionId: string;
1068
1068
  /**
1069
- * Field ID to delete
1069
+ * ID of the field to delete.
1070
1070
  * @maxLength 1000
1071
1071
  */
1072
1072
  fieldKey: string;
1073
1073
  }
1074
1074
  interface DeleteDataCollectionFieldResponse {
1075
- /** updated data collection */
1075
+ /** Updated data collection. */
1076
1076
  dataCollection?: DataCollection;
1077
1077
  }
1078
1078
  interface UpdateDataPermissionsRequest {
@@ -1543,14 +1543,18 @@ interface ListDataCollectionsOptions {
1543
1543
  * Updates a data collection.
1544
1544
  *
1545
1545
  * A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
1546
- * 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.
1547
1547
  * Otherwise, the request fails.
1548
1548
  *
1549
1549
  * When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
1550
1550
  *
1551
- * > **Note:**
1552
- * > 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
1553
- * > 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>
1554
1558
  * @param collection - Updated collection details. The existing collection is replaced with this version.
1555
1559
  * @public
1556
1560
  * @requiredField collection
@@ -1572,8 +1576,13 @@ declare function updateDataCollection(collection: NonNullablePaths<DataCollectio
1572
1576
  /**
1573
1577
  * Deletes a data collection.
1574
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
+ *
1575
1584
  * > **Note:**
1576
- * > 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.
1577
1586
  * @param dataCollectionId - ID of the collection to delete.
1578
1587
  * @public
1579
1588
  * @requiredField dataCollectionId
@@ -1583,8 +1592,8 @@ declare function updateDataCollection(collection: NonNullablePaths<DataCollectio
1583
1592
  */
1584
1593
  declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1585
1594
  /**
1586
- * Adds new field to data collection schema
1587
- * @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.
1588
1597
  * @public
1589
1598
  * @documentationMaturity preview
1590
1599
  * @requiredField dataCollectionId
@@ -1598,12 +1607,12 @@ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1598
1607
  */
1599
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>>;
1600
1609
  interface CreateDataCollectionFieldOptions {
1601
- /** field to create */
1610
+ /** New field to add. */
1602
1611
  field: Field;
1603
1612
  }
1604
1613
  /**
1605
- * Updates data collection field
1606
- * @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.
1607
1616
  * @public
1608
1617
  * @documentationMaturity preview
1609
1618
  * @requiredField dataCollectionId
@@ -1617,12 +1626,15 @@ interface CreateDataCollectionFieldOptions {
1617
1626
  */
1618
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>>;
1619
1628
  interface UpdateDataCollectionFieldOptions {
1620
- /** Field to update */
1629
+ /** Field to update. */
1621
1630
  field: Field;
1622
1631
  }
1623
1632
  /**
1624
- * Deletes data collection field
1625
- * @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.
1626
1638
  * @public
1627
1639
  * @documentationMaturity preview
1628
1640
  * @requiredField dataCollectionId
@@ -1635,7 +1647,7 @@ interface UpdateDataCollectionFieldOptions {
1635
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>>;
1636
1648
  interface DeleteDataCollectionFieldOptions {
1637
1649
  /**
1638
- * Field ID to delete
1650
+ * ID of the field to delete.
1639
1651
  * @maxLength 1000
1640
1652
  */
1641
1653
  fieldKey: string;
@@ -947,6 +947,7 @@ async function getDataCollection2(dataCollectionId, options) {
947
947
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
948
948
  dataCollectionId,
949
949
  consistentRead: options?.consistentRead,
950
+ includeAllowedDataPermissions: options?.includeAllowedDataPermissions,
950
951
  fields: options?.fields
951
952
  });
952
953
  const reqOpts = getDataCollection(payload);
@@ -963,6 +964,7 @@ async function getDataCollection2(dataCollectionId, options) {
963
964
  explicitPathsToArguments: {
964
965
  dataCollectionId: "$[0]",
965
966
  consistentRead: "$[1].consistentRead",
967
+ includeAllowedDataPermissions: "$[1].includeAllowedDataPermissions",
966
968
  fields: "$[1].fields"
967
969
  },
968
970
  singleArgumentUnchanged: false
@@ -979,6 +981,7 @@ async function listDataCollections2(options) {
979
981
  sort: options?.sort,
980
982
  paging: options?.paging,
981
983
  consistentRead: options?.consistentRead,
984
+ includeAllowedDataPermissions: options?.includeAllowedDataPermissions,
982
985
  fields: options?.fields
983
986
  });
984
987
  const reqOpts = listDataCollections(payload);
@@ -996,6 +999,7 @@ async function listDataCollections2(options) {
996
999
  sort: "$[0].sort",
997
1000
  paging: "$[0].paging",
998
1001
  consistentRead: "$[0].consistentRead",
1002
+ includeAllowedDataPermissions: "$[0].includeAllowedDataPermissions",
999
1003
  fields: "$[0].fields"
1000
1004
  },
1001
1005
  singleArgumentUnchanged: false