arky-sdk 0.4.47 → 0.4.49
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 +28 -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 +28 -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,32 @@ 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
|
+
entity: params.entity,
|
|
1382
|
+
limit: params.limit,
|
|
1383
|
+
cursor: params.cursor
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
},
|
|
1387
|
+
async updateEvent(params, options) {
|
|
1388
|
+
return apiConfig.httpClient.put(
|
|
1389
|
+
`/v1/events/${params.eventId}`,
|
|
1390
|
+
{
|
|
1391
|
+
eventId: params.eventId,
|
|
1392
|
+
event: params.event
|
|
1393
|
+
},
|
|
1394
|
+
options
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1394
1400
|
// src/utils/price.ts
|
|
1395
1401
|
function formatCurrency(amount, currencyCode, locale = "en") {
|
|
1396
1402
|
return new Intl.NumberFormat(locale, {
|
|
@@ -1712,6 +1718,7 @@ async function createArkySDK(config) {
|
|
|
1712
1718
|
workflow: createWorkflowApi(apiConfig),
|
|
1713
1719
|
audience: createAudienceApi(apiConfig),
|
|
1714
1720
|
shipping: createShippingApi(apiConfig),
|
|
1721
|
+
events: createEventsApi(apiConfig),
|
|
1715
1722
|
analytics: {
|
|
1716
1723
|
track
|
|
1717
1724
|
},
|