@teemill/orders 0.3.1 → 1.0.2

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 (87) hide show
  1. package/.openapi-generator/FILES +24 -6
  2. package/README.md +3 -3
  3. package/dist/apis/OrdersApi.d.ts +79 -0
  4. package/dist/apis/OrdersApi.js +319 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +19 -0
  7. package/dist/index.d.ts +3 -13
  8. package/dist/index.js +5 -15
  9. package/dist/models/Address.d.ts +73 -0
  10. package/dist/models/Address.js +68 -0
  11. package/dist/models/ApiError.d.ts +37 -0
  12. package/dist/models/ApiError.js +53 -0
  13. package/dist/models/ConfirmOrderFulfillment.d.ts +37 -0
  14. package/dist/models/ConfirmOrderFulfillment.js +53 -0
  15. package/dist/models/ConfirmOrderRequest.d.ts +32 -0
  16. package/dist/models/ConfirmOrderRequest.js +51 -0
  17. package/dist/models/ConfirmOrderValidationError.d.ts +47 -0
  18. package/dist/models/ConfirmOrderValidationError.js +62 -0
  19. package/dist/models/ContactInformation.d.ts +37 -0
  20. package/dist/models/ContactInformation.js +53 -0
  21. package/dist/models/DeliveryEstimates.d.ts +37 -0
  22. package/dist/models/DeliveryEstimates.js +52 -0
  23. package/dist/models/Fulfillment.d.ts +71 -0
  24. package/dist/models/Fulfillment.js +66 -0
  25. package/dist/models/FulfillmentItem.d.ts +43 -0
  26. package/dist/models/FulfillmentItem.js +54 -0
  27. package/dist/models/Order.d.ts +128 -0
  28. package/dist/models/Order.js +89 -0
  29. package/dist/models/OrderItem.d.ts +75 -0
  30. package/dist/models/OrderItem.js +64 -0
  31. package/dist/models/OrderItemTaxPrice.d.ts +37 -0
  32. package/dist/models/OrderItemTaxPrice.js +52 -0
  33. package/dist/models/OrderTracking.d.ts +43 -0
  34. package/dist/models/OrderTracking.js +54 -0
  35. package/dist/models/OrdersResponse.d.ts +38 -0
  36. package/dist/models/OrdersResponse.js +53 -0
  37. package/dist/models/Origin.d.ts +37 -0
  38. package/dist/models/Origin.js +52 -0
  39. package/dist/models/Price.d.ts +37 -0
  40. package/dist/models/Price.js +52 -0
  41. package/dist/models/ShippingMethod.d.ts +75 -0
  42. package/dist/models/ShippingMethod.js +66 -0
  43. package/dist/models/Status.d.ts +26 -0
  44. package/dist/models/Status.js +39 -0
  45. package/dist/models/index.d.ts +18 -0
  46. package/dist/models/index.js +36 -0
  47. package/dist/runtime.d.ts +182 -0
  48. package/dist/runtime.js +562 -0
  49. package/package.json +3 -15
  50. package/src/apis/OrdersApi.ts +269 -0
  51. package/src/apis/index.ts +3 -0
  52. package/src/index.ts +5 -0
  53. package/src/models/Address.ts +125 -0
  54. package/src/models/ApiError.ts +74 -0
  55. package/src/models/ConfirmOrderFulfillment.ts +75 -0
  56. package/src/models/ConfirmOrderRequest.ts +73 -0
  57. package/src/models/ConfirmOrderValidationError.ts +88 -0
  58. package/src/models/ContactInformation.ts +74 -0
  59. package/src/models/DeliveryEstimates.ts +73 -0
  60. package/src/models/Fulfillment.ts +138 -0
  61. package/src/models/FulfillmentItem.ts +81 -0
  62. package/src/models/Order.ts +230 -0
  63. package/src/models/OrderItem.ts +132 -0
  64. package/src/models/OrderItemTaxPrice.ts +73 -0
  65. package/src/models/OrderTracking.ts +81 -0
  66. package/src/models/OrdersResponse.ts +80 -0
  67. package/src/models/Origin.ts +73 -0
  68. package/src/models/Price.ts +73 -0
  69. package/src/models/ShippingMethod.ts +134 -0
  70. package/src/models/Status.ts +41 -0
  71. package/src/models/index.ts +20 -0
  72. package/src/runtime.ts +431 -0
  73. package/tsconfig.json +2 -3
  74. package/api.ts +0 -988
  75. package/base.ts +0 -72
  76. package/common.ts +0 -150
  77. package/configuration.ts +0 -101
  78. package/dist/api.d.ts +0 -750
  79. package/dist/api.js +0 -560
  80. package/dist/base.d.ts +0 -54
  81. package/dist/base.js +0 -80
  82. package/dist/common.d.ts +0 -65
  83. package/dist/common.js +0 -252
  84. package/dist/configuration.d.ts +0 -83
  85. package/dist/configuration.js +0 -44
  86. package/git_push.sh +0 -57
  87. package/index.ts +0 -18
