@wix/auto_sdk_ecom_local-delivery-options 1.0.28 → 1.0.30

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, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { LocalDeliveryOption, CreateLocalDeliveryOptionApplicationErrors, GetLocalDeliveryOptionOptions, ListLocalDeliveryOptionsResponse, LocalDeliveryOptionsQueryBuilder, UpdateLocalDeliveryOption, DeleteLocalDeliveryOptionOptions, BulkCreateLocalDeliveryOptionResponse, BulkCreateLocalDeliveryOptionApplicationErrors, BulkUpdateLocalDeliveryOptionResponse, AddDeliveryRegionOptions, AddDeliveryRegionResponse, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse } from './index.typings.mjs';
3
- export { ActionEvent, AddDeliveryRegionRequest, AddressLocation, BulkCreateLocalDeliveryOptionRequest, BulkDeleteLocalDeliveryOptionRequest, BulkDeleteLocalDeliveryOptionResponse, BulkUpdateLocalDeliveryOptionRequest, Condition, ConditionType, ConditionTypeWithLiterals, ConditionalRates, CreateLocalDeliveryOptionRequest, CreateLocalDeliveryOptionResponse, CursorPaging, CursorPagingMetadata, Cursors, CustomAreaConfig, DayOfWeek, DayOfWeekWithLiterals, DaySlot, Days, DeleteLocalDeliveryOptionRequest, DeleteLocalDeliveryOptionResponse, Destination, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetLocalDeliveryOptionRequest, GetLocalDeliveryOptionResponse, IdentificationData, IdentificationDataIdOneOf, LengthUnit, LengthUnitWithLiterals, ListLocalDeliveryOptionsRequest, LocalDeliveryAddress, LocalDeliveryOptionConfigOneOf, LocalDeliveryOptionError, LocalDeliveryOptionsQueryResult, LogicalOperator, LogicalOperatorWithLiterals, MessageEnvelope, Paging, QueryLocalDeliveryOptionsRequest, QueryLocalDeliveryOptionsResponse, QueryV2, QueryV2PagingMethodOneOf, RadiusConfig, RemoveDeliveryRegionRequest, RestoreInfo, ScheduledDelivery, SortOrder, SortOrderWithLiterals, Sorting, TimeOfDay, TimePoint, TimeSlot, TimeWindow, UpdateLocalDeliveryOptionRequest, UpdateLocalDeliveryOptionResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, ZipCodeConfig } from './index.typings.mjs';
2
+ import { LocalDeliveryOption, CreateLocalDeliveryOptionApplicationErrors, GetLocalDeliveryOptionOptions, ListLocalDeliveryOptionsResponse, UpdateLocalDeliveryOption, DeleteLocalDeliveryOptionOptions, BulkCreateLocalDeliveryOptionResponse, BulkCreateLocalDeliveryOptionApplicationErrors, BulkUpdateLocalDeliveryOptionResponse, AddDeliveryRegionOptions, AddDeliveryRegionResponse, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, LocalDeliveryOptionsQueryBuilder, QueryV2, typedQueryLocalDeliveryOptions } from './index.typings.mjs';
3
+ export { ActionEvent, AddDeliveryRegionRequest, AddressLocation, BulkCreateLocalDeliveryOptionRequest, BulkDeleteLocalDeliveryOptionRequest, BulkDeleteLocalDeliveryOptionResponse, BulkUpdateLocalDeliveryOptionRequest, Condition, ConditionType, ConditionTypeWithLiterals, ConditionalRates, CreateLocalDeliveryOptionRequest, CreateLocalDeliveryOptionResponse, CursorPaging, CursorPagingMetadata, Cursors, CustomAreaConfig, DayOfWeek, DayOfWeekWithLiterals, DaySlot, Days, DeleteLocalDeliveryOptionRequest, DeleteLocalDeliveryOptionResponse, Destination, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetLocalDeliveryOptionRequest, GetLocalDeliveryOptionResponse, IdentificationData, IdentificationDataIdOneOf, LengthUnit, LengthUnitWithLiterals, ListLocalDeliveryOptionsRequest, LocalDeliveryAddress, LocalDeliveryOptionConfigOneOf, LocalDeliveryOptionError, LocalDeliveryOptionsQueryResult, LogicalOperator, LogicalOperatorWithLiterals, MessageEnvelope, Paging, QueryLocalDeliveryOptionsRequest, QueryLocalDeliveryOptionsResponse, QueryV2PagingMethodOneOf, RadiusConfig, RemoveDeliveryRegionRequest, RestoreInfo, ScheduledDelivery, SortOrder, SortOrderWithLiterals, Sorting, TimeOfDay, TimePoint, TimeSlot, TimeWindow, UpdateLocalDeliveryOptionRequest, UpdateLocalDeliveryOptionResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, ZipCodeConfig } from './index.typings.mjs';
4
4
 
