@wix/auto_sdk_stores_customizations-v-3 1.0.37 → 1.0.39

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { Customization, CreateCustomizationApplicationErrors, CreateCustomizationValidationErrors, GetCustomizationOptions, UpdateCustomization, UpdateCustomizationOptions, DeleteCustomizationValidationErrors, QueryCustomizationsOptions, CustomizationsQueryBuilder, BulkCreateCustomizationsOptions, BulkCreateCustomizationsResponse, BulkCreateCustomizationsApplicationErrors, BulkCreateCustomizationsValidationErrors, Choice, AddCustomizationChoicesOptions, AddCustomizationChoicesResponse, AddCustomizationChoicesApplicationErrors, AddCustomizationChoicesValidationErrors, SetCustomizationChoicesOptions, SetCustomizationChoicesResponse, SetCustomizationChoicesApplicationErrors, SetCustomizationChoicesValidationErrors, RemoveCustomizationChoicesOptions, RemoveCustomizationChoicesResponse, RemoveCustomizationChoicesApplicationErrors, RemoveCustomizationChoicesValidationErrors, CustomizationChoices, BulkAddCustomizationChoicesOptions, BulkAddCustomizationChoicesResponse, BulkAddCustomizationChoicesApplicationErrors, BulkAddCustomizationChoicesValidationErrors, MaskedCustomization, BulkUpdateCustomizationsOptions, BulkUpdateCustomizationsResponse, CustomizationCreatedEnvelope, CustomizationDeletedEnvelope, CustomizationUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, AddCustomizationChoicesRequest, App, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkAddCustomizationChoicesRequest, BulkCreateCustomizationsRequest, BulkCustomizationResult, BulkUpdateCustomizationsRequest, ChoiceType, ChoiceTypeWithLiterals, ChoiceValueOneOf, ChoicesSettings, CreateCustomizationRequest, CreateCustomizationResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomTag, CustomizationCustomizationSettingsOneOf, CustomizationIdsWrapper, CustomizationRenderType, CustomizationRenderTypeWithLiterals, CustomizationType, CustomizationTypeWithLiterals, CustomizationsQueryResult, DeleteCustomizationRequest, DeleteCustomizationResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, File, FocalPoint, FreeTextSettings, GetCustomizationRequest, GetCustomizationResponse, IdentificationData, IdentificationDataIdOneOf, InvalidateCache, InvalidateCacheGetByOneOf, ItemMetadata, MessageEnvelope, MultipleColors, Page, QueryCustomizationsRequest, QueryCustomizationsResponse, RemoveCustomizationChoicesRequest, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, SetCustomizationChoicesRequest, SortOrder, SortOrderWithLiterals, Sorting, URI, UpdateCustomizationRequest, UpdateCustomizationResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { Customization, CreateCustomizationApplicationErrors, CreateCustomizationValidationErrors, GetCustomizationOptions, UpdateCustomization, UpdateCustomizationOptions, DeleteCustomizationValidationErrors, BulkCreateCustomizationsOptions, BulkCreateCustomizationsResponse, BulkCreateCustomizationsApplicationErrors, BulkCreateCustomizationsValidationErrors, Choice, AddCustomizationChoicesOptions, AddCustomizationChoicesResponse, AddCustomizationChoicesApplicationErrors, AddCustomizationChoicesValidationErrors, SetCustomizationChoicesOptions, SetCustomizationChoicesResponse, SetCustomizationChoicesApplicationErrors, SetCustomizationChoicesValidationErrors, RemoveCustomizationChoicesOptions, RemoveCustomizationChoicesResponse, RemoveCustomizationChoicesApplicationErrors, RemoveCustomizationChoicesValidationErrors, CustomizationChoices, BulkAddCustomizationChoicesOptions, BulkAddCustomizationChoicesResponse, BulkAddCustomizationChoicesApplicationErrors, BulkAddCustomizationChoicesValidationErrors, MaskedCustomization, BulkUpdateCustomizationsOptions, BulkUpdateCustomizationsResponse, CustomizationCreatedEnvelope, CustomizationDeletedEnvelope, CustomizationUpdatedEnvelope, CursorQuery, typedQueryCustomizations, QueryCustomizationsOptions, CustomizationsQueryBuilder } from './index.typings.js';
3
+ export { ActionEvent, AddCustomizationChoicesRequest, App, ApplicationError, BaseEventMetadata, BulkActionMetadata, BulkAddCustomizationChoicesRequest, BulkCreateCustomizationsRequest, BulkCustomizationResult, BulkUpdateCustomizationsRequest, ChoiceType, ChoiceTypeWithLiterals, ChoiceValueOneOf, ChoicesSettings, CreateCustomizationRequest, CreateCustomizationResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, CustomTag, CustomizationCustomizationSettingsOneOf, CustomizationIdsWrapper, CustomizationRenderType, CustomizationRenderTypeWithLiterals, CustomizationType, CustomizationTypeWithLiterals, CustomizationsQueryResult, DeleteCustomizationRequest, DeleteCustomizationResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, File, FocalPoint, FreeTextSettings, GetCustomizationRequest, GetCustomizationResponse, IdentificationData, IdentificationDataIdOneOf, InvalidateCache, InvalidateCacheGetByOneOf, ItemMetadata, MessageEnvelope, MultipleColors, Page, QueryCustomizationsRequest, QueryCustomizationsResponse, RemoveCustomizationChoicesRequest, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, SetCustomizationChoicesRequest, SortOrder, SortOrderWithLiterals, Sorting, URI, UpdateCustomizationRequest, UpdateCustomizationResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function createCustomization$1(httpClient: HttpClient): CreateCustomizationSignature;
6
6
  interface CreateCustomizationSignature {
@@ -48,27 +48,6 @@ interface DeleteCustomizationSignature {
48
48
  __validationErrorsType?: DeleteCustomizationValidationErrors;
49
49
  }>;
50
50
  }
51
- declare function queryCustomizations$1(httpClient: HttpClient): QueryCustomizationsSignature;
52
- interface QueryCustomizationsSignature {
53
- /**
54
- * Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging.
55
- * Pass supported values to the `fields` array in the request to include those fields in the response.
56
- *
57
- *
58
- * Query Customizations runs with these defaults, which you can override:
59
- *
60
- * - `createdDate` is sorted in `DESC` order
61
- * - `cursorPaging.limit` is `100`
62
- *
63
- * For field support for filters and sorting,
64
- * see [Customizations: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/customizations-v3/supported-filters-and-sorting).
65
- *
66
- * To learn about working with _Query_ endpoints, see
67
- * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
68
- * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
69
- */
70
- (options?: QueryCustomizationsOptions): CustomizationsQueryBuilder;
71
- }
72
51
  declare function bulkCreateCustomizations$1(httpClient: HttpClient): BulkCreateCustomizationsSignature;
73
52
  interface BulkCreateCustomizationsSignature {
74
53
  /**
@@ -147,17 +126,23 @@ declare const onCustomizationCreated$1: EventDefinition<CustomizationCreatedEnve
147
126
  declare const onCustomizationDeleted$1: EventDefinition<CustomizationDeletedEnvelope, "wix.stores.catalog.v3.customization_deleted">;
148
127
  declare const onCustomizationUpdated$1: EventDefinition<CustomizationUpdatedEnvelope, "wix.stores.catalog.v3.customization_updated">;
149
128
 
129
+ declare function customQueryCustomizations(httpClient: HttpClient): {
130
+ (query: CursorQuery): ReturnType<typeof typedQueryCustomizations>;
131
+ (query: CursorQuery, options: QueryCustomizationsOptions): ReturnType<typeof typedQueryCustomizations>;
132
+ (): CustomizationsQueryBuilder;
133
+ (options: QueryCustomizationsOptions): CustomizationsQueryBuilder;
134
+ };
150
135
  declare const createCustomization: MaybeContext<BuildRESTFunction<typeof createCustomization$1> & typeof createCustomization$1>;
151
136
  declare const getCustomization: MaybeContext<BuildRESTFunction<typeof getCustomization$1> & typeof getCustomization$1>;
152
137
  declare const updateCustomization: MaybeContext<BuildRESTFunction<typeof updateCustomization$1> & typeof updateCustomization$1>;
153
138
  declare const deleteCustomization: MaybeContext<BuildRESTFunction<typeof deleteCustomization$1> & typeof deleteCustomization$1>;
154
- declare const queryCustomizations: MaybeContext<BuildRESTFunction<typeof queryCustomizations$1> & typeof queryCustomizations$1>;
155
139
  declare const bulkCreateCustomizations: MaybeContext<BuildRESTFunction<typeof bulkCreateCustomizations$1> & typeof bulkCreateCustomizations$1>;
156
140
  declare const addCustomizationChoices: MaybeContext<BuildRESTFunction<typeof addCustomizationChoices$1> & typeof addCustomizationChoices$1>;
157
141
  declare const setCustomizationChoices: MaybeContext<BuildRESTFunction<typeof setCustomizationChoices$1> & typeof setCustomizationChoices$1>;
158
142
  declare const removeCustomizationChoices: MaybeContext<BuildRESTFunction<typeof removeCustomizationChoices$1> & typeof removeCustomizationChoices$1>;
159
143
  declare const bulkAddCustomizationChoices: MaybeContext<BuildRESTFunction<typeof bulkAddCustomizationChoices$1> & typeof bulkAddCustomizationChoices$1>;
160
144
  declare const bulkUpdateCustomizations: MaybeContext<BuildRESTFunction<typeof bulkUpdateCustomizations$1> & typeof bulkUpdateCustomizations$1>;
145
+ declare const queryCustomizations: MaybeContext<BuildRESTFunction<typeof customQueryCustomizations> & typeof customQueryCustomizations>;
161
146
  /**
162
147
  * Triggered when a customization is created.
163
148
  */
@@ -171,4 +156,4 @@ declare const onCustomizationDeleted: BuildEventDefinition<typeof onCustomizatio
171
156
  */
172
157
  declare const onCustomizationUpdated: BuildEventDefinition<typeof onCustomizationUpdated$1> & typeof onCustomizationUpdated$1;
173
158
 
174
- export { AddCustomizationChoicesApplicationErrors, AddCustomizationChoicesOptions, AddCustomizationChoicesResponse, AddCustomizationChoicesValidationErrors, BulkAddCustomizationChoicesApplicationErrors, BulkAddCustomizationChoicesOptions, BulkAddCustomizationChoicesResponse, BulkAddCustomizationChoicesValidationErrors, BulkCreateCustomizationsApplicationErrors, BulkCreateCustomizationsOptions, BulkCreateCustomizationsResponse, BulkCreateCustomizationsValidationErrors, BulkUpdateCustomizationsOptions, BulkUpdateCustomizationsResponse, Choice, CreateCustomizationApplicationErrors, CreateCustomizationValidationErrors, Customization, CustomizationChoices, CustomizationCreatedEnvelope, CustomizationDeletedEnvelope, CustomizationUpdatedEnvelope, CustomizationsQueryBuilder, DeleteCustomizationValidationErrors, GetCustomizationOptions, MaskedCustomization, QueryCustomizationsOptions, RemoveCustomizationChoicesApplicationErrors, RemoveCustomizationChoicesOptions, RemoveCustomizationChoicesResponse, RemoveCustomizationChoicesValidationErrors, SetCustomizationChoicesApplicationErrors, SetCustomizationChoicesOptions, SetCustomizationChoicesResponse, SetCustomizationChoicesValidationErrors, UpdateCustomization, UpdateCustomizationOptions, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, setCustomizationChoices, updateCustomization };
159
+ export { AddCustomizationChoicesApplicationErrors, AddCustomizationChoicesOptions, AddCustomizationChoicesResponse, AddCustomizationChoicesValidationErrors, BulkAddCustomizationChoicesApplicationErrors, BulkAddCustomizationChoicesOptions, BulkAddCustomizationChoicesResponse, BulkAddCustomizationChoicesValidationErrors, BulkCreateCustomizationsApplicationErrors, BulkCreateCustomizationsOptions, BulkCreateCustomizationsResponse, BulkCreateCustomizationsValidationErrors, BulkUpdateCustomizationsOptions, BulkUpdateCustomizationsResponse, Choice, CreateCustomizationApplicationErrors, CreateCustomizationValidationErrors, CursorQuery, Customization, CustomizationChoices, CustomizationCreatedEnvelope, CustomizationDeletedEnvelope, CustomizationUpdatedEnvelope, CustomizationsQueryBuilder, DeleteCustomizationValidationErrors, GetCustomizationOptions, MaskedCustomization, QueryCustomizationsOptions, RemoveCustomizationChoicesApplicationErrors, RemoveCustomizationChoicesOptions, RemoveCustomizationChoicesResponse, RemoveCustomizationChoicesValidationErrors, SetCustomizationChoicesApplicationErrors, SetCustomizationChoicesOptions, SetCustomizationChoicesResponse, SetCustomizationChoicesValidationErrors, UpdateCustomization, UpdateCustomizationOptions, addCustomizationChoices, bulkAddCustomizationChoices, bulkCreateCustomizations, bulkUpdateCustomizations, createCustomization, deleteCustomization, getCustomization, onCustomizationCreated, onCustomizationDeleted, onCustomizationUpdated, queryCustomizations, removeCustomizationChoices, setCustomizationChoices, updateCustomization };
@@ -957,6 +957,39 @@ function queryCustomizations2(options) {
957
957
  transformationPaths: {}
958
958
  });
959
959
  }
960
+ async function typedQueryCustomizations(query, options) {
961
+ const { httpClient, sideEffects } = arguments[2];
962
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
963
+ query,
964
+ ...options
965
+ });
966
+ const reqOpts = queryCustomizations(payload);
967
+ sideEffects?.onSiteCall?.();
968
+ try {
969
+ const result = await httpClient.request(reqOpts);
970
+ sideEffects?.onSuccess?.(result);
971
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
972
+ (0, import_transform_paths2.transformPaths)(result.data, [
973
+ {
974
+ transformFn: import_image2.transformRESTImageToSDKImage,
975
+ paths: [{ path: "customizations.choicesSettings.choices.image" }]
976
+ }
977
+ ])
978
+ );
979
+ } catch (err) {
980
+ const transformedError = (0, import_transform_error.transformError)(
981
+ err,
982
+ {
983
+ spreadPathsToArguments: {},
984
+ explicitPathsToArguments: { query: "$[0]" },
985
+ singleArgumentUnchanged: false
986
+ },
987
+ ["query", "options"]
988
+ );
989
+ sideEffects?.onError?.(err);
990
+ throw transformedError;
991
+ }
992
+ }
960
993
  async function bulkCreateCustomizations2(customizations, options) {
961
994
  const { httpClient, sideEffects } = arguments[2];
962
995
  const payload = (0, import_transform_paths2.transformPaths)(
@@ -1279,6 +1312,14 @@ function queryCustomizations3(httpClient) {
1279
1312
  { httpClient }
1280
1313
  );
1281
1314
  }
1315
+ function typedQueryCustomizations2(httpClient) {
1316
+ return (query, options) => typedQueryCustomizations(
1317
+ query,
1318
+ options,
1319
+ // @ts-ignore
1320
+ { httpClient }
1321
+ );
1322
+ }
1282
1323
  function bulkCreateCustomizations3(httpClient) {
1283
1324
  return (customizations, options) => bulkCreateCustomizations2(
1284
1325
  customizations,
@@ -1394,17 +1435,29 @@ var onCustomizationUpdated = (0, import_sdk_types.EventDefinition)(
1394
1435
  // src/stores-catalog-v3-customization-customizations-v-3.context.ts
1395
1436
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1396
1437
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
1438
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
1439
+ function customQueryCustomizations(httpClient) {
1440
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
1441
+ builderQueryFunction: (options) => queryCustomizations3(httpClient)(options),
1442
+ typedQueryFunction: (query, options) => typedQueryCustomizations2(httpClient)(query, options),
1443
+ hasOptionsParameter: true
1444
+ });
1445
+ function overloadedQuery(queryOrOptions, options) {
1446
+ return router(...arguments);
1447
+ }
1448
+ return overloadedQuery;
1449
+ }
1397
1450
  var createCustomization4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCustomization3);
1398
1451
  var getCustomization4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCustomization3);
1399
1452
  var updateCustomization4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCustomization3);
1400
1453
  var deleteCustomization4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteCustomization3);
1401
- var queryCustomizations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryCustomizations3);
1402
1454
  var bulkCreateCustomizations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateCustomizations3);
1403
1455
  var addCustomizationChoices4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addCustomizationChoices3);
1404
1456
  var setCustomizationChoices4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setCustomizationChoices3);
1405
1457
  var removeCustomizationChoices4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeCustomizationChoices3);
1406
1458
  var bulkAddCustomizationChoices4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkAddCustomizationChoices3);
1407
1459
  var bulkUpdateCustomizations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateCustomizations3);
1460
+ var queryCustomizations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryCustomizations);
1408
1461
  var onCustomizationCreated2 = (0, import_event_definition_modules.createEventModule)(
1409
1462
  onCustomizationCreated
1410
1463
  );