@wix/auto_sdk_ecom_tax-regions 1.0.13 → 1.0.14

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 (134) hide show
  1. package/build/{internal/cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts → billing-v1-tax-region-tax-regions.universal-BXT3KsX3.d.mts} +55 -247
  2. package/build/{cjs/src/billing-v1-tax-region-tax-regions.universal.d.ts → billing-v1-tax-region-tax-regions.universal-BXT3KsX3.d.ts} +55 -247
  3. package/build/index.d.mts +93 -0
  4. package/build/index.d.ts +93 -0
  5. package/build/index.js +496 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +463 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{es/src/billing-v1-tax-region-tax-regions.universal.d.ts → internal/billing-v1-tax-region-tax-regions.universal-BXT3KsX3.d.mts} +55 -247
  10. package/build/internal/{es/src/billing-v1-tax-region-tax-regions.universal.d.ts → billing-v1-tax-region-tax-regions.universal-BXT3KsX3.d.ts} +55 -247
  11. package/build/internal/index.d.mts +93 -0
  12. package/build/internal/index.d.ts +93 -0
  13. package/build/internal/index.js +496 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +463 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +208 -0
  18. package/build/internal/meta.d.ts +208 -0
  19. package/build/internal/meta.js +312 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +281 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +208 -0
  24. package/build/meta.d.ts +208 -0
  25. package/build/meta.js +312 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +281 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/billing-v1-tax-region-tax-regions.context.d.ts +0 -23
  40. package/build/cjs/src/billing-v1-tax-region-tax-regions.context.js +0 -28
  41. package/build/cjs/src/billing-v1-tax-region-tax-regions.context.js.map +0 -1
  42. package/build/cjs/src/billing-v1-tax-region-tax-regions.http.d.ts +0 -44
  43. package/build/cjs/src/billing-v1-tax-region-tax-regions.http.js +0 -227
  44. package/build/cjs/src/billing-v1-tax-region-tax-regions.http.js.map +0 -1
  45. package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.d.ts +0 -23
  46. package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.js +0 -123
  47. package/build/cjs/src/billing-v1-tax-region-tax-regions.meta.js.map +0 -1
  48. package/build/cjs/src/billing-v1-tax-region-tax-regions.public.d.ts +0 -77
  49. package/build/cjs/src/billing-v1-tax-region-tax-regions.public.js +0 -73
  50. package/build/cjs/src/billing-v1-tax-region-tax-regions.public.js.map +0 -1
  51. package/build/cjs/src/billing-v1-tax-region-tax-regions.types.d.ts +0 -423
  52. package/build/cjs/src/billing-v1-tax-region-tax-regions.types.js +0 -17
  53. package/build/cjs/src/billing-v1-tax-region-tax-regions.types.js.map +0 -1
  54. package/build/cjs/src/billing-v1-tax-region-tax-regions.universal.js +0 -313
  55. package/build/cjs/src/billing-v1-tax-region-tax-regions.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/billing-v1-tax-region-tax-regions.context.d.ts +0 -23
  67. package/build/es/src/billing-v1-tax-region-tax-regions.context.js +0 -23
  68. package/build/es/src/billing-v1-tax-region-tax-regions.context.js.map +0 -1
  69. package/build/es/src/billing-v1-tax-region-tax-regions.http.d.ts +0 -44
  70. package/build/es/src/billing-v1-tax-region-tax-regions.http.js +0 -219
  71. package/build/es/src/billing-v1-tax-region-tax-regions.http.js.map +0 -1
  72. package/build/es/src/billing-v1-tax-region-tax-regions.meta.d.ts +0 -23
  73. package/build/es/src/billing-v1-tax-region-tax-regions.meta.js +0 -92
  74. package/build/es/src/billing-v1-tax-region-tax-regions.meta.js.map +0 -1
  75. package/build/es/src/billing-v1-tax-region-tax-regions.public.d.ts +0 -77
  76. package/build/es/src/billing-v1-tax-region-tax-regions.public.js +0 -63
  77. package/build/es/src/billing-v1-tax-region-tax-regions.public.js.map +0 -1
  78. package/build/es/src/billing-v1-tax-region-tax-regions.types.d.ts +0 -423
  79. package/build/es/src/billing-v1-tax-region-tax-regions.types.js +0 -14
  80. package/build/es/src/billing-v1-tax-region-tax-regions.types.js.map +0 -1
  81. package/build/es/src/billing-v1-tax-region-tax-regions.universal.js +0 -282
  82. package/build/es/src/billing-v1-tax-region-tax-regions.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.d.ts +0 -23
  93. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.js +0 -28
  94. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.context.js.map +0 -1
  95. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.d.ts +0 -44
  96. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.js +0 -227
  97. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.http.js.map +0 -1
  98. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.d.ts +0 -23
  99. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.js +0 -123
  100. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.meta.js.map +0 -1
  101. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.d.ts +0 -77
  102. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.js +0 -73
  103. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.public.js.map +0 -1
  104. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.d.ts +0 -423
  105. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.js +0 -17
  106. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.types.js.map +0 -1
  107. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.universal.js +0 -313
  108. package/build/internal/cjs/src/billing-v1-tax-region-tax-regions.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.d.ts +0 -23
  119. package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.js +0 -23
  120. package/build/internal/es/src/billing-v1-tax-region-tax-regions.context.js.map +0 -1
  121. package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.d.ts +0 -44
  122. package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.js +0 -219
  123. package/build/internal/es/src/billing-v1-tax-region-tax-regions.http.js.map +0 -1
  124. package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.d.ts +0 -23
  125. package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.js +0 -92
  126. package/build/internal/es/src/billing-v1-tax-region-tax-regions.meta.js.map +0 -1
  127. package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.d.ts +0 -77
  128. package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.js +0 -63
  129. package/build/internal/es/src/billing-v1-tax-region-tax-regions.public.js.map +0 -1
  130. package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.d.ts +0 -423
  131. package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.js +0 -14
  132. package/build/internal/es/src/billing-v1-tax-region-tax-regions.types.js.map +0 -1
  133. package/build/internal/es/src/billing-v1-tax-region-tax-regions.universal.js +0 -282
  134. package/build/internal/es/src/billing-v1-tax-region-tax-regions.universal.js.map +0 -1
