@zippendo/sdk 1.2.4 → 1.2.5

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 (122) hide show
  1. package/dist/apis/OrderChannelsApi.d.ts +195 -0
  2. package/dist/apis/OrderChannelsApi.js +496 -0
  3. package/dist/apis/index.d.ts +1 -0
  4. package/dist/apis/index.js +1 -0
  5. package/dist/esm/apis/OrderChannelsApi.d.ts +195 -0
  6. package/dist/esm/apis/OrderChannelsApi.js +492 -0
  7. package/dist/esm/apis/index.d.ts +1 -0
  8. package/dist/esm/apis/index.js +1 -0
  9. package/dist/esm/models/BatchSendShipments200ResponseResultsInner.d.ts +1 -0
  10. package/dist/esm/models/BatchSendShipments200ResponseResultsInner.js +1 -0
  11. package/dist/esm/models/CreateOrderChannelRequest.d.ts +65 -0
  12. package/dist/esm/models/CreateOrderChannelRequest.js +61 -0
  13. package/dist/esm/models/CreateOrderChannelRequestSettings.d.ts +105 -0
  14. package/dist/esm/models/CreateOrderChannelRequestSettings.js +66 -0
  15. package/dist/esm/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.d.ts +52 -0
  16. package/dist/esm/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.js +56 -0
  17. package/dist/esm/models/CreateOrderChannelWebhookSecret201Response.d.ts +44 -0
  18. package/dist/esm/models/CreateOrderChannelWebhookSecret201Response.js +51 -0
  19. package/dist/esm/models/CreateOrderRequest.d.ts +12 -0
  20. package/dist/esm/models/CreateOrderRequest.js +4 -0
  21. package/dist/esm/models/GetOrderChannelWebhookStatus200Response.d.ts +45 -0
  22. package/dist/esm/models/GetOrderChannelWebhookStatus200Response.js +52 -0
  23. package/dist/esm/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.d.ts +62 -0
  24. package/dist/esm/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.js +59 -0
  25. package/dist/esm/models/ListApiTokens401Response.d.ts +1 -0
  26. package/dist/esm/models/ListApiTokens401Response.js +1 -0
  27. package/dist/esm/models/ListOrderChannels200Response.d.ts +57 -0
  28. package/dist/esm/models/ListOrderChannels200Response.js +60 -0
  29. package/dist/esm/models/ListOrderChannels200ResponseDataInner.d.ts +121 -0
  30. package/dist/esm/models/ListOrderChannels200ResponseDataInner.js +97 -0
  31. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettings.d.ts +129 -0
  32. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettings.js +86 -0
  33. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.d.ts +52 -0
  34. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.js +56 -0
  35. package/dist/esm/models/ListOrders200ResponseDataInnerOrderChannel.d.ts +1 -0
  36. package/dist/esm/models/ListOrders200ResponseDataInnerOrderChannel.js +2 -1
  37. package/dist/esm/models/RevokeOrderChannelWebhookSecret200Response.d.ts +32 -0
  38. package/dist/esm/models/RevokeOrderChannelWebhookSecret200Response.js +43 -0
  39. package/dist/esm/models/SendShipment422Response.d.ts +1 -0
  40. package/dist/esm/models/SendShipment422Response.js +1 -0
  41. package/dist/esm/models/UpdateOrderChannelRequest.d.ts +65 -0
  42. package/dist/esm/models/UpdateOrderChannelRequest.js +52 -0
  43. package/dist/esm/models/UpdateOrderChannelRequestSettings.d.ts +105 -0
  44. package/dist/esm/models/UpdateOrderChannelRequestSettings.js +66 -0
  45. package/dist/esm/models/index.d.ts +13 -0
  46. package/dist/esm/models/index.js +13 -0
  47. package/dist/models/BatchSendShipments200ResponseResultsInner.d.ts +1 -0
  48. package/dist/models/BatchSendShipments200ResponseResultsInner.js +1 -0
  49. package/dist/models/CreateOrderChannelRequest.d.ts +65 -0
  50. package/dist/models/CreateOrderChannelRequest.js +69 -0
  51. package/dist/models/CreateOrderChannelRequestSettings.d.ts +105 -0
  52. package/dist/models/CreateOrderChannelRequestSettings.js +73 -0
  53. package/dist/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.d.ts +52 -0
  54. package/dist/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.js +64 -0
  55. package/dist/models/CreateOrderChannelWebhookSecret201Response.d.ts +44 -0
  56. package/dist/models/CreateOrderChannelWebhookSecret201Response.js +58 -0
  57. package/dist/models/CreateOrderRequest.d.ts +12 -0
  58. package/dist/models/CreateOrderRequest.js +4 -0
  59. package/dist/models/GetOrderChannelWebhookStatus200Response.d.ts +45 -0
  60. package/dist/models/GetOrderChannelWebhookStatus200Response.js +59 -0
  61. package/dist/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.d.ts +62 -0
  62. package/dist/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.js +66 -0
  63. package/dist/models/ListApiTokens401Response.d.ts +1 -0
  64. package/dist/models/ListApiTokens401Response.js +1 -0
  65. package/dist/models/ListOrderChannels200Response.d.ts +57 -0
  66. package/dist/models/ListOrderChannels200Response.js +67 -0
  67. package/dist/models/ListOrderChannels200ResponseDataInner.d.ts +121 -0
  68. package/dist/models/ListOrderChannels200ResponseDataInner.js +105 -0
  69. package/dist/models/ListOrderChannels200ResponseDataInnerSettings.d.ts +129 -0
  70. package/dist/models/ListOrderChannels200ResponseDataInnerSettings.js +93 -0
  71. package/dist/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.d.ts +52 -0
  72. package/dist/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.js +64 -0
  73. package/dist/models/ListOrders200ResponseDataInnerOrderChannel.d.ts +1 -0
  74. package/dist/models/ListOrders200ResponseDataInnerOrderChannel.js +2 -1
  75. package/dist/models/RevokeOrderChannelWebhookSecret200Response.d.ts +32 -0
  76. package/dist/models/RevokeOrderChannelWebhookSecret200Response.js +50 -0
  77. package/dist/models/SendShipment422Response.d.ts +1 -0
  78. package/dist/models/SendShipment422Response.js +1 -0
  79. package/dist/models/UpdateOrderChannelRequest.d.ts +65 -0
  80. package/dist/models/UpdateOrderChannelRequest.js +59 -0
  81. package/dist/models/UpdateOrderChannelRequestSettings.d.ts +105 -0
  82. package/dist/models/UpdateOrderChannelRequestSettings.js +73 -0
  83. package/dist/models/index.d.ts +13 -0
  84. package/dist/models/index.js +13 -0
  85. package/docs/CreateOrderChannelRequest.md +42 -0
  86. package/docs/CreateOrderChannelRequestSettings.md +58 -0
  87. package/docs/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.md +38 -0
  88. package/docs/CreateOrderChannelWebhookSecret201Response.md +38 -0
  89. package/docs/CreateOrderRequest.md +4 -0
  90. package/docs/GetOrderChannelWebhookStatus200Response.md +38 -0
  91. package/docs/GetOrderChannelWebhookStatus200ResponseWebhooksInner.md +44 -0
  92. package/docs/ListOrderChannels200Response.md +42 -0
  93. package/docs/ListOrderChannels200ResponseDataInner.md +60 -0
  94. package/docs/ListOrderChannels200ResponseDataInnerSettings.md +67 -0
  95. package/docs/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.md +38 -0
  96. package/docs/OrderChannelsApi.md +650 -0
  97. package/docs/OrdersApi.md +1 -0
  98. package/docs/RevokeOrderChannelWebhookSecret200Response.md +34 -0
  99. package/docs/UpdateOrderChannelRequest.md +44 -0
  100. package/docs/UpdateOrderChannelRequestSettings.md +59 -0
  101. package/package.json +1 -1
  102. package/src/apis/OrderChannelsApi.ts +670 -0
  103. package/src/apis/index.ts +1 -0
  104. package/src/models/BatchSendShipments200ResponseResultsInner.ts +1 -0
  105. package/src/models/CreateOrderChannelRequest.ts +118 -0
  106. package/src/models/CreateOrderChannelRequestSettings.ts +169 -0
  107. package/src/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.ts +94 -0
  108. package/src/models/CreateOrderChannelWebhookSecret201Response.ts +84 -0
  109. package/src/models/CreateOrderRequest.ts +16 -0
  110. package/src/models/GetOrderChannelWebhookStatus200Response.ts +92 -0
  111. package/src/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.ts +109 -0
  112. package/src/models/ListApiTokens401Response.ts +1 -0
  113. package/src/models/ListOrderChannels200Response.ts +110 -0
  114. package/src/models/ListOrderChannels200ResponseDataInner.ts +200 -0
  115. package/src/models/ListOrderChannels200ResponseDataInnerSettings.ts +207 -0
  116. package/src/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.ts +94 -0
  117. package/src/models/ListOrders200ResponseDataInnerOrderChannel.ts +2 -1
  118. package/src/models/RevokeOrderChannelWebhookSecret200Response.ts +66 -0
  119. package/src/models/SendShipment422Response.ts +1 -0
  120. package/src/models/UpdateOrderChannelRequest.ts +113 -0
  121. package/src/models/UpdateOrderChannelRequestSettings.ts +169 -0
  122. package/src/models/index.ts +13 -0
