@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
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { DataCollection, GetDataCollectionOptions, ListDataCollectionsOptions, ListDataCollectionsResponse, CreateDataCollectionFieldOptions, CreateDataCollectionFieldResponse, UpdateDataCollectionFieldOptions, UpdateDataCollectionFieldResponse, DeleteDataCollectionFieldOptions, DeleteDataCollectionFieldResponse } from './index.typings.mjs';
3
- export { AccessLevel, AccessLevelWithLiterals, ActionEvent, AllowedDataPermissions, AppOptions, ApplicationError, ArraySizeRange, BulkGetDataCollectionsPageBySnapshotsRequest, BulkGetDataCollectionsPageBySnapshotsRequestTenantModeOptionsOneOf, BulkGetDataCollectionsPageBySnapshotsResponse, BulkGetDataCollectionsRequest, BulkGetDataCollectionsResponse, Calculator, CalculatorPatternOneOf, CatalogOptions, CmsOptions, CollectionCapabilities, CollectionDefinition, CollectionOperation, CollectionOperationWithLiterals, CollectionType, CollectionTypeWithLiterals, CreateAppCollectionsSnapshotRequest, CreateAppCollectionsSnapshotResponse, CreateDataCollectionFieldRequest, CreateDataCollectionRequest, CreateDataCollectionResponse, CreateDataCollectionsSnapshotRequest, CreateDataCollectionsSnapshotResponse, CreateMigratedCollectionsSnapshotRequest, CreateMigratedCollectionsSnapshotResponse, DataCollectionChangedEvent, DataCollectionClonedEvent, DataCollectionEvictedEvent, DataOperation, DataOperationWithLiterals, DataPermissions, DeleteDataCollectionFieldRequest, DeleteDataCollectionRequest, DeleteDataCollectionResponse, DeleteDataCollectionsSnapshotRequest, DeleteDataCollectionsSnapshotResponse, Destination, Direction, DirectionWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FailedCollection, Failure, Field, FieldCapabilities, FieldPlugin, FieldPluginOptionsOneOf, FieldPluginType, FieldPluginTypeWithLiterals, FieldRangeValidationsOneOf, FieldUpdate, FieldsPattern, Format, FormatWithLiterals, GetDataCollectionRequest, GetDataCollectionResponse, IdentificationData, IdentificationDataIdOneOf, Index, IndexField, IndexLimits, IndexQuotaLimits, IndexSource, IndexSourceWithLiterals, IndexStatus, IndexStatusWithLiterals, ListDataCollectionsRequest, MessageEnvelope, MultiReference, MultilingualOptions, NumberRange, ObjectField, Order, OrderWithLiterals, PageLink, PageLinkPluginOptions, Paging, PagingMetadataV2, PagingMode, PagingModeWithLiterals, Permissions, Plugin, PluginCmsOptions, PluginOptionsOneOf, PluginType, PluginTypeWithLiterals, PluginUpdate, PublishPluginOptions, QueryOperator, QueryOperatorWithLiterals, Reference, RestorationCollection, RestoreDataCollectionRequest, RestoreDataCollectionResponse, RestoreDataCollectionsFromSnapshotRequest, RestoreDataCollectionsFromSnapshotResponse, RestoreInfo, Role, RoleWithLiterals, Segment, SegmentWithLiterals, SingleItemPluginOptions, SiteSort, SnapshotCollection, Sort, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, StringLengthRange, TenantMode, TenantModeWithLiterals, Type, TypeMetadata, TypeMetadataMetadataOneOf, TypeWithLiterals, UpdateDataCollectionFieldRequest, UpdateDataCollectionRequest, UpdateDataCollectionResponse, UpdateDataPermissionsRequest, UpdateDataPermissionsResponse, UrlizedOnlyPattern, UrlizedPluginOptions, WebhookIdentityType, WebhookIdentityTypeWithLiterals, _Array, _Object } from './index.typings.mjs';
3
+ export { AccessLevel, AccessLevelWithLiterals, ActionEvent, AllowedDataPermissions, AppOptions, ApplicationError, ArraySizeRange, BulkGetDataCollectionsPageBySnapshotsRequest, BulkGetDataCollectionsPageBySnapshotsRequestTenantModeOptionsOneOf, BulkGetDataCollectionsPageBySnapshotsResponse, BulkGetDataCollectionsRequest, BulkGetDataCollectionsResponse, Calculator, CalculatorPatternOneOf, CatalogOptions, CmsOptions, CollectionCapabilities, CollectionDefinition, CollectionOperation, CollectionOperationWithLiterals, CollectionType, CollectionTypeWithLiterals, CreateAppCollectionsSnapshotRequest, CreateAppCollectionsSnapshotResponse, CreateDataCollectionFieldRequest, CreateDataCollectionRequest, CreateDataCollectionResponse, CreateDataCollectionsSnapshotRequest, CreateDataCollectionsSnapshotResponse, CreateMigratedCollectionsSnapshotRequest, CreateMigratedCollectionsSnapshotResponse, DataCollectionChangedEvent, DataCollectionClonedEvent, DataCollectionEvictedEvent, DataOperation, DataOperationWithLiterals, DataPermissions, DeleteDataCollectionFieldRequest, DeleteDataCollectionRequest, DeleteDataCollectionResponse, DeleteDataCollectionsSnapshotRequest, DeleteDataCollectionsSnapshotResponse, Destination, Direction, DirectionWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FailedCollection, Failure, Field, FieldCapabilities, FieldPlugin, FieldPluginOptionsOneOf, FieldPluginType, FieldPluginTypeWithLiterals, FieldRangeValidationsOneOf, FieldUpdate, FieldsPattern, Format, FormatWithLiterals, GetDataCollectionRequest, GetDataCollectionResponse, IdentificationData, IdentificationDataIdOneOf, Index, IndexField, IndexLimits, IndexQuotaLimits, IndexSource, IndexSourceWithLiterals, IndexStatus, IndexStatusWithLiterals, ListDataCollectionsRequest, MessageEnvelope, MultiReference, MultilingualOptions, NumberRange, ObjectField, Order, OrderWithLiterals, PageLink, PageLinkPluginOptions, Paging, PagingMetadataV2, PagingMode, PagingModeWithLiterals, PatchDataCollection, PatchDataCollectionRequest, PatchDataCollectionResponse, Permissions, Plugin, PluginCmsOptions, PluginOptionsOneOf, PluginType, PluginTypeWithLiterals, PluginUpdate, PublishPluginOptions, QueryOperator, QueryOperatorWithLiterals, Reference, RestorationCollection, RestoreDataCollectionRequest, RestoreDataCollectionResponse, RestoreDataCollectionsFromSnapshotRequest, RestoreDataCollectionsFromSnapshotResponse, RestoreInfo, Role, RoleWithLiterals, Segment, SegmentWithLiterals, SingleItemPluginOptions, SiteSort, Slug, SnapshotCollection, Sort, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, StringLengthRange, TenantMode, TenantModeWithLiterals, Type, TypeMetadata, TypeMetadataMetadataOneOf, TypeWithLiterals, UpdateDataCollectionFieldRequest, UpdateDataCollectionRequest, UpdateDataCollectionResponse, UpdateDataPermissionsRequest, UpdateDataPermissionsResponse, UrlizedOnlyPattern, UrlizedPluginOptions, WebhookIdentityType, WebhookIdentityTypeWithLiterals, _Array, _Object } from './index.typings.mjs';
4
4
 