@@ -0,0 +1,93 @@
1
+ import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { T as TaxRegion, U as UpdateTaxRegion, a as TaxRegionsQueryBuilder, b as TaxRegionCreatedEnvelope, c as TaxRegionDeletedEnvelope, d as TaxRegionUpdatedEnvelope } from './billing-v1-tax-region-tax-regions.universal-BXT3KsX3.js';
3
+ export { M as ActionEvent, A as ApplicationError, V as BaseEventMetadata, i as BulkActionMetadata, B as BulkCreateTaxRegionRequest, g as BulkCreateTaxRegionResponse, h as BulkCreateTaxRegionResult, y as BulkRestoreTaxRegionsRequest, z as BulkRestoreTaxRegionsResponse, E as BulkRestoreTaxRegionsResult, f as ConflictErrorDetails, u as CreateOrGetTaxRegionWithoutValidationRequest, v as CreateOrGetTaxRegionWithoutValidationResponse, C as CreateTaxRegionRequest, e as CreateTaxRegionResponse, q as CursorPaging, s as CursorPagingMetadata, n as CursorQuery, o as CursorQueryPagingMethodOneOf, t as Cursors, D as DeleteTaxRegionRequest, m as DeleteTaxRegionResponse, w as DeleteTaxRegionWithoutDomainEventsRequest, x as DeleteTaxRegionWithoutDomainEventsResponse, F as DomainEvent, H as DomainEventBodyOneOf, J as EntityCreatedEvent, L as EntityDeletedEvent, K as EntityUpdatedEvent, X as EventMetadata, G as GetTaxRegionRequest, j as GetTaxRegionResponse, O as IdentificationData, P as IdentificationDataIdOneOf, I as ItemMetadata, N as MessageEnvelope, Q as QueryTaxRegionsRequest, r as QueryTaxRegionsResponse, R as RestoreInfo, S as SortOrder, p as Sorting, Y as TaxRegionsQueryResult, k as UpdateTaxRegionRequest, l as UpdateTaxRegionResponse, W as WebhookIdentityType } from './billing-v1-tax-region-tax-regions.universal-BXT3KsX3.js';
4
+
5
+ declare function createTaxRegion$1(httpClient: HttpClient): CreateTaxRegionSignature;
6
+ interface CreateTaxRegionSignature {
7
+ /**
8
+ * Creates a tax region.
9
+ *
10
+ * Tax regions require a tax calculator `appId`. Call List Tax Calculators to retrieve a list of available calculators for a site.
11
+ *
12
+ * Wix uses tax regions to calculate tax.
13
+ * <!-- Subdivisions are supported for the following countries: `AU`, `BR`, `CA`, `FR`, `DE`, `IN`, `IT`, `MX`, `NL`, `ES`, `AE`, `GB`, `US` -->
14
+ * @param - Tax region to create.
15
+ * @returns Created tax region.
16
+ */
17
+ (taxRegion: TaxRegion): Promise<TaxRegion>;
18
+ }
19
+ declare function getTaxRegion$1(httpClient: HttpClient): GetTaxRegionSignature;
20
+ interface GetTaxRegionSignature {
21
+ /**
22
+ * Retrieves a tax region.
23
+ * @param - ID of the tax region to retrieve.
24
+ * @returns Retrieved tax region.
25
+ */
26
+ (taxRegionId: string): Promise<TaxRegion>;
27
+ }
28
+ declare function updateTaxRegion$1(httpClient: HttpClient): UpdateTaxRegionSignature;
29
+ interface UpdateTaxRegionSignature {
30
+ /**
31
+ * Updates a tax region.
32
+ *
33
+ * Each time the tax region is updated, `revision` increments by 1.
34
+ * The current `revision` must be passed when updating the tax region.
35
+ * This ensures you're working with the latest tax region and prevents
36
+ * unintended overwrites.
37
+ * @param - Tax region ID.
38
+ * @param - Tax region info.
39
+ * @returns Updated tax region.
40
+ */
41
+ (_id: string, taxRegion: UpdateTaxRegion): Promise<TaxRegion>;
42
+ }
43
+ declare function deleteTaxRegion$1(httpClient: HttpClient): DeleteTaxRegionSignature;
44
+ interface DeleteTaxRegionSignature {
45
+ /**
46
+ * Deletes a tax region.
47
+ *
48
+ * When a tax region is deleted, tax is not calculated and zero tax will be returned for addresses in this region.
49
+ * @param - ID of the tax region to delete.
50
+ */
51
+ (taxRegionId: string): Promise<void>;
52
+ }
53
+ declare function queryTaxRegions$1(httpClient: HttpClient): QueryTaxRegionsSignature;
54
+ interface QueryTaxRegionsSignature {
55
+ /**
56
+ * Creates a query to retrieve a list of tax regions.
57
+ *
58
+ * The `queryTaxRegions()` function builds a query to retrieve a list of tax regions and returns a `TaxRegionsQueryBuilder` object.
59
+ *
60
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
61
+ *
62
+ * You can refine the query by chaining `TaxRegionsQueryBuilder` functions onto the query. `TaxRegionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTaxRegions()` returns.
63
+ *
64
+ * `queryTaxRegions()` runs with the following `TaxRegionsQueryBuilder` default that you can override:
65
+ * + `ascending("_id")`
66
+ *
67
+ * The functions that are chained to `queryTaxRegions()` are applied in the order they are called. For example, if you apply `ascending("country")` and then `ascending("subdivision")`, the results are sorted first by the `"country"`, and then, if there are multiple results with the same `"country"`, the items are sorted by `"subdivision"`.
68
+ *
69
+ * The following `TaxRegionsQueryBuilder` functions are supported for the `queryTaxRegions()` function. For a full description of the tax region object, see the object returned for the `items` property in `TaxRegionsQueryResult`.
70
+ */
71
+ (): TaxRegionsQueryBuilder;
72
+ }
73
+ declare const onTaxRegionCreated$1: EventDefinition<TaxRegionCreatedEnvelope, "wix.billing.v1.tax_region_created">;
74
+ declare const onTaxRegionDeleted$1: EventDefinition<TaxRegionDeletedEnvelope, "wix.billing.v1.tax_region_deleted">;
75
+ declare const onTaxRegionUpdated$1: EventDefinition<TaxRegionUpdatedEnvelope, "wix.billing.v1.tax_region_updated">;
76
+
77
+ declare const createTaxRegion: MaybeContext<BuildRESTFunction<typeof createTaxRegion$1> & typeof createTaxRegion$1>;
78
+ declare const getTaxRegion: MaybeContext<BuildRESTFunction<typeof getTaxRegion$1> & typeof getTaxRegion$1>;
79
+ declare const updateTaxRegion: MaybeContext<BuildRESTFunction<typeof updateTaxRegion$1> & typeof updateTaxRegion$1>;
80
+ declare const deleteTaxRegion: MaybeContext<BuildRESTFunction<typeof deleteTaxRegion$1> & typeof deleteTaxRegion$1>;
81
+ declare const queryTaxRegions: MaybeContext<BuildRESTFunction<typeof queryTaxRegions$1> & typeof queryTaxRegions$1>;
82
+ /** */
83
+ declare const onTaxRegionCreated: BuildEventDefinition<typeof onTaxRegionCreated$1>;
84
+ /**
85
+ * Triggered when a tax region is deleted.
86
+ */
87
+ declare const onTaxRegionDeleted: BuildEventDefinition<typeof onTaxRegionDeleted$1>;
88
+ /**
89
+ * Triggered when a tax region is updated.
90
+ */
91
+ declare const onTaxRegionUpdated: BuildEventDefinition<typeof onTaxRegionUpdated$1>;
92
+
93
+ export { TaxRegion, TaxRegionCreatedEnvelope, TaxRegionDeletedEnvelope, TaxRegionUpdatedEnvelope, TaxRegionsQueryBuilder, UpdateTaxRegion, createTaxRegion, deleteTaxRegion, getTaxRegion, onTaxRegionCreated, onTaxRegionDeleted, onTaxRegionUpdated, queryTaxRegions, updateTaxRegion };
@@ -0,0 +1,496 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ SortOrder: () => SortOrder,
24
+ WebhookIdentityType: () => WebhookIdentityType,
25
+ createTaxRegion: () => createTaxRegion4,
26
+ deleteTaxRegion: () => deleteTaxRegion4,
27
+ getTaxRegion: () => getTaxRegion4,
28
+ onTaxRegionCreated: () => onTaxRegionCreated2,
29
+ onTaxRegionDeleted: () => onTaxRegionDeleted2,
30
+ onTaxRegionUpdated: () => onTaxRegionUpdated2,
31
+ queryTaxRegions: () => queryTaxRegions4,
32
+ updateTaxRegion: () => updateTaxRegion4
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+
36
+ // src/billing-v1-tax-region-tax-regions.public.ts
37
+ var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
38
+ var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
39
+ var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
40
+ var import_sdk_types = require("@wix/sdk-types");
41
+
42
+ // src/billing-v1-tax-region-tax-regions.universal.ts
43
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
44
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
45
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
46
+
47
+ // src/billing-v1-tax-region-tax-regions.http.ts
48
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
49
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
50
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
51
+ var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
52
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
53
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
54
+ function resolveWixBillingV1TaxRegionsServiceUrl(opts) {
55
+ const domainToMappings = {
56
+ "www.wixapis.com": [
57
+ {
58
+ srcPath: "/billing/v1/tax-regions",
59
+ destPath: "/v1/tax-regions"
60
+ },
61
+ {
62
+ srcPath: "/billing/v1/bulk/tax-regions",
63
+ destPath: "/v1/bulk/tax-regions"
64
+ }
65
+ ],
66
+ "manage._base_domain_": [
67
+ {
68
+ srcPath: "/billing/v1/tax-regions",
69
+ destPath: "/v1/tax-regions"
70
+ },
71
+ {
72
+ srcPath: "/billing/v1/bulk/tax-regions",
73
+ destPath: "/v1/bulk/tax-regions"
74
+ }
75
+ ]
76
+ };
77
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
78
+ }
79
+ var PACKAGE_NAME = "@wix/auto_sdk_ecom_tax-regions";
80
+ function createTaxRegion(payload) {
81
+ function __createTaxRegion({ host }) {
82
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
83
+ {
84
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
85
+ paths: [
86
+ { path: "taxRegion.createdDate" },
87
+ { path: "taxRegion.updatedDate" }
88
+ ]
89
+ }
90
+ ]);
91
+ const metadata = {
92
+ entityFqdn: "wix.billing.v1.tax_region",
93
+ method: "POST",
94
+ methodFqn: "wix.billing.v1.TaxRegionsService.CreateTaxRegion",
95
+ packageName: PACKAGE_NAME,
96
+ url: resolveWixBillingV1TaxRegionsServiceUrl({
97
+ protoPath: "/v1/tax-regions",
98
+ data: serializedData,
99
+ host
100
+ }),
101
+ data: serializedData,
102
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
103
+ {
104
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
105
+ paths: [
106
+ { path: "taxRegion.createdDate" },
107
+ { path: "taxRegion.updatedDate" }
108
+ ]
109
+ }
110
+ ])
111
+ };
112
+ return metadata;
113
+ }
114
+ return __createTaxRegion;
115
+ }
116
+ function getTaxRegion(payload) {
117
+ function __getTaxRegion({ host }) {
118
+ const metadata = {
119
+ entityFqdn: "wix.billing.v1.tax_region",
120
+ method: "GET",
121
+ methodFqn: "wix.billing.v1.TaxRegionsService.GetTaxRegion",
122
+ packageName: PACKAGE_NAME,
123
+ url: resolveWixBillingV1TaxRegionsServiceUrl({
124
+ protoPath: "/v1/tax-regions/{taxRegionId}",
125
+ data: payload,
126
+ host
127
+ }),
128
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
129
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
130
+ {
131
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
132
+ paths: [
133
+ { path: "taxRegion.createdDate" },
134
+ { path: "taxRegion.updatedDate" }
135
+ ]
136
+ }
137
+ ])
138
+ };
139
+ return metadata;
140
+ }
141
+ return __getTaxRegion;
142
+ }
143
+ function updateTaxRegion(payload) {
144
+ function __updateTaxRegion({ host }) {
145
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
146
+ {
147
+ transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
148
+ paths: [{ path: "fieldMask" }]
149
+ },
150
+ {
151
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
152
+ paths: [
153
+ { path: "taxRegion.createdDate" },
154
+ { path: "taxRegion.updatedDate" }
155
+ ]
156
+ }
157
+ ]);
158
+ const metadata = {
159
+ entityFqdn: "wix.billing.v1.tax_region",
160
+ method: "PATCH",
161
+ methodFqn: "wix.billing.v1.TaxRegionsService.UpdateTaxRegion",
162
+ packageName: PACKAGE_NAME,
163
+ url: resolveWixBillingV1TaxRegionsServiceUrl({
164
+ protoPath: "/v1/tax-regions/{taxRegion.id}",
165
+ data: serializedData,
166
+ host
167
+ }),
168
+ data: serializedData,
169
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
170
+ {
171
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
172
+ paths: [
173
+ { path: "taxRegion.createdDate" },
174
+ { path: "taxRegion.updatedDate" }
175
+ ]
176
+ }
177
+ ])
178
+ };
179
+ return metadata;
180
+ }
181
+ return __updateTaxRegion;
182
+ }
183
+ function deleteTaxRegion(payload) {
184
+ function __deleteTaxRegion({ host }) {
185
+ const metadata = {
186
+ entityFqdn: "wix.billing.v1.tax_region",
187
+ method: "DELETE",
188
+ methodFqn: "wix.billing.v1.TaxRegionsService.DeleteTaxRegion",
189
+ packageName: PACKAGE_NAME,
190
+ url: resolveWixBillingV1TaxRegionsServiceUrl({
191
+ protoPath: "/v1/tax-regions/{taxRegionId}",
192
+ data: payload,
193
+ host
194
+ }),
195
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
196
+ };
197
+ return metadata;
198
+ }
199
+ return __deleteTaxRegion;
200
+ }
201
+ function queryTaxRegions(payload) {
202
+ function __queryTaxRegions({ host }) {
203
+ const metadata = {
204
+ entityFqdn: "wix.billing.v1.tax_region",
205
+ method: "POST",
206
+ methodFqn: "wix.billing.v1.TaxRegionsService.QueryTaxRegions",
207
+ packageName: PACKAGE_NAME,
208
+ url: resolveWixBillingV1TaxRegionsServiceUrl({
209
+ protoPath: "/v1/tax-regions/query",
210
+ data: payload,
211
+ host
212
+ }),
213
+ data: payload,
214
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
215
+ {
216
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
217
+ paths: [
218
+ { path: "taxRegions.createdDate" },
219
+ { path: "taxRegions.updatedDate" }
220
+ ]
221
+ }
222
+ ])
223
+ };
224
+ return metadata;
225
+ }
226
+ return __queryTaxRegions;
227
+ }
228
+
229
+ // src/billing-v1-tax-region-tax-regions.universal.ts
230
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
231
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
232
+ SortOrder2["ASC"] = "ASC";
233
+ SortOrder2["DESC"] = "DESC";
234
+ return SortOrder2;
235
+ })(SortOrder || {});
236
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
237
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
238
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
239
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
240
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
241
+ WebhookIdentityType2["APP"] = "APP";
242
+ return WebhookIdentityType2;
243
+ })(WebhookIdentityType || {});
244
+ async function createTaxRegion2(taxRegion) {
245
+ const { httpClient, sideEffects } = arguments[1];
246
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
247
+ taxRegion
248
+ });
249
+ const reqOpts = createTaxRegion(payload);
250
+ sideEffects?.onSiteCall?.();
251
+ try {
252
+ const result = await httpClient.request(reqOpts);
253
+ sideEffects?.onSuccess?.(result);
254
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
255
+ } catch (err) {
256
+ const transformedError = (0, import_transform_error.transformError)(
257
+ err,
258
+ {
259
+ spreadPathsToArguments: {},
260
+ explicitPathsToArguments: { taxRegion: "$[0]" },
261
+ singleArgumentUnchanged: false
262
+ },
263
+ ["taxRegion"]
264
+ );
265
+ sideEffects?.onError?.(err);
266
+ throw transformedError;
267
+ }
268
+ }
269
+ async function getTaxRegion2(taxRegionId) {
270
+ const { httpClient, sideEffects } = arguments[1];
271
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
272
+ taxRegionId
273
+ });
274
+ const reqOpts = getTaxRegion(payload);
275
+ sideEffects?.onSiteCall?.();
276
+ try {
277
+ const result = await httpClient.request(reqOpts);
278
+ sideEffects?.onSuccess?.(result);
279
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
280
+ } catch (err) {
281
+ const transformedError = (0, import_transform_error.transformError)(
282
+ err,
283
+ {
284
+ spreadPathsToArguments: {},
285
+ explicitPathsToArguments: { taxRegionId: "$[0]" },
286
+ singleArgumentUnchanged: false
287
+ },
288
+ ["taxRegionId"]
289
+ );
290
+ sideEffects?.onError?.(err);
291
+ throw transformedError;
292
+ }
293
+ }
294
+ async function updateTaxRegion2(_id, taxRegion) {
295
+ const { httpClient, sideEffects } = arguments[2];
296
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
297
+ taxRegion: { ...taxRegion, id: _id }
298
+ });
299
+ const reqOpts = updateTaxRegion(payload);
300
+ sideEffects?.onSiteCall?.();
301
+ try {
302
+ const result = await httpClient.request(reqOpts);
303
+ sideEffects?.onSuccess?.(result);
304
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.taxRegion;
305
+ } catch (err) {
306
+ const transformedError = (0, import_transform_error.transformError)(
307
+ err,
308
+ {
309
+ spreadPathsToArguments: { taxRegion: "$[1]" },
310
+ explicitPathsToArguments: { "taxRegion.id": "$[0]" },
311
+ singleArgumentUnchanged: false
312
+ },
313
+ ["_id", "taxRegion"]
314
+ );
315
+ sideEffects?.onError?.(err);
316
+ throw transformedError;
317
+ }
318
+ }
319
+ async function deleteTaxRegion2(taxRegionId) {
320
+ const { httpClient, sideEffects } = arguments[1];
321
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
322
+ taxRegionId
323
+ });
324
+ const reqOpts = deleteTaxRegion(payload);
325
+ sideEffects?.onSiteCall?.();
326
+ try {
327
+ const result = await httpClient.request(reqOpts);
328
+ sideEffects?.onSuccess?.(result);
329
+ } catch (err) {
330
+ const transformedError = (0, import_transform_error.transformError)(
331
+ err,
332
+ {
333
+ spreadPathsToArguments: {},
334
+ explicitPathsToArguments: { taxRegionId: "$[0]" },
335
+ singleArgumentUnchanged: false
336
+ },
337
+ ["taxRegionId"]
338
+ );
339
+ sideEffects?.onError?.(err);
340
+ throw transformedError;
341
+ }
342
+ }
343
+ function queryTaxRegions2() {
344
+ const { httpClient, sideEffects } = arguments[0];
345
+ return (0, import_query_builder.queryBuilder)({
346
+ func: async (payload) => {
347
+ const reqOpts = queryTaxRegions(payload);
348
+ sideEffects?.onSiteCall?.();
349
+ try {
350
+ const result = await httpClient.request(reqOpts);
351
+ sideEffects?.onSuccess?.(result);
352
+ return result;
353
+ } catch (err) {
354
+ sideEffects?.onError?.(err);
355
+ throw err;
356
+ }
357
+ },
358
+ requestTransformer: (query) => {
359
+ const args = [query, {}];
360
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
361
+ ...args?.[1],
362
+ query: args?.[0]
363
+ });
364
+ },
365
+ responseTransformer: ({ data }) => {
366
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
367
+ (0, import_transform_paths2.transformPaths)(data, [])
368
+ );
369
+ return {
370
+ items: transformedData?.taxRegions,
371
+ pagingMetadata: transformedData?.pagingMetadata
372
+ };
373
+ },
374
+ errorTransformer: (err) => {
375
+ const transformedError = (0, import_transform_error.transformError)(err, {
376
+ spreadPathsToArguments: {},
377
+ explicitPathsToArguments: { query: "$[0]" },
378
+ singleArgumentUnchanged: false
379
+ });
380
+ throw transformedError;
381
+ },
382
+ pagingMethod: "CURSOR",
383
+ transformationPaths: {}
384
+ });
385
+ }
386
+
387
+ // src/billing-v1-tax-region-tax-regions.public.ts
388
+ function createTaxRegion3(httpClient) {
389
+ return (taxRegion) => createTaxRegion2(
390
+ taxRegion,
391
+ // @ts-ignore
392
+ { httpClient }
393
+ );
394
+ }
395
+ function getTaxRegion3(httpClient) {
396
+ return (taxRegionId) => getTaxRegion2(
397
+ taxRegionId,
398
+ // @ts-ignore
399
+ { httpClient }
400
+ );
401
+ }
402
+ function updateTaxRegion3(httpClient) {
403
+ return (_id, taxRegion) => updateTaxRegion2(
404
+ _id,
405
+ taxRegion,
406
+ // @ts-ignore
407
+ { httpClient }
408
+ );
409
+ }
410
+ function deleteTaxRegion3(httpClient) {
411
+ return (taxRegionId) => deleteTaxRegion2(
412
+ taxRegionId,
413
+ // @ts-ignore
414
+ { httpClient }
415
+ );
416
+ }
417
+ function queryTaxRegions3(httpClient) {
418
+ return () => queryTaxRegions2(
419
+ // @ts-ignore
420
+ { httpClient }
421
+ );
422
+ }
423
+ var onTaxRegionCreated = (0, import_sdk_types.EventDefinition)(
424
+ "wix.billing.v1.tax_region_created",
425
+ true,
426
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
427
+ (0, import_transform_paths3.transformPaths)(event, [
428
+ {
429
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
430
+ paths: [
431
+ { path: "entity.createdDate" },
432
+ { path: "entity.updatedDate" },
433
+ { path: "metadata.eventTime" }
434
+ ]
435
+ }
436
+ ])
437
+ )
438
+ )();
439
+ var onTaxRegionDeleted = (0, import_sdk_types.EventDefinition)(
440
+ "wix.billing.v1.tax_region_deleted",
441
+ true,
442
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
443
+ (0, import_transform_paths3.transformPaths)(event, [
444
+ {
445
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
446
+ paths: [
447
+ { path: "undefined.createdDate" },
448
+ { path: "undefined.updatedDate" },
449
+ { path: "metadata.eventTime" }
450
+ ]
451
+ }
452
+ ])
453
+ )
454
+ )();
455
+ var onTaxRegionUpdated = (0, import_sdk_types.EventDefinition)(
456
+ "wix.billing.v1.tax_region_updated",
457
+ true,
458
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
459
+ (0, import_transform_paths3.transformPaths)(event, [
460
+ {
461
+ transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
462
+ paths: [
463
+ { path: "entity.createdDate" },
464
+ { path: "entity.updatedDate" },
465
+ { path: "metadata.eventTime" }
466
+ ]
467
+ }
468
+ ])
469
+ )
470
+ )();
471
+
472
+ // src/billing-v1-tax-region-tax-regions.context.ts
473
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
474
+ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
475
+ var createTaxRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createTaxRegion3);
476
+ var getTaxRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getTaxRegion3);
477
+ var updateTaxRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateTaxRegion3);
478
+ var deleteTaxRegion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteTaxRegion3);
479
+ var queryTaxRegions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryTaxRegions3);
480
+ var onTaxRegionCreated2 = (0, import_event_definition_modules.createEventModule)(onTaxRegionCreated);
481
+ var onTaxRegionDeleted2 = (0, import_event_definition_modules.createEventModule)(onTaxRegionDeleted);
482
+ var onTaxRegionUpdated2 = (0, import_event_definition_modules.createEventModule)(onTaxRegionUpdated);
483
+ // Annotate the CommonJS export names for ESM import in node:
484
+ 0 && (module.exports = {
485
+ SortOrder,
486
+ WebhookIdentityType,
487
+ createTaxRegion,
488
+ deleteTaxRegion,
489
+ getTaxRegion,
490
+ onTaxRegionCreated,
491
+ onTaxRegionDeleted,
492
+ onTaxRegionUpdated,
493
+ queryTaxRegions,
494
+ updateTaxRegion
495
+ });
496
+ //# sourceMappingURL=index.js.map