@@ -0,0 +1,496 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Zippendo Public API
6
+ * Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand\'s team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand\'s id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan\'s limit returns `403`.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@zippendo.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ListOrderChannelsTypeEnum = exports.ListOrderChannelsBrandScopeEnum = exports.OrderChannelsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const CreateOrderChannelRequest_1 = require("../models/CreateOrderChannelRequest");
28
+ const CreateOrderChannelWebhookSecret201Response_1 = require("../models/CreateOrderChannelWebhookSecret201Response");
29
+ const GetOrderChannelWebhookStatus200Response_1 = require("../models/GetOrderChannelWebhookStatus200Response");
30
+ const ListOrderChannels200Response_1 = require("../models/ListOrderChannels200Response");
31
+ const ListOrderChannels200ResponseDataInner_1 = require("../models/ListOrderChannels200ResponseDataInner");
32
+ const RevokeApiToken200Response_1 = require("../models/RevokeApiToken200Response");
33
+ const RevokeOrderChannelWebhookSecret200Response_1 = require("../models/RevokeOrderChannelWebhookSecret200Response");
34
+ const UpdateOrderChannelRequest_1 = require("../models/UpdateOrderChannelRequest");
35
+ /**
36
+ *
37
+ */
38
+ class OrderChannelsApi extends runtime.BaseAPI {
39
+ /**
40
+ * Creates request options for createOrderChannel without sending the request
41
+ */
42
+ createOrderChannelRequestOpts(requestParameters) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ if (requestParameters['orgId'] == null) {
45
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling createOrderChannel().');
46
+ }
47
+ if (requestParameters['createOrderChannelRequest'] == null) {
48
+ throw new runtime.RequiredError('createOrderChannelRequest', 'Required parameter "createOrderChannelRequest" was null or undefined when calling createOrderChannel().');
49
+ }
50
+ const queryParameters = {};
51
+ const headerParameters = {};
52
+ headerParameters['Content-Type'] = 'application/json';
53
+ if (this.configuration && this.configuration.accessToken) {
54
+ const token = this.configuration.accessToken;
55
+ const tokenString = yield token("bearerAuth", []);
56
+ if (tokenString) {
57
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
58
+ }
59
+ }
60
+ let urlPath = `/orgs/{orgId}/order-channels`;
61
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
62
+ return {
63
+ path: urlPath,
64
+ method: 'POST',
65
+ headers: headerParameters,
66
+ query: queryParameters,
67
+ body: (0, CreateOrderChannelRequest_1.CreateOrderChannelRequestToJSON)(requestParameters['createOrderChannelRequest']),
68
+ };
69
+ });
70
+ }
71
+ /**
72
+ * Creates a new order channel for an organization.
73
+ * Create order channel
74
+ */
75
+ createOrderChannelRaw(requestParameters, initOverrides) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const requestOptions = yield this.createOrderChannelRequestOpts(requestParameters);
78
+ const response = yield this.request(requestOptions, initOverrides);
79
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListOrderChannels200ResponseDataInner_1.ListOrderChannels200ResponseDataInnerFromJSON)(jsonValue));
80
+ });
81
+ }
82
+ /**
83
+ * Creates a new order channel for an organization.
84
+ * Create order channel
85
+ */
86
+ createOrderChannel(requestParameters, initOverrides) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ const response = yield this.createOrderChannelRaw(requestParameters, initOverrides);
89
+ return yield response.value();
90
+ });
91
+ }
92
+ /**
93
+ * Creates request options for createOrderChannelWebhookSecret without sending the request
94
+ */
95
+ createOrderChannelWebhookSecretRequestOpts(requestParameters) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ if (requestParameters['orgId'] == null) {
98
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling createOrderChannelWebhookSecret().');
99
+ }
100
+ if (requestParameters['channelId'] == null) {
101
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling createOrderChannelWebhookSecret().');
102
+ }
103
+ const queryParameters = {};
104
+ const headerParameters = {};
105
+ if (this.configuration && this.configuration.accessToken) {
106
+ const token = this.configuration.accessToken;
107
+ const tokenString = yield token("bearerAuth", []);
108
+ if (tokenString) {
109
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
110
+ }
111
+ }
112
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhook-secret`;
113
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
114
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
115
+ return {
116
+ path: urlPath,
117
+ method: 'POST',
118
+ headers: headerParameters,
119
+ query: queryParameters,
120
+ };
121
+ });
122
+ }
123
+ /**
124
+ * Generates (or rotates) the custom channel\'s webhook signing secret used to authenticate order pushes to the ingest URL. The secret is returned only once. Rotating invalidates the previous secret immediately.
125
+ * Create or rotate webhook signing secret
126
+ */
127
+ createOrderChannelWebhookSecretRaw(requestParameters, initOverrides) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const requestOptions = yield this.createOrderChannelWebhookSecretRequestOpts(requestParameters);
130
+ const response = yield this.request(requestOptions, initOverrides);
131
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CreateOrderChannelWebhookSecret201Response_1.CreateOrderChannelWebhookSecret201ResponseFromJSON)(jsonValue));
132
+ });
133
+ }
134
+ /**
135
+ * Generates (or rotates) the custom channel\'s webhook signing secret used to authenticate order pushes to the ingest URL. The secret is returned only once. Rotating invalidates the previous secret immediately.
136
+ * Create or rotate webhook signing secret
137
+ */
138
+ createOrderChannelWebhookSecret(requestParameters, initOverrides) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const response = yield this.createOrderChannelWebhookSecretRaw(requestParameters, initOverrides);
141
+ return yield response.value();
142
+ });
143
+ }
144
+ /**
145
+ * Creates request options for deleteOrderChannel without sending the request
146
+ */
147
+ deleteOrderChannelRequestOpts(requestParameters) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ if (requestParameters['orgId'] == null) {
150
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling deleteOrderChannel().');
151
+ }
152
+ if (requestParameters['channelId'] == null) {
153
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling deleteOrderChannel().');
154
+ }
155
+ const queryParameters = {};
156
+ const headerParameters = {};
157
+ if (this.configuration && this.configuration.accessToken) {
158
+ const token = this.configuration.accessToken;
159
+ const tokenString = yield token("bearerAuth", []);
160
+ if (tokenString) {
161
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
162
+ }
163
+ }
164
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
165
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
166
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
167
+ return {
168
+ path: urlPath,
169
+ method: 'DELETE',
170
+ headers: headerParameters,
171
+ query: queryParameters,
172
+ };
173
+ });
174
+ }
175
+ /**
176
+ * Deletes an order channel and cascades deletion of its orders.
177
+ * Delete order channel
178
+ */
179
+ deleteOrderChannelRaw(requestParameters, initOverrides) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ const requestOptions = yield this.deleteOrderChannelRequestOpts(requestParameters);
182
+ const response = yield this.request(requestOptions, initOverrides);
183
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, RevokeApiToken200Response_1.RevokeApiToken200ResponseFromJSON)(jsonValue));
184
+ });
185
+ }
186
+ /**
187
+ * Deletes an order channel and cascades deletion of its orders.
188
+ * Delete order channel
189
+ */
190
+ deleteOrderChannel(requestParameters, initOverrides) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ const response = yield this.deleteOrderChannelRaw(requestParameters, initOverrides);
193
+ return yield response.value();
194
+ });
195
+ }
196
+ /**
197
+ * Creates request options for getOrderChannel without sending the request
198
+ */
199
+ getOrderChannelRequestOpts(requestParameters) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ if (requestParameters['orgId'] == null) {
202
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling getOrderChannel().');
203
+ }
204
+ if (requestParameters['channelId'] == null) {
205
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling getOrderChannel().');
206
+ }
207
+ const queryParameters = {};
208
+ const headerParameters = {};
209
+ if (this.configuration && this.configuration.accessToken) {
210
+ const token = this.configuration.accessToken;
211
+ const tokenString = yield token("bearerAuth", []);
212
+ if (tokenString) {
213
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
214
+ }
215
+ }
216
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
217
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
218
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
219
+ return {
220
+ path: urlPath,
221
+ method: 'GET',
222
+ headers: headerParameters,
223
+ query: queryParameters,
224
+ };
225
+ });
226
+ }
227
+ /**
228
+ * Returns a single order channel by ID, including its linked shipping rules.
229
+ * Get order channel
230
+ */
231
+ getOrderChannelRaw(requestParameters, initOverrides) {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ const requestOptions = yield this.getOrderChannelRequestOpts(requestParameters);
234
+ const response = yield this.request(requestOptions, initOverrides);
235
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListOrderChannels200ResponseDataInner_1.ListOrderChannels200ResponseDataInnerFromJSON)(jsonValue));
236
+ });
237
+ }
238
+ /**
239
+ * Returns a single order channel by ID, including its linked shipping rules.
240
+ * Get order channel
241
+ */
242
+ getOrderChannel(requestParameters, initOverrides) {
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ const response = yield this.getOrderChannelRaw(requestParameters, initOverrides);
245
+ return yield response.value();
246
+ });
247
+ }
248
+ /**
249
+ * Creates request options for getOrderChannelWebhookStatus without sending the request
250
+ */
251
+ getOrderChannelWebhookStatusRequestOpts(requestParameters) {
252
+ return __awaiter(this, void 0, void 0, function* () {
253
+ if (requestParameters['orgId'] == null) {
254
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling getOrderChannelWebhookStatus().');
255
+ }
256
+ if (requestParameters['channelId'] == null) {
257
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling getOrderChannelWebhookStatus().');
258
+ }
259
+ const queryParameters = {};
260
+ const headerParameters = {};
261
+ if (this.configuration && this.configuration.accessToken) {
262
+ const token = this.configuration.accessToken;
263
+ const tokenString = yield token("bearerAuth", []);
264
+ if (tokenString) {
265
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
266
+ }
267
+ }
268
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhooks`;
269
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
270
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
271
+ return {
272
+ path: urlPath,
273
+ method: 'GET',
274
+ headers: headerParameters,
275
+ query: queryParameters,
276
+ };
277
+ });
278
+ }
279
+ /**
280
+ * Returns whether webhooks are enabled and lists the webhooks registered with the platform.
281
+ * Get channel webhook status
282
+ */
283
+ getOrderChannelWebhookStatusRaw(requestParameters, initOverrides) {
284
+ return __awaiter(this, void 0, void 0, function* () {
285
+ const requestOptions = yield this.getOrderChannelWebhookStatusRequestOpts(requestParameters);
286
+ const response = yield this.request(requestOptions, initOverrides);
287
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetOrderChannelWebhookStatus200Response_1.GetOrderChannelWebhookStatus200ResponseFromJSON)(jsonValue));
288
+ });
289
+ }
290
+ /**
291
+ * Returns whether webhooks are enabled and lists the webhooks registered with the platform.
292
+ * Get channel webhook status
293
+ */
294
+ getOrderChannelWebhookStatus(requestParameters, initOverrides) {
295
+ return __awaiter(this, void 0, void 0, function* () {
296
+ const response = yield this.getOrderChannelWebhookStatusRaw(requestParameters, initOverrides);
297
+ return yield response.value();
298
+ });
299
+ }
300
+ /**
301
+ * Creates request options for listOrderChannels without sending the request
302
+ */
303
+ listOrderChannelsRequestOpts(requestParameters) {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ if (requestParameters['orgId'] == null) {
306
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling listOrderChannels().');
307
+ }
308
+ const queryParameters = {};
309
+ if (requestParameters['page'] != null) {
310
+ queryParameters['page'] = requestParameters['page'];
311
+ }
312
+ if (requestParameters['limit'] != null) {
313
+ queryParameters['limit'] = requestParameters['limit'];
314
+ }
315
+ if (requestParameters['brandId'] != null) {
316
+ queryParameters['brandId'] = requestParameters['brandId'];
317
+ }
318
+ if (requestParameters['brandScope'] != null) {
319
+ queryParameters['brandScope'] = requestParameters['brandScope'];
320
+ }
321
+ if (requestParameters['type'] != null) {
322
+ queryParameters['type'] = requestParameters['type'];
323
+ }
324
+ if (requestParameters['enabled'] != null) {
325
+ queryParameters['enabled'] = requestParameters['enabled'];
326
+ }
327
+ if (requestParameters['search'] != null) {
328
+ queryParameters['search'] = requestParameters['search'];
329
+ }
330
+ const headerParameters = {};
331
+ if (this.configuration && this.configuration.accessToken) {
332
+ const token = this.configuration.accessToken;
333
+ const tokenString = yield token("bearerAuth", []);
334
+ if (tokenString) {
335
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
336
+ }
337
+ }
338
+ let urlPath = `/orgs/{orgId}/order-channels`;
339
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
340
+ return {
341
+ path: urlPath,
342
+ method: 'GET',
343
+ headers: headerParameters,
344
+ query: queryParameters,
345
+ };
346
+ });
347
+ }
348
+ /**
349
+ * Returns a paginated list of order channels for an organization.
350
+ * List order channels
351
+ */
352
+ listOrderChannelsRaw(requestParameters, initOverrides) {
353
+ return __awaiter(this, void 0, void 0, function* () {
354
+ const requestOptions = yield this.listOrderChannelsRequestOpts(requestParameters);
355
+ const response = yield this.request(requestOptions, initOverrides);
356
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListOrderChannels200Response_1.ListOrderChannels200ResponseFromJSON)(jsonValue));
357
+ });
358
+ }
359
+ /**
360
+ * Returns a paginated list of order channels for an organization.
361
+ * List order channels
362
+ */
363
+ listOrderChannels(requestParameters, initOverrides) {
364
+ return __awaiter(this, void 0, void 0, function* () {
365
+ const response = yield this.listOrderChannelsRaw(requestParameters, initOverrides);
366
+ return yield response.value();
367
+ });
368
+ }
369
+ /**
370
+ * Creates request options for revokeOrderChannelWebhookSecret without sending the request
371
+ */
372
+ revokeOrderChannelWebhookSecretRequestOpts(requestParameters) {
373
+ return __awaiter(this, void 0, void 0, function* () {
374
+ if (requestParameters['orgId'] == null) {
375
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling revokeOrderChannelWebhookSecret().');
376
+ }
377
+ if (requestParameters['channelId'] == null) {
378
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling revokeOrderChannelWebhookSecret().');
379
+ }
380
+ const queryParameters = {};
381
+ const headerParameters = {};
382
+ if (this.configuration && this.configuration.accessToken) {
383
+ const token = this.configuration.accessToken;
384
+ const tokenString = yield token("bearerAuth", []);
385
+ if (tokenString) {
386
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
387
+ }
388
+ }
389
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhook-secret`;
390
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
391
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
392
+ return {
393
+ path: urlPath,
394
+ method: 'DELETE',
395
+ headers: headerParameters,
396
+ query: queryParameters,
397
+ };
398
+ });
399
+ }
400
+ /**
401
+ * Revokes the custom channel\'s webhook signing secret. All subsequent pushes to the ingest URL are rejected until a new secret is generated.
402
+ * Revoke webhook signing secret
403
+ */
404
+ revokeOrderChannelWebhookSecretRaw(requestParameters, initOverrides) {
405
+ return __awaiter(this, void 0, void 0, function* () {
406
+ const requestOptions = yield this.revokeOrderChannelWebhookSecretRequestOpts(requestParameters);
407
+ const response = yield this.request(requestOptions, initOverrides);
408
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, RevokeOrderChannelWebhookSecret200Response_1.RevokeOrderChannelWebhookSecret200ResponseFromJSON)(jsonValue));
409
+ });
410
+ }
411
+ /**
412
+ * Revokes the custom channel\'s webhook signing secret. All subsequent pushes to the ingest URL are rejected until a new secret is generated.
413
+ * Revoke webhook signing secret
414
+ */
415
+ revokeOrderChannelWebhookSecret(requestParameters, initOverrides) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ const response = yield this.revokeOrderChannelWebhookSecretRaw(requestParameters, initOverrides);
418
+ return yield response.value();
419
+ });
420
+ }
421
+ /**
422
+ * Creates request options for updateOrderChannel without sending the request
423
+ */
424
+ updateOrderChannelRequestOpts(requestParameters) {
425
+ return __awaiter(this, void 0, void 0, function* () {
426
+ if (requestParameters['orgId'] == null) {
427
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling updateOrderChannel().');
428
+ }
429
+ if (requestParameters['channelId'] == null) {
430
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling updateOrderChannel().');
431
+ }
432
+ if (requestParameters['updateOrderChannelRequest'] == null) {
433
+ throw new runtime.RequiredError('updateOrderChannelRequest', 'Required parameter "updateOrderChannelRequest" was null or undefined when calling updateOrderChannel().');
434
+ }
435
+ const queryParameters = {};
436
+ const headerParameters = {};
437
+ headerParameters['Content-Type'] = 'application/json';
438
+ if (this.configuration && this.configuration.accessToken) {
439
+ const token = this.configuration.accessToken;
440
+ const tokenString = yield token("bearerAuth", []);
441
+ if (tokenString) {
442
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
443
+ }
444
+ }
445
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
446
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
447
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
448
+ return {
449
+ path: urlPath,
450
+ method: 'PATCH',
451
+ headers: headerParameters,
452
+ query: queryParameters,
453
+ body: (0, UpdateOrderChannelRequest_1.UpdateOrderChannelRequestToJSON)(requestParameters['updateOrderChannelRequest']),
454
+ };
455
+ });
456
+ }
457
+ /**
458
+ * Updates an order channel and its linked shipping rules.
459
+ * Update order channel
460
+ */
461
+ updateOrderChannelRaw(requestParameters, initOverrides) {
462
+ return __awaiter(this, void 0, void 0, function* () {
463
+ const requestOptions = yield this.updateOrderChannelRequestOpts(requestParameters);
464
+ const response = yield this.request(requestOptions, initOverrides);
465
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListOrderChannels200ResponseDataInner_1.ListOrderChannels200ResponseDataInnerFromJSON)(jsonValue));
466
+ });
467
+ }
468
+ /**
469
+ * Updates an order channel and its linked shipping rules.
470
+ * Update order channel
471
+ */
472
+ updateOrderChannel(requestParameters, initOverrides) {
473
+ return __awaiter(this, void 0, void 0, function* () {
474
+ const response = yield this.updateOrderChannelRaw(requestParameters, initOverrides);
475
+ return yield response.value();
476
+ });
477
+ }
478
+ }
479
+ exports.OrderChannelsApi = OrderChannelsApi;
480
+ /**
481
+ * @export
482
+ */
483
+ exports.ListOrderChannelsBrandScopeEnum = {
484
+ Own: 'own',
485
+ Shared: 'shared',
486
+ Both: 'both'
487
+ };
488
+ /**
489
+ * @export
490
+ */
491
+ exports.ListOrderChannelsTypeEnum = {
492
+ Shopify: 'shopify',
493
+ Woocommerce: 'woocommerce',
494
+ Manual: 'manual',
495
+ Custom: 'custom'
496
+ };
@@ -3,6 +3,7 @@ export * from './BillingApi';
3
3
  export * from './BrandsApi';
4
4
  export * from './CarrierCatalogApi';
5
5
  export * from './CarriersApi';
6
+ export * from './OrderChannelsApi';
6
7
  export * from './OrdersApi';
7
8
  export * from './OrgsApi';
8
9
  export * from './QuotesApi';
@@ -21,6 +21,7 @@ __exportStar(require("./BillingApi"), exports);
21
21
  __exportStar(require("./BrandsApi"), exports);
22
22
  __exportStar(require("./CarrierCatalogApi"), exports);
23
23
  __exportStar(require("./CarriersApi"), exports);
24
+ __exportStar(require("./OrderChannelsApi"), exports);
24
25
  __exportStar(require("./OrdersApi"), exports);
25
26
  __exportStar(require("./OrgsApi"), exports);
26
27
  __exportStar(require("./QuotesApi"), exports);