@frogbotai/piece-xero 0.22.0 → 0.23.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 +80 -0
- package/dist/actions.d.ts +58 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +833 -0
- package/dist/actions.js.map +1 -0
- package/dist/client.d.ts +45 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +99 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +147 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -90
- package/dist/index.js.map +1 -1
- package/dist/triggers.d.ts +52 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.js +289 -0
- package/dist/triggers.js.map +1 -0
- package/dist/webhook.d.ts +4 -0
- package/dist/webhook.d.ts.map +1 -0
- package/dist/webhook.js +22 -0
- package/dist/webhook.js.map +1 -0
- package/package.json +7 -12
package/dist/actions.js
ADDED
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { xeroResponse } from './client.js';
|
|
3
|
+
const tenant = { tenantId: z.string().min(1).meta({ label: 'Organization' }) };
|
|
4
|
+
const date = z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
5
|
+
const lineAmountType = z.enum(['Exclusive', 'Inclusive', 'NoTax']);
|
|
6
|
+
const lineItem = z.object({
|
|
7
|
+
Description: z.string().min(1),
|
|
8
|
+
Quantity: z.number().optional(),
|
|
9
|
+
UnitAmount: z.number().optional(),
|
|
10
|
+
AccountCode: z.string().optional(),
|
|
11
|
+
ItemCode: z.string().optional(),
|
|
12
|
+
TaxType: z.string().optional(),
|
|
13
|
+
DiscountRate: z.number().optional(),
|
|
14
|
+
LineItemID: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
function apiAction({ slug, label, description, input, idempotent = false, run, }) {
|
|
17
|
+
return {
|
|
18
|
+
slug,
|
|
19
|
+
label,
|
|
20
|
+
description,
|
|
21
|
+
input,
|
|
22
|
+
output: xeroResponse,
|
|
23
|
+
idempotent,
|
|
24
|
+
options: {
|
|
25
|
+
async tenantId({ client, req, }) {
|
|
26
|
+
const tenants = await client.listTenants(req.signal ?? undefined);
|
|
27
|
+
return tenants.map(({ tenantId, tenantName }) => ({ label: tenantName, value: tenantId }));
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
run,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function accountingRequest(client, input, path, method, body, signal) {
|
|
34
|
+
return client.request({ path, method, tenantId: input.tenantId, body, signal }, xeroResponse);
|
|
35
|
+
}
|
|
36
|
+
const createOrUpdateContactInput = z.object({
|
|
37
|
+
...tenant,
|
|
38
|
+
contactId: z.string().optional(),
|
|
39
|
+
name: z.string().min(1),
|
|
40
|
+
email: z.string().email().optional(),
|
|
41
|
+
});
|
|
42
|
+
const createOrUpdateContact = apiAction({
|
|
43
|
+
slug: 'createOrUpdateContact',
|
|
44
|
+
label: 'Create or update contact',
|
|
45
|
+
description: 'Create a Xero contact or update one by ID.',
|
|
46
|
+
input: createOrUpdateContactInput,
|
|
47
|
+
async run({ input, client, req }) {
|
|
48
|
+
return accountingRequest(client, input, `/Contacts${input.contactId ? `/${input.contactId}` : ''}`, 'POST', { Contacts: [{ Name: input.name, EmailAddress: input.email }] }, req.signal ?? undefined);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const createOrUpdateInvoiceInput = z.object({
|
|
52
|
+
...tenant,
|
|
53
|
+
invoiceId: z.string().optional(),
|
|
54
|
+
contactId: z.string().optional(),
|
|
55
|
+
name: z.string().min(1),
|
|
56
|
+
email: z.string().email().optional(),
|
|
57
|
+
lineItem: lineItem,
|
|
58
|
+
date: date.optional(),
|
|
59
|
+
dueDate: date,
|
|
60
|
+
reference: z.string().optional(),
|
|
61
|
+
status: z.enum(['DRAFT', 'SUBMITTED', 'AUTHORISED', 'DELETED', 'VOIDED']),
|
|
62
|
+
});
|
|
63
|
+
const createOrUpdateInvoice = apiAction({
|
|
64
|
+
slug: 'createOrUpdateInvoice',
|
|
65
|
+
label: 'Create or update invoice',
|
|
66
|
+
description: 'Create or update an accounts-receivable invoice.',
|
|
67
|
+
input: createOrUpdateInvoiceInput,
|
|
68
|
+
async run({ input, client, req }) {
|
|
69
|
+
return accountingRequest(client, input, `/Invoices${input.invoiceId ? `/${input.invoiceId}` : ''}`, 'POST', {
|
|
70
|
+
Invoices: [
|
|
71
|
+
{
|
|
72
|
+
Type: 'ACCREC',
|
|
73
|
+
Contact: { ContactID: input.contactId, Name: input.name, EmailAddress: input.email },
|
|
74
|
+
LineItems: [input.lineItem],
|
|
75
|
+
Date: input.date,
|
|
76
|
+
DueDate: input.dueDate,
|
|
77
|
+
Reference: input.reference,
|
|
78
|
+
Status: input.status,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}, req.signal ?? undefined);
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const allocateCreditNoteInput = z.object({
|
|
85
|
+
...tenant,
|
|
86
|
+
creditNoteId: z.string().min(1),
|
|
87
|
+
invoiceId: z.string().min(1),
|
|
88
|
+
amount: z.number(),
|
|
89
|
+
date: date.optional(),
|
|
90
|
+
});
|
|
91
|
+
const allocateCreditNote = apiAction({
|
|
92
|
+
slug: 'allocateCreditNote',
|
|
93
|
+
label: 'Allocate credit note',
|
|
94
|
+
description: 'Allocate a credit note to an invoice.',
|
|
95
|
+
input: allocateCreditNoteInput,
|
|
96
|
+
async run({ input, client, req }) {
|
|
97
|
+
return accountingRequest(client, input, `/CreditNotes/${input.creditNoteId}/Allocations`, 'POST', {
|
|
98
|
+
Allocations: [
|
|
99
|
+
{ Invoice: { InvoiceID: input.invoiceId }, Amount: input.amount, Date: input.date },
|
|
100
|
+
],
|
|
101
|
+
}, req.signal ?? undefined);
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
const createBankTransferInput = z.object({
|
|
105
|
+
...tenant,
|
|
106
|
+
fromBankAccountId: z.string().min(1),
|
|
107
|
+
toBankAccountId: z.string().min(1),
|
|
108
|
+
amount: z.number(),
|
|
109
|
+
date: date.optional(),
|
|
110
|
+
reference: z.string().optional(),
|
|
111
|
+
fromIsReconciled: z.boolean().default(false),
|
|
112
|
+
toIsReconciled: z.boolean().default(false),
|
|
113
|
+
});
|
|
114
|
+
const createBankTransfer = apiAction({
|
|
115
|
+
slug: 'createBankTransfer',
|
|
116
|
+
label: 'Create bank transfer',
|
|
117
|
+
description: 'Transfer between bank accounts.',
|
|
118
|
+
input: createBankTransferInput,
|
|
119
|
+
async run({ input, client, req }) {
|
|
120
|
+
return accountingRequest(client, input, '/BankTransfers', 'PUT', {
|
|
121
|
+
BankTransfers: [
|
|
122
|
+
{
|
|
123
|
+
FromBankAccount: { AccountID: input.fromBankAccountId },
|
|
124
|
+
ToBankAccount: { AccountID: input.toBankAccountId },
|
|
125
|
+
Amount: input.amount,
|
|
126
|
+
Date: input.date,
|
|
127
|
+
Reference: input.reference,
|
|
128
|
+
FromIsReconciled: input.fromIsReconciled || undefined,
|
|
129
|
+
ToIsReconciled: input.toIsReconciled || undefined,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
}, req.signal ?? undefined);
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
const createQuoteInput = z.object({
|
|
136
|
+
...tenant,
|
|
137
|
+
contactId: z.string().min(1),
|
|
138
|
+
date,
|
|
139
|
+
expiryDate: date.optional(),
|
|
140
|
+
lineItem,
|
|
141
|
+
lineAmountTypes: lineAmountType.optional(),
|
|
142
|
+
reference: z.string().optional(),
|
|
143
|
+
quoteNumber: z.string().optional(),
|
|
144
|
+
title: z.string().optional(),
|
|
145
|
+
summary: z.string().optional(),
|
|
146
|
+
terms: z.string().optional(),
|
|
147
|
+
status: z.literal('DRAFT').default('DRAFT'),
|
|
148
|
+
});
|
|
149
|
+
const createQuote = apiAction({
|
|
150
|
+
slug: 'createQuote',
|
|
151
|
+
label: 'Create quote',
|
|
152
|
+
description: 'Create a draft quote.',
|
|
153
|
+
input: createQuoteInput,
|
|
154
|
+
async run({ input, client, req }) {
|
|
155
|
+
return accountingRequest(client, input, '/Quotes', 'POST', {
|
|
156
|
+
Quotes: [
|
|
157
|
+
{
|
|
158
|
+
Contact: { ContactID: input.contactId },
|
|
159
|
+
Date: input.date,
|
|
160
|
+
ExpiryDate: input.expiryDate,
|
|
161
|
+
LineItems: [input.lineItem],
|
|
162
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
163
|
+
Reference: input.reference,
|
|
164
|
+
QuoteNumber: input.quoteNumber,
|
|
165
|
+
Title: input.title,
|
|
166
|
+
Summary: input.summary,
|
|
167
|
+
Terms: input.terms,
|
|
168
|
+
Status: input.status,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
}, req.signal ?? undefined);
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
const sendInvoiceEmailInput = z.object({ ...tenant, invoiceId: z.string().min(1) });
|
|
175
|
+
const sendInvoiceEmail = {
|
|
176
|
+
slug: 'sendInvoiceEmail',
|
|
177
|
+
label: 'Send invoice email',
|
|
178
|
+
description: 'Send a sales invoice by email.',
|
|
179
|
+
input: sendInvoiceEmailInput,
|
|
180
|
+
output: z.object({ success: z.literal(true) }),
|
|
181
|
+
async run({ input, client, req, }) {
|
|
182
|
+
await client.request({
|
|
183
|
+
path: `/Invoices/${input.invoiceId}/Email`,
|
|
184
|
+
method: 'POST',
|
|
185
|
+
tenantId: input.tenantId,
|
|
186
|
+
signal: req.signal ?? undefined,
|
|
187
|
+
}, z.null());
|
|
188
|
+
return { success: true };
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
const invoiceBase = {
|
|
192
|
+
...tenant,
|
|
193
|
+
contactId: z.string().min(1),
|
|
194
|
+
lineItem,
|
|
195
|
+
date: date.optional(),
|
|
196
|
+
dueDate: date.optional(),
|
|
197
|
+
lineAmountTypes: lineAmountType.optional(),
|
|
198
|
+
invoiceNumber: z.string().optional(),
|
|
199
|
+
status: z.enum(['DRAFT', 'SUBMITTED', 'AUTHORISED']).default('DRAFT'),
|
|
200
|
+
};
|
|
201
|
+
const createBillInput = z.object(invoiceBase);
|
|
202
|
+
const createBill = apiAction({
|
|
203
|
+
slug: 'createBill',
|
|
204
|
+
label: 'Create bill',
|
|
205
|
+
description: 'Create an accounts-payable bill.',
|
|
206
|
+
input: createBillInput,
|
|
207
|
+
async run({ input, client, req }) {
|
|
208
|
+
return accountingRequest(client, input, '/Invoices', 'POST', {
|
|
209
|
+
Invoices: [
|
|
210
|
+
{
|
|
211
|
+
Type: 'ACCPAY',
|
|
212
|
+
Contact: { ContactID: input.contactId },
|
|
213
|
+
LineItems: [input.lineItem],
|
|
214
|
+
Date: input.date,
|
|
215
|
+
DueDate: input.dueDate,
|
|
216
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
217
|
+
InvoiceNumber: input.invoiceNumber,
|
|
218
|
+
Status: input.status,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
}, req.signal ?? undefined);
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
const createPaymentInput = z.object({
|
|
225
|
+
...tenant,
|
|
226
|
+
invoiceId: z.string().min(1),
|
|
227
|
+
accountId: z.string().min(1),
|
|
228
|
+
amount: z.number(),
|
|
229
|
+
date,
|
|
230
|
+
reference: z.string().optional(),
|
|
231
|
+
isReconciled: z.boolean().default(false),
|
|
232
|
+
});
|
|
233
|
+
const createPayment = apiAction({
|
|
234
|
+
slug: 'createPayment',
|
|
235
|
+
label: 'Create payment',
|
|
236
|
+
description: 'Apply a payment to an invoice.',
|
|
237
|
+
input: createPaymentInput,
|
|
238
|
+
async run({ input, client, req }) {
|
|
239
|
+
return accountingRequest(client, input, '/Payments', 'PUT', {
|
|
240
|
+
Payments: [
|
|
241
|
+
{
|
|
242
|
+
Invoice: { InvoiceID: input.invoiceId },
|
|
243
|
+
Account: { AccountID: input.accountId },
|
|
244
|
+
Amount: input.amount,
|
|
245
|
+
Date: input.date,
|
|
246
|
+
Reference: input.reference,
|
|
247
|
+
IsReconciled: input.isReconciled || undefined,
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
}, req.signal ?? undefined);
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
const purchaseOrderInput = z.object({
|
|
254
|
+
...tenant,
|
|
255
|
+
contactId: z.string().min(1),
|
|
256
|
+
lineItem,
|
|
257
|
+
date: date.optional(),
|
|
258
|
+
deliveryDate: date.optional(),
|
|
259
|
+
lineAmountTypes: lineAmountType.optional(),
|
|
260
|
+
purchaseOrderNumber: z.string().optional(),
|
|
261
|
+
reference: z.string().optional(),
|
|
262
|
+
brandingThemeId: z.string().optional(),
|
|
263
|
+
status: z.enum(['DRAFT', 'SUBMITTED', 'AUTHORISED', 'BILLED', 'DELETED']).default('DRAFT'),
|
|
264
|
+
deliveryAddress: z.string().optional(),
|
|
265
|
+
attentionTo: z.string().optional(),
|
|
266
|
+
telephone: z.string().optional(),
|
|
267
|
+
deliveryInstructions: z.string().optional(),
|
|
268
|
+
expectedArrivalDate: date.optional(),
|
|
269
|
+
});
|
|
270
|
+
const createPurchaseOrder = apiAction({
|
|
271
|
+
slug: 'createPurchaseOrder',
|
|
272
|
+
label: 'Create purchase order',
|
|
273
|
+
description: 'Create a purchase order.',
|
|
274
|
+
input: purchaseOrderInput,
|
|
275
|
+
async run({ input, client, req }) {
|
|
276
|
+
return accountingRequest(client, input, '/PurchaseOrders', 'POST', {
|
|
277
|
+
PurchaseOrders: [
|
|
278
|
+
{
|
|
279
|
+
Contact: { ContactID: input.contactId },
|
|
280
|
+
LineItems: [input.lineItem],
|
|
281
|
+
Date: input.date,
|
|
282
|
+
DeliveryDate: input.deliveryDate,
|
|
283
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
284
|
+
PurchaseOrderNumber: input.purchaseOrderNumber,
|
|
285
|
+
Reference: input.reference,
|
|
286
|
+
BrandingThemeID: input.brandingThemeId,
|
|
287
|
+
Status: input.status,
|
|
288
|
+
DeliveryAddress: input.deliveryAddress,
|
|
289
|
+
AttentionTo: input.attentionTo,
|
|
290
|
+
Telephone: input.telephone,
|
|
291
|
+
DeliveryInstructions: input.deliveryInstructions,
|
|
292
|
+
ExpectedArrivalDate: input.expectedArrivalDate,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
}, req.signal ?? undefined);
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
const updatePurchaseOrderInput = z.object({
|
|
299
|
+
...tenant,
|
|
300
|
+
purchaseOrderId: z.string().min(1),
|
|
301
|
+
status: z.enum(['DRAFT', 'SUBMITTED', 'AUTHORISED', 'BILLED', 'DELETED']).optional(),
|
|
302
|
+
sentToContact: z.boolean().default(false),
|
|
303
|
+
deliveryAddress: z.string().optional(),
|
|
304
|
+
attentionTo: z.string().optional(),
|
|
305
|
+
telephone: z.string().optional(),
|
|
306
|
+
deliveryInstructions: z.string().optional(),
|
|
307
|
+
expectedArrivalDate: date.optional(),
|
|
308
|
+
});
|
|
309
|
+
const updatePurchaseOrder = apiAction({
|
|
310
|
+
slug: 'updatePurchaseOrder',
|
|
311
|
+
label: 'Update purchase order',
|
|
312
|
+
description: 'Update a purchase order.',
|
|
313
|
+
input: updatePurchaseOrderInput,
|
|
314
|
+
idempotent: true,
|
|
315
|
+
async run({ input, client, req }) {
|
|
316
|
+
return accountingRequest(client, input, `/PurchaseOrders/${input.purchaseOrderId}`, 'POST', {
|
|
317
|
+
PurchaseOrders: [
|
|
318
|
+
{
|
|
319
|
+
PurchaseOrderID: input.purchaseOrderId,
|
|
320
|
+
Status: input.status,
|
|
321
|
+
SentToContact: input.sentToContact,
|
|
322
|
+
DeliveryAddress: input.deliveryAddress,
|
|
323
|
+
AttentionTo: input.attentionTo,
|
|
324
|
+
Telephone: input.telephone,
|
|
325
|
+
DeliveryInstructions: input.deliveryInstructions,
|
|
326
|
+
ExpectedArrivalDate: input.expectedArrivalDate,
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
}, req.signal ?? undefined);
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
const uploadAttachmentInput = z.object({
|
|
333
|
+
...tenant,
|
|
334
|
+
resourceType: z.enum([
|
|
335
|
+
'Invoices',
|
|
336
|
+
'CreditNotes',
|
|
337
|
+
'PurchaseOrders',
|
|
338
|
+
'Quotes',
|
|
339
|
+
'BankTransfers',
|
|
340
|
+
'BankTransactions',
|
|
341
|
+
'Contacts',
|
|
342
|
+
'Accounts',
|
|
343
|
+
'ManualJournals',
|
|
344
|
+
'Receipts',
|
|
345
|
+
'RepeatingInvoices',
|
|
346
|
+
]),
|
|
347
|
+
resourceId: z.string().min(1),
|
|
348
|
+
file: z.union([z.string(), z.number()]),
|
|
349
|
+
fileName: z.string().min(1),
|
|
350
|
+
contentType: z.string().min(1).default('application/octet-stream'),
|
|
351
|
+
includeOnline: z.boolean().default(false),
|
|
352
|
+
});
|
|
353
|
+
const uploadAttachment = apiAction({
|
|
354
|
+
slug: 'uploadAttachment',
|
|
355
|
+
label: 'Upload attachment',
|
|
356
|
+
description: 'Upload an attachment to a Xero resource.',
|
|
357
|
+
input: uploadAttachmentInput,
|
|
358
|
+
async run({ input, client, req }) {
|
|
359
|
+
const collection = req.frogbot.config.files?.slug;
|
|
360
|
+
if (!collection)
|
|
361
|
+
throw new Error('FrogBot files are not configured.');
|
|
362
|
+
const file = await req.frogbot.findByID({
|
|
363
|
+
collection,
|
|
364
|
+
id: input.file,
|
|
365
|
+
depth: 0,
|
|
366
|
+
req,
|
|
367
|
+
overrideAccess: false,
|
|
368
|
+
});
|
|
369
|
+
const urlValue = typeof file.url === 'string' ? file.url : undefined;
|
|
370
|
+
if (!urlValue)
|
|
371
|
+
throw new Error('The selected file has no URL.');
|
|
372
|
+
const payloadConfig = await req.frogbot.config._internal.payloadConfig;
|
|
373
|
+
const originValue = payloadConfig.serverURL || req.url;
|
|
374
|
+
if (!originValue)
|
|
375
|
+
throw new Error('FrogBot file requests require a server URL.');
|
|
376
|
+
const origin = new URL(originValue);
|
|
377
|
+
const url = new URL(urlValue, origin);
|
|
378
|
+
if (!['http:', 'https:'].includes(origin.protocol) ||
|
|
379
|
+
origin.username ||
|
|
380
|
+
origin.password ||
|
|
381
|
+
!['http:', 'https:'].includes(url.protocol) ||
|
|
382
|
+
url.username ||
|
|
383
|
+
url.password ||
|
|
384
|
+
url.origin !== origin.origin) {
|
|
385
|
+
throw new Error('The selected file URL is unsafe.');
|
|
386
|
+
}
|
|
387
|
+
const response = await fetch(url, {
|
|
388
|
+
headers: {
|
|
389
|
+
cookie: req.headers.get('cookie') ?? '',
|
|
390
|
+
authorization: req.headers.get('authorization') ?? '',
|
|
391
|
+
},
|
|
392
|
+
redirect: 'error',
|
|
393
|
+
signal: req.signal ?? undefined,
|
|
394
|
+
});
|
|
395
|
+
if (!response.ok)
|
|
396
|
+
throw new Error(`Unable to load attachment (${response.status}).`);
|
|
397
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
398
|
+
if (bytes.byteLength > 10_000_000)
|
|
399
|
+
throw new Error('Xero attachments cannot exceed 10 MB.');
|
|
400
|
+
const suffix = input.includeOnline && ['Invoices', 'CreditNotes'].includes(input.resourceType)
|
|
401
|
+
? '?IncludeOnline=true'
|
|
402
|
+
: '';
|
|
403
|
+
return client.request({
|
|
404
|
+
path: `/${input.resourceType}/${input.resourceId}/Attachments/${encodeURIComponent(input.fileName)}${suffix}`,
|
|
405
|
+
method: 'POST',
|
|
406
|
+
tenantId: input.tenantId,
|
|
407
|
+
body: bytes,
|
|
408
|
+
headers: { 'Content-Type': input.contentType },
|
|
409
|
+
signal: req.signal ?? undefined,
|
|
410
|
+
}, xeroResponse);
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
const addInvoiceItemsInput = z.object({
|
|
414
|
+
...tenant,
|
|
415
|
+
invoiceId: z.string().min(1),
|
|
416
|
+
newLineItems: z.array(lineItem).min(1),
|
|
417
|
+
});
|
|
418
|
+
const addInvoiceItems = apiAction({
|
|
419
|
+
slug: 'addInvoiceItems',
|
|
420
|
+
label: 'Add invoice items',
|
|
421
|
+
description: 'Append items to a sales invoice.',
|
|
422
|
+
input: addInvoiceItemsInput,
|
|
423
|
+
async run({ input, client, req }) {
|
|
424
|
+
const current = await client.request({
|
|
425
|
+
path: `/Invoices/${input.invoiceId}`,
|
|
426
|
+
tenantId: input.tenantId,
|
|
427
|
+
signal: req.signal ?? undefined,
|
|
428
|
+
}, z.object({
|
|
429
|
+
Invoices: z
|
|
430
|
+
.array(z.object({ LineItems: z.array(lineItem.passthrough()).default([]) }))
|
|
431
|
+
.min(1),
|
|
432
|
+
}));
|
|
433
|
+
return accountingRequest(client, input, `/Invoices/${input.invoiceId}`, 'POST', {
|
|
434
|
+
Invoices: [
|
|
435
|
+
{ Type: 'ACCREC', LineItems: [...current.Invoices[0].LineItems, ...input.newLineItems] },
|
|
436
|
+
],
|
|
437
|
+
}, req.signal ?? undefined);
|
|
438
|
+
},
|
|
439
|
+
});
|
|
440
|
+
const createCreditNoteInput = z.object({
|
|
441
|
+
...tenant,
|
|
442
|
+
type: z.enum(['ACCRECCREDIT', 'ACCPAYCREDIT']).default('ACCRECCREDIT'),
|
|
443
|
+
contactId: z.string().min(1),
|
|
444
|
+
date: date.optional(),
|
|
445
|
+
status: z.enum(['DRAFT', 'AUTHORISED']).default('DRAFT'),
|
|
446
|
+
lineAmountTypes: lineAmountType.optional(),
|
|
447
|
+
creditNoteNumber: z.string().optional(),
|
|
448
|
+
reference: z.string().optional(),
|
|
449
|
+
currencyCode: z.string().optional(),
|
|
450
|
+
brandingThemeId: z.string().optional(),
|
|
451
|
+
lineItems: z.array(lineItem).optional(),
|
|
452
|
+
});
|
|
453
|
+
const createCreditNote = apiAction({
|
|
454
|
+
slug: 'createCreditNote',
|
|
455
|
+
label: 'Create credit note',
|
|
456
|
+
description: 'Create a credit note.',
|
|
457
|
+
input: createCreditNoteInput,
|
|
458
|
+
async run({ input, client, req }) {
|
|
459
|
+
return accountingRequest(client, input, '/CreditNotes', 'POST', {
|
|
460
|
+
CreditNotes: [
|
|
461
|
+
{
|
|
462
|
+
Type: input.type,
|
|
463
|
+
Contact: { ContactID: input.contactId },
|
|
464
|
+
Date: input.date,
|
|
465
|
+
Status: input.status,
|
|
466
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
467
|
+
CreditNoteNumber: input.creditNoteNumber,
|
|
468
|
+
Reference: input.type === 'ACCRECCREDIT' ? input.reference : undefined,
|
|
469
|
+
CurrencyCode: input.currencyCode,
|
|
470
|
+
BrandingThemeID: input.brandingThemeId,
|
|
471
|
+
LineItems: input.lineItems,
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
}, req.signal ?? undefined);
|
|
475
|
+
},
|
|
476
|
+
});
|
|
477
|
+
const createItemInput = z.object({
|
|
478
|
+
...tenant,
|
|
479
|
+
code: z.string().min(1),
|
|
480
|
+
name: z.string().optional(),
|
|
481
|
+
description: z.string().optional(),
|
|
482
|
+
purchaseDescription: z.string().optional(),
|
|
483
|
+
isSold: z.boolean().default(true),
|
|
484
|
+
isPurchased: z.boolean().default(true),
|
|
485
|
+
salesDetails: z.object({ UnitPrice: z.number() }).optional(),
|
|
486
|
+
purchaseDetails: z.object({ UnitPrice: z.number() }).optional(),
|
|
487
|
+
salesAccountId: z.string().optional(),
|
|
488
|
+
purchaseAccountId: z.string().optional(),
|
|
489
|
+
cogsAccountId: z.string().optional(),
|
|
490
|
+
inventoryAssetAccountId: z.string().optional(),
|
|
491
|
+
});
|
|
492
|
+
const createItem = apiAction({
|
|
493
|
+
slug: 'createItem',
|
|
494
|
+
label: 'Create inventory item',
|
|
495
|
+
description: 'Create an inventory item.',
|
|
496
|
+
input: createItemInput,
|
|
497
|
+
async run({ input, client, req }) {
|
|
498
|
+
return accountingRequest(client, input, '/Items', 'POST', {
|
|
499
|
+
Code: input.code,
|
|
500
|
+
Name: input.name,
|
|
501
|
+
Description: input.description,
|
|
502
|
+
PurchaseDescription: input.purchaseDescription,
|
|
503
|
+
IsSold: input.isSold,
|
|
504
|
+
IsPurchased: input.isPurchased,
|
|
505
|
+
SalesDetails: input.salesDetails || input.salesAccountId
|
|
506
|
+
? { ...input.salesDetails, AccountID: input.salesAccountId }
|
|
507
|
+
: undefined,
|
|
508
|
+
PurchaseDetails: input.purchaseDetails || input.purchaseAccountId || input.cogsAccountId
|
|
509
|
+
? {
|
|
510
|
+
...input.purchaseDetails,
|
|
511
|
+
AccountID: input.purchaseAccountId,
|
|
512
|
+
COGSAccountID: input.cogsAccountId,
|
|
513
|
+
}
|
|
514
|
+
: undefined,
|
|
515
|
+
InventoryAssetAccountID: input.inventoryAssetAccountId,
|
|
516
|
+
}, req.signal ?? undefined);
|
|
517
|
+
},
|
|
518
|
+
});
|
|
519
|
+
const createProjectInput = z.object({
|
|
520
|
+
...tenant,
|
|
521
|
+
contactId: z.string().min(1),
|
|
522
|
+
name: z.string().min(1),
|
|
523
|
+
deadlineUtc: z.string().datetime().optional(),
|
|
524
|
+
estimateAmount: z.number().optional(),
|
|
525
|
+
});
|
|
526
|
+
const createProject = apiAction({
|
|
527
|
+
slug: 'createProject',
|
|
528
|
+
label: 'Create project',
|
|
529
|
+
description: 'Create a Xero project.',
|
|
530
|
+
input: createProjectInput,
|
|
531
|
+
async run({ input, client, req }) {
|
|
532
|
+
return client.request({
|
|
533
|
+
base: 'projects',
|
|
534
|
+
path: '/Projects',
|
|
535
|
+
method: 'POST',
|
|
536
|
+
tenantId: input.tenantId,
|
|
537
|
+
body: {
|
|
538
|
+
contactId: input.contactId,
|
|
539
|
+
name: input.name,
|
|
540
|
+
deadlineUtc: input.deadlineUtc,
|
|
541
|
+
estimateAmount: input.estimateAmount,
|
|
542
|
+
},
|
|
543
|
+
signal: req.signal ?? undefined,
|
|
544
|
+
}, xeroResponse);
|
|
545
|
+
},
|
|
546
|
+
});
|
|
547
|
+
const updateInvoiceInput = z.object({
|
|
548
|
+
...tenant,
|
|
549
|
+
invoiceId: z.string().min(1),
|
|
550
|
+
reference: z.string().optional(),
|
|
551
|
+
dueDate: date.optional(),
|
|
552
|
+
invoiceNumber: z.string().optional(),
|
|
553
|
+
brandingThemeId: z.string().optional(),
|
|
554
|
+
url: z.string().url().optional(),
|
|
555
|
+
contactId: z.string().optional(),
|
|
556
|
+
status: z.enum(['DRAFT', 'SUBMITTED', 'AUTHORISED', 'VOIDED', 'DELETED']).optional(),
|
|
557
|
+
sentToContact: z.boolean().default(false),
|
|
558
|
+
replaceAllLineItems: z.boolean().default(false),
|
|
559
|
+
lineItems: z.array(lineItem).optional(),
|
|
560
|
+
});
|
|
561
|
+
const updateInvoice = apiAction({
|
|
562
|
+
slug: 'updateInvoice',
|
|
563
|
+
label: 'Update sales invoice',
|
|
564
|
+
description: 'Update a sales invoice.',
|
|
565
|
+
input: updateInvoiceInput,
|
|
566
|
+
idempotent: true,
|
|
567
|
+
async run({ input, client, req }) {
|
|
568
|
+
let lineItems = input.lineItems;
|
|
569
|
+
if (lineItems?.length && !input.replaceAllLineItems) {
|
|
570
|
+
const current = await client.request({
|
|
571
|
+
path: `/Invoices/${input.invoiceId}`,
|
|
572
|
+
tenantId: input.tenantId,
|
|
573
|
+
signal: req.signal ?? undefined,
|
|
574
|
+
}, z.object({
|
|
575
|
+
Invoices: z
|
|
576
|
+
.array(z.object({ LineItems: z.array(lineItem.passthrough()).default([]) }))
|
|
577
|
+
.min(1),
|
|
578
|
+
}));
|
|
579
|
+
const updates = new Map(lineItems.filter((item) => item.LineItemID).map((item) => [item.LineItemID, item]));
|
|
580
|
+
const existing = current.Invoices[0].LineItems.map((item) => {
|
|
581
|
+
const update = item.LineItemID ? updates.get(item.LineItemID) : undefined;
|
|
582
|
+
if (item.LineItemID)
|
|
583
|
+
updates.delete(item.LineItemID);
|
|
584
|
+
return update ? { ...item, ...update } : item;
|
|
585
|
+
});
|
|
586
|
+
const additions = lineItems.filter((item) => !item.LineItemID || updates.has(item.LineItemID));
|
|
587
|
+
lineItems = [...existing, ...additions];
|
|
588
|
+
}
|
|
589
|
+
return accountingRequest(client, input, `/Invoices/${input.invoiceId}`, 'POST', {
|
|
590
|
+
Invoices: [
|
|
591
|
+
{
|
|
592
|
+
InvoiceID: input.invoiceId,
|
|
593
|
+
Type: 'ACCREC',
|
|
594
|
+
Reference: input.reference,
|
|
595
|
+
DueDate: input.dueDate,
|
|
596
|
+
InvoiceNumber: input.invoiceNumber,
|
|
597
|
+
BrandingThemeID: input.brandingThemeId,
|
|
598
|
+
Url: input.url,
|
|
599
|
+
Contact: input.contactId ? { ContactID: input.contactId } : undefined,
|
|
600
|
+
Status: input.status,
|
|
601
|
+
SentToContact: input.sentToContact,
|
|
602
|
+
LineItems: lineItems,
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
}, req.signal ?? undefined);
|
|
606
|
+
},
|
|
607
|
+
});
|
|
608
|
+
const repeatingInput = z.object({
|
|
609
|
+
...tenant,
|
|
610
|
+
contactId: z.string().min(1),
|
|
611
|
+
schedulePeriod: z.number().int(),
|
|
612
|
+
scheduleUnit: z.enum(['WEEKLY', 'MONTHLY']),
|
|
613
|
+
dueDate: z.number().int(),
|
|
614
|
+
dueDateType: z.enum([
|
|
615
|
+
'OFCURRENTMONTH',
|
|
616
|
+
'OFFOLLOWINGMONTH',
|
|
617
|
+
'DAYSAFTERBILLDATE',
|
|
618
|
+
'DAYSAFTERBILLMONTH',
|
|
619
|
+
]),
|
|
620
|
+
startDate: date,
|
|
621
|
+
endDate: date.optional(),
|
|
622
|
+
lineAmountTypes: lineAmountType.default('Exclusive'),
|
|
623
|
+
currencyCode: z.string().min(1),
|
|
624
|
+
status: z.enum(['DRAFT', 'AUTHORISED']).default('DRAFT'),
|
|
625
|
+
reference: z.string().optional(),
|
|
626
|
+
brandingThemeId: z.string().optional(),
|
|
627
|
+
approvedForSending: z.boolean().default(false),
|
|
628
|
+
sendCopy: z.boolean().default(false),
|
|
629
|
+
markAsSent: z.boolean().default(false),
|
|
630
|
+
includePdf: z.boolean().default(false),
|
|
631
|
+
lineItems: z.array(lineItem).min(1),
|
|
632
|
+
});
|
|
633
|
+
const createRepeatingInvoice = apiAction({
|
|
634
|
+
slug: 'createRepeatingInvoice',
|
|
635
|
+
label: 'Create repeating invoice',
|
|
636
|
+
description: 'Create a repeating sales invoice.',
|
|
637
|
+
input: repeatingInput,
|
|
638
|
+
async run({ input, client, req }) {
|
|
639
|
+
if (input.scheduleUnit === 'WEEKLY' &&
|
|
640
|
+
!['DAYSAFTERBILLDATE', 'OFFOLLOWINGMONTH'].includes(input.dueDateType)) {
|
|
641
|
+
throw new Error('Weekly schedules require DAYSAFTERBILLDATE or OFFOLLOWINGMONTH.');
|
|
642
|
+
}
|
|
643
|
+
if (input.scheduleUnit === 'MONTHLY' &&
|
|
644
|
+
!['OFCURRENTMONTH', 'OFFOLLOWINGMONTH'].includes(input.dueDateType)) {
|
|
645
|
+
throw new Error('Monthly schedules require OFCURRENTMONTH or OFFOLLOWINGMONTH.');
|
|
646
|
+
}
|
|
647
|
+
return accountingRequest(client, input, '/RepeatingInvoices', 'POST', {
|
|
648
|
+
RepeatingInvoices: [
|
|
649
|
+
{
|
|
650
|
+
Type: 'ACCREC',
|
|
651
|
+
Contact: { ContactID: input.contactId },
|
|
652
|
+
Schedule: {
|
|
653
|
+
Period: input.schedulePeriod,
|
|
654
|
+
Unit: input.scheduleUnit,
|
|
655
|
+
DueDate: input.dueDate,
|
|
656
|
+
DueDateType: input.dueDateType,
|
|
657
|
+
StartDate: input.startDate,
|
|
658
|
+
EndDate: input.endDate,
|
|
659
|
+
},
|
|
660
|
+
LineItems: input.lineItems,
|
|
661
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
662
|
+
CurrencyCode: input.currencyCode,
|
|
663
|
+
Status: input.status,
|
|
664
|
+
Reference: input.reference,
|
|
665
|
+
BrandingThemeID: input.brandingThemeId,
|
|
666
|
+
ApprovedForSending: input.approvedForSending || undefined,
|
|
667
|
+
SendCopy: input.sendCopy || undefined,
|
|
668
|
+
MarkAsSent: input.markAsSent || undefined,
|
|
669
|
+
IncludePDF: input.includePdf || undefined,
|
|
670
|
+
},
|
|
671
|
+
],
|
|
672
|
+
}, req.signal ?? undefined);
|
|
673
|
+
},
|
|
674
|
+
});
|
|
675
|
+
function lookupAction(slug, label, path, input, query) {
|
|
676
|
+
return apiAction({
|
|
677
|
+
slug,
|
|
678
|
+
label,
|
|
679
|
+
description: label,
|
|
680
|
+
input,
|
|
681
|
+
idempotent: true,
|
|
682
|
+
async run({ input: value, client, req }) {
|
|
683
|
+
const parsed = lookupInput.parse(value);
|
|
684
|
+
return client.request({ path, tenantId: parsed.tenantId, query: query(parsed), signal: req.signal ?? undefined }, xeroResponse);
|
|
685
|
+
},
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
const lookupInput = z.object({
|
|
689
|
+
...tenant,
|
|
690
|
+
searchBy: z.string().min(1),
|
|
691
|
+
value: z.string().min(1),
|
|
692
|
+
page: z.number().int().positive().optional(),
|
|
693
|
+
});
|
|
694
|
+
const findContact = lookupAction('findContact', 'Find contact', '/Contacts', lookupInput, (input) => input.searchBy === 'SEARCH_TERM'
|
|
695
|
+
? { SearchTerm: input.value, page: input.page ?? 1 }
|
|
696
|
+
: {
|
|
697
|
+
where: `${input.searchBy === 'ACCOUNT_NUMBER' ? 'AccountNumber' : 'Name'}=="${input.value.replaceAll('"', '\\"')}"`,
|
|
698
|
+
page: input.page ?? 1,
|
|
699
|
+
});
|
|
700
|
+
const findInvoice = lookupAction('findInvoice', 'Find invoice', '/Invoices', lookupInput, (input) => input.searchBy === 'SEARCH_TERM'
|
|
701
|
+
? { SearchTerm: input.value, page: input.page ?? 1 }
|
|
702
|
+
: {
|
|
703
|
+
where: `${input.searchBy === 'REFERENCE' ? 'Reference' : 'InvoiceNumber'}=="${input.value.replaceAll('"', '\\"')}"`,
|
|
704
|
+
page: input.page ?? 1,
|
|
705
|
+
});
|
|
706
|
+
const findItem = lookupAction('findItem', 'Find item', '/Items', lookupInput, (input) => ({
|
|
707
|
+
where: `${input.searchBy === 'NAME' ? 'Name' : 'Code'}=="${input.value.replaceAll('"', '\\"')}"`,
|
|
708
|
+
}));
|
|
709
|
+
const findPurchaseOrder = lookupAction('findPurchaseOrder', 'Find purchase order', '/PurchaseOrders', lookupInput, (input) => ({
|
|
710
|
+
where: `${input.searchBy === 'REFERENCE' ? 'Reference' : 'PurchaseOrderNumber'}=="${input.value.replaceAll('"', '\\"')}"`,
|
|
711
|
+
page: String(input.page ?? 1),
|
|
712
|
+
}));
|
|
713
|
+
const getInvoiceHistoryInput = z.object({ ...tenant, invoiceId: z.string().min(1) });
|
|
714
|
+
const getInvoiceHistory = apiAction({
|
|
715
|
+
slug: 'getInvoiceHistory',
|
|
716
|
+
label: 'Get invoice history',
|
|
717
|
+
description: 'Get invoice history.',
|
|
718
|
+
input: getInvoiceHistoryInput,
|
|
719
|
+
idempotent: true,
|
|
720
|
+
async run({ input, client, req }) {
|
|
721
|
+
return client.request({
|
|
722
|
+
path: `/Invoices/${input.invoiceId}/History`,
|
|
723
|
+
tenantId: input.tenantId,
|
|
724
|
+
signal: req.signal ?? undefined,
|
|
725
|
+
}, xeroResponse);
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
const createBankTransactionInput = z.object({
|
|
729
|
+
...tenant,
|
|
730
|
+
type: z.enum(['SPEND', 'RECEIVE']).default('SPEND'),
|
|
731
|
+
contactId: z.string().min(1),
|
|
732
|
+
bankAccountId: z.string().min(1),
|
|
733
|
+
lineItem,
|
|
734
|
+
date: date.optional(),
|
|
735
|
+
reference: z.string().optional(),
|
|
736
|
+
lineAmountTypes: lineAmountType.optional(),
|
|
737
|
+
isReconciled: z.boolean().default(false),
|
|
738
|
+
});
|
|
739
|
+
const createBankTransaction = apiAction({
|
|
740
|
+
slug: 'createBankTransaction',
|
|
741
|
+
label: 'Create bank transaction',
|
|
742
|
+
description: 'Create a spend or receive transaction.',
|
|
743
|
+
input: createBankTransactionInput,
|
|
744
|
+
async run({ input, client, req }) {
|
|
745
|
+
return accountingRequest(client, input, '/BankTransactions', 'POST', {
|
|
746
|
+
BankTransactions: [
|
|
747
|
+
{
|
|
748
|
+
Type: input.type,
|
|
749
|
+
Contact: { ContactID: input.contactId },
|
|
750
|
+
BankAccount: { AccountID: input.bankAccountId },
|
|
751
|
+
LineItems: [input.lineItem],
|
|
752
|
+
Date: input.date,
|
|
753
|
+
Reference: input.reference,
|
|
754
|
+
LineAmountTypes: input.lineAmountTypes,
|
|
755
|
+
IsReconciled: input.isReconciled || undefined,
|
|
756
|
+
},
|
|
757
|
+
],
|
|
758
|
+
}, req.signal ?? undefined);
|
|
759
|
+
},
|
|
760
|
+
});
|
|
761
|
+
const findOrCreateContact = apiAction({
|
|
762
|
+
slug: 'findOrCreateContact',
|
|
763
|
+
label: 'Find or create contact',
|
|
764
|
+
description: 'Find a contact by name or create it.',
|
|
765
|
+
input: createOrUpdateContactInput.omit({ contactId: true }),
|
|
766
|
+
idempotent: true,
|
|
767
|
+
async run({ input, client, req }) {
|
|
768
|
+
const existing = await client.request({
|
|
769
|
+
path: '/Contacts',
|
|
770
|
+
tenantId: input.tenantId,
|
|
771
|
+
query: { where: `Name=="${input.name.replaceAll('"', '\\"')}"` },
|
|
772
|
+
signal: req.signal ?? undefined,
|
|
773
|
+
}, xeroResponse);
|
|
774
|
+
if (Array.isArray(existing.Contacts) && existing.Contacts.length)
|
|
775
|
+
return existing;
|
|
776
|
+
return accountingRequest(client, input, '/Contacts', 'POST', { Contacts: [{ Name: input.name, EmailAddress: input.email }] }, req.signal ?? undefined);
|
|
777
|
+
},
|
|
778
|
+
});
|
|
779
|
+
const customPath = z
|
|
780
|
+
.string()
|
|
781
|
+
.regex(/^\/(?!\/)(?!.*[%?#\\])[A-Za-z0-9._~!$&'()*+,;=:@/-]+$/)
|
|
782
|
+
.refine((value) => value.split('/').every((segment) => segment !== '.' && segment !== '..'));
|
|
783
|
+
const customApiInput = z.object({
|
|
784
|
+
...tenant,
|
|
785
|
+
method: z.enum(['DELETE', 'GET', 'POST', 'PUT']),
|
|
786
|
+
path: customPath,
|
|
787
|
+
query: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).default({}),
|
|
788
|
+
body: z.json().optional(),
|
|
789
|
+
});
|
|
790
|
+
const customApiCall = apiAction({
|
|
791
|
+
slug: 'customApiCall',
|
|
792
|
+
label: 'Custom API call',
|
|
793
|
+
description: 'Call a relative Xero accounting API path.',
|
|
794
|
+
input: customApiInput,
|
|
795
|
+
async run({ input, client, req }) {
|
|
796
|
+
return client.request({
|
|
797
|
+
path: input.path,
|
|
798
|
+
method: input.method,
|
|
799
|
+
tenantId: input.tenantId,
|
|
800
|
+
query: input.query,
|
|
801
|
+
body: input.body,
|
|
802
|
+
signal: req.signal ?? undefined,
|
|
803
|
+
}, xeroResponse);
|
|
804
|
+
},
|
|
805
|
+
});
|
|
806
|
+
export const xeroActions = [
|
|
807
|
+
createOrUpdateContact,
|
|
808
|
+
createOrUpdateInvoice,
|
|
809
|
+
allocateCreditNote,
|
|
810
|
+
createBankTransfer,
|
|
811
|
+
createQuote,
|
|
812
|
+
sendInvoiceEmail,
|
|
813
|
+
createBill,
|
|
814
|
+
createPayment,
|
|
815
|
+
createPurchaseOrder,
|
|
816
|
+
updatePurchaseOrder,
|
|
817
|
+
uploadAttachment,
|
|
818
|
+
addInvoiceItems,
|
|
819
|
+
createCreditNote,
|
|
820
|
+
createItem,
|
|
821
|
+
createProject,
|
|
822
|
+
updateInvoice,
|
|
823
|
+
createRepeatingInvoice,
|
|
824
|
+
findContact,
|
|
825
|
+
findInvoice,
|
|
826
|
+
findItem,
|
|
827
|
+
findPurchaseOrder,
|
|
828
|
+
getInvoiceHistory,
|
|
829
|
+
createBankTransaction,
|
|
830
|
+
findOrCreateContact,
|
|
831
|
+
customApiCall,
|
|
832
|
+
];
|
|
833
|
+
//# sourceMappingURL=actions.js.map
|