doboxa-js 1.0.2 → 1.1.0
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.
- package/README.md +134 -72
- package/dist/{chunk-CGJD4ZO5.mjs → chunk-7RN7PBJH.mjs} +11 -1
- package/dist/chunk-7RN7PBJH.mjs.map +1 -0
- package/dist/{chunk-36DDSV5T.mjs → chunk-RTI5YLAB.mjs} +163 -44
- package/dist/chunk-RTI5YLAB.mjs.map +1 -0
- package/dist/client-BrWpdgrN.d.mts +3024 -0
- package/dist/client-BrWpdgrN.d.ts +3024 -0
- package/dist/client.d.mts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +167 -28
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/errors-lG5MwUyw.d.mts +176 -0
- package/dist/errors-lG5MwUyw.d.ts +176 -0
- package/dist/errors.d.mts +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -1
- package/dist/errors.mjs +3 -1
- package/dist/index.d.mts +153 -0
- package/dist/index.d.ts +153 -0
- package/dist/index.js +172 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -10
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +2 -0
- package/dist/models.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-36DDSV5T.mjs.map +0 -1
- package/dist/chunk-CGJD4ZO5.mjs.map +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { D as Doboxa } from './client-BrWpdgrN.js';
|
|
2
|
+
export { p as ApiV2AuthenticationRefreshTokenPost200Response, r as ApiV2AuthenticationRefreshTokenPost200ResponseFromJSON, s as ApiV2AuthenticationRefreshTokenPost200ResponseFromJSONTyped, t as ApiV2AuthenticationRefreshTokenPost200ResponseToJSON, u as ApiV2AuthenticationRefreshTokenPost200ResponseToJSONTyped, v as ApiV2AuthenticationTokenPost200Response, x as ApiV2AuthenticationTokenPost200ResponseFromJSON, y as ApiV2AuthenticationTokenPost200ResponseFromJSONTyped, z as ApiV2AuthenticationTokenPost200ResponseToJSON, B as ApiV2AuthenticationTokenPost200ResponseToJSONTyped, E as Attachment, G as AttachmentFromJSON, H as AttachmentFromJSONTyped, J as AttachmentToJSON, K as AttachmentToJSONTyped, A as AuthenticationResource, dj as BaseLinkerAction, dk as BaseLinkerConnectorConfig, dn as BaseLinkerError, M as BillingAddress, P as BillingAddressFromJSON, Q as BillingAddressFromJSONTyped, S as BillingAddressToJSON, V as BillingAddressToJSONTyped, e as CatalogResource, W as Client, Y as ClientFromJSON, Z as ClientFromJSONTyped, k as ClientListParams, _ as ClientToJSON, $ as ClientToJSONTyped, C as ClientsResource, a0 as CreateOrderComment, a1 as CreateOrderCommentAuthorTypeEnum, a3 as CreateOrderCommentFromJSON, a4 as CreateOrderCommentFromJSONTyped, a5 as CreateOrderCommentToJSON, a6 as CreateOrderCommentToJSONTyped, a7 as DeliveryAddress, a9 as DeliveryAddressFromJSON, aa as DeliveryAddressFromJSONTyped, ab as DeliveryAddressToJSON, ac as DeliveryAddressToJSONTyped, l as DiscountCodeListParams, b as DiscountCodesResource, a as DoboxaConfig, dp as FileVersionResponse, ad as GetApiV2DiscountCodesExternal200Response, af as GetApiV2DiscountCodesExternal200ResponseFromJSON, ag as GetApiV2DiscountCodesExternal200ResponseFromJSONTyped, aj as GetApiV2DiscountCodesExternal200ResponseItemsInner, al as GetApiV2DiscountCodesExternal200ResponseItemsInnerFromJSON, am as GetApiV2DiscountCodesExternal200ResponseItemsInnerFromJSONTyped, an as GetApiV2DiscountCodesExternal200ResponseItemsInnerToJSON, ao as GetApiV2DiscountCodesExternal200ResponseItemsInnerToJSONTyped, ah as GetApiV2DiscountCodesExternal200ResponseToJSON, ai as GetApiV2DiscountCodesExternal200ResponseToJSONTyped, ap as Invoice, aq as InvoiceDocumentTypeEnum, as as InvoiceFromJSON, at as InvoiceFromJSONTyped, aw as InvoiceItem, ay as InvoiceItemFromJSON, az as InvoiceItemFromJSONTyped, aA as InvoiceItemToJSON, aB as InvoiceItemToJSONTyped, j as InvoiceListParams, aC as InvoiceOrder, aE as InvoiceOrderFromJSON, aF as InvoiceOrderFromJSONTyped, aI as InvoiceOrderItem, aK as InvoiceOrderItemFromJSON, aL as InvoiceOrderItemFromJSONTyped, aM as InvoiceOrderItemToJSON, aN as InvoiceOrderItemToJSONTyped, aG as InvoiceOrderToJSON, aH as InvoiceOrderToJSONTyped, au as InvoiceToJSON, av as InvoiceToJSONTyped, I as InvoicesResource, L as LoginParams, aO as Me, aQ as MeFromJSON, aR as MeFromJSONTyped, aS as MeToJSON, aT as MeToJSONTyped, aU as Order, i as OrderCancelParams, a$ as OrderCancellationResponse, b0 as OrderCancellationResponseDetailsEnum, b2 as OrderCancellationResponseFromJSON, b3 as OrderCancellationResponseFromJSONTyped, b4 as OrderCancellationResponseToJSON, b5 as OrderCancellationResponseToJSONTyped, b6 as OrderComment, b7 as OrderCommentAuthorTypeEnum, h as OrderCommentCreateParams, b9 as OrderCommentFromJSON, ba as OrderCommentFromJSONTyped, n as OrderCommentListParams, bb as OrderCommentToJSON, bc as OrderCommentToJSONTyped, c as OrderCommentsResource, f as OrderCreateParams, aX as OrderFromJSON, aY as OrderFromJSONTyped, bd as OrderItem, bj as OrderItemCropData, bk as OrderItemCropDataFilterEnum, bn as OrderItemCropDataFromJSON, bo as OrderItemCropDataFromJSONTyped, bl as OrderItemCropDataReflectionEnum, bp as OrderItemCropDataToJSON, bq as OrderItemCropDataToJSONTyped, bf as OrderItemFromJSON, bg as OrderItemFromJSONTyped, br as OrderItemOriginalData, bt as OrderItemOriginalDataFromJSON, bu as OrderItemOriginalDataFromJSONTyped, bv as OrderItemOriginalDataToJSON, bw as OrderItemOriginalDataToJSONTyped, bx as OrderItemStatus, bA as OrderItemStatusFromJSON, bB as OrderItemStatusFromJSONTyped, by as OrderItemStatusStatusEnum, bC as OrderItemStatusToJSON, bD as OrderItemStatusToJSONTyped, bh as OrderItemToJSON, bi as OrderItemToJSONTyped, bE as OrderOriginalData, bG as OrderOriginalDataFromJSON, bH as OrderOriginalDataFromJSONTyped, bI as OrderOriginalDataToJSON, bJ as OrderOriginalDataToJSONTyped, aV as OrderPaymentMethodEnum, bK as OrderStatus, bR as OrderStatusChange, bU as OrderStatusChangeFromJSON, bV as OrderStatusChangeFromJSONTyped, o as OrderStatusChangeListParams, bS as OrderStatusChangeStatusEnum, bW as OrderStatusChangeToJSON, bX as OrderStatusChangeToJSONTyped, d as OrderStatusChangesResource, bN as OrderStatusFromJSON, bO as OrderStatusFromJSONTyped, bL as OrderStatusStatusEnum, bP as OrderStatusToJSON, bQ as OrderStatusToJSONTyped, g as OrderStatusUpdateParams, aZ as OrderToJSON, a_ as OrderToJSONTyped, O as OrdersResource, bY as PageOfClients, b_ as PageOfClientsFromJSON, b$ as PageOfClientsFromJSONTyped, c0 as PageOfClientsToJSON, c1 as PageOfClientsToJSONTyped, c2 as PageOfInvoices, c4 as PageOfInvoicesFromJSON, c5 as PageOfInvoicesFromJSONTyped, c6 as PageOfInvoicesToJSON, c7 as PageOfInvoicesToJSONTyped, c8 as PageOfOrderComments, ca as PageOfOrderCommentsFromJSON, cb as PageOfOrderCommentsFromJSONTyped, cc as PageOfOrderCommentsToJSON, cd as PageOfOrderCommentsToJSONTyped, ce as PageOfOrderStatusChanges, cg as PageOfOrderStatusChangesFromJSON, ch as PageOfOrderStatusChangesFromJSONTyped, ci as PageOfOrderStatusChangesToJSON, cj as PageOfOrderStatusChangesToJSONTyped, ck as PageOfTrackingNumbers, cm as PageOfTrackingNumbersFromJSON, cn as PageOfTrackingNumbersFromJSONTyped, co as PageOfTrackingNumbersToJSON, cp as PageOfTrackingNumbersToJSONTyped, cq as PostOrderCommentResponse, cs as PostOrderCommentResponseFromJSON, ct as PostOrderCommentResponseFromJSONTyped, cu as PostOrderCommentResponseToJSON, cv as PostOrderCommentResponseToJSONTyped, cw as PostOrderResponse, cy as PostOrderResponseFromJSON, cz as PostOrderResponseFromJSONTyped, cA as PostOrderResponseToJSON, cB as PostOrderResponseToJSONTyped, cC as PostOrderStatus, cF as PostOrderStatusFromJSON, cG as PostOrderStatusFromJSONTyped, cJ as PostOrderStatusItem, cM as PostOrderStatusItemFromJSON, cN as PostOrderStatusItemFromJSONTyped, cK as PostOrderStatusItemStatusEnum, cO as PostOrderStatusItemToJSON, cP as PostOrderStatusItemToJSONTyped, cQ as PostOrderStatusResponse, cS as PostOrderStatusResponseFromJSON, cT as PostOrderStatusResponseFromJSONTyped, cU as PostOrderStatusResponseToJSON, cV as PostOrderStatusResponseToJSONTyped, cD as PostOrderStatusStatusEnum, cH as PostOrderStatusToJSON, cI as PostOrderStatusToJSONTyped, dz as ProductData, dw as ProductFeature, dx as ProductFeatureName, dy as ProductVariant, dr as ProductsCategoriesResponse, dm as ProductsDataParams, dA as ProductsDataResponse, dt as ProductsListEntry, ds as ProductsListItem, dl as ProductsListParams, dv as ProductsListResponse, du as ProductsListResult, R as RefreshTokenParams, cW as ReturnLabel, cY as ReturnLabelFromJSON, cZ as ReturnLabelFromJSONTyped, c_ as ReturnLabelToJSON, c$ as ReturnLabelToJSONTyped, dq as SupportedMethodsResponse, d0 as TrackingNumber, d2 as TrackingNumberFromJSON, d3 as TrackingNumberFromJSONTyped, d6 as TrackingNumberItem, d8 as TrackingNumberItemFromJSON, d9 as TrackingNumberItemFromJSONTyped, da as TrackingNumberItemToJSON, db as TrackingNumberItemToJSONTyped, m as TrackingNumberListParams, d4 as TrackingNumberToJSON, d5 as TrackingNumberToJSONTyped, T as TrackingNumbersResource, U as UsersResource, dc as Waybill, dd as WaybillDeliveryMethodEnum, df as WaybillFromJSON, dg as WaybillFromJSONTyped, dh as WaybillToJSON, di as WaybillToJSONTyped, q as instanceOfApiV2AuthenticationRefreshTokenPost200Response, w as instanceOfApiV2AuthenticationTokenPost200Response, F as instanceOfAttachment, N as instanceOfBillingAddress, X as instanceOfClient, a2 as instanceOfCreateOrderComment, a8 as instanceOfDeliveryAddress, ae as instanceOfGetApiV2DiscountCodesExternal200Response, ak as instanceOfGetApiV2DiscountCodesExternal200ResponseItemsInner, ar as instanceOfInvoice, ax as instanceOfInvoiceItem, aD as instanceOfInvoiceOrder, aJ as instanceOfInvoiceOrderItem, aP as instanceOfMe, aW as instanceOfOrder, b1 as instanceOfOrderCancellationResponse, b8 as instanceOfOrderComment, be as instanceOfOrderItem, bm as instanceOfOrderItemCropData, bs as instanceOfOrderItemOriginalData, bz as instanceOfOrderItemStatus, bF as instanceOfOrderOriginalData, bM as instanceOfOrderStatus, bT as instanceOfOrderStatusChange, bZ as instanceOfPageOfClients, c3 as instanceOfPageOfInvoices, c9 as instanceOfPageOfOrderComments, cf as instanceOfPageOfOrderStatusChanges, cl as instanceOfPageOfTrackingNumbers, cr as instanceOfPostOrderCommentResponse, cx as instanceOfPostOrderResponse, cE as instanceOfPostOrderStatus, cL as instanceOfPostOrderStatusItem, cR as instanceOfPostOrderStatusResponse, cX as instanceOfReturnLabel, d1 as instanceOfTrackingNumber, d7 as instanceOfTrackingNumberItem, de as instanceOfWaybill } from './client-BrWpdgrN.js';
|
|
3
|
+
export { a as DoboxaAPIError, b as DoboxaAuthenticationError, d as DoboxaConnectorError, D as DoboxaError, c as DoboxaValidationError, I as InvalidParameter, e as InvalidParameterFromJSON, f as InvalidParameterFromJSONTyped, g as InvalidParameterToJSON, h as InvalidParameterToJSONTyped, j as InvalidRequestDataResponse, l as InvalidRequestDataResponseFromJSON, m as InvalidRequestDataResponseFromJSONTyped, n as InvalidRequestDataResponseToJSON, o as InvalidRequestDataResponseToJSONTyped, S as ServerErrorResponse, r as ServerErrorResponseFromJSON, s as ServerErrorResponseFromJSONTyped, t as ServerErrorResponseToJSON, u as ServerErrorResponseToJSONTyped, i as instanceOfInvalidParameter, k as instanceOfInvalidRequestDataResponse, q as instanceOfServerErrorResponse, p as parseErrorResponse } from './errors-lG5MwUyw.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* API V2
|
|
7
|
+
* API V2
|
|
8
|
+
*
|
|
9
|
+
* The version of the OpenAPI document: 1.0-alpha
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13
|
+
* https://openapi-generator.tech
|
|
14
|
+
* Do not edit the class manually.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ApiV2AuthenticationRefreshTokenPostRequest
|
|
20
|
+
*/
|
|
21
|
+
interface ApiV2AuthenticationRefreshTokenPostRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ApiV2AuthenticationRefreshTokenPostRequest
|
|
26
|
+
*/
|
|
27
|
+
refresh_token?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if a given object implements the ApiV2AuthenticationRefreshTokenPostRequest interface.
|
|
31
|
+
*/
|
|
32
|
+
declare function instanceOfApiV2AuthenticationRefreshTokenPostRequest(value: object): value is ApiV2AuthenticationRefreshTokenPostRequest;
|
|
33
|
+
declare function ApiV2AuthenticationRefreshTokenPostRequestFromJSON(json: any): ApiV2AuthenticationRefreshTokenPostRequest;
|
|
34
|
+
declare function ApiV2AuthenticationRefreshTokenPostRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiV2AuthenticationRefreshTokenPostRequest;
|
|
35
|
+
declare function ApiV2AuthenticationRefreshTokenPostRequestToJSON(json: any): ApiV2AuthenticationRefreshTokenPostRequest;
|
|
36
|
+
declare function ApiV2AuthenticationRefreshTokenPostRequestToJSONTyped(value?: ApiV2AuthenticationRefreshTokenPostRequest | null, ignoreDiscriminator?: boolean): any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* API V2
|
|
40
|
+
* API V2
|
|
41
|
+
*
|
|
42
|
+
* The version of the OpenAPI document: 1.0-alpha
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
46
|
+
* https://openapi-generator.tech
|
|
47
|
+
* Do not edit the class manually.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @export
|
|
52
|
+
* @interface ApiV2AuthenticationTokenPost401Response
|
|
53
|
+
*/
|
|
54
|
+
interface ApiV2AuthenticationTokenPost401Response {
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @type {number}
|
|
58
|
+
* @memberof ApiV2AuthenticationTokenPost401Response
|
|
59
|
+
*/
|
|
60
|
+
code?: number;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof ApiV2AuthenticationTokenPost401Response
|
|
65
|
+
*/
|
|
66
|
+
message?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check if a given object implements the ApiV2AuthenticationTokenPost401Response interface.
|
|
70
|
+
*/
|
|
71
|
+
declare function instanceOfApiV2AuthenticationTokenPost401Response(value: object): value is ApiV2AuthenticationTokenPost401Response;
|
|
72
|
+
declare function ApiV2AuthenticationTokenPost401ResponseFromJSON(json: any): ApiV2AuthenticationTokenPost401Response;
|
|
73
|
+
declare function ApiV2AuthenticationTokenPost401ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiV2AuthenticationTokenPost401Response;
|
|
74
|
+
declare function ApiV2AuthenticationTokenPost401ResponseToJSON(json: any): ApiV2AuthenticationTokenPost401Response;
|
|
75
|
+
declare function ApiV2AuthenticationTokenPost401ResponseToJSONTyped(value?: ApiV2AuthenticationTokenPost401Response | null, ignoreDiscriminator?: boolean): any;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* API V2
|
|
79
|
+
* API V2
|
|
80
|
+
*
|
|
81
|
+
* The version of the OpenAPI document: 1.0-alpha
|
|
82
|
+
*
|
|
83
|
+
*
|
|
84
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
85
|
+
* https://openapi-generator.tech
|
|
86
|
+
* Do not edit the class manually.
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @export
|
|
91
|
+
* @interface ApiV2AuthenticationTokenPostRequest
|
|
92
|
+
*/
|
|
93
|
+
interface ApiV2AuthenticationTokenPostRequest {
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @type {string}
|
|
97
|
+
* @memberof ApiV2AuthenticationTokenPostRequest
|
|
98
|
+
*/
|
|
99
|
+
username?: string;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @type {string}
|
|
103
|
+
* @memberof ApiV2AuthenticationTokenPostRequest
|
|
104
|
+
*/
|
|
105
|
+
password?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check if a given object implements the ApiV2AuthenticationTokenPostRequest interface.
|
|
109
|
+
*/
|
|
110
|
+
declare function instanceOfApiV2AuthenticationTokenPostRequest(value: object): value is ApiV2AuthenticationTokenPostRequest;
|
|
111
|
+
declare function ApiV2AuthenticationTokenPostRequestFromJSON(json: any): ApiV2AuthenticationTokenPostRequest;
|
|
112
|
+
declare function ApiV2AuthenticationTokenPostRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiV2AuthenticationTokenPostRequest;
|
|
113
|
+
declare function ApiV2AuthenticationTokenPostRequestToJSON(json: any): ApiV2AuthenticationTokenPostRequest;
|
|
114
|
+
declare function ApiV2AuthenticationTokenPostRequestToJSONTyped(value?: ApiV2AuthenticationTokenPostRequest | null, ignoreDiscriminator?: boolean): any;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* API V2
|
|
118
|
+
* API V2
|
|
119
|
+
*
|
|
120
|
+
* The version of the OpenAPI document: 1.0-alpha
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
124
|
+
* https://openapi-generator.tech
|
|
125
|
+
* Do not edit the class manually.
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @export
|
|
130
|
+
* @interface OrderCancellation
|
|
131
|
+
*/
|
|
132
|
+
interface OrderCancellation {
|
|
133
|
+
/**
|
|
134
|
+
* Doboxa order id
|
|
135
|
+
* @type {string}
|
|
136
|
+
* @memberof OrderCancellation
|
|
137
|
+
*/
|
|
138
|
+
order_id: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Check if a given object implements the OrderCancellation interface.
|
|
142
|
+
*/
|
|
143
|
+
declare function instanceOfOrderCancellation(value: object): value is OrderCancellation;
|
|
144
|
+
declare function OrderCancellationFromJSON(json: any): OrderCancellation;
|
|
145
|
+
declare function OrderCancellationFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderCancellation;
|
|
146
|
+
declare function OrderCancellationToJSON(json: any): OrderCancellation;
|
|
147
|
+
declare function OrderCancellationToJSONTyped(value?: OrderCancellation | null, ignoreDiscriminator?: boolean): any;
|
|
148
|
+
|
|
149
|
+
type OrderStatusEnum = 'new' | 'wait_for_payment' | 'paid' | 'in_progress' | 'ready_to_be_sent' | 'sent' | 'cancelled' | 'hold' | 'refund';
|
|
150
|
+
type InvoiceStateEnum = 'PAID' | 'UNPAID';
|
|
151
|
+
type AuthorTypeEnum = 'client' | 'support';
|
|
152
|
+
|
|
153
|
+
export { type ApiV2AuthenticationRefreshTokenPostRequest, ApiV2AuthenticationRefreshTokenPostRequestFromJSON, ApiV2AuthenticationRefreshTokenPostRequestFromJSONTyped, ApiV2AuthenticationRefreshTokenPostRequestToJSON, ApiV2AuthenticationRefreshTokenPostRequestToJSONTyped, type ApiV2AuthenticationTokenPost401Response, ApiV2AuthenticationTokenPost401ResponseFromJSON, ApiV2AuthenticationTokenPost401ResponseFromJSONTyped, ApiV2AuthenticationTokenPost401ResponseToJSON, ApiV2AuthenticationTokenPost401ResponseToJSONTyped, type ApiV2AuthenticationTokenPostRequest, ApiV2AuthenticationTokenPostRequestFromJSON, ApiV2AuthenticationTokenPostRequestFromJSONTyped, ApiV2AuthenticationTokenPostRequestToJSON, ApiV2AuthenticationTokenPostRequestToJSONTyped, type AuthorTypeEnum, Doboxa, type InvoiceStateEnum, type OrderCancellation, OrderCancellationFromJSON, OrderCancellationFromJSONTyped, OrderCancellationToJSON, OrderCancellationToJSONTyped, type OrderStatusEnum, Doboxa as default, instanceOfApiV2AuthenticationRefreshTokenPostRequest, instanceOfApiV2AuthenticationTokenPost401Response, instanceOfApiV2AuthenticationTokenPostRequest, instanceOfOrderCancellation };
|
package/dist/index.js
CHANGED
|
@@ -85,10 +85,7 @@ __export(src_exports, {
|
|
|
85
85
|
BillingAddressFromJSONTyped: () => BillingAddressFromJSONTyped,
|
|
86
86
|
BillingAddressToJSON: () => BillingAddressToJSON,
|
|
87
87
|
BillingAddressToJSONTyped: () => BillingAddressToJSONTyped,
|
|
88
|
-
|
|
89
|
-
BoolFromJSONTyped: () => BoolFromJSONTyped,
|
|
90
|
-
BoolToJSON: () => BoolToJSON,
|
|
91
|
-
BoolToJSONTyped: () => BoolToJSONTyped,
|
|
88
|
+
CatalogResource: () => CatalogResource,
|
|
92
89
|
ClientFromJSON: () => ClientFromJSON,
|
|
93
90
|
ClientFromJSONTyped: () => ClientFromJSONTyped,
|
|
94
91
|
ClientToJSON: () => ClientToJSON,
|
|
@@ -107,6 +104,7 @@ __export(src_exports, {
|
|
|
107
104
|
Doboxa: () => Doboxa,
|
|
108
105
|
DoboxaAPIError: () => DoboxaAPIError,
|
|
109
106
|
DoboxaAuthenticationError: () => DoboxaAuthenticationError,
|
|
107
|
+
DoboxaConnectorError: () => DoboxaConnectorError,
|
|
110
108
|
DoboxaError: () => DoboxaError,
|
|
111
109
|
DoboxaValidationError: () => DoboxaValidationError,
|
|
112
110
|
GetApiV2DiscountCodesExternal200ResponseFromJSON: () => GetApiV2DiscountCodesExternal200ResponseFromJSON,
|
|
@@ -602,6 +600,15 @@ var DoboxaAuthenticationError = class _DoboxaAuthenticationError extends DoboxaE
|
|
|
602
600
|
Object.setPrototypeOf(this, _DoboxaAuthenticationError.prototype);
|
|
603
601
|
}
|
|
604
602
|
};
|
|
603
|
+
var DoboxaConnectorError = class _DoboxaConnectorError extends DoboxaError {
|
|
604
|
+
constructor(errorCode, errorText, message) {
|
|
605
|
+
super(message || errorText || `BaseLinker connector error: ${errorCode}`);
|
|
606
|
+
this.name = "DoboxaConnectorError";
|
|
607
|
+
this.errorCode = errorCode;
|
|
608
|
+
this.errorText = errorText;
|
|
609
|
+
Object.setPrototypeOf(this, _DoboxaConnectorError.prototype);
|
|
610
|
+
}
|
|
611
|
+
};
|
|
605
612
|
var DoboxaValidationError = class _DoboxaValidationError extends DoboxaAPIError {
|
|
606
613
|
constructor(statusCode, message, body) {
|
|
607
614
|
super(statusCode, message, body);
|
|
@@ -638,26 +645,24 @@ var HTTPClient = class {
|
|
|
638
645
|
if (!accessToken || this.tokenManager.isTokenExpired()) {
|
|
639
646
|
if (this.onTokenRefresh) {
|
|
640
647
|
const refreshToken = this.tokenManager.getRefreshToken();
|
|
641
|
-
if (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
this.tokenManager.setRefreshPromise(null);
|
|
648
|
+
if (refreshToken) {
|
|
649
|
+
let refreshPromise = this.tokenManager.getRefreshPromise();
|
|
650
|
+
if (!refreshPromise) {
|
|
651
|
+
refreshPromise = this.onTokenRefresh(refreshToken);
|
|
652
|
+
this.tokenManager.setRefreshPromise(refreshPromise);
|
|
653
|
+
}
|
|
654
|
+
try {
|
|
655
|
+
accessToken = yield refreshPromise;
|
|
656
|
+
} finally {
|
|
657
|
+
this.tokenManager.setRefreshPromise(null);
|
|
658
|
+
}
|
|
653
659
|
}
|
|
654
|
-
} else {
|
|
655
|
-
throw new DoboxaAuthenticationError("No access token available");
|
|
656
660
|
}
|
|
657
661
|
}
|
|
658
662
|
const headers = new Headers(options.headers);
|
|
659
663
|
headers.set("Content-Type", "application/json");
|
|
660
664
|
headers.set("Authorization", `Bearer ${accessToken}`);
|
|
665
|
+
console.log("url", url);
|
|
661
666
|
const response = yield fetch(url, __spreadProps(__spreadValues({}, options), {
|
|
662
667
|
headers
|
|
663
668
|
}));
|
|
@@ -846,20 +851,6 @@ var AuthenticationResource = class {
|
|
|
846
851
|
}
|
|
847
852
|
};
|
|
848
853
|
|
|
849
|
-
// src/types/generated/src/models/Bool.ts
|
|
850
|
-
function BoolFromJSON(json) {
|
|
851
|
-
return json;
|
|
852
|
-
}
|
|
853
|
-
function BoolFromJSONTyped(json, ignoreDiscriminator) {
|
|
854
|
-
return json;
|
|
855
|
-
}
|
|
856
|
-
function BoolToJSON(value) {
|
|
857
|
-
return value;
|
|
858
|
-
}
|
|
859
|
-
function BoolToJSONTyped(value, ignoreDiscriminator = false) {
|
|
860
|
-
return value;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
854
|
// src/types/generated/src/models/ApiV2AuthenticationRefreshTokenPost200Response.ts
|
|
864
855
|
function instanceOfApiV2AuthenticationRefreshTokenPost200Response(value) {
|
|
865
856
|
return true;
|
|
@@ -1933,7 +1924,7 @@ function OrderCancellationResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
1933
1924
|
return json;
|
|
1934
1925
|
}
|
|
1935
1926
|
return {
|
|
1936
|
-
"cancelled": json["cancelled"] == null ? void 0 :
|
|
1927
|
+
"cancelled": json["cancelled"] == null ? void 0 : json["cancelled"],
|
|
1937
1928
|
"details": json["details"] == null ? void 0 : json["details"]
|
|
1938
1929
|
};
|
|
1939
1930
|
}
|
|
@@ -1945,7 +1936,7 @@ function OrderCancellationResponseToJSONTyped(value, ignoreDiscriminator = false
|
|
|
1945
1936
|
return value;
|
|
1946
1937
|
}
|
|
1947
1938
|
return {
|
|
1948
|
-
"cancelled":
|
|
1939
|
+
"cancelled": value["cancelled"],
|
|
1949
1940
|
"details": value["details"]
|
|
1950
1941
|
};
|
|
1951
1942
|
}
|
|
@@ -3411,10 +3402,122 @@ var UsersResource = class {
|
|
|
3411
3402
|
}
|
|
3412
3403
|
};
|
|
3413
3404
|
|
|
3405
|
+
// src/resources/catalog.ts
|
|
3406
|
+
var CatalogResource = class {
|
|
3407
|
+
constructor(config) {
|
|
3408
|
+
this.config = config;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* Call a connector action.
|
|
3412
|
+
*
|
|
3413
|
+
* @param action - Connector action, e.g. "ProductsList"
|
|
3414
|
+
* @param params - Additional action parameters
|
|
3415
|
+
* @throws DoboxaConnectorError on HTTP or connector errors
|
|
3416
|
+
*/
|
|
3417
|
+
call(_0) {
|
|
3418
|
+
return __async(this, arguments, function* (action, params = {}) {
|
|
3419
|
+
const response = yield fetch(this.config.url, {
|
|
3420
|
+
method: "POST",
|
|
3421
|
+
headers: {
|
|
3422
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
3423
|
+
},
|
|
3424
|
+
body: new URLSearchParams(__spreadValues({
|
|
3425
|
+
bl_pass: this.config.password,
|
|
3426
|
+
action
|
|
3427
|
+
}, params))
|
|
3428
|
+
});
|
|
3429
|
+
if (!response.ok) {
|
|
3430
|
+
throw new DoboxaConnectorError(
|
|
3431
|
+
`http_${response.status}`,
|
|
3432
|
+
response.statusText || "Unexpected HTTP status",
|
|
3433
|
+
`BaseLinker connector request failed with HTTP ${response.status}`
|
|
3434
|
+
);
|
|
3435
|
+
}
|
|
3436
|
+
let payload;
|
|
3437
|
+
try {
|
|
3438
|
+
payload = yield response.json();
|
|
3439
|
+
} catch (e) {
|
|
3440
|
+
throw new DoboxaConnectorError(
|
|
3441
|
+
"invalid_response",
|
|
3442
|
+
"Connector response is not valid JSON",
|
|
3443
|
+
"BaseLinker connector returned a non-JSON response"
|
|
3444
|
+
);
|
|
3445
|
+
}
|
|
3446
|
+
if (payload !== null && typeof payload === "object" && !Array.isArray(payload) && payload.error === true) {
|
|
3447
|
+
const error = payload;
|
|
3448
|
+
throw new DoboxaConnectorError(error.error_code, error.error_text);
|
|
3449
|
+
}
|
|
3450
|
+
return payload;
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
/**
|
|
3454
|
+
* Get the connector platform and version.
|
|
3455
|
+
*/
|
|
3456
|
+
fileVersion() {
|
|
3457
|
+
return __async(this, null, function* () {
|
|
3458
|
+
return this.call("FileVersion");
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
/**
|
|
3462
|
+
* Get the list of actions the connector supports.
|
|
3463
|
+
*/
|
|
3464
|
+
supportedMethods() {
|
|
3465
|
+
return __async(this, null, function* () {
|
|
3466
|
+
return this.call("SupportedMethods");
|
|
3467
|
+
});
|
|
3468
|
+
}
|
|
3469
|
+
/**
|
|
3470
|
+
* Get all product categories as a map of category id to category path.
|
|
3471
|
+
*/
|
|
3472
|
+
categories() {
|
|
3473
|
+
return __async(this, null, function* () {
|
|
3474
|
+
return this.call("ProductsCategories");
|
|
3475
|
+
});
|
|
3476
|
+
}
|
|
3477
|
+
/**
|
|
3478
|
+
* List one page of products (designs).
|
|
3479
|
+
*
|
|
3480
|
+
* @param params - Page number and optional category filter
|
|
3481
|
+
*/
|
|
3482
|
+
list() {
|
|
3483
|
+
return __async(this, arguments, function* (params = {}) {
|
|
3484
|
+
var _a;
|
|
3485
|
+
const response = yield this.call("ProductsList", __spreadValues({
|
|
3486
|
+
page: String((_a = params.page) != null ? _a : 1)
|
|
3487
|
+
}, params.category_id !== void 0 ? { category_id: params.category_id } : {}));
|
|
3488
|
+
const items = [];
|
|
3489
|
+
for (const id of Object.keys(response)) {
|
|
3490
|
+
if (id === "pages") {
|
|
3491
|
+
continue;
|
|
3492
|
+
}
|
|
3493
|
+
const value = response[id];
|
|
3494
|
+
if (typeof value !== "object" || value === null) {
|
|
3495
|
+
continue;
|
|
3496
|
+
}
|
|
3497
|
+
items.push(__spreadValues({ id }, value));
|
|
3498
|
+
}
|
|
3499
|
+
return { pages: response.pages, items };
|
|
3500
|
+
});
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* Get full product data (images, variants) for the given design ids.
|
|
3504
|
+
*
|
|
3505
|
+
* @param params - Design ids from the product list
|
|
3506
|
+
*/
|
|
3507
|
+
data(params) {
|
|
3508
|
+
return __async(this, null, function* () {
|
|
3509
|
+
const response = yield this.call("ProductsData", {
|
|
3510
|
+
products_id: params.products_id.join(",")
|
|
3511
|
+
});
|
|
3512
|
+
return Array.isArray(response) ? {} : response;
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
|
|
3414
3517
|
// src/client.ts
|
|
3415
3518
|
var Doboxa = class {
|
|
3416
3519
|
constructor(config = {}) {
|
|
3417
|
-
const baseURL = config.baseURL || getBaseURL() || "
|
|
3520
|
+
const baseURL = config.baseURL || getBaseURL() || "https://pl.doboxa.biz";
|
|
3418
3521
|
this.tokenManager = new TokenManager();
|
|
3419
3522
|
if (config.apiKey) {
|
|
3420
3523
|
this.tokenManager.setTokens(config.apiKey, "", 3600);
|
|
@@ -3440,21 +3543,46 @@ var Doboxa = class {
|
|
|
3440
3543
|
baseURL,
|
|
3441
3544
|
tokenManager: this.tokenManager,
|
|
3442
3545
|
onTokenRefresh: (refreshToken) => __async(this, null, function* () {
|
|
3443
|
-
const tempAuth = new AuthenticationResource(
|
|
3546
|
+
const tempAuth = new AuthenticationResource(
|
|
3547
|
+
tempHttpClient,
|
|
3548
|
+
this.tokenManager
|
|
3549
|
+
);
|
|
3444
3550
|
const response = yield tempAuth.refreshToken(refreshToken);
|
|
3445
|
-
this.tokenManager.setTokens(
|
|
3551
|
+
this.tokenManager.setTokens(
|
|
3552
|
+
response.token,
|
|
3553
|
+
response.refresh_token,
|
|
3554
|
+
3600
|
|
3555
|
+
);
|
|
3446
3556
|
return response.token;
|
|
3447
3557
|
})
|
|
3448
3558
|
});
|
|
3449
|
-
this.authentication = new AuthenticationResource(
|
|
3559
|
+
this.authentication = new AuthenticationResource(
|
|
3560
|
+
this.httpClient,
|
|
3561
|
+
this.tokenManager
|
|
3562
|
+
);
|
|
3450
3563
|
this.orders = new OrdersResource(this.httpClient, this.config);
|
|
3451
3564
|
this.invoices = new InvoicesResource(this.httpClient, this.config);
|
|
3452
3565
|
this.clients = new ClientsResource(this.httpClient, this.config);
|
|
3453
|
-
this.discountCodes = new DiscountCodesResource(
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3566
|
+
this.discountCodes = new DiscountCodesResource(
|
|
3567
|
+
this.httpClient,
|
|
3568
|
+
this.config
|
|
3569
|
+
);
|
|
3570
|
+
this.trackingNumbers = new TrackingNumbersResource(
|
|
3571
|
+
this.httpClient,
|
|
3572
|
+
this.config
|
|
3573
|
+
);
|
|
3574
|
+
this.orderComments = new OrderCommentsResource(
|
|
3575
|
+
this.httpClient,
|
|
3576
|
+
this.config
|
|
3577
|
+
);
|
|
3578
|
+
this.orderStatusChanges = new OrderStatusChangesResource(
|
|
3579
|
+
this.httpClient,
|
|
3580
|
+
this.config
|
|
3581
|
+
);
|
|
3457
3582
|
this.users = new UsersResource(this.httpClient, this.config);
|
|
3583
|
+
if (config.catalog) {
|
|
3584
|
+
this.catalog = new CatalogResource(config.catalog);
|
|
3585
|
+
}
|
|
3458
3586
|
}
|
|
3459
3587
|
};
|
|
3460
3588
|
|
|
@@ -3491,10 +3619,7 @@ var src_default = Doboxa;
|
|
|
3491
3619
|
BillingAddressFromJSONTyped,
|
|
3492
3620
|
BillingAddressToJSON,
|
|
3493
3621
|
BillingAddressToJSONTyped,
|
|
3494
|
-
|
|
3495
|
-
BoolFromJSONTyped,
|
|
3496
|
-
BoolToJSON,
|
|
3497
|
-
BoolToJSONTyped,
|
|
3622
|
+
CatalogResource,
|
|
3498
3623
|
ClientFromJSON,
|
|
3499
3624
|
ClientFromJSONTyped,
|
|
3500
3625
|
ClientToJSON,
|
|
@@ -3513,6 +3638,7 @@ var src_default = Doboxa;
|
|
|
3513
3638
|
Doboxa,
|
|
3514
3639
|
DoboxaAPIError,
|
|
3515
3640
|
DoboxaAuthenticationError,
|
|
3641
|
+
DoboxaConnectorError,
|
|
3516
3642
|
DoboxaError,
|
|
3517
3643
|
DoboxaValidationError,
|
|
3518
3644
|
GetApiV2DiscountCodesExternal200ResponseFromJSON,
|