@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
@@ -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.js';
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, 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.js';
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.js';
4
4
 
5
5
  declare function createDataCollection$1(httpClient: HttpClient): CreateDataCollectionSignature;
6
6
  interface CreateDataCollectionSignature {
@@ -46,6 +46,7 @@ __export(index_exports, {
46
46
  deleteDataCollectionField: () => deleteDataCollectionField4,
47
47
  getDataCollection: () => getDataCollection4,
48
48
  listDataCollections: () => listDataCollections4,
49
+ patchDataCollection: () => patchDataCollection4,
49
50
  restoreDataCollection: () => restoreDataCollection4,
50
51
  updateDataCollection: () => updateDataCollection4,
51
52
  updateDataCollectionField: () => updateDataCollectionField4
@@ -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)({
@@ -1278,6 +1364,14 @@ function restoreDataCollection3(httpClient) {
1278
1364
  { httpClient }
1279
1365
  );
1280
1366
  }
1367
+ function patchDataCollection3(httpClient) {
1368
+ return (_id, dataCollection) => patchDataCollection2(
1369
+ _id,
1370
+ dataCollection,
1371
+ // @ts-ignore
1372
+ { httpClient }
1373
+ );
1374
+ }
1281
1375
  function createDataCollectionField3(httpClient) {
1282
1376
  return (dataCollectionId, options) => createDataCollectionField2(
1283
1377
  dataCollectionId,
@@ -1311,6 +1405,7 @@ var listDataCollections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTMo
1311
1405
  var updateDataCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateDataCollection3);
1312
1406
  var deleteDataCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDataCollection3);
1313
1407
  var restoreDataCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(restoreDataCollection3);
1408
+ var patchDataCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(patchDataCollection3);
1314
1409
  var createDataCollectionField4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createDataCollectionField3);
1315
1410
  var updateDataCollectionField4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateDataCollectionField3);
1316
1411
  var deleteDataCollectionField4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteDataCollectionField3);
@@ -1342,6 +1437,7 @@ var deleteDataCollectionField4 = /* @__PURE__ */ (0, import_rest_modules3.create
1342
1437
  deleteDataCollectionField,
1343
1438
  getDataCollection,
1344
1439
  listDataCollections,
1440
+ patchDataCollection,
1345
1441
  restoreDataCollection,
1346
1442
  updateDataCollection,
1347
1443
  updateDataCollectionField