5
5
  declare function createLocalDeliveryOption$1(httpClient: HttpClient): CreateLocalDeliveryOptionSignature;
6
6
  interface CreateLocalDeliveryOptionSignature {
@@ -19,20 +19,6 @@ interface ListLocalDeliveryOptionsSignature {
19
19
  /** @deprecated method is deprecated due to the fact that external_id is deprecated */
20
20
  (externalId: string): Promise<NonNullablePaths<ListLocalDeliveryOptionsResponse, `localDeliveryOptions` | `localDeliveryOptions.${number}.radiusConfig.radius` | `localDeliveryOptions.${number}.radiusConfig.lengthUnit`, 5>>;
21
21
  }
22
- declare function queryLocalDeliveryOptions$1(httpClient: HttpClient): QueryLocalDeliveryOptionsSignature;
23
- interface QueryLocalDeliveryOptionsSignature {
24
- /**
25
- * Retrieves a list of local delivery options, given the provided paging, filtering, and sorting.
26
- *
27
- * For field support for filters and sorting, see [Local Delivery: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-management/payments/tax/tax-regions/supported-filters-and-sorting).
28
- *
29
- * To learn about working with _Query_ endpoints, see
30
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
31
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging),
32
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
33
- */
34
- (): LocalDeliveryOptionsQueryBuilder;
35
- }
36
22
  declare function updateLocalDeliveryOption$1(httpClient: HttpClient): UpdateLocalDeliveryOptionSignature;
37
23
  interface UpdateLocalDeliveryOptionSignature {
38
24
  /** @param - LocalDeliveryOptionId - unique identifier of local delivery option */
@@ -71,10 +57,13 @@ interface RemoveDeliveryRegionSignature {
71
57
  (deliveryRegionId: string, options?: NonNullablePaths<RemoveDeliveryRegionOptions, `localDeliveryOptionId`, 2>): Promise<NonNullablePaths<RemoveDeliveryRegionResponse, `localDeliveryOption.zipConfig.zipCodes` | `localDeliveryOption.radiusConfig.radius` | `localDeliveryOption.radiusConfig.lengthUnit` | `localDeliveryOption.customAreaConfig.geocodes` | `localDeliveryOption.destinations` | `localDeliveryOption.destinations.${number}.code` | `localDeliveryOption.scheduledDeliveryConfig.days.monday.timeSlots` | `localDeliveryOption.scheduledDeliveryConfig.timeWindows` | `localDeliveryOption.scheduledDeliveryConfig.timeWindows.${number}.day` | `localDeliveryOption.scheduledDeliveryConfig.timeWindows.${number}.start.hours` | `localDeliveryOption.scheduledDeliveryConfig.timeWindows.${number}.start.minutes` | `localDeliveryOption.rates` | `localDeliveryOption.rates.${number}.amount` | `localDeliveryOption.rates.${number}.multiplyByQuantity` | `localDeliveryOption.deliveryRegionIds`, 7>>;
72
58
  }
73
59
 
60
+ declare function customQueryLocalDeliveryOptions(httpClient: HttpClient): {
61
+ (): LocalDeliveryOptionsQueryBuilder;
62
+ (query: QueryV2): ReturnType<typeof typedQueryLocalDeliveryOptions>;
63
+ };
74
64
  declare const createLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof createLocalDeliveryOption$1> & typeof createLocalDeliveryOption$1>;
75
65
  declare const getLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof getLocalDeliveryOption$1> & typeof getLocalDeliveryOption$1>;
76
66
  declare const listLocalDeliveryOptions: MaybeContext<BuildRESTFunction<typeof listLocalDeliveryOptions$1> & typeof listLocalDeliveryOptions$1>;
77
- declare const queryLocalDeliveryOptions: MaybeContext<BuildRESTFunction<typeof queryLocalDeliveryOptions$1> & typeof queryLocalDeliveryOptions$1>;
78
67
  declare const updateLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof updateLocalDeliveryOption$1> & typeof updateLocalDeliveryOption$1>;
79
68
  declare const deleteLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof deleteLocalDeliveryOption$1> & typeof deleteLocalDeliveryOption$1>;
80
69
  declare const bulkCreateLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof bulkCreateLocalDeliveryOption$1> & typeof bulkCreateLocalDeliveryOption$1>;
@@ -82,5 +71,6 @@ declare const bulkUpdateLocalDeliveryOption: MaybeContext<BuildRESTFunction<type
82
71
  declare const bulkDeleteLocalDeliveryOption: MaybeContext<BuildRESTFunction<typeof bulkDeleteLocalDeliveryOption$1> & typeof bulkDeleteLocalDeliveryOption$1>;
83
72
  declare const addDeliveryRegion: MaybeContext<BuildRESTFunction<typeof addDeliveryRegion$1> & typeof addDeliveryRegion$1>;
84
73
  declare const removeDeliveryRegion: MaybeContext<BuildRESTFunction<typeof removeDeliveryRegion$1> & typeof removeDeliveryRegion$1>;
74
+ declare const queryLocalDeliveryOptions: MaybeContext<BuildRESTFunction<typeof customQueryLocalDeliveryOptions> & typeof customQueryLocalDeliveryOptions>;
85
75
 
86
- export { AddDeliveryRegionOptions, AddDeliveryRegionResponse, BulkCreateLocalDeliveryOptionApplicationErrors, BulkCreateLocalDeliveryOptionResponse, BulkUpdateLocalDeliveryOptionResponse, CreateLocalDeliveryOptionApplicationErrors, DeleteLocalDeliveryOptionOptions, GetLocalDeliveryOptionOptions, ListLocalDeliveryOptionsResponse, LocalDeliveryOption, LocalDeliveryOptionsQueryBuilder, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, UpdateLocalDeliveryOption, addDeliveryRegion, bulkCreateLocalDeliveryOption, bulkDeleteLocalDeliveryOption, bulkUpdateLocalDeliveryOption, createLocalDeliveryOption, deleteLocalDeliveryOption, getLocalDeliveryOption, listLocalDeliveryOptions, queryLocalDeliveryOptions, removeDeliveryRegion, updateLocalDeliveryOption };
76
+ export { AddDeliveryRegionOptions, AddDeliveryRegionResponse, BulkCreateLocalDeliveryOptionApplicationErrors, BulkCreateLocalDeliveryOptionResponse, BulkUpdateLocalDeliveryOptionResponse, CreateLocalDeliveryOptionApplicationErrors, DeleteLocalDeliveryOptionOptions, GetLocalDeliveryOptionOptions, ListLocalDeliveryOptionsResponse, LocalDeliveryOption, LocalDeliveryOptionsQueryBuilder, QueryV2, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, UpdateLocalDeliveryOption, addDeliveryRegion, bulkCreateLocalDeliveryOption, bulkDeleteLocalDeliveryOption, bulkUpdateLocalDeliveryOption, createLocalDeliveryOption, deleteLocalDeliveryOption, getLocalDeliveryOption, listLocalDeliveryOptions, queryLocalDeliveryOptions, removeDeliveryRegion, updateLocalDeliveryOption };
@@ -845,6 +845,36 @@ function queryLocalDeliveryOptions2() {
845
845
  transformationPaths: {}
846
846
  });
847
847
  }
