@wix/auto_sdk_ecom_order-invoices 1.0.6 → 1.0.8
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/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.context.d.ts +5 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.context.js +15 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.context.js.map +1 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.http.d.ts +14 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.http.js +114 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.http.js.map +1 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.d.ts +20 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.js +104 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.js.map +1 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.public.d.ts +17 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.public.js +35 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.public.js.map +1 -0
- package/build/{ecom-orders-v1-invoice-order-invoices.universal-MRNaa-Xt.d.mts → cjs/src/ecom-orders-v1-invoice-order-invoices.types.d.ts} +42 -42
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.types.js +12 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.types.js.map +1 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.d.ts +335 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.js +223 -0
- package/build/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.context.d.ts +5 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.context.js +11 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.context.js.map +1 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.http.d.ts +14 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.http.js +107 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.http.js.map +1 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.meta.d.ts +20 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.meta.js +74 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.meta.js.map +1 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.public.d.ts +17 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.public.js +27 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.public.js.map +1 -0
- package/build/{ecom-orders-v1-invoice-order-invoices.universal-MRNaa-Xt.d.ts → es/src/ecom-orders-v1-invoice-order-invoices.types.d.ts} +42 -42
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.types.js +9 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.types.js.map +1 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.universal.d.ts +335 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.universal.js +193 -0
- package/build/es/src/ecom-orders-v1-invoice-order-invoices.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.context.d.ts +11 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.context.js +15 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.context.js.map +1 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.http.d.ts +14 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.http.js +114 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.http.js.map +1 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.d.ts +20 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.js +104 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.meta.js.map +1 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.public.d.ts +45 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.public.js +35 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.public.js.map +1 -0
- package/build/internal/{ecom-orders-v1-invoice-order-invoices.universal-CZFxrTkE.d.mts → cjs/src/ecom-orders-v1-invoice-order-invoices.types.d.ts} +42 -42
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.types.js +12 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.types.js.map +1 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.d.ts +404 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.js +223 -0
- package/build/internal/cjs/src/ecom-orders-v1-invoice-order-invoices.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.context.d.ts +11 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.context.js +11 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.context.js.map +1 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.http.d.ts +14 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.http.js +107 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.http.js.map +1 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.meta.d.ts +20 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.meta.js +74 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.meta.js.map +1 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.public.d.ts +45 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.public.js +27 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.public.js.map +1 -0
- package/build/internal/{ecom-orders-v1-invoice-order-invoices.universal-CZFxrTkE.d.ts → es/src/ecom-orders-v1-invoice-order-invoices.types.d.ts} +42 -42
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.types.js +9 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.types.js.map +1 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.universal.d.ts +404 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.universal.js +193 -0
- package/build/internal/es/src/ecom-orders-v1-invoice-order-invoices.universal.js.map +1 -0
- package/package.json +11 -12
- package/build/index.d.mts +0 -19
- package/build/index.d.ts +0 -19
- package/build/index.js +0 -284
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -256
- package/build/index.mjs.map +0 -1
- package/build/internal/index.d.mts +0 -53
- package/build/internal/index.d.ts +0 -53
- package/build/internal/index.js +0 -284
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -256
- package/build/internal/index.mjs.map +0 -1
- package/build/internal/meta.d.mts +0 -127
- package/build/internal/meta.d.ts +0 -127
- package/build/internal/meta.js +0 -209
- package/build/internal/meta.js.map +0 -1
- package/build/internal/meta.mjs +0 -179
- package/build/internal/meta.mjs.map +0 -1
- package/build/meta.d.mts +0 -127
- package/build/meta.d.ts +0 -127
- package/build/meta.js +0 -209
- package/build/meta.js.map +0 -1
- package/build/meta.mjs +0 -179
- package/build/meta.mjs.map +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
export interface Invoice {
|
|
3
|
+
/** Invoice ID. */
|
|
4
|
+
_id?: string;
|
|
5
|
+
/** ID of the app that set the invoice. */
|
|
6
|
+
appId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ListInvoicesForSingleOrderRequest {
|
|
9
|
+
/**
|
|
10
|
+
* Order ID.
|
|
11
|
+
* @minLength 1
|
|
12
|
+
* @maxLength 100
|
|
13
|
+
*/
|
|
14
|
+
orderId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ListInvoicesForSingleOrderResponse {
|
|
17
|
+
/** List of invoices. */
|
|
18
|
+
invoices?: Invoice[];
|
|
19
|
+
}
|
|
20
|
+
export interface ListInvoicesForMultipleOrdersRequest {
|
|
21
|
+
/**
|
|
22
|
+
* Order IDs for which to retrieve invoices.
|
|
23
|
+
* @maxSize 100
|
|
24
|
+
* @minLength 1
|
|
25
|
+
* @maxLength 100
|
|
26
|
+
*/
|
|
27
|
+
orderIds: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface ListInvoicesForMultipleOrdersResponse {
|
|
30
|
+
/** List of order IDs and their associated invoices. */
|
|
31
|
+
invoicesForOrder?: InvoicesForOrder[];
|
|
32
|
+
}
|
|
33
|
+
export interface InvoicesForOrder {
|
|
34
|
+
/** Order ID. */
|
|
35
|
+
orderId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Invoices info.
|
|
38
|
+
* @maxSize 300
|
|
39
|
+
*/
|
|
40
|
+
invoicesInfo?: Invoice[];
|
|
41
|
+
}
|
|
42
|
+
export interface GenerateInvoiceRequest {
|
|
43
|
+
/**
|
|
44
|
+
* Order ID.
|
|
45
|
+
* @minLength 1
|
|
46
|
+
* @maxLength 100
|
|
47
|
+
*/
|
|
48
|
+
orderId: string;
|
|
49
|
+
}
|
|
50
|
+
export interface GenerateInvoiceResponse {
|
|
51
|
+
/** Invoice ID. */
|
|
52
|
+
invoiceId?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface BulkGenerateInvoicesRequest {
|
|
55
|
+
/**
|
|
56
|
+
* Order IDs.
|
|
57
|
+
* @minSize 1
|
|
58
|
+
* @maxSize 300
|
|
59
|
+
* @minLength 1
|
|
60
|
+
* @maxLength 100
|
|
61
|
+
*/
|
|
62
|
+
orderIds: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface BulkGenerateInvoicesResponse {
|
|
65
|
+
results?: BulkInvoiceResult[];
|
|
66
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
67
|
+
}
|
|
68
|
+
export interface BulkInvoiceResult {
|
|
69
|
+
itemMetadata?: ItemMetadata;
|
|
70
|
+
item?: InvoiceForOrder;
|
|
71
|
+
}
|
|
72
|
+
export interface ItemMetadata {
|
|
73
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
74
|
+
_id?: string | null;
|
|
75
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
76
|
+
originalIndex?: number;
|
|
77
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
78
|
+
success?: boolean;
|
|
79
|
+
/** Details about the error in case of failure. */
|
|
80
|
+
error?: ApplicationError;
|
|
81
|
+
}
|
|
82
|
+
export interface ApplicationError {
|
|
83
|
+
/** Error code. */
|
|
84
|
+
code?: string;
|
|
85
|
+
/** Description of the error. */
|
|
86
|
+
description?: string;
|
|
87
|
+
/** Data related to the error. */
|
|
88
|
+
data?: Record<string, any> | null;
|
|
89
|
+
}
|
|
90
|
+
export interface InvoiceForOrder {
|
|
91
|
+
/** Order ID. */
|
|
92
|
+
orderId?: string;
|
|
93
|
+
/** Invoice ID. */
|
|
94
|
+
invoiceId?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface BulkActionMetadata {
|
|
97
|
+
/** Number of items that were successfully processed. */
|
|
98
|
+
totalSuccesses?: number;
|
|
99
|
+
/** Number of items that couldn't be processed. */
|
|
100
|
+
totalFailures?: number;
|
|
101
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
102
|
+
undetailedFailures?: number;
|
|
103
|
+
}
|
|
104
|
+
export interface AddInvoiceToOrderRequest {
|
|
105
|
+
/**
|
|
106
|
+
* Order ID.
|
|
107
|
+
* @minLength 1
|
|
108
|
+
* @maxLength 100
|
|
109
|
+
*/
|
|
110
|
+
orderId: string;
|
|
111
|
+
/** Invoice info. */
|
|
112
|
+
invoiceInfo: Invoice;
|
|
113
|
+
}
|
|
114
|
+
export interface AddInvoiceToOrderResponse {
|
|
115
|
+
/** List of order invoices. */
|
|
116
|
+
orderInvoices?: Invoice[];
|
|
117
|
+
}
|
|
118
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
119
|
+
createdEvent?: EntityCreatedEvent;
|
|
120
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
121
|
+
deletedEvent?: EntityDeletedEvent;
|
|
122
|
+
actionEvent?: ActionEvent;
|
|
123
|
+
/**
|
|
124
|
+
* Unique event ID.
|
|
125
|
+
* Allows clients to ignore duplicate webhooks.
|
|
126
|
+
*/
|
|
127
|
+
_id?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Assumes actions are also always typed to an entity_type
|
|
130
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
131
|
+
*/
|
|
132
|
+
entityFqdn?: string;
|
|
133
|
+
/**
|
|
134
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
135
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
136
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
137
|
+
*/
|
|
138
|
+
slug?: string;
|
|
139
|
+
/** ID of the entity associated with the event. */
|
|
140
|
+
entityId?: string;
|
|
141
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
142
|
+
eventTime?: Date | null;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
145
|
+
* (for example, GDPR).
|
|
146
|
+
*/
|
|
147
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
148
|
+
/** If present, indicates the action that triggered the event. */
|
|
149
|
+
originatedFrom?: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
152
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
153
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
154
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
155
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
156
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
157
|
+
*/
|
|
158
|
+
entityEventSequence?: string | null;
|
|
159
|
+
}
|
|
160
|
+
/** @oneof */
|
|
161
|
+
export interface DomainEventBodyOneOf {
|
|
162
|
+
createdEvent?: EntityCreatedEvent;
|
|
163
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
164
|
+
deletedEvent?: EntityDeletedEvent;
|
|
165
|
+
actionEvent?: ActionEvent;
|
|
166
|
+
}
|
|
167
|
+
export interface EntityCreatedEvent {
|
|
168
|
+
entity?: string;
|
|
169
|
+
}
|
|
170
|
+
export interface RestoreInfo {
|
|
171
|
+
deletedDate?: Date | null;
|
|
172
|
+
}
|
|
173
|
+
export interface EntityUpdatedEvent {
|
|
174
|
+
/**
|
|
175
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
176
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
177
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
178
|
+
*/
|
|
179
|
+
currentEntity?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface EntityDeletedEvent {
|
|
182
|
+
/** Entity that was deleted */
|
|
183
|
+
deletedEntity?: string | null;
|
|
184
|
+
}
|
|
185
|
+
export interface ActionEvent {
|
|
186
|
+
body?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface Empty {
|
|
189
|
+
}
|
|
190
|
+
export interface GetOrderInvoiceRequest {
|
|
191
|
+
/**
|
|
192
|
+
* Invoice ID.
|
|
193
|
+
* @minLength 1
|
|
194
|
+
* @maxLength 100
|
|
195
|
+
*/
|
|
196
|
+
invoiceId?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface GetOrderInvoiceResponse {
|
|
199
|
+
/**
|
|
200
|
+
* Order ID.
|
|
201
|
+
* @minLength 1
|
|
202
|
+
* @maxLength 100
|
|
203
|
+
*/
|
|
204
|
+
orderId?: string;
|
|
205
|
+
/** Invoice info. */
|
|
206
|
+
invoiceInfo?: Invoice;
|
|
207
|
+
}
|
|
208
|
+
export interface GenerateInvoiceWithNumberRequest {
|
|
209
|
+
/**
|
|
210
|
+
* Order ID.
|
|
211
|
+
* @minLength 1
|
|
212
|
+
* @maxLength 100
|
|
213
|
+
*/
|
|
214
|
+
orderId?: string;
|
|
215
|
+
/**
|
|
216
|
+
* @minLength 1
|
|
217
|
+
* @maxLength 11
|
|
218
|
+
*/
|
|
219
|
+
invoiceNumber?: string;
|
|
220
|
+
/** Date and time the payment was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. Defaults to current time when not provided. */
|
|
221
|
+
issueDate?: Date | null;
|
|
222
|
+
}
|
|
223
|
+
export interface GenerateInvoiceWithNumberResponse {
|
|
224
|
+
/**
|
|
225
|
+
* Invoice ID.
|
|
226
|
+
* @minLength 1
|
|
227
|
+
* @maxLength 100
|
|
228
|
+
*/
|
|
229
|
+
invoiceId?: string;
|
|
230
|
+
}
|
|
231
|
+
export interface MessageEnvelope {
|
|
232
|
+
/**
|
|
233
|
+
* App instance ID.
|
|
234
|
+
* @format GUID
|
|
235
|
+
*/
|
|
236
|
+
instanceId?: string | null;
|
|
237
|
+
/**
|
|
238
|
+
* Event type.
|
|
239
|
+
* @maxLength 150
|
|
240
|
+
*/
|
|
241
|
+
eventType?: string;
|
|
242
|
+
/** The identification type and identity data. */
|
|
243
|
+
identity?: IdentificationData;
|
|
244
|
+
/** Stringify payload. */
|
|
245
|
+
data?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
248
|
+
/**
|
|
249
|
+
* ID of a site visitor that has not logged in to the site.
|
|
250
|
+
* @format GUID
|
|
251
|
+
*/
|
|
252
|
+
anonymousVisitorId?: string;
|
|
253
|
+
/**
|
|
254
|
+
* ID of a site visitor that has logged in to the site.
|
|
255
|
+
* @format GUID
|
|
256
|
+
*/
|
|
257
|
+
memberId?: string;
|
|
258
|
+
/**
|
|
259
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
260
|
+
* @format GUID
|
|
261
|
+
*/
|
|
262
|
+
wixUserId?: string;
|
|
263
|
+
/**
|
|
264
|
+
* ID of an app.
|
|
265
|
+
* @format GUID
|
|
266
|
+
*/
|
|
267
|
+
appId?: string;
|
|
268
|
+
/** @readonly */
|
|
269
|
+
identityType?: WebhookIdentityType;
|
|
270
|
+
}
|
|
271
|
+
/** @oneof */
|
|
272
|
+
export interface IdentificationDataIdOneOf {
|
|
273
|
+
/**
|
|
274
|
+
* ID of a site visitor that has not logged in to the site.
|
|
275
|
+
* @format GUID
|
|
276
|
+
*/
|
|
277
|
+
anonymousVisitorId?: string;
|
|
278
|
+
/**
|
|
279
|
+
* ID of a site visitor that has logged in to the site.
|
|
280
|
+
* @format GUID
|
|
281
|
+
*/
|
|
282
|
+
memberId?: string;
|
|
283
|
+
/**
|
|
284
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
285
|
+
* @format GUID
|
|
286
|
+
*/
|
|
287
|
+
wixUserId?: string;
|
|
288
|
+
/**
|
|
289
|
+
* ID of an app.
|
|
290
|
+
* @format GUID
|
|
291
|
+
*/
|
|
292
|
+
appId?: string;
|
|
293
|
+
}
|
|
294
|
+
export declare enum WebhookIdentityType {
|
|
295
|
+
UNKNOWN = "UNKNOWN",
|
|
296
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
297
|
+
MEMBER = "MEMBER",
|
|
298
|
+
WIX_USER = "WIX_USER",
|
|
299
|
+
APP = "APP"
|
|
300
|
+
}
|
|
301
|
+
type InvoiceNonNullablePaths = `_id` | `appId`;
|
|
302
|
+
/**
|
|
303
|
+
* Retrieves the IDs of invoices associated with all specified orders.
|
|
304
|
+
*
|
|
305
|
+
*
|
|
306
|
+
* The `listInvoicesForSingleOrder()` function returns a Promise that resolves when the specified order's transaction records are retrieved.
|
|
307
|
+
* @param orderIds - Order IDs for which to retrieve invoices.
|
|
308
|
+
* @public
|
|
309
|
+
* @documentationMaturity preview
|
|
310
|
+
* @requiredField orderIds
|
|
311
|
+
* @permissionId ECOM.READ_INVOICES
|
|
312
|
+
* @permissionScope Manage Stores - all permissions
|
|
313
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
314
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
315
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
316
|
+
* @permissionScope Read Orders
|
|
317
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
318
|
+
* @permissionScope Read Stores - all read permissions
|
|
319
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
320
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
321
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
322
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
323
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
324
|
+
* @permissionScope Picasso private app mega scope
|
|
325
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
326
|
+
* @permissionScope Manage Orders
|
|
327
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
328
|
+
* @applicableIdentity APP
|
|
329
|
+
* @applicableIdentity MEMBER
|
|
330
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.ListInvoicesForMultipleOrders
|
|
331
|
+
*/
|
|
332
|
+
export declare function listInvoicesForMultipleOrders(orderIds: string[]): Promise<NonNullablePaths<ListInvoicesForMultipleOrdersResponse, `invoicesForOrder` | `invoicesForOrder.${number}.orderId` | {
|
|
333
|
+
[P in InvoiceNonNullablePaths]: `invoicesForOrder.${number}.invoicesInfo.${number}.${P}`;
|
|
334
|
+
}[InvoiceNonNullablePaths]>>;
|
|
335
|
+
/**
|
|
336
|
+
* Generates and adds an invoice to a specified order.
|
|
337
|
+
* @param orderId - Order ID.
|
|
338
|
+
* @internal
|
|
339
|
+
* @documentationMaturity preview
|
|
340
|
+
* @requiredField orderId
|
|
341
|
+
* @permissionId ECOM.MODIFY_INVOICES
|
|
342
|
+
* @permissionScope Manage Stores - all permissions
|
|
343
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
344
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
345
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
346
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
347
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
348
|
+
* @permissionScope Picasso private app mega scope
|
|
349
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
350
|
+
* @permissionScope Manage Orders
|
|
351
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
352
|
+
* @applicableIdentity APP
|
|
353
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.GenerateInvoice
|
|
354
|
+
*/
|
|
355
|
+
export declare function generateInvoice(orderId: string): Promise<NonNullablePaths<GenerateInvoiceResponse, `invoiceId`>>;
|
|
356
|
+
/**
|
|
357
|
+
* Generates and adds invoices to all specified orders.
|
|
358
|
+
* @param orderIds - Order IDs.
|
|
359
|
+
* @internal
|
|
360
|
+
* @documentationMaturity preview
|
|
361
|
+
* @requiredField orderIds
|
|
362
|
+
* @permissionId ECOM.MODIFY_INVOICES
|
|
363
|
+
* @permissionScope Manage Stores - all permissions
|
|
364
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
365
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
366
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
367
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
368
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
369
|
+
* @permissionScope Picasso private app mega scope
|
|
370
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
371
|
+
* @permissionScope Manage Orders
|
|
372
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
373
|
+
* @applicableIdentity APP
|
|
374
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.BulkGenerateInvoices
|
|
375
|
+
*/
|
|
376
|
+
export declare function bulkGenerateInvoices(orderIds: string[]): Promise<NonNullablePaths<BulkGenerateInvoicesResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.orderId` | `results.${number}.item.invoiceId` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
|
|
377
|
+
/**
|
|
378
|
+
* Adds an invoice to a specified order.
|
|
379
|
+
* @param orderId - Order ID.
|
|
380
|
+
* @param invoiceInfo - Invoice info.
|
|
381
|
+
* @internal
|
|
382
|
+
* @documentationMaturity preview
|
|
383
|
+
* @requiredField invoiceInfo
|
|
384
|
+
* @requiredField invoiceInfo._id
|
|
385
|
+
* @requiredField invoiceInfo.appId
|
|
386
|
+
* @requiredField orderId
|
|
387
|
+
* @permissionId ECOM.ADD_INVOICE
|
|
388
|
+
* @permissionScope Manage Stores - all permissions
|
|
389
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
390
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
391
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
392
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
393
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
394
|
+
* @permissionScope Picasso private app mega scope
|
|
395
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
396
|
+
* @permissionScope Manage Orders
|
|
397
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
398
|
+
* @applicableIdentity APP
|
|
399
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.AddInvoiceToOrder
|
|
400
|
+
*/
|
|
401
|
+
export declare function addInvoiceToOrder(orderId: string, invoiceInfo: NonNullablePaths<Invoice, `_id` | `appId`>): Promise<NonNullablePaths<AddInvoiceToOrderResponse, {
|
|
402
|
+
[P in InvoiceNonNullablePaths]: `orderInvoices.${number}.${P}`;
|
|
403
|
+
}[InvoiceNonNullablePaths]>>;
|
|
404
|
+
export {};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.addInvoiceToOrder = exports.bulkGenerateInvoices = exports.generateInvoice = exports.listInvoicesForMultipleOrders = exports.WebhookIdentityType = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
29
|
+
const ambassadorWixEcomOrdersV1Invoice = __importStar(require("./ecom-orders-v1-invoice-order-invoices.http.js"));
|
|
30
|
+
var WebhookIdentityType;
|
|
31
|
+
(function (WebhookIdentityType) {
|
|
32
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
33
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
34
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
35
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
36
|
+
WebhookIdentityType["APP"] = "APP";
|
|
37
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the IDs of invoices associated with all specified orders.
|
|
40
|
+
*
|
|
41
|
+
*
|
|
42
|
+
* The `listInvoicesForSingleOrder()` function returns a Promise that resolves when the specified order's transaction records are retrieved.
|
|
43
|
+
* @param orderIds - Order IDs for which to retrieve invoices.
|
|
44
|
+
* @public
|
|
45
|
+
* @documentationMaturity preview
|
|
46
|
+
* @requiredField orderIds
|
|
47
|
+
* @permissionId ECOM.READ_INVOICES
|
|
48
|
+
* @permissionScope Manage Stores - all permissions
|
|
49
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
50
|
+
* @permissionScope Read eCommerce - all read permissions
|
|
51
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
52
|
+
* @permissionScope Read Orders
|
|
53
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
54
|
+
* @permissionScope Read Stores - all read permissions
|
|
55
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
56
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
57
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
58
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
59
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
60
|
+
* @permissionScope Picasso private app mega scope
|
|
61
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
62
|
+
* @permissionScope Manage Orders
|
|
63
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
64
|
+
* @applicableIdentity APP
|
|
65
|
+
* @applicableIdentity MEMBER
|
|
66
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.ListInvoicesForMultipleOrders
|
|
67
|
+
*/
|
|
68
|
+
async function listInvoicesForMultipleOrders(orderIds) {
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
71
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ orderIds: orderIds });
|
|
72
|
+
const reqOpts = ambassadorWixEcomOrdersV1Invoice.listInvoicesForMultipleOrders(payload);
|
|
73
|
+
sideEffects?.onSiteCall?.();
|
|
74
|
+
try {
|
|
75
|
+
const result = await httpClient.request(reqOpts);
|
|
76
|
+
sideEffects?.onSuccess?.(result);
|
|
77
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
81
|
+
spreadPathsToArguments: {},
|
|
82
|
+
explicitPathsToArguments: { orderIds: '$[0]' },
|
|
83
|
+
singleArgumentUnchanged: false,
|
|
84
|
+
}, ['orderIds']);
|
|
85
|
+
sideEffects?.onError?.(err);
|
|
86
|
+
throw transformedError;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.listInvoicesForMultipleOrders = listInvoicesForMultipleOrders;
|
|
90
|
+
/**
|
|
91
|
+
* Generates and adds an invoice to a specified order.
|
|
92
|
+
* @param orderId - Order ID.
|
|
93
|
+
* @internal
|
|
94
|
+
* @documentationMaturity preview
|
|
95
|
+
* @requiredField orderId
|
|
96
|
+
* @permissionId ECOM.MODIFY_INVOICES
|
|
97
|
+
* @permissionScope Manage Stores - all permissions
|
|
98
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
99
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
100
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
101
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
102
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
103
|
+
* @permissionScope Picasso private app mega scope
|
|
104
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
105
|
+
* @permissionScope Manage Orders
|
|
106
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
107
|
+
* @applicableIdentity APP
|
|
108
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.GenerateInvoice
|
|
109
|
+
*/
|
|
110
|
+
async function generateInvoice(orderId) {
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
113
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ orderId: orderId });
|
|
114
|
+
const reqOpts = ambassadorWixEcomOrdersV1Invoice.generateInvoice(payload);
|
|
115
|
+
sideEffects?.onSiteCall?.();
|
|
116
|
+
try {
|
|
117
|
+
const result = await httpClient.request(reqOpts);
|
|
118
|
+
sideEffects?.onSuccess?.(result);
|
|
119
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
123
|
+
spreadPathsToArguments: {},
|
|
124
|
+
explicitPathsToArguments: { orderId: '$[0]' },
|
|
125
|
+
singleArgumentUnchanged: false,
|
|
126
|
+
}, ['orderId']);
|
|
127
|
+
sideEffects?.onError?.(err);
|
|
128
|
+
throw transformedError;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.generateInvoice = generateInvoice;
|
|
132
|
+
/**
|
|
133
|
+
* Generates and adds invoices to all specified orders.
|
|
134
|
+
* @param orderIds - Order IDs.
|
|
135
|
+
* @internal
|
|
136
|
+
* @documentationMaturity preview
|
|
137
|
+
* @requiredField orderIds
|
|
138
|
+
* @permissionId ECOM.MODIFY_INVOICES
|
|
139
|
+
* @permissionScope Manage Stores - all permissions
|
|
140
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
141
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
142
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
143
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
144
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
145
|
+
* @permissionScope Picasso private app mega scope
|
|
146
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
147
|
+
* @permissionScope Manage Orders
|
|
148
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
149
|
+
* @applicableIdentity APP
|
|
150
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.BulkGenerateInvoices
|
|
151
|
+
*/
|
|
152
|
+
async function bulkGenerateInvoices(orderIds) {
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
155
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ orderIds: orderIds });
|
|
156
|
+
const reqOpts = ambassadorWixEcomOrdersV1Invoice.bulkGenerateInvoices(payload);
|
|
157
|
+
sideEffects?.onSiteCall?.();
|
|
158
|
+
try {
|
|
159
|
+
const result = await httpClient.request(reqOpts);
|
|
160
|
+
sideEffects?.onSuccess?.(result);
|
|
161
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
165
|
+
spreadPathsToArguments: {},
|
|
166
|
+
explicitPathsToArguments: { orderIds: '$[0]' },
|
|
167
|
+
singleArgumentUnchanged: false,
|
|
168
|
+
}, ['orderIds']);
|
|
169
|
+
sideEffects?.onError?.(err);
|
|
170
|
+
throw transformedError;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.bulkGenerateInvoices = bulkGenerateInvoices;
|
|
174
|
+
/**
|
|
175
|
+
* Adds an invoice to a specified order.
|
|
176
|
+
* @param orderId - Order ID.
|
|
177
|
+
* @param invoiceInfo - Invoice info.
|
|
178
|
+
* @internal
|
|
179
|
+
* @documentationMaturity preview
|
|
180
|
+
* @requiredField invoiceInfo
|
|
181
|
+
* @requiredField invoiceInfo._id
|
|
182
|
+
* @requiredField invoiceInfo.appId
|
|
183
|
+
* @requiredField orderId
|
|
184
|
+
* @permissionId ECOM.ADD_INVOICE
|
|
185
|
+
* @permissionScope Manage Stores - all permissions
|
|
186
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
187
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
188
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
189
|
+
* @permissionScope Manage eCommerce - all permissions
|
|
190
|
+
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
191
|
+
* @permissionScope Picasso private app mega scope
|
|
192
|
+
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
193
|
+
* @permissionScope Manage Orders
|
|
194
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
195
|
+
* @applicableIdentity APP
|
|
196
|
+
* @fqn com.wix.ecom.orders.invoices.v1.Invoices.AddInvoiceToOrder
|
|
197
|
+
*/
|
|
198
|
+
async function addInvoiceToOrder(orderId, invoiceInfo) {
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
201
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
202
|
+
orderId: orderId,
|
|
203
|
+
invoiceInfo: invoiceInfo,
|
|
204
|
+
});
|
|
205
|
+
const reqOpts = ambassadorWixEcomOrdersV1Invoice.addInvoiceToOrder(payload);
|
|
206
|
+
sideEffects?.onSiteCall?.();
|
|
207
|
+
try {
|
|
208
|
+
const result = await httpClient.request(reqOpts);
|
|
209
|
+
sideEffects?.onSuccess?.(result);
|
|
210
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
211
|
+
}
|
|
212
|
+
catch (err) {
|
|
213
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
214
|
+
spreadPathsToArguments: {},
|
|
215
|
+
explicitPathsToArguments: { orderId: '$[0]', invoiceInfo: '$[1]' },
|
|
216
|
+
singleArgumentUnchanged: false,
|
|
217
|
+
}, ['orderId', 'invoiceInfo']);
|
|
218
|
+
sideEffects?.onError?.(err);
|
|
219
|
+
throw transformedError;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
exports.addInvoiceToOrder = addInvoiceToOrder;
|
|
223
|
+
//# sourceMappingURL=ecom-orders-v1-invoice-order-invoices.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecom-orders-v1-invoice-order-invoices.universal.js","sourceRoot":"","sources":["../../../../src/ecom-orders-v1-invoice-order-invoices.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,kHAAoG;AAqUpG,IAAY,mBAMX;AAND,WAAY,mBAAmB;I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;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;YAClE,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,SAAS,EAAE,aAAa,CAAC,CAC3B,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AA5CD,8CA4CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/ecom-orders-v1-invoice-order-invoices.context.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,wDAAwD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/ecom-orders-v1-invoice-order-invoices.universal.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,0DAA0D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/ecom-orders-v1-invoice-order-invoices.meta.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { listInvoicesForMultipleOrders as publicListInvoicesForMultipleOrders, generateInvoice as publicGenerateInvoice, bulkGenerateInvoices as publicBulkGenerateInvoices, addInvoiceToOrder as publicAddInvoiceToOrder } from './ecom-orders-v1-invoice-order-invoices.public.js';
|
|
2
|
+
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
3
|
+
export declare const listInvoicesForMultipleOrders: MaybeContext<BuildRESTFunction<typeof publicListInvoicesForMultipleOrders> & typeof publicListInvoicesForMultipleOrders>;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const generateInvoice: MaybeContext<BuildRESTFunction<typeof publicGenerateInvoice> & typeof publicGenerateInvoice>;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const bulkGenerateInvoices: MaybeContext<BuildRESTFunction<typeof publicBulkGenerateInvoices> & typeof publicBulkGenerateInvoices>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const addInvoiceToOrder: MaybeContext<BuildRESTFunction<typeof publicAddInvoiceToOrder> & typeof publicAddInvoiceToOrder>;
|
|
10
|
+
export { WebhookIdentityType } from './ecom-orders-v1-invoice-order-invoices.universal.js';
|
|
11
|
+
export { Invoice, ListInvoicesForSingleOrderRequest, ListInvoicesForSingleOrderResponse, ListInvoicesForMultipleOrdersRequest, ListInvoicesForMultipleOrdersResponse, InvoicesForOrder, GenerateInvoiceRequest, GenerateInvoiceResponse, BulkGenerateInvoicesRequest, BulkGenerateInvoicesResponse, BulkInvoiceResult, ItemMetadata, ApplicationError, InvoiceForOrder, BulkActionMetadata, AddInvoiceToOrderRequest, AddInvoiceToOrderResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, Empty, GetOrderInvoiceRequest, GetOrderInvoiceResponse, GenerateInvoiceWithNumberRequest, GenerateInvoiceWithNumberResponse, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, } from './ecom-orders-v1-invoice-order-invoices.universal.js';
|