@wix/auto_sdk_data_collections 1.0.39 → 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 +102 -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 +20 -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 +102 -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 +20 -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 +126 -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 +20 -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 +126 -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 +20 -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
@@ -497,6 +497,13 @@ interface PageLink {
497
497
  */
498
498
  linkedRouterPage?: string | null;
499
499
  }
500
+ interface Slug {
501
+ /**
502
+ * @minLength 1
503
+ * @maxLength 1000
504
+ */
505
+ pattern?: string;
506
+ }
500
507
  interface NumberRange {
501
508
  /**
502
509
  * Minimum permitted value for a numerical field.
@@ -1068,6 +1075,14 @@ interface RestoreDataCollectionResponse {
1068
1075
  /** Restored data collection */
1069
1076
  dataCollection?: DataCollection;
1070
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
+ }
1071
1086
  interface CreateDataCollectionFieldRequest {
1072
1087
  /**
1073
1088
  * ID of the data collection to update.
@@ -1730,6 +1745,116 @@ declare function deleteDataCollection(dataCollectionId: string): Promise<void>;
1730
1745
  * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.RestoreDataCollection
1731
1746
  */
1732
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
+ }
1733
1858
  /**
1734
1859
  * Adds a new field to the structure of a data collection.
1735
1860
  * @param dataCollectionId - ID of the data collection to update.
@@ -1792,4 +1917,4 @@ interface DeleteDataCollectionFieldOptions {
1792
1917
  fieldKey: string;
1793
1918
  }
1794
1919
 
1795
- 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 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 };
@@ -11,6 +11,7 @@ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/f
11
11
  import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
12
12
  import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
13
13
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
14
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
14
15
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
15
16
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
16
17
  function resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(opts) {
@@ -605,6 +606,65 @@ function restoreDataCollection(payload) {
605
606
  }
606
607
  return __restoreDataCollection;
607
608
  }
609
+ function patchDataCollection(payload) {
610
+ function __patchDataCollection({ host }) {
611
+ const serializedData = transformPaths(payload, [
612
+ {
613
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
614
+ paths: [{ path: "fieldMask" }]
615
+ },
616
+ {
617
+ transformFn: transformSDKTimestampToRESTTimestamp,
618
+ paths: [
619
+ { path: "dataCollection.createdDate" },
620
+ { path: "dataCollection.updatedDate" }
621
+ ]
622
+ },
623
+ {
624
+ transformFn: transformSDKFloatToRESTFloat,
625
+ paths: [
626
+ { path: "dataCollection.fields.numberRange.min" },
627
+ { path: "dataCollection.fields.numberRange.max" }
628
+ ]
629
+ }
630
+ ]);
631
+ const metadata = {
632
+ entityFqdn: "wix.data.v2.data_collection",
633
+ method: "PATCH",
634
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.PatchDataCollection",
635
+ packageName: PACKAGE_NAME,
636
+ migrationOptions: {
637
+ optInTransformResponse: true
638
+ },
639
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
640
+ {
641
+ protoPath: "/v2/collections/{dataCollection.id}",
642
+ data: serializedData,
643
+ host
644
+ }
645
+ ),
646
+ data: serializedData,
647
+ transformResponse: (payload2) => transformPaths(payload2, [
648
+ {
649
+ transformFn: transformRESTTimestampToSDKTimestamp,
650
+ paths: [
651
+ { path: "dataCollection.createdDate" },
652
+ { path: "dataCollection.updatedDate" }
653
+ ]
654
+ },
655
+ {
656
+ transformFn: transformRESTFloatToSDKFloat,
657
+ paths: [
658
+ { path: "dataCollection.fields.numberRange.min" },
659
+ { path: "dataCollection.fields.numberRange.max" }
660
+ ]
661
+ }
662
+ ])
663
+ };
664
+ return metadata;
665
+ }
666
+ return __patchDataCollection;
667
+ }
608
668
  function createDataCollectionField(payload) {
609
669
  function __createDataCollectionField({ host }) {
610
670
  const serializedData = transformPaths(payload, [
@@ -1095,6 +1155,31 @@ async function restoreDataCollection2(dataCollectionId) {
1095
1155
  throw transformedError;
1096
1156
  }
1097
1157
  }
1158
+ async function patchDataCollection2(_id, dataCollection) {
1159
+ const { httpClient, sideEffects } = arguments[2];
1160
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1161
+ dataCollection: { ...dataCollection, id: _id }
1162
+ });
1163
+ const reqOpts = patchDataCollection(payload);
1164
+ sideEffects?.onSiteCall?.();
1165
+ try {
1166
+ const result = await httpClient.request(reqOpts);
1167
+ sideEffects?.onSuccess?.(result);
1168
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1169
+ } catch (err) {
1170
+ const transformedError = sdkTransformError(
1171
+ err,
1172
+ {
1173
+ spreadPathsToArguments: { dataCollection: "$[1]" },
1174
+ explicitPathsToArguments: { "dataCollection.id": "$[0]" },
1175
+ singleArgumentUnchanged: false
1176
+ },
1177
+ ["_id", "dataCollection"]
1178
+ );
1179
+ sideEffects?.onError?.(err);
1180
+ throw transformedError;
1181
+ }
1182
+ }
1098
1183
  async function createDataCollectionField2(dataCollectionId, options) {
1099
1184
  const { httpClient, sideEffects } = arguments[2];
1100
1185
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1209,6 +1294,7 @@ export {
1209
1294
  deleteDataCollectionField2 as deleteDataCollectionField,
1210
1295
  getDataCollection2 as getDataCollection,
1211
1296
  listDataCollections2 as listDataCollections,
1297
+ patchDataCollection2 as patchDataCollection,
1212
1298
  restoreDataCollection2 as restoreDataCollection,
1213
1299
  updateDataCollection2 as updateDataCollection,
1214
1300
  updateDataCollectionField2 as updateDataCollectionField