@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.
- package/build/cjs/index.d.ts +23 -11
- package/build/cjs/index.js +4 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +35 -23
- package/build/cjs/index.typings.js +4 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +9 -9
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +23 -11
- package/build/es/index.mjs +4 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +35 -23
- package/build/es/index.typings.mjs +4 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +9 -9
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +23 -11
- package/build/internal/cjs/index.js +4 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +45 -23
- package/build/internal/cjs/index.typings.js +4 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +9 -9
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +23 -11
- package/build/internal/es/index.mjs +4 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +45 -23
- package/build/internal/es/index.typings.mjs +4 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +9 -9
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1066,44 +1066,44 @@ interface RestoreDataCollectionResponse {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
interface CreateDataCollectionFieldRequest {
|
|
1068
1068
|
/**
|
|
1069
|
-
* ID of data collection to update
|
|
1069
|
+
* ID of the data collection to update.
|
|
1070
1070
|
* @maxLength 256
|
|
1071
1071
|
*/
|
|
1072
1072
|
dataCollectionId: string;
|
|
1073
|
-
/** field to
|
|
1073
|
+
/** New field to add. */
|
|
1074
1074
|
field: Field;
|
|
1075
1075
|
}
|
|
1076
1076
|
interface CreateDataCollectionFieldResponse {
|
|
1077
|
-
/**
|
|
1077
|
+
/** Updated data collection. */
|
|
1078
1078
|
dataCollection?: DataCollection;
|
|
1079
1079
|
}
|
|
1080
1080
|
interface UpdateDataCollectionFieldRequest {
|
|
1081
1081
|
/**
|
|
1082
|
-
* ID of data collection to update
|
|
1082
|
+
* ID of the data collection to update.
|
|
1083
1083
|
* @maxLength 256
|
|
1084
1084
|
*/
|
|
1085
1085
|
dataCollectionId: string;
|
|
1086
|
-
/** Field to update */
|
|
1086
|
+
/** Field to update. */
|
|
1087
1087
|
field: Field;
|
|
1088
1088
|
}
|
|
1089
1089
|
interface UpdateDataCollectionFieldResponse {
|
|
1090
|
-
/**
|
|
1090
|
+
/** Updated data collection. */
|
|
1091
1091
|
dataCollection?: DataCollection;
|
|
1092
1092
|
}
|
|
1093
1093
|
interface DeleteDataCollectionFieldRequest {
|
|
1094
1094
|
/**
|
|
1095
|
-
* ID of data collection to update
|
|
1095
|
+
* ID of the data collection to update.
|
|
1096
1096
|
* @maxLength 256
|
|
1097
1097
|
*/
|
|
1098
1098
|
dataCollectionId: string;
|
|
1099
1099
|
/**
|
|
1100
|
-
*
|
|
1100
|
+
* ID of the field to delete.
|
|
1101
1101
|
* @maxLength 1000
|
|
1102
1102
|
*/
|
|
1103
1103
|
fieldKey: string;
|
|
1104
1104
|
}
|
|
1105
1105
|
interface DeleteDataCollectionFieldResponse {
|
|
1106
|
-
/**
|
|
1106
|
+
/** Updated data collection. */
|
|
1107
1107
|
dataCollection?: DataCollection;
|
|
1108
1108
|
}
|
|
1109
1109
|
interface UpdateDataPermissionsRequest {
|
|
@@ -1526,6 +1526,11 @@ interface GetDataCollectionOptions {
|
|
|
1526
1526
|
* Default: `false`
|
|
1527
1527
|
*/
|
|
1528
1528
|
consistentRead?: boolean;
|
|
1529
|
+
/**
|
|
1530
|
+
* If set allowed for caller data permissions would be included in the response
|
|
1531
|
+
* @internal
|
|
1532
|
+
*/
|
|
1533
|
+
includeAllowedDataPermissions?: boolean;
|
|
1529
1534
|
/**
|
|
1530
1535
|
* List of specific field names to return, if empty all fields are returned.
|
|
1531
1536
|
* Affects all returned collections
|
|
@@ -1562,6 +1567,11 @@ interface ListDataCollectionsOptions {
|
|
|
1562
1567
|
* Default: `false`
|
|
1563
1568
|
*/
|
|
1564
1569
|
consistentRead?: boolean;
|
|
1570
|
+
/**
|
|
1571
|
+
* If set allowed for caller data permissions would be included in the response
|
|
1572
|
+
* @internal
|
|
1573
|
+
*/
|
|
1574
|
+
includeAllowedDataPermissions?: boolean;
|
|
1565
1575
|
/**
|
|
1566
1576
|
* List of specific field names to return, if empty all fields are returned.
|
|
1567
1577
|
* Affects all returned collections
|
|
@@ -1574,14 +1584,18 @@ interface ListDataCollectionsOptions {
|
|
|
1574
1584
|
* Updates a data collection.
|
|
1575
1585
|
*
|
|
1576
1586
|
* A collection ID, revision number, permissions, and at least 1 field must be provided within the `collection` body parameter.
|
|
1577
|
-
* If a collection with that ID exists, and if its current `revision` number matches the one provided, it
|
|
1587
|
+
* If a collection with that ID exists, and if its current `revision` number matches the one provided, it's updated.
|
|
1578
1588
|
* Otherwise, the request fails.
|
|
1579
1589
|
*
|
|
1580
1590
|
* When a collection is updated, its `updatedDate` property is changed to the current date and its `revision` property is incremented.
|
|
1581
1591
|
*
|
|
1582
|
-
* >
|
|
1583
|
-
* >
|
|
1584
|
-
*
|
|
1592
|
+
* <blockquote class="important">
|
|
1593
|
+
* <strong>Important:</strong>
|
|
1594
|
+
* After a collection is updated, it only contains the properties included in the Update Data Collection request. If the existing collection
|
|
1595
|
+
* has properties with values and those properties aren't included in the updated collection details, their values are lost.<br/><br/>
|
|
1596
|
+
*
|
|
1597
|
+
* To update a single field, use the Update Data Collection Field method.
|
|
1598
|
+
* </blockquote>
|
|
1585
1599
|
* @param collection - Updated collection details. The existing collection is replaced with this version.
|
|
1586
1600
|
* @public
|
|
1587
1601
|
* @requiredField collection
|
|
@@ -1603,8 +1617,13 @@ declare function updateDataCollection(collection: NonNullablePaths<DataCollectio
|
|
|
1603
1617
|
/**
|
|
1604
1618
|
* Deletes a data collection.
|
|
1605
1619
|
*
|
|
1620
|
+
* Before deleting a collection:
|
|
1621
|
+
* - Make sure the collection isn't connected to any site pages or elements.
|
|
1622
|
+
* - You can create a manual backup of a collections with the Backups API, in case you need to restore them later.
|
|
1623
|
+
* - 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.
|
|
1624
|
+
*
|
|
1606
1625
|
* > **Note:**
|
|
1607
|
-
* > Once a collection is deleted, it can only be restored for limited amount of time.
|
|
1626
|
+
* > Once a collection is deleted, it can only be restored for a limited amount of time.
|
|
1608
1627
|
* @param dataCollectionId - ID of the collection to delete.
|
|
1609
1628
|
* @public
|
|
1610
1629
|
* @requiredField dataCollectionId
|
|
@@ -1627,8 +1646,8 @@ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
|
|
|
1627
1646
|
*/
|
|
1628
1647
|
declare function restoreDataCollection(dataCollectionId: string): Promise<NonNullablePaths<RestoreDataCollectionResponse, `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>>;
|
|
1629
1648
|
/**
|
|
1630
|
-
* Adds new field to data collection
|
|
1631
|
-
* @param dataCollectionId - ID of data collection to update
|
|
1649
|
+
* Adds a new field to the structure of a data collection.
|
|
1650
|
+
* @param dataCollectionId - ID of the data collection to update.
|
|
1632
1651
|
* @public
|
|
1633
1652
|
* @documentationMaturity preview
|
|
1634
1653
|
* @requiredField dataCollectionId
|
|
@@ -1642,12 +1661,12 @@ declare function restoreDataCollection(dataCollectionId: string): Promise<NonNul
|
|
|
1642
1661
|
*/
|
|
1643
1662
|
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>>;
|
|
1644
1663
|
interface CreateDataCollectionFieldOptions {
|
|
1645
|
-
/** field to
|
|
1664
|
+
/** New field to add. */
|
|
1646
1665
|
field: Field;
|
|
1647
1666
|
}
|
|
1648
1667
|
/**
|
|
1649
|
-
* Updates data collection
|
|
1650
|
-
* @param dataCollectionId - ID of data collection to update
|
|
1668
|
+
* Updates a field in the structure of a data collection.
|
|
1669
|
+
* @param dataCollectionId - ID of the data collection to update.
|
|
1651
1670
|
* @public
|
|
1652
1671
|
* @documentationMaturity preview
|
|
1653
1672
|
* @requiredField dataCollectionId
|
|
@@ -1661,12 +1680,15 @@ interface CreateDataCollectionFieldOptions {
|
|
|
1661
1680
|
*/
|
|
1662
1681
|
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>>;
|
|
1663
1682
|
interface UpdateDataCollectionFieldOptions {
|
|
1664
|
-
/** Field to update */
|
|
1683
|
+
/** Field to update. */
|
|
1665
1684
|
field: Field;
|
|
1666
1685
|
}
|
|
1667
1686
|
/**
|
|
1668
|
-
* Deletes data collection
|
|
1669
|
-
*
|
|
1687
|
+
* Deletes a field from the structure of a data collection.
|
|
1688
|
+
*
|
|
1689
|
+
* When a field is deleted, all values associated with that field are also deleted
|
|
1690
|
+
* from all items in the collection.
|
|
1691
|
+
* @param dataCollectionId - ID of the data collection to update.
|
|
1670
1692
|
* @public
|
|
1671
1693
|
* @documentationMaturity preview
|
|
1672
1694
|
* @requiredField dataCollectionId
|
|
@@ -1679,7 +1701,7 @@ interface UpdateDataCollectionFieldOptions {
|
|
|
1679
1701
|
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>>;
|
|
1680
1702
|
interface DeleteDataCollectionFieldOptions {
|
|
1681
1703
|
/**
|
|
1682
|
-
*
|
|
1704
|
+
* ID of the field to delete.
|
|
1683
1705
|
* @maxLength 1000
|
|
1684
1706
|
*/
|
|
1685
1707
|
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
|