@wix/auto_sdk_data_collections 1.0.40 → 1.0.41

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js +96 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +95 -1
  5. package/build/cjs/index.typings.js +87 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +13 -2
  8. package/build/cjs/meta.js +80 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +95 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +95 -1
  14. package/build/es/index.typings.mjs +86 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +13 -2
  17. package/build/es/meta.mjs +79 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +14 -3
  20. package/build/internal/cjs/index.js +96 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +119 -1
  23. package/build/internal/cjs/index.typings.js +87 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +13 -2
  26. package/build/internal/cjs/meta.js +80 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +14 -3
  29. package/build/internal/es/index.mjs +95 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +119 -1
  32. package/build/internal/es/index.typings.mjs +86 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +13 -2
  35. package/build/internal/es/meta.mjs +79 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -1075,6 +1075,14 @@ interface RestoreDataCollectionResponse {
1075
1075
  /** Restored data collection */
1076
1076
  dataCollection?: DataCollection;
1077
1077
  }
1078
+ interface PatchDataCollectionRequest {
1079
+ /** Data collection to patch. Only fields specified in the field_mask are updated. */
1080
+ dataCollection: DataCollection;
1081
+ }
1082
+ interface PatchDataCollectionResponse {
1083
+ /** The updated data collection. */
1084
+ dataCollection?: DataCollection;
1085
+ }
1078
1086
  interface CreateDataCollectionFieldRequest {
1079
1087
  /**
1080
1088
  * ID of the data collection to update.
@@ -1737,6 +1745,116 @@ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1737
1745
  * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.RestoreDataCollection
1738
1746
  */
1739
1747
  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>>;
1748
+ /**
1749
+ * Patches (partial update) a data collection.
1750
+ * @param _id - Collection ID. For example, `my-first-collection`. May include a namespace.
1751
+ * @internal
1752
+ * @documentationMaturity preview
1753
+ * @requiredField _id
1754
+ * @requiredField dataCollection
1755
+ * @requiredField dataCollection.revision
1756
+ * @permissionId WIX_DATA.UPDATE_COLLECTION
1757
+ * @applicableIdentity APP
1758
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.PatchDataCollection
1759
+ */
1760
+ declare function patchDataCollection(_id: string, dataCollection: NonNullablePaths<PatchDataCollection, `revision`, 2>): Promise<NonNullablePaths<PatchDataCollectionResponse, `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>>;
1761
+ interface PatchDataCollection {
1762
+ /**
1763
+ * Collection ID. For example, `my-first-collection`. May include a namespace.
1764
+ * @immutable
1765
+ * @maxLength 256
1766
+ */
1767
+ _id?: string;
1768
+ /**
1769
+ * Collection type. Indicates how the collection was created and how it is stored.
1770
+ * @readonly
1771
+ */
1772
+ collectionType?: CollectionTypeWithLiterals;
1773
+ /**
1774
+ * ID of the app that defined this collection. For collections defined by Wix users, this value is null.
1775
+ * @format GUID
1776
+ * @readonly
1777
+ */
1778
+ ownerAppId?: string | null;
1779
+ /**
1780
+ * Maximum number of items returned in a single query, based on the underlying storage.
1781
+ * Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries.
1782
+ * External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
1783
+ * @readonly
1784
+ */
1785
+ maxPageSize?: number | null;
1786
+ /**
1787
+ * Collection's display name as shown in the CMS. For example, `My First Collection`.
1788
+ * @maxLength 1000
1789
+ */
1790
+ displayName?: string | null;
1791
+ /**
1792
+ * Default item sorting order when a query doesn't specify one.
1793
+ * @readonly
1794
+ */
1795
+ defaultDisplayOrder?: Sort;
1796
+ /**
1797
+ * UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings.
1798
+ * Empty for all data collections not owned by Wix apps.
1799
+ * @readonly
1800
+ * @maxLength 1000
1801
+ */
1802
+ displayNamespace?: string | null;
1803
+ /**
1804
+ * Field whose value the CMS displays to represent the collection item when referenced in a different collection.
1805
+ * @maxLength 1000
1806
+ */
1807
+ displayField?: string | null;
1808
+ /**
1809
+ * Capabilities the collection supports.
1810
+ * @readonly
1811
+ */
1812
+ capabilities?: CollectionCapabilities;
1813
+ /**
1814
+ * Collection's field structure.
1815
+ * @maxSize 1000
1816
+ */
1817
+ fields?: Field[];
1818
+ /** Levels of permission for accessing and modifying data, defined by lowest role needed to perform each action. */
1819
+ permissions?: Permissions;
1820
+ /**
1821
+ * Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must specify the latest revision number.
1822
+ * @readonly
1823
+ */
1824
+ revision?: string | null;
1825
+ /**
1826
+ * Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality.
1827
+ * @maxSize 100
1828
+ */
1829
+ plugins?: Plugin[];
1830
+ /**
1831
+ * Paging modes the collection supports. In native collections, offset-based paging is supported by default.
1832
+ * @readonly
1833
+ * @maxSize 2
1834
+ */
1835
+ pagingModes?: PagingModeWithLiterals[];
1836
+ /**
1837
+ * Date the collection was created.
1838
+ * @readonly
1839
+ */
1840
+ _createdDate?: Date | null;
1841
+ /**
1842
+ * Date the collection was last updated.
1843
+ * @readonly
1844
+ */
1845
+ _updatedDate?: Date | null;
1846
+ /**
1847
+ * Levels of permission for accessing and modifying data.
1848
+ * @internal
1849
+ */
1850
+ dataPermissions?: DataPermissions;
1851
+ /**
1852
+ * Actual data operations permitted for the caller. Included only if requested by `include_allowed_data_permissions`
1853
+ * @internal
1854
+ * @readonly
1855
+ */
1856
+ allowedDataPermissions?: AllowedDataPermissions;
1857
+ }
1740
1858
  /**
1741
1859
  * Adds a new field to the structure of a data collection.
1742
1860
  * @param dataCollectionId - ID of the data collection to update.
@@ -1799,4 +1917,4 @@ interface DeleteDataCollectionFieldOptions {
1799
1917
  fieldKey: string;
1800
1918
  }
1801
1919
 
1802
- export { AccessLevel, type AccessLevelWithLiterals, type ActionEvent, type AllowedDataPermissions, type AppOptions, type ApplicationError, type ArraySizeRange, type BulkGetDataCollectionsPageBySnapshotsRequest, type BulkGetDataCollectionsPageBySnapshotsRequestTenantModeOptionsOneOf, type BulkGetDataCollectionsPageBySnapshotsResponse, type BulkGetDataCollectionsRequest, type BulkGetDataCollectionsResponse, type Calculator, type CalculatorPatternOneOf, type CatalogOptions, type CmsOptions, type CollectionCapabilities, type CollectionDefinition, CollectionOperation, type CollectionOperationWithLiterals, CollectionType, type CollectionTypeWithLiterals, type CreateAppCollectionsSnapshotRequest, type CreateAppCollectionsSnapshotResponse, 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 Slug, type SnapshotCollection, type Sort, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, type StringLengthRange, TenantMode, type TenantModeWithLiterals, 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, restoreDataCollection, updateDataCollection, updateDataCollectionField };
1920
+ export { AccessLevel, type AccessLevelWithLiterals, type ActionEvent, type AllowedDataPermissions, type AppOptions, type ApplicationError, type ArraySizeRange, type BulkGetDataCollectionsPageBySnapshotsRequest, type BulkGetDataCollectionsPageBySnapshotsRequestTenantModeOptionsOneOf, type BulkGetDataCollectionsPageBySnapshotsResponse, type BulkGetDataCollectionsRequest, type BulkGetDataCollectionsResponse, type Calculator, type CalculatorPatternOneOf, type CatalogOptions, type CmsOptions, type CollectionCapabilities, type CollectionDefinition, CollectionOperation, type CollectionOperationWithLiterals, CollectionType, type CollectionTypeWithLiterals, type CreateAppCollectionsSnapshotRequest, type CreateAppCollectionsSnapshotResponse, 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 PatchDataCollection, type PatchDataCollectionRequest, type PatchDataCollectionResponse, 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 Slug, type SnapshotCollection, type Sort, SortOrder, type SortOrderWithLiterals, type Sorting, Status, type StatusWithLiterals, type StringLengthRange, TenantMode, type TenantModeWithLiterals, 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, patchDataCollection, restoreDataCollection, updateDataCollection, updateDataCollectionField };
@@ -46,6 +46,7 @@ __export(index_typings_exports, {
46
46
  deleteDataCollectionField: () => deleteDataCollectionField2,
47
47
  getDataCollection: () => getDataCollection2,
48
48
  listDataCollections: () => listDataCollections2,
49
+ patchDataCollection: () => patchDataCollection2,
49
50
  restoreDataCollection: () => restoreDataCollection2,
50
51
  updateDataCollection: () => updateDataCollection2,
51
52
  updateDataCollectionField: () => updateDataCollectionField2
@@ -62,6 +63,7 @@ var import_float = require("@wix/sdk-runtime/transformations/float");
62
63
  var import_float2 = require("@wix/sdk-runtime/transformations/float");
63
64
  var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
64
65
  var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
66
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
65
67
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
66
68
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
67
69
  function resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(opts) {
@@ -656,6 +658,65 @@ function restoreDataCollection(payload) {
656
658
  }
657
659
  return __restoreDataCollection;
658
660
  }
661
+ function patchDataCollection(payload) {
662
+ function __patchDataCollection({ host }) {
663
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
664
+ {
665
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
666
+ paths: [{ path: "fieldMask" }]
667
+ },
668
+ {
669
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
670
+ paths: [
671
+ { path: "dataCollection.createdDate" },
672
+ { path: "dataCollection.updatedDate" }
673
+ ]
674
+ },
675
+ {
676
+ transformFn: import_float.transformSDKFloatToRESTFloat,
677
+ paths: [
678
+ { path: "dataCollection.fields.numberRange.min" },
679
+ { path: "dataCollection.fields.numberRange.max" }
680
+ ]
681
+ }
682
+ ]);
683
+ const metadata = {
684
+ entityFqdn: "wix.data.v2.data_collection",
685
+ method: "PATCH",
686
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.PatchDataCollection",
687
+ packageName: PACKAGE_NAME,
688
+ migrationOptions: {
689
+ optInTransformResponse: true
690
+ },
691
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
692
+ {
693
+ protoPath: "/v2/collections/{dataCollection.id}",
694
+ data: serializedData,
695
+ host
696
+ }
697
+ ),
698
+ data: serializedData,
699
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
700
+ {
701
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
702
+ paths: [
703
+ { path: "dataCollection.createdDate" },
704
+ { path: "dataCollection.updatedDate" }
705
+ ]
706
+ },
707
+ {
708
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
709
+ paths: [
710
+ { path: "dataCollection.fields.numberRange.min" },
711
+ { path: "dataCollection.fields.numberRange.max" }
712
+ ]
713
+ }
714
+ ])
715
+ };
716
+ return metadata;
717
+ }
718
+ return __patchDataCollection;
719
+ }
659
720
  function createDataCollectionField(payload) {
660
721
  function __createDataCollectionField({ host }) {
661
722
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -1146,6 +1207,31 @@ async function restoreDataCollection2(dataCollectionId) {
1146
1207
  throw transformedError;
1147
1208
  }
1148
1209
  }
1210
+ async function patchDataCollection2(_id, dataCollection) {
1211
+ const { httpClient, sideEffects } = arguments[2];
1212
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1213
+ dataCollection: { ...dataCollection, id: _id }
1214
+ });
1215
+ const reqOpts = patchDataCollection(payload);
1216
+ sideEffects?.onSiteCall?.();
1217
+ try {
1218
+ const result = await httpClient.request(reqOpts);
1219
+ sideEffects?.onSuccess?.(result);
1220
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1221
+ } catch (err) {
1222
+ const transformedError = (0, import_transform_error.transformError)(
1223
+ err,
1224
+ {
1225
+ spreadPathsToArguments: { dataCollection: "$[1]" },
1226
+ explicitPathsToArguments: { "dataCollection.id": "$[0]" },
1227
+ singleArgumentUnchanged: false
1228
+ },
1229
+ ["_id", "dataCollection"]
1230
+ );
1231
+ sideEffects?.onError?.(err);
1232
+ throw transformedError;
1233
+ }
1234
+ }
1149
1235
  async function createDataCollectionField2(dataCollectionId, options) {
1150
1236
  const { httpClient, sideEffects } = arguments[2];
1151
1237
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1261,6 +1347,7 @@ async function deleteDataCollectionField2(dataCollectionId, options) {
1261
1347
  deleteDataCollectionField,
1262
1348
  getDataCollection,
1263
1349
  listDataCollections,
1350
+ patchDataCollection,
1264
1351
  restoreDataCollection,
1265
1352
  updateDataCollection,
1266
1353
  updateDataCollectionField