@wix/auto_sdk_data_collections 1.0.41 → 1.0.42

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 +11 -3
  2. package/build/cjs/index.js +92 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +100 -1
  5. package/build/cjs/index.typings.js +83 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +19 -2
  8. package/build/cjs/meta.js +75 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +11 -3
  11. package/build/es/index.mjs +91 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +100 -1
  14. package/build/es/index.typings.mjs +82 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +19 -2
  17. package/build/es/meta.mjs +74 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +11 -3
  20. package/build/internal/cjs/index.js +92 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +100 -1
  23. package/build/internal/cjs/index.typings.js +83 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +19 -2
  26. package/build/internal/cjs/meta.js +75 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +11 -3
  29. package/build/internal/es/index.mjs +91 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +100 -1
  32. package/build/internal/es/index.typings.mjs +82 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +19 -2
  35. package/build/internal/es/meta.mjs +74 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1094,6 +1094,19 @@ interface DeleteDataCollectionFieldResponse {
1094
1094
  /** Updated data collection. */
1095
1095
  dataCollection?: DataCollection;
1096
1096
  }
1097
+ interface PatchDataCollectionFieldRequest {
1098
+ /**
1099
+ * ID of the data collection to update.
1100
+ * @maxLength 256
1101
+ */
1102
+ dataCollectionId: string;
1103
+ /** Field to patch. */
1104
+ field: Field;
1105
+ }
1106
+ interface PatchDataCollectionFieldResponse {
1107
+ /** Updated data collection. */
1108
+ dataCollection?: DataCollection;
1109
+ }
1097
1110
  interface UpdateDataPermissionsRequest {
1098
1111
  /**
1099
1112
  * ID of data collections to update
@@ -1838,5 +1851,91 @@ interface DeleteDataCollectionFieldOptions {
1838
1851
  */
1839
1852
  fieldKey: string;
1840
1853
  }
1854
+ /**
1855
+ * Patches (partial update) a field in the structure of a data collection.
1856
+ * @public
1857
+ * @documentationMaturity preview
1858
+ * @requiredField field
1859
+ * @requiredField identifiers
1860
+ * @requiredField identifiers.dataCollectionId
1861
+ * @requiredField identifiers.fieldKey
1862
+ * @permissionId WIX_DATA.UPDATE_COLLECTION_FIELD
1863
+ * @applicableIdentity APP
1864
+ * @fqn com.wixpress.cloud.data.api.collectionservice.DataCollectionService.PatchDataCollectionField
1865
+ */
1866
+ declare function patchDataCollectionField(identifiers: NonNullablePaths<PatchDataCollectionFieldIdentifiers, `dataCollectionId` | `fieldKey`, 2>, field: PatchDataCollectionField): Promise<NonNullablePaths<PatchDataCollectionFieldResponse, `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>>;
1867
+ interface PatchDataCollectionFieldIdentifiers {
1868
+ /**
1869
+ * ID of the data collection to update.
1870
+ * @maxLength 256
1871
+ */
1872
+ dataCollectionId: string;
1873
+ /**
1874
+ * Unique identifier for the field. For example, `firstName`.
1875
+ * @maxLength 1000
1876
+ */
1877
+ fieldKey?: string;
1878
+ }
1879
+ interface PatchDataCollectionField {
1880
+ /** Range of possible values for a numerical field. */
1881
+ numberRange?: NumberRange;
1882
+ /** Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`. */
1883
+ stringLengthRange?: StringLengthRange;
1884
+ /** Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`. */
1885
+ arraySizeRange?: ArraySizeRange;
1886
+ /**
1887
+ * Field's display name when displayed in the CMS. For example, `First Name`.
1888
+ * @maxLength 1000
1889
+ */
1890
+ displayName?: string | null;
1891
+ /**
1892
+ * Field's data type.
1893
+ *
1894
+ * Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data).
1895
+ */
1896
+ type?: TypeWithLiterals;
1897
+ /** Metadata for complex data types. This property only exists for references, multi-references, objects, and arrays. */
1898
+ typeMetadata?: TypeMetadata;
1899
+ /**
1900
+ * Whether the field is a system field.
1901
+ * @readonly
1902
+ */
1903
+ systemField?: boolean;
1904
+ /**
1905
+ * Capabilities the field supports.
1906
+ * @readonly
1907
+ */
1908
+ capabilities?: FieldCapabilities;
1909
+ /** Whether the field is encrypted. */
1910
+ encrypted?: boolean;
1911
+ /**
1912
+ * Field description.
1913
+ * @maxLength 16000
1914
+ */
1915
+ description?: string | null;
1916
+ /**
1917
+ * Whether the field is read-only. A read-only field can't be changed.
1918
+ *
1919
+ * Default: `false`
1920
+ */
1921
+ readOnly?: boolean | null;
1922
+ /**
1923
+ * Whether the field is immutable. An immutable field can be set once, but then cannot be updated.
1924
+ *
1925
+ * Default: `false`
1926
+ */
1927
+ immutable?: boolean | null;
1928
+ /**
1929
+ * Whether the field is required.
1930
+ *
1931
+ * Default: `false`
1932
+ */
1933
+ required?: boolean | null;
1934
+ /**
1935
+ * Additional optional plugins for the field.
1936
+ * @maxSize 100
1937
+ */
1938
+ plugins?: FieldPlugin[];
1939
+ }
1841
1940
 
