arky-sdk 0.4.47 → 0.4.48
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/dist/index.cjs +29 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +29 -21
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +59 -8
- package/dist/types.d.ts +59 -8
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -407,26 +407,6 @@ var createBusinessApi = (apiConfig) => {
|
|
|
407
407
|
options
|
|
408
408
|
);
|
|
409
409
|
},
|
|
410
|
-
async getBusinessEvents(params, options) {
|
|
411
|
-
return apiConfig.httpClient.get(
|
|
412
|
-
`/v1/businesses/${apiConfig.businessId}/events`,
|
|
413
|
-
{
|
|
414
|
-
...options,
|
|
415
|
-
params: {
|
|
416
|
-
entity: params.entity,
|
|
417
|
-
limit: params.limit,
|
|
418
|
-
cursor: params.cursor
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
},
|
|
423
|
-
async updateBusinessEventPayload(params, options) {
|
|
424
|
-
return apiConfig.httpClient.put(
|
|
425
|
-
`/v1/businesses/${apiConfig.businessId}/events/${params.eventId}`,
|
|
426
|
-
{ payload: params.payload },
|
|
427
|
-
options
|
|
428
|
-
);
|
|
429
|
-
},
|
|
430
410
|
async connectStripe(params, options) {
|
|
431
411
|
return apiConfig.httpClient.post(
|
|
432
412
|
`/v1/businesses/${params.businessId}/stripe/connect`,
|
|
@@ -1372,7 +1352,7 @@ var createShippingApi = (apiConfig) => {
|
|
|
1372
1352
|
async getRates(params, options) {
|
|
1373
1353
|
const { orderId, ...payload } = params;
|
|
1374
1354
|
return apiConfig.httpClient.post(
|
|
1375
|
-
`/v1/businesses/${apiConfig.businessId}/orders/${orderId}/
|
|
1355
|
+
`/v1/businesses/${apiConfig.businessId}/orders/${orderId}/rates`,
|
|
1376
1356
|
payload,
|
|
1377
1357
|
options
|
|
1378
1358
|
);
|
|
@@ -1391,6 +1371,33 @@ var createShippingApi = (apiConfig) => {
|
|
|
1391
1371
|
};
|
|
1392
1372
|
};
|
|
1393
1373
|
|
|
1374
|
+
// src/api/events.ts
|
|
1375
|
+
function createEventsApi(apiConfig) {
|
|
1376
|
+
return {
|
|
1377
|
+
async getEvents(params, options) {
|
|
1378
|
+
return apiConfig.httpClient.get(`/v1/events`, {
|
|
1379
|
+
...options,
|
|
1380
|
+
params: {
|
|
1381
|
+
businessId: apiConfig.businessId,
|
|
1382
|
+
entity: params.entity,
|
|
1383
|
+
limit: params.limit,
|
|
1384
|
+
cursor: params.cursor
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
},
|
|
1388
|
+
async updateEvent(params, options) {
|
|
1389
|
+
return apiConfig.httpClient.put(
|
|
1390
|
+
`/v1/events/${params.eventId}`,
|
|
1391
|
+
{
|
|
1392
|
+
businessId: apiConfig.businessId,
|
|
1393
|
+
event: params.event
|
|
1394
|
+
},
|
|
1395
|
+
options
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1394
1401
|
// src/utils/price.ts
|
|
1395
1402
|
function formatCurrency(amount, currencyCode, locale = "en") {
|
|
1396
1403
|
return new Intl.NumberFormat(locale, {
|
|
@@ -1712,6 +1719,7 @@ async function createArkySDK(config) {
|
|
|
1712
1719
|
workflow: createWorkflowApi(apiConfig),
|
|
1713
1720
|
audience: createAudienceApi(apiConfig),
|
|
1714
1721
|
shipping: createShippingApi(apiConfig),
|
|
1722
|
+
events: createEventsApi(apiConfig),
|
|
1715
1723
|
analytics: {
|
|
1716
1724
|
track
|
|
1717
1725
|
},
|