5
5
  declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
6
6
  interface CreateDataCollectionSignature {
@@ -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({
@@ -1227,6 +1312,14 @@ function restoreDataCollection3(httpClient) {
1227
1312
  { httpClient }
1228
1313
  );
1229
1314
  }
1315
+ function patchDataCollection3(httpClient) {
1316
+ return (_id, dataCollection) => patchDataCollection2(
1317
+ _id,
1318
+ dataCollection,
1319
+ // @ts-ignore
1320
+ { httpClient }
1321
+ );
1322
+ }
1230
1323
  function createDataCollectionField3(httpClient) {
1231
1324
  return (dataCollectionId, options) => createDataCollectionField2(
1232
1325
  dataCollectionId,
@@ -1260,6 +1353,7 @@ var listDataCollections4 = /* @__PURE__ */ createRESTModule(listDataCollections3
1260
1353
  var updateDataCollection4 = /* @__PURE__ */ createRESTModule(updateDataCollection3);
1261
1354
  var deleteDataCollection4 = /* @__PURE__ */ createRESTModule(deleteDataCollection3);
1262
1355
  var restoreDataCollection4 = /* @__PURE__ */ createRESTModule(restoreDataCollection3);
1356
+ var patchDataCollection4 = /* @__PURE__ */ createRESTModule(patchDataCollection3);
1263
1357
  var createDataCollectionField4 = /* @__PURE__ */ createRESTModule(createDataCollectionField3);
1264
1358
  var updateDataCollectionField4 = /* @__PURE__ */ createRESTModule(updateDataCollectionField3);
1265
1359
  var deleteDataCollectionField4 = /* @__PURE__ */ createRESTModule(deleteDataCollectionField3);
@@ -1290,6 +1384,7 @@ export {
1290
1384
  deleteDataCollectionField4 as deleteDataCollectionField,
1291
1385
  getDataCollection4 as getDataCollection,
1292
1386
  listDataCollections4 as listDataCollections,
1387
+ patchDataCollection4 as patchDataCollection,
1293
1388
  restoreDataCollection4 as restoreDataCollection,
1294
1389
  updateDataCollection4 as updateDataCollection,
1295
1390
  updateDataCollectionField4 as updateDataCollectionField