1842
- 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, updateDataCollection, updateDataCollectionField };
1941
+ 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 PatchDataCollectionField, type PatchDataCollectionFieldIdentifiers, type PatchDataCollectionFieldRequest, type PatchDataCollectionFieldResponse, 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, patchDataCollectionField, updateDataCollection, updateDataCollectionField };
@@ -796,6 +796,58 @@ function deleteDataCollectionField(payload) {
796
796
  }
797
797
  return __deleteDataCollectionField;
798
798
  }
799
+ function patchDataCollectionField(payload) {
800
+ function __patchDataCollectionField({ host }) {
801
+ const serializedData = transformPaths(payload, [
802
+ {
803
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
804
+ paths: [{ path: "fieldMask" }]
805
+ },
806
+ {
807
+ transformFn: transformSDKFloatToRESTFloat,
808
+ paths: [
809
+ { path: "field.numberRange.min" },
810
+ { path: "field.numberRange.max" }
811
+ ]
812
+ }
813
+ ]);
814
+ const metadata = {
815
+ entityFqdn: "wix.data.v2.data_collection",
816
+ method: "PATCH",
817
+ methodFqn: "com.wixpress.cloud.data.api.collectionservice.DataCollectionService.PatchDataCollectionField",
818
+ packageName: PACKAGE_NAME,
819
+ migrationOptions: {
820
+ optInTransformResponse: true
821
+ },
822
+ url: resolveComWixpressCloudDataApiCollectionserviceDataCollectionServiceUrl(
823
+ {
824
+ protoPath: "/v2/collections/{dataCollectionId}/fields/{field.key}",
825
+ data: serializedData,
826
+ host
827
+ }
828
+ ),
829
+ data: serializedData,
830
+ transformResponse: (payload2) => transformPaths(payload2, [
831
+ {
832
+ transformFn: transformRESTTimestampToSDKTimestamp,
833
+ paths: [
834
+ { path: "dataCollection.createdDate" },
835
+ { path: "dataCollection.updatedDate" }
836
+ ]
837
+ },
838
+ {
839
+ transformFn: transformRESTFloatToSDKFloat,
840
+ paths: [
841
+ { path: "dataCollection.fields.numberRange.min" },
842
+ { path: "dataCollection.fields.numberRange.max" }
843
+ ]
844
+ }
845
+ ])
846
+ };
847
+ return metadata;
848
+ }
849
+ return __patchDataCollectionField;
850
+ }
799
851
 
800
852
  // src/data-v2-data-collection-collections.universal.ts
801
853
  var CollectionType = /* @__PURE__ */ ((CollectionType2) => {
@@ -1267,6 +1319,35 @@ async function deleteDataCollectionField2(dataCollectionId, options) {
1267
1319
  throw transformedError;
1268
1320
  }
1269
1321
  }
1322
+ async function patchDataCollectionField2(identifiers, field) {
1323
+ const { httpClient, sideEffects } = arguments[2];
1324
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1325
+ dataCollectionId: identifiers?.dataCollectionId,
1326
+ field: { ...field, key: identifiers?.fieldKey }
1327
+ });
1328
+ const reqOpts = patchDataCollectionField(payload);
1329
+ sideEffects?.onSiteCall?.();
1330
+ try {
1331
+ const result = await httpClient.request(reqOpts);
1332
+ sideEffects?.onSuccess?.(result);
1333
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1334
+ } catch (err) {
1335
+ const transformedError = sdkTransformError(
1336
+ err,
1337
+ {
1338
+ spreadPathsToArguments: { field: "$[1]" },
1339
+ explicitPathsToArguments: {
1340
+ dataCollectionId: "$[0].dataCollectionId",
1341
+ "field.key": "$[0].fieldKey"
1342
+ },
1343
+ singleArgumentUnchanged: false
1344
+ },
1345
+ ["identifiers", "field"]
1346
+ );
1347
+ sideEffects?.onError?.(err);
1348
+ throw transformedError;
1349
+ }
1350
+ }
1270
1351
  export {
1271
1352
  AccessLevel,
1272
1353
  CollectionOperation,
@@ -1295,6 +1376,7 @@ export {
1295
1376
  getDataCollection2 as getDataCollection,
1296
1377
  listDataCollections2 as listDataCollections,
1297
1378
  patchDataCollection2 as patchDataCollection,
1379
+ patchDataCollectionField2 as patchDataCollectionField,
1298
1380
  restoreDataCollection2 as restoreDataCollection,
1299
1381
  updateDataCollection2 as updateDataCollection,
1300
1382
  updateDataCollectionField2 as updateDataCollectionField