848
+ async function typedQueryLocalDeliveryOptions(query) {
849
+ const { httpClient, sideEffects } = arguments[1];
850
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query });
851
+ const reqOpts = queryLocalDeliveryOptions(payload);
852
+ sideEffects?.onSiteCall?.();
853
+ try {
854
+ const result = await httpClient.request(reqOpts);
855
+ sideEffects?.onSuccess?.(result);
856
+ return renameKeysFromRESTResponseToSDKResponse(
857
+ transformPaths2(result.data, [
858
+ {
859
+ transformFn: transformRESTAddressToSDKAddress,
860
+ paths: [{ path: "localDeliveryOptions.radiusConfig.address" }]
861
+ }
862
+ ])
863
+ );
864
+ } catch (err) {
865
+ const transformedError = sdkTransformError(
866
+ err,
867
+ {
868
+ spreadPathsToArguments: {},
869
+ explicitPathsToArguments: { query: "$[0]" },
870
+ singleArgumentUnchanged: false
871
+ },
872
+ ["query"]
873
+ );
874
+ sideEffects?.onError?.(err);
875
+ throw transformedError;
876
+ }
877
+ }
848
878
  async function updateLocalDeliveryOption2(_id, localDeliveryOption) {
849
879
  const { httpClient, sideEffects } = arguments[2];
850
880
  const payload = transformPaths2(
@@ -1127,6 +1157,13 @@ function queryLocalDeliveryOptions3(httpClient) {
1127
1157
  { httpClient }
1128
1158
  );
1129
1159
  }
1160
+ function typedQueryLocalDeliveryOptions2(httpClient) {
1161
+ return (query) => typedQueryLocalDeliveryOptions(
1162
+ query,
1163
+ // @ts-ignore
1164
+ { httpClient }
1165
+ );
1166
+ }
1130
1167
  function updateLocalDeliveryOption3(httpClient) {
1131
1168
  return (_id, localDeliveryOption) => updateLocalDeliveryOption2(
1132
1169
  _id,
@@ -1183,10 +1220,21 @@ function removeDeliveryRegion3(httpClient) {
1183
1220
 
1184
1221
  // src/ecom-v1-local-delivery-option-local-delivery-options.context.ts
1185
1222
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1223
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1224
+ function customQueryLocalDeliveryOptions(httpClient) {
1225
+ const router = createQueryOverloadRouter({
1226
+ builderQueryFunction: () => queryLocalDeliveryOptions3(httpClient)(),
1227
+ typedQueryFunction: (query) => typedQueryLocalDeliveryOptions2(httpClient)(query),
1228
+ hasOptionsParameter: false
1229
+ });
1230
+ function overloadedQuery(query) {
1231
+ return router(...arguments);
1232
+ }
1233
+ return overloadedQuery;
1234
+ }
1186
1235
  var createLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(createLocalDeliveryOption3);
1187
1236
  var getLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(getLocalDeliveryOption3);
1188
1237
  var listLocalDeliveryOptions4 = /* @__PURE__ */ createRESTModule(listLocalDeliveryOptions3);
1189
- var queryLocalDeliveryOptions4 = /* @__PURE__ */ createRESTModule(queryLocalDeliveryOptions3);
1190
1238
  var updateLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(updateLocalDeliveryOption3);
1191
1239
  var deleteLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(deleteLocalDeliveryOption3);
1192
1240
  var bulkCreateLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(bulkCreateLocalDeliveryOption3);
@@ -1194,6 +1242,7 @@ var bulkUpdateLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(bulkUpdate
1194
1242
  var bulkDeleteLocalDeliveryOption4 = /* @__PURE__ */ createRESTModule(bulkDeleteLocalDeliveryOption3);
1195
1243
  var addDeliveryRegion4 = /* @__PURE__ */ createRESTModule(addDeliveryRegion3);
1196
1244
  var removeDeliveryRegion4 = /* @__PURE__ */ createRESTModule(removeDeliveryRegion3);
1245
+ var queryLocalDeliveryOptions4 = /* @__PURE__ */ createRESTModule(customQueryLocalDeliveryOptions);
1197
1246
  export {
1198
1247
  ConditionType,
1199
1248
  DayOfWeek,