@wix/auto_sdk_ecom_shippo-configurations 1.0.38 → 1.0.40

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 { ShippoConfiguration, CreateShippoConfigurationOptions, UpdateShippoConfiguration, ShippoConfigurationsQueryBuilder, UpdateExtendedFieldsOptions, UpdateExtendedFieldsResponse, AddDeliveryRegionOptions, AddDeliveryRegionResponse, RemoveDeliveryRegionIdentifiers, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, ShippoConfigurationCreatedEnvelope, ShippoConfigurationDeletedEnvelope, ShippoConfigurationUpdatedEnvelope } from './index.typings.js';
3
- export { ActionEvent, AddDeliveryRegionRequest, Address, AddressLocation, BaseEventMetadata, CalculationType, CalculationTypeWithLiterals, CreateShippoConfigurationRequest, CreateShippoConfigurationResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteShippoConfigurationRequest, DeleteShippoConfigurationResponse, DomainEvent, DomainEventBodyOneOf, DomesticService, DomesticServiceSettings, DomesticServiceWithLiterals, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GetShippoConfigurationRequest, GetShippoConfigurationResponse, HandlingFee, IdentificationData, IdentificationDataIdOneOf, InternationalService, InternationalServiceSettings, InternationalServiceWithLiterals, MessageEnvelope, PackageDetails, PackageDimensions, PackageType, PackageTypeWithLiterals, QueryShippoConfigurationsRequest, QueryShippoConfigurationsResponse, RemoveDeliveryRegionRequest, RestoreInfo, ServiceSettings, ShippoConfigurationsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, StreetAddress, UpdateExtendedFieldsRequest, UpdateShippoConfigurationRequest, UpdateShippoConfigurationResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { ShippoConfiguration, CreateShippoConfigurationOptions, UpdateShippoConfiguration, UpdateExtendedFieldsOptions, UpdateExtendedFieldsResponse, AddDeliveryRegionOptions, AddDeliveryRegionResponse, RemoveDeliveryRegionIdentifiers, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, ShippoConfigurationCreatedEnvelope, ShippoConfigurationDeletedEnvelope, ShippoConfigurationUpdatedEnvelope, ShippoConfigurationsQueryBuilder, CursorQuery, typedQueryShippoConfigurations } from './index.typings.js';
3
+ export { ActionEvent, AddDeliveryRegionRequest, Address, AddressLocation, BaseEventMetadata, CalculationType, CalculationTypeWithLiterals, CreateShippoConfigurationRequest, CreateShippoConfigurationResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteShippoConfigurationRequest, DeleteShippoConfigurationResponse, DomainEvent, DomainEventBodyOneOf, DomesticService, DomesticServiceSettings, DomesticServiceWithLiterals, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, GetShippoConfigurationRequest, GetShippoConfigurationResponse, HandlingFee, IdentificationData, IdentificationDataIdOneOf, InternationalService, InternationalServiceSettings, InternationalServiceWithLiterals, MessageEnvelope, PackageDetails, PackageDimensions, PackageType, PackageTypeWithLiterals, QueryShippoConfigurationsRequest, QueryShippoConfigurationsResponse, RemoveDeliveryRegionRequest, RestoreInfo, ServiceSettings, ShippoConfigurationsQueryResult, SortOrder, SortOrderWithLiterals, Sorting, StreetAddress, UpdateExtendedFieldsRequest, UpdateShippoConfigurationRequest, UpdateShippoConfigurationResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function createShippoConfiguration$1(httpClient: HttpClient): CreateShippoConfigurationSignature;
6
6
  interface CreateShippoConfigurationSignature {
@@ -37,20 +37,6 @@ interface DeleteShippoConfigurationSignature {
37
37
  */
38
38
  (shippoConfigurationId: string): Promise<void>;
39
39
  }
40
- declare function queryShippoConfigurations$1(httpClient: HttpClient): QueryShippoConfigurationsSignature;
41
- interface QueryShippoConfigurationsSignature {
42
- /**
43
- * Retrieves a list of ShippoConfigurations, given the provided [paging, filtering, and sorting][1].
44
- *
45
- * Up to 1,000 ShippoConfigurations can be returned per request.
46
- *
47
- * To learn how to query ShippoConfigurations, see [API Query Language][2].
48
- *
49
- * [1]: https://dev.wix.com/api/rest/getting-started/sorting-and-paging
50
- * [2]: https://dev.wix.com/api/rest/getting-started/api-query-language
51
- */
52
- (): ShippoConfigurationsQueryBuilder;
53
- }
54
40
  declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
55
41
  interface UpdateExtendedFieldsSignature {
56
42
  /**
@@ -81,14 +67,18 @@ declare const onShippoConfigurationCreated$1: EventDefinition<ShippoConfiguratio
81
67
  declare const onShippoConfigurationDeleted$1: EventDefinition<ShippoConfigurationDeletedEnvelope, "wix.ecom.v1.shippo_configuration_deleted">;
82
68
  declare const onShippoConfigurationUpdated$1: EventDefinition<ShippoConfigurationUpdatedEnvelope, "wix.ecom.v1.shippo_configuration_updated">;
83
69
 
70
+ declare function customQueryShippoConfigurations(httpClient: HttpClient): {
71
+ (): ShippoConfigurationsQueryBuilder;
72
+ (query: CursorQuery): ReturnType<typeof typedQueryShippoConfigurations>;
73
+ };
84
74
  declare const createShippoConfiguration: MaybeContext<BuildRESTFunction<typeof createShippoConfiguration$1> & typeof createShippoConfiguration$1>;
85
75
  declare const getShippoConfiguration: MaybeContext<BuildRESTFunction<typeof getShippoConfiguration$1> & typeof getShippoConfiguration$1>;
86
76
  declare const updateShippoConfiguration: MaybeContext<BuildRESTFunction<typeof updateShippoConfiguration$1> & typeof updateShippoConfiguration$1>;
87
77
  declare const deleteShippoConfiguration: MaybeContext<BuildRESTFunction<typeof deleteShippoConfiguration$1> & typeof deleteShippoConfiguration$1>;
88
- declare const queryShippoConfigurations: MaybeContext<BuildRESTFunction<typeof queryShippoConfigurations$1> & typeof queryShippoConfigurations$1>;
89
78
  declare const updateExtendedFields: MaybeContext<BuildRESTFunction<typeof updateExtendedFields$1> & typeof updateExtendedFields$1>;
90
79
  declare const addDeliveryRegion: MaybeContext<BuildRESTFunction<typeof addDeliveryRegion$1> & typeof addDeliveryRegion$1>;
91
80
  declare const removeDeliveryRegion: MaybeContext<BuildRESTFunction<typeof removeDeliveryRegion$1> & typeof removeDeliveryRegion$1>;
81
+ declare const queryShippoConfigurations: MaybeContext<BuildRESTFunction<typeof customQueryShippoConfigurations> & typeof customQueryShippoConfigurations>;
92
82
  /**
93
83
  * Triggered when a shipping option is created.
94
84
  */
@@ -102,4 +92,4 @@ declare const onShippoConfigurationDeleted: BuildEventDefinition<typeof onShippo
102
92
  */
103
93
  declare const onShippoConfigurationUpdated: BuildEventDefinition<typeof onShippoConfigurationUpdated$1> & typeof onShippoConfigurationUpdated$1;
104
94
 
105
- export { AddDeliveryRegionOptions, AddDeliveryRegionResponse, CreateShippoConfigurationOptions, RemoveDeliveryRegionIdentifiers, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, ShippoConfiguration, ShippoConfigurationCreatedEnvelope, ShippoConfigurationDeletedEnvelope, ShippoConfigurationUpdatedEnvelope, ShippoConfigurationsQueryBuilder, UpdateExtendedFieldsOptions, UpdateExtendedFieldsResponse, UpdateShippoConfiguration, addDeliveryRegion, createShippoConfiguration, deleteShippoConfiguration, getShippoConfiguration, onShippoConfigurationCreated, onShippoConfigurationDeleted, onShippoConfigurationUpdated, queryShippoConfigurations, removeDeliveryRegion, updateExtendedFields, updateShippoConfiguration };
95
+ export { AddDeliveryRegionOptions, AddDeliveryRegionResponse, CreateShippoConfigurationOptions, CursorQuery, RemoveDeliveryRegionIdentifiers, RemoveDeliveryRegionOptions, RemoveDeliveryRegionResponse, ShippoConfiguration, ShippoConfigurationCreatedEnvelope, ShippoConfigurationDeletedEnvelope, ShippoConfigurationUpdatedEnvelope, ShippoConfigurationsQueryBuilder, UpdateExtendedFieldsOptions, UpdateExtendedFieldsResponse, UpdateShippoConfiguration, addDeliveryRegion, createShippoConfiguration, deleteShippoConfiguration, getShippoConfiguration, onShippoConfigurationCreated, onShippoConfigurationDeleted, onShippoConfigurationUpdated, queryShippoConfigurations, removeDeliveryRegion, updateExtendedFields, updateShippoConfiguration };
@@ -649,6 +649,36 @@ function queryShippoConfigurations2() {
649
649
  transformationPaths: {}
650
650
  });
651
651
  }
652
+ async function typedQueryShippoConfigurations(query) {
653
+ const { httpClient, sideEffects } = arguments[1];
654
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
655
+ const reqOpts = queryShippoConfigurations(payload);
656
+ sideEffects?.onSiteCall?.();
657
+ try {
658
+ const result = await httpClient.request(reqOpts);
659
+ sideEffects?.onSuccess?.(result);
660
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
661
+ (0, import_transform_paths2.transformPaths)(result.data, [
662
+ {
663
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
664
+ paths: [{ path: "shippoConfigurations.shipFromAddress" }]
665
+ }
666
+ ])
667
+ );
668
+ } catch (err) {
669
+ const transformedError = (0, import_transform_error.transformError)(
670
+ err,
671
+ {
672
+ spreadPathsToArguments: {},
673
+ explicitPathsToArguments: { query: "$[0]" },
674
+ singleArgumentUnchanged: false
675
+ },
676
+ ["query"]
677
+ );
678
+ sideEffects?.onError?.(err);
679
+ throw transformedError;
680
+ }
681
+ }
652
682
  async function updateExtendedFields2(_id, namespace, options) {
653
683
  const { httpClient, sideEffects } = arguments[3];
654
684
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -801,6 +831,13 @@ function queryShippoConfigurations3(httpClient) {
801
831
  { httpClient }
802
832
  );
803
833
  }
834
+ function typedQueryShippoConfigurations2(httpClient) {
835
+ return (query) => typedQueryShippoConfigurations(
836
+ query,
837
+ // @ts-ignore
838
+ { httpClient }
839
+ );
840
+ }
804
841
  function updateExtendedFields3(httpClient) {
805
842
  return (_id, namespace, options) => updateExtendedFields2(
806
843
  _id,
@@ -891,14 +928,26 @@ var onShippoConfigurationUpdated = (0, import_sdk_types.EventDefinition)(
891
928
  // src/ecom-v1-shippo-configuration-shippo-configurations.context.ts
892
929
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
893
930
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
931
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
932
+ function customQueryShippoConfigurations(httpClient) {
933
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
934
+ builderQueryFunction: () => queryShippoConfigurations3(httpClient)(),
935
+ typedQueryFunction: (query) => typedQueryShippoConfigurations2(httpClient)(query),
936
+ hasOptionsParameter: false
937
+ });
938
+ function overloadedQuery(query) {
939
+ return router(...arguments);
940
+ }
941
+ return overloadedQuery;
942
+ }
894
943
  var createShippoConfiguration4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createShippoConfiguration3);
895
944
  var getShippoConfiguration4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getShippoConfiguration3);
896
945
  var updateShippoConfiguration4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateShippoConfiguration3);
897
946
  var deleteShippoConfiguration4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteShippoConfiguration3);
898
- var queryShippoConfigurations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryShippoConfigurations3);
899
947
  var updateExtendedFields4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateExtendedFields3);
900
948
  var addDeliveryRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addDeliveryRegion3);
901
949
  var removeDeliveryRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeDeliveryRegion3);
950
+ var queryShippoConfigurations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryShippoConfigurations);
902
951
  var onShippoConfigurationCreated2 = (0, import_event_definition_modules.createEventModule)(
903
952
  onShippoConfigurationCreated
904
953
  );