package/api.ts DELETED
@@ -1,988 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Orders API
5
- * Manage Teemill Orders For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
6
- *
7
- * The version of the OpenAPI document: 0.3.1
8
- * Contact: hello@teemill.com
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import type { Configuration } from './configuration';
17
- import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18
- import globalAxios from 'axios';
19
- // Some imports not used depending on template conditions
20
- // @ts-ignore
21
- import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
- import type { RequestArgs } from './base';
23
- // @ts-ignore
24
- import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
25
-
26
- /**
27
- * A person\'s address.
28
- * @export
29
- * @interface Address
30
- */
31
- export interface Address {
32
- /**
33
- *
34
- * @type {string}
35
- * @memberof Address
36
- */
37
- 'contactName': string;
38
- /**
39
- *
40
- * @type {string}
41
- * @memberof Address
42
- */
43
- 'company'?: string;
44
- /**
45
- * First line of the address.
46
- * @type {string}
47
- * @memberof Address
48
- */
49
- 'line1': string;
50
- /**
51
- * Second line of the address.
52
- * @type {string}
53
- * @memberof Address
54
- */
55
- 'line2'?: string;
56
- /**
57
- * City of the address.
58
- * @type {string}
59
- * @memberof Address
60
- */
61
- 'city': string;
62
- /**
63
- * Postal code of the address.
64
- * @type {string}
65
- * @memberof Address
66
- */
67
- 'postalCode'?: string;
68
- /**
69
- * Country of the address (ISO 3166-1 alpha-2).
70
- * @type {string}
71
- * @memberof Address
72
- */
73
- 'country': string;
74
- /**
75
- * State of the address.
76
- * @type {string}
77
- * @memberof Address
78
- */
79
- 'state'?: string;
80
- }
81
- /**
82
- *
83
- * @export
84
- * @interface ConfirmOrderRequest
85
- */
86
- export interface ConfirmOrderRequest {
87
- /**
88
- *
89
- * @type {Array<ConfirmOrderRequestFulfillmentsInner>}
90
- * @memberof ConfirmOrderRequest
91
- */
92
- 'fulfillments': Array<ConfirmOrderRequestFulfillmentsInner>;
93
- }
94
- /**
95
- *
96
- * @export
97
- * @interface ConfirmOrderRequestFulfillmentsInner
98
- */
99
- export interface ConfirmOrderRequestFulfillmentsInner {
100
- /**
101
- * Unique object identifier
102
- * @type {string}
103
- * @memberof ConfirmOrderRequestFulfillmentsInner
104
- */
105
- 'fulfillmentId': string;
106
- /**
107
- * Unique object identifier
108
- * @type {string}
109
- * @memberof ConfirmOrderRequestFulfillmentsInner
110
- */
111
- 'shippingMethodId': string;
112
- }
113
- /**
114
- *
115
- * @export
116
- * @interface Fulfillment
117
- */
118
- export interface Fulfillment {
119
- /**
120
- * Unique object identifier
121
- * @type {string}
122
- * @memberof Fulfillment
123
- */
124
- 'id'?: string;
125
- /**
126
- *
127
- * @type {Status}
128
- * @memberof Fulfillment
129
- */
130
- 'status'?: Status;
131
- /**
132
- *
133
- * @type {Array<FulfillmentItemsInner>}
134
- * @memberof Fulfillment
135
- */
136
- 'items'?: Array<FulfillmentItemsInner>;
137
- /**
138
- *
139
- * @type {Tracking}
140
- * @memberof Fulfillment
141
- */
142
- 'tracking'?: Tracking | null;
143
- /**
144
- * Shipping method currently set
145
- * @type {ShippingMethod}
146
- * @memberof Fulfillment
147
- */
148
- 'shippingMethod'?: ShippingMethod;
149
- /**
150
- *
151
- * @type {Array<ShippingMethod>}
152
- * @memberof Fulfillment
153
- */
154
- 'availableShippingMethods'?: Array<ShippingMethod>;
155
- /**
156
- * Weight of the package being shipped in grams
157
- * @type {number}
158
- * @memberof Fulfillment
159
- */
160
- 'packageWeight'?: number;
161
- }
162
-
163
-
164
- /**
165
- *
166
- * @export
167
- * @interface FulfillmentItemsInner
168
- */
169
- export interface FulfillmentItemsInner {
170
- /**
171
- * Unique object identifier
172
- * @type {string}
173
- * @memberof FulfillmentItemsInner
174
- */
175
- 'id'?: string;
176
- /**
177
- * Unique object identifier
178
- * @type {string}
179
- * @memberof FulfillmentItemsInner
180
- */
181
- 'itemId'?: string;
182
- /**
183
- * Number of this item being fulfilled
184
- * @type {number}
185
- * @memberof FulfillmentItemsInner
186
- */
187
- 'quantity'?: number;
188
- }
189
- /**
190
- *
191
- * @export
192
- * @interface ModelError
193
- */
194
- export interface ModelError {
195
- /**
196
- *
197
- * @type {string}
198
- * @memberof ModelError
199
- */
200
- 'code'?: string;
201
- /**
202
- *
203
- * @type {string}
204
- * @memberof ModelError
205
- */
206
- 'message': string;
207
- }
208
- /**
209
- *
210
- * @export
211
- * @interface Order
212
- */
213
- export interface Order {
214
- /**
215
- * Unique object identifier
216
- * @type {string}
217
- * @memberof Order
218
- */
219
- 'id'?: string;
220
- /**
221
- * A reference to the resource location
222
- * @type {string}
223
- * @memberof Order
224
- */
225
- 'ref'?: string;
226
- /**
227
- *
228
- * @type {Status}
229
- * @memberof Order
230
- */
231
- 'status'?: Status;
232
- /**
233
- *
234
- * @type {OrderContactInformation}
235
- * @memberof Order
236
- */
237
- 'contactInformation': OrderContactInformation;
238
- /**
239
- * Order recipient\'s address
240
- * @type {Address}
241
- * @memberof Order
242
- */
243
- 'shippingAddress': Address;
244
- /**
245
- * ISO 8601 Timestamp
246
- * @type {string}
247
- * @memberof Order
248
- */
249
- 'createdAt'?: string;
250
- /**
251
- * ISO 8601 Timestamp
252
- * @type {string}
253
- * @memberof Order
254
- */
255
- 'updatedAt'?: string;
256
- /**
257
- * A custom reference to the merchant\'s order that will be displayed on the shipping label.
258
- * @type {string}
259
- * @memberof Order
260
- */
261
- 'merchantReference'?: string | null;
262
- /**
263
- *
264
- * @type {Array<Fulfillment>}
265
- * @memberof Order
266
- */
267
- 'fulfillments'?: Array<Fulfillment>;
268
- /**
269
- *
270
- * @type {Array<OrderItem>}
271
- * @memberof Order
272
- */
273
- 'items': Array<OrderItem>;
274
- /**
275
- *
276
- * @type {Price}
277
- * @memberof Order
278
- */
279
- 'totalPrice'?: Price;
280
- /**
281
- *
282
- * @type {Price}
283
- * @memberof Order
284
- */
285
- 'taxPrice'?: Price;
286
- /**
287
- *
288
- * @type {Price}
289
- * @memberof Order
290
- */
291
- 'subtotalPrice'?: Price;
292
- /**
293
- *
294
- * @type {Price}
295
- * @memberof Order
296
- */
297
- 'discountPrice'?: Price;
298
- /**
299
- *
300
- * @type {Price}
301
- * @memberof Order
302
- */
303
- 'shippingPrice'?: Price;
304
- /**
305
- *
306
- * @type {OrderOrigin}
307
- * @memberof Order
308
- */
309
- 'origin'?: OrderOrigin;
310
- }
311
-
312
-
313
- /**
314
- * Order recipient contact information, used only for courier tracking/updates.
315
- * @export
316
- * @interface OrderContactInformation
317
- */
318
- export interface OrderContactInformation {
319
- /**
320
- *
321
- * @type {string}
322
- * @memberof OrderContactInformation
323
- */
324
- 'email': string;
325
- /**
326
- *
327
- * @type {string}
328
- * @memberof OrderContactInformation
329
- */
330
- 'phone'?: string | null;
331
- }
332
- /**
333
- *
334
- * @export
335
- * @interface OrderItem
336
- */
337
- export interface OrderItem {
338
- /**
339
- * Unique object identifier
340
- * @type {string}
341
- * @memberof OrderItem
342
- */
343
- 'id'?: string;
344
- /**
345
- * A reference to the resource location
346
- * @type {string}
347
- * @memberof OrderItem
348
- */
349
- 'variantRef': string;
350
- /**
351
- *
352
- * @type {number}
353
- * @memberof OrderItem
354
- */
355
- 'quantity': number;
356
- /**
357
- *
358
- * @type {OrderItemTotalPrice}
359
- * @memberof OrderItem
360
- */
361
- 'totalPrice'?: OrderItemTotalPrice;
362
- /**
363
- *
364
- * @type {OrderItemTaxPrice}
365
- * @memberof OrderItem
366
- */
367
- 'taxPrice'?: OrderItemTaxPrice;
368
- /**
369
- *
370
- * @type {OrderItemTotalPrice}
371
- * @memberof OrderItem
372
- */
373
- 'subtotalPrice'?: OrderItemTotalPrice;
374
- /**
375
- *
376
- * @type {OrderItemTotalPrice}
377
- * @memberof OrderItem
378
- */
379
- 'discountPrice'?: OrderItemTotalPrice;
380
- /**
381
- *
382
- * @type {Price}
383
- * @memberof OrderItem
384
- */
385
- 'recipientCost'?: Price;
386
- }
387
- /**
388
- * This is an estimate until the order has been confirmed
389
- * @export
390
- * @interface OrderItemTaxPrice
391
- */
392
- export interface OrderItemTaxPrice {
393
- /**
394
- * Price including tax in the specified currency.
395
- * @type {string}
396
- * @memberof OrderItemTaxPrice
397
- */
398
- 'amount'?: string;
399
- /**
400
- * Currency code for the currency the price is valued in.
401
- * @type {string}
402
- * @memberof OrderItemTaxPrice
403
- */
404
- 'currencyCode'?: string;
405
- }
406
- /**
407
- *
408
- * @export
409
- * @interface OrderItemTotalPrice
410
- */
411
- export interface OrderItemTotalPrice {
412
- /**
413
- * Price including tax in the specified currency.
414
- * @type {string}
415
- * @memberof OrderItemTotalPrice
416
- */
417
- 'amount'?: string;
418
- /**
419
- * Currency code for the currency the price is valued in.
420
- * @type {string}
421
- * @memberof OrderItemTotalPrice
422
- */
423
- 'currencyCode'?: string;
424
- }
425
- /**
426
- *
427
- * @export
428
- * @interface OrderOrigin
429
- */
430
- export interface OrderOrigin {
431
- /**
432
- *
433
- * @type {string}
434
- * @memberof OrderOrigin
435
- */
436
- 'code'?: string;
437
- /**
438
- *
439
- * @type {boolean}
440
- * @memberof OrderOrigin
441
- */
442
- 'isPaid'?: boolean;
443
- }
444
- /**
445
- * Standard price definition that defines the amount and currency.
446
- * @export
447
- * @interface Price
448
- */
449
- export interface Price {
450
- /**
451
- * Price including tax in the specified currency.
452
- * @type {string}
453
- * @memberof Price
454
- */
455
- 'amount'?: string;
456
- /**
457
- * Currency code for the currency the price is valued in.
458
- * @type {string}
459
- * @memberof Price
460
- */
461
- 'currencyCode'?: string;
462
- }
463
- /**
464
- *
465
- * @export
466
- * @interface ShippingMethod
467
- */
468
- export interface ShippingMethod {
469
- /**
470
- * Unique object identifier
471
- * @type {string}
472
- * @memberof ShippingMethod
473
- */
474
- 'id'?: string;
475
- /**
476
- *
477
- * @type {string}
478
- * @memberof ShippingMethod
479
- */
480
- 'name'?: string;
481
- /**
482
- *
483
- * @type {string}
484
- * @memberof ShippingMethod
485
- */
486
- 'description'?: string;
487
- /**
488
- *
489
- * @type {ShippingMethodDeliveryEstimates}
490
- * @memberof ShippingMethod
491
- */
492
- 'deliveryEstimates'?: ShippingMethodDeliveryEstimates;
493
- /**
494
- *
495
- * @type {Price}
496
- * @memberof ShippingMethod
497
- */
498
- 'totalPrice'?: Price;
499
- /**
500
- *
501
- * @type {Price}
502
- * @memberof ShippingMethod
503
- */
504
- 'taxPrice'?: Price;
505
- /**
506
- *
507
- * @type {Price}
508
- * @memberof ShippingMethod
509
- */
510
- 'subtotalPrice'?: Price;
511
- /**
512
- *
513
- * @type {Price}
514
- * @memberof ShippingMethod
515
- */
516
- 'discountPrice'?: Price;
517
- }
518
- /**
519
- *
520
- * @export
521
- * @interface ShippingMethodDeliveryEstimates
522
- */
523
- export interface ShippingMethodDeliveryEstimates {
524
- /**
525
- * ISO 8601 Timestamp
526
- * @type {string}
527
- * @memberof ShippingMethodDeliveryEstimates
528
- */
529
- 'min'?: string;
530
- /**
531
- * ISO 8601 Timestamp
532
- * @type {string}
533
- * @memberof ShippingMethodDeliveryEstimates
534
- */
535
- 'max'?: string;
536
- }
537
- /**
538
- *
539
- * @export
540
- * @enum {string}
541
- */
542
-
543
- export const Status = {
544
- New: 'new',
545
- Paid: 'paid',
546
- Processing: 'processing',
547
- Complete: 'complete',
548
- Refunded: 'refunded'
549
- } as const;
550
-
551
- export type Status = typeof Status[keyof typeof Status];
552
-
553
-
554
- /**
555
- *
556
- * @export
557
- * @interface Tracking
558
- */
559
- export interface Tracking {
560
- /**
561
- *
562
- * @type {string}
563
- * @memberof Tracking
564
- */
565
- 'courier'?: string;
566
- /**
567
- *
568
- * @type {string}
569
- * @memberof Tracking
570
- */
571
- 'code'?: string;
572
- /**
573
- *
574
- * @type {string}
575
- * @memberof Tracking
576
- */
577
- 'url'?: string;
578
- }
579
-
580
- /**
581
- * OrdersApi - axios parameter creator
582
- * @export
583
- */
584
- export const OrdersApiAxiosParamCreator = function (configuration?: Configuration) {
585
- return {
586
- /**
587
- * Confirms and order, and submits it as ready to take payment and begin processing.
588
- * @summary Confirm order
589
- * @param {any} project What project it is
590
- * @param {string} orderId Unique identifier of an order
591
- * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
592
- * @param {*} [options] Override http request option.
593
- * @throws {RequiredError}
594
- */
595
- confirmOrder: async (project: any, orderId: string, confirmOrderRequest: ConfirmOrderRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
596
- // verify required parameter 'project' is not null or undefined
597
- assertParamExists('confirmOrder', 'project', project)
598
- // verify required parameter 'orderId' is not null or undefined
599
- assertParamExists('confirmOrder', 'orderId', orderId)
600
- // verify required parameter 'confirmOrderRequest' is not null or undefined
601
- assertParamExists('confirmOrder', 'confirmOrderRequest', confirmOrderRequest)
602
- const localVarPath = `/v1/orders/{orderId}/confirm`
603
- .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
604
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
605
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
606
- let baseOptions;
607
- if (configuration) {
608
- baseOptions = configuration.baseOptions;
609
- }
610
-
611
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
612
- const localVarHeaderParameter = {} as any;
613
- const localVarQueryParameter = {} as any;
614
-
615
- // authentication api-key required
616
- await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
617
-
618
- if (project !== undefined) {
619
- for (let param of Object.keys(project)) {
620
- localVarQueryParameter[param] = project?.[param];
621
- }
622
- }
623
-
624
-
625
-
626
- localVarHeaderParameter['Content-Type'] = 'application/json';
627
-
628
- setSearchParams(localVarUrlObj, localVarQueryParameter);
629
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
630
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
631
- localVarRequestOptions.data = serializeDataIfNeeded(confirmOrderRequest, localVarRequestOptions, configuration)
632
-
633
- return {
634
- url: toPathString(localVarUrlObj),
635
- options: localVarRequestOptions,
636
- };
637
- },
638
- /**
639
- * Creates a new order for the provided variants.
640
- * @summary Create order
641
- * @param {any} project What project it is
642
- * @param {Order} order Order schema
643
- * @param {*} [options] Override http request option.
644
- * @throws {RequiredError}
645
- */
646
- createOrder: async (project: any, order: Order, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
647
- // verify required parameter 'project' is not null or undefined
648
- assertParamExists('createOrder', 'project', project)
649
- // verify required parameter 'order' is not null or undefined
650
- assertParamExists('createOrder', 'order', order)
651
- const localVarPath = `/v1/orders`;
652
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
653
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
654
- let baseOptions;
655
- if (configuration) {
656
- baseOptions = configuration.baseOptions;
657
- }
658
-
659
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
660
- const localVarHeaderParameter = {} as any;
661
- const localVarQueryParameter = {} as any;
662
-
663
- // authentication api-key required
664
- await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
665
-
666
- if (project !== undefined) {
667
- for (let param of Object.keys(project)) {
668
- localVarQueryParameter[param] = project?.[param];
669
- }
670
- }
671
-
672
-
673
-
674
- localVarHeaderParameter['Content-Type'] = 'application/json';
675
-
676
- setSearchParams(localVarUrlObj, localVarQueryParameter);
677
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
678
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
679
- localVarRequestOptions.data = serializeDataIfNeeded(order, localVarRequestOptions, configuration)
680
-
681
- return {
682
- url: toPathString(localVarUrlObj),
683
- options: localVarRequestOptions,
684
- };
685
- },
686
- /**
687
- * Get an order
688
- * @summary Get order
689
- * @param {any} project What project it is
690
- * @param {string} orderId Unique identifier of an order
691
- * @param {*} [options] Override http request option.
692
- * @throws {RequiredError}
693
- */
694
- getOrder: async (project: any, orderId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
695
- // verify required parameter 'project' is not null or undefined
696
- assertParamExists('getOrder', 'project', project)
697
- // verify required parameter 'orderId' is not null or undefined
698
- assertParamExists('getOrder', 'orderId', orderId)
699
- const localVarPath = `/v1/orders/{orderId}`
700
- .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
701
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
702
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
703
- let baseOptions;
704
- if (configuration) {
705
- baseOptions = configuration.baseOptions;
706
- }
707
-
708
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
709
- const localVarHeaderParameter = {} as any;
710
- const localVarQueryParameter = {} as any;
711
-
712
- // authentication api-key required
713
- await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
714
-
715
- if (project !== undefined) {
716
- for (let param of Object.keys(project)) {
717
- localVarQueryParameter[param] = project?.[param];
718
- }
719
- }
720
-
721
-
722
-
723
- setSearchParams(localVarUrlObj, localVarQueryParameter);
724
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
725
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
726
-
727
- return {
728
- url: toPathString(localVarUrlObj),
729
- options: localVarRequestOptions,
730
- };
731
- },
732
- /**
733
- * Lists all orders available paginated into chunks
734
- * @summary List orders
735
- * @param {any} [pageToken] Page reference token
736
- * @param {any} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
737
- * @param {any} [start] Start of date range to filter by when orders were placed
738
- * @param {any} [end] End of date range to filter by when orders were placed
739
- * @param {any} [search] Search term to filter based on order reference, customer name and email
740
- * @param {*} [options] Override http request option.
741
- * @throws {RequiredError}
742
- */
743
- getOrders: async (pageToken?: any, pageSize?: any, start?: any, end?: any, search?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
744
- const localVarPath = `/v1/orders`;
745
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
746
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
747
- let baseOptions;
748
- if (configuration) {
749
- baseOptions = configuration.baseOptions;
750
- }
751
-
752
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
753
- const localVarHeaderParameter = {} as any;
754
- const localVarQueryParameter = {} as any;
755
-
756
- // authentication api-key required
757
- await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
758
-
759
- if (pageToken !== undefined) {
760
- for (let param of Object.keys(pageToken)) {
761
- localVarQueryParameter[param] = pageToken?.[param];
762
- }
763
- }
764
-
765
- if (pageSize !== undefined) {
766
- for (let param of Object.keys(pageSize)) {
767
- localVarQueryParameter[param] = pageSize?.[param];
768
- }
769
- }
770
-
771
- if (start !== undefined) {
772
- for (let param of Object.keys(start)) {
773
- localVarQueryParameter[param] = start?.[param];
774
- }
775
- }
776
-
777
- if (end !== undefined) {
778
- for (let param of Object.keys(end)) {
779
- localVarQueryParameter[param] = end?.[param];
780
- }
781
- }
782
-
783
- if (search !== undefined) {
784
- for (let param of Object.keys(search)) {
785
- localVarQueryParameter[param] = search?.[param];
786
- }
787
- }
788
-
789
-
790
-
791
- setSearchParams(localVarUrlObj, localVarQueryParameter);
792
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
793
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
794
-
795
- return {
796
- url: toPathString(localVarUrlObj),
797
- options: localVarRequestOptions,
798
- };
799
- },
800
- }
801
- };
802
-
803
- /**
804
- * OrdersApi - functional programming interface
805
- * @export
806
- */
807
- export const OrdersApiFp = function(configuration?: Configuration) {
808
- const localVarAxiosParamCreator = OrdersApiAxiosParamCreator(configuration)
809
- return {
810
- /**
811
- * Confirms and order, and submits it as ready to take payment and begin processing.
812
- * @summary Confirm order
813
- * @param {any} project What project it is
814
- * @param {string} orderId Unique identifier of an order
815
- * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
816
- * @param {*} [options] Override http request option.
817
- * @throws {RequiredError}
818
- */
819
- async confirmOrder(project: any, orderId: string, confirmOrderRequest: ConfirmOrderRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
820
- const localVarAxiosArgs = await localVarAxiosParamCreator.confirmOrder(project, orderId, confirmOrderRequest, options);
821
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
822
- },
823
- /**
824
- * Creates a new order for the provided variants.
825
- * @summary Create order
826
- * @param {any} project What project it is
827
- * @param {Order} order Order schema
828
- * @param {*} [options] Override http request option.
829
- * @throws {RequiredError}
830
- */
831
- async createOrder(project: any, order: Order, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
832
- const localVarAxiosArgs = await localVarAxiosParamCreator.createOrder(project, order, options);
833
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
834
- },
835
- /**
836
- * Get an order
837
- * @summary Get order
838
- * @param {any} project What project it is
839
- * @param {string} orderId Unique identifier of an order
840
- * @param {*} [options] Override http request option.
841
- * @throws {RequiredError}
842
- */
843
- async getOrder(project: any, orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
844
- const localVarAxiosArgs = await localVarAxiosParamCreator.getOrder(project, orderId, options);
845
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
846
- },
847
- /**
848
- * Lists all orders available paginated into chunks
849
- * @summary List orders
850
- * @param {any} [pageToken] Page reference token
851
- * @param {any} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
852
- * @param {any} [start] Start of date range to filter by when orders were placed
853
- * @param {any} [end] End of date range to filter by when orders were placed
854
- * @param {any} [search] Search term to filter based on order reference, customer name and email
855
- * @param {*} [options] Override http request option.
856
- * @throws {RequiredError}
857
- */
858
- async getOrders(pageToken?: any, pageSize?: any, start?: any, end?: any, search?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
859
- const localVarAxiosArgs = await localVarAxiosParamCreator.getOrders(pageToken, pageSize, start, end, search, options);
860
- return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
861
- },
862
- }
863
- };
864
-
865
- /**
866
- * OrdersApi - factory interface
867
- * @export
868
- */
869
- export const OrdersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
870
- const localVarFp = OrdersApiFp(configuration)
871
- return {
872
- /**
873
- * Confirms and order, and submits it as ready to take payment and begin processing.
874
- * @summary Confirm order
875
- * @param {any} project What project it is
876
- * @param {string} orderId Unique identifier of an order
877
- * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
878
- * @param {*} [options] Override http request option.
879
- * @throws {RequiredError}
880
- */
881
- confirmOrder(project: any, orderId: string, confirmOrderRequest: ConfirmOrderRequest, options?: any): AxiosPromise<void> {
882
- return localVarFp.confirmOrder(project, orderId, confirmOrderRequest, options).then((request) => request(axios, basePath));
883
- },
884
- /**
885
- * Creates a new order for the provided variants.
886
- * @summary Create order
887
- * @param {any} project What project it is
888
- * @param {Order} order Order schema
889
- * @param {*} [options] Override http request option.
890
- * @throws {RequiredError}
891
- */
892
- createOrder(project: any, order: Order, options?: any): AxiosPromise<void> {
893
- return localVarFp.createOrder(project, order, options).then((request) => request(axios, basePath));
894
- },
895
- /**
896
- * Get an order
897
- * @summary Get order
898
- * @param {any} project What project it is
899
- * @param {string} orderId Unique identifier of an order
900
- * @param {*} [options] Override http request option.
901
- * @throws {RequiredError}
902
- */
903
- getOrder(project: any, orderId: string, options?: any): AxiosPromise<void> {
904
- return localVarFp.getOrder(project, orderId, options).then((request) => request(axios, basePath));
905
- },
906
- /**
907
- * Lists all orders available paginated into chunks
908
- * @summary List orders
909
- * @param {any} [pageToken] Page reference token
910
- * @param {any} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
911
- * @param {any} [start] Start of date range to filter by when orders were placed
912
- * @param {any} [end] End of date range to filter by when orders were placed
913
- * @param {any} [search] Search term to filter based on order reference, customer name and email
914
- * @param {*} [options] Override http request option.
915
- * @throws {RequiredError}
916
- */
917
- getOrders(pageToken?: any, pageSize?: any, start?: any, end?: any, search?: any, options?: any): AxiosPromise<void> {
918
- return localVarFp.getOrders(pageToken, pageSize, start, end, search, options).then((request) => request(axios, basePath));
919
- },
920
- };
921
- };
922
-
923
- /**
924
- * OrdersApi - object-oriented interface
925
- * @export
926
- * @class OrdersApi
927
- * @extends {BaseAPI}
928
- */
929
- export class OrdersApi extends BaseAPI {
930
- /**
931
- * Confirms and order, and submits it as ready to take payment and begin processing.
932
- * @summary Confirm order
933
- * @param {any} project What project it is
934
- * @param {string} orderId Unique identifier of an order
935
- * @param {ConfirmOrderRequest} confirmOrderRequest ConfirmFulfillment schema
936
- * @param {*} [options] Override http request option.
937
- * @throws {RequiredError}
938
- * @memberof OrdersApi
939
- */
940
- public confirmOrder(project: any, orderId: string, confirmOrderRequest: ConfirmOrderRequest, options?: AxiosRequestConfig) {
941
- return OrdersApiFp(this.configuration).confirmOrder(project, orderId, confirmOrderRequest, options).then((request) => request(this.axios, this.basePath));
942
- }
943
-
944
- /**
945
- * Creates a new order for the provided variants.
946
- * @summary Create order
947
- * @param {any} project What project it is
948
- * @param {Order} order Order schema
949
- * @param {*} [options] Override http request option.
950
- * @throws {RequiredError}
951
- * @memberof OrdersApi
952
- */
953
- public createOrder(project: any, order: Order, options?: AxiosRequestConfig) {
954
- return OrdersApiFp(this.configuration).createOrder(project, order, options).then((request) => request(this.axios, this.basePath));
955
- }
956
-
957
- /**
958
- * Get an order
959
- * @summary Get order
960
- * @param {any} project What project it is
961
- * @param {string} orderId Unique identifier of an order
962
- * @param {*} [options] Override http request option.
963
- * @throws {RequiredError}
964
- * @memberof OrdersApi
965
- */
966
- public getOrder(project: any, orderId: string, options?: AxiosRequestConfig) {
967
- return OrdersApiFp(this.configuration).getOrder(project, orderId, options).then((request) => request(this.axios, this.basePath));
968
- }
969
-
970
- /**
971
- * Lists all orders available paginated into chunks
972
- * @summary List orders
973
- * @param {any} [pageToken] Page reference token
974
- * @param {any} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
975
- * @param {any} [start] Start of date range to filter by when orders were placed
976
- * @param {any} [end] End of date range to filter by when orders were placed
977
- * @param {any} [search] Search term to filter based on order reference, customer name and email
978
- * @param {*} [options] Override http request option.
979
- * @throws {RequiredError}
980
- * @memberof OrdersApi
981
- */
982
- public getOrders(pageToken?: any, pageSize?: any, start?: any, end?: any, search?: any, options?: AxiosRequestConfig) {
983
- return OrdersApiFp(this.configuration).getOrders(pageToken, pageSize, start, end, search, options).then((request) => request(this.axios, this.basePath));
984
- }
985
- }
986
-
987
-
988
-