arky-sdk 0.7.113 → 0.7.115
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/admin.cjs +120 -132
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +120 -132
- package/dist/admin.js.map +1 -1
- package/dist/index.cjs +128 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +128 -140
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +8 -8
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.js +8 -8
- package/dist/storefront.js.map +1 -1
- package/dist/types.d.cts +3 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -397,14 +397,6 @@ var createStorefrontApi = (apiConfig, updateCustomerSession) => {
|
|
|
397
397
|
...options,
|
|
398
398
|
params: queryParams
|
|
399
399
|
});
|
|
400
|
-
},
|
|
401
|
-
getAvailability(params, options) {
|
|
402
|
-
const { store_id, ...queryParams } = params;
|
|
403
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
404
|
-
return apiConfig.httpClient.get(
|
|
405
|
-
`${base(target_store_id)}/orders/availability`,
|
|
406
|
-
{ ...options, params: queryParams }
|
|
407
|
-
);
|
|
408
400
|
}
|
|
409
401
|
},
|
|
410
402
|
service: {
|
|
@@ -436,6 +428,14 @@ var createStorefrontApi = (apiConfig, updateCustomerSession) => {
|
|
|
436
428
|
...options,
|
|
437
429
|
params: queryParams
|
|
438
430
|
});
|
|
431
|
+
},
|
|
432
|
+
getAvailability(params, options) {
|
|
433
|
+
const { store_id, ...queryParams } = params;
|
|
434
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
435
|
+
return apiConfig.httpClient.get(
|
|
436
|
+
`${base(target_store_id)}/services/availability`,
|
|
437
|
+
{ ...options, params: queryParams }
|
|
438
|
+
);
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
provider: {
|
|
@@ -1381,123 +1381,12 @@ var createEshopApi = (apiConfig) => {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
);
|
|
1383
1383
|
},
|
|
1384
|
-
async createOrder(params, options) {
|
|
1385
|
-
const { store_id, items, ...rest } = params;
|
|
1386
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1387
|
-
const payload = {
|
|
1388
|
-
...rest,
|
|
1389
|
-
market: rest.market || apiConfig.market,
|
|
1390
|
-
items: normalizeOrderCheckoutItems(items)
|
|
1391
|
-
};
|
|
1392
|
-
return apiConfig.httpClient.post(
|
|
1393
|
-
`/v1/stores/${target_store_id}/orders`,
|
|
1394
|
-
payload,
|
|
1395
|
-
options
|
|
1396
|
-
);
|
|
1397
|
-
},
|
|
1398
|
-
async checkoutOrder(params, options) {
|
|
1399
|
-
const { store_id, items, ...rest } = params;
|
|
1400
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1401
|
-
const payload = {
|
|
1402
|
-
...rest,
|
|
1403
|
-
store_id: target_store_id,
|
|
1404
|
-
market: rest.market || apiConfig.market,
|
|
1405
|
-
items: normalizeOrderCheckoutItems(items)
|
|
1406
|
-
};
|
|
1407
|
-
return apiConfig.httpClient.post(
|
|
1408
|
-
`/v1/stores/${target_store_id}/orders/checkout`,
|
|
1409
|
-
payload,
|
|
1410
|
-
options
|
|
1411
|
-
);
|
|
1412
|
-
},
|
|
1413
|
-
async updateOrder(params, options) {
|
|
1414
|
-
const { store_id, items, ...rest } = params;
|
|
1415
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1416
|
-
const payload = {
|
|
1417
|
-
...rest,
|
|
1418
|
-
...items ? { items: normalizeOrderCheckoutItems(items) } : {}
|
|
1419
|
-
};
|
|
1420
|
-
return apiConfig.httpClient.put(
|
|
1421
|
-
`/v1/stores/${target_store_id}/orders/${params.id}`,
|
|
1422
|
-
payload,
|
|
1423
|
-
options
|
|
1424
|
-
);
|
|
1425
|
-
},
|
|
1426
|
-
async getOrder(params, options) {
|
|
1427
|
-
const target_store_id = params.store_id || apiConfig.storeId;
|
|
1428
|
-
return apiConfig.httpClient.get(
|
|
1429
|
-
`/v1/stores/${target_store_id}/orders/${params.id}`,
|
|
1430
|
-
options
|
|
1431
|
-
);
|
|
1432
|
-
},
|
|
1433
|
-
async getOrders(params, options) {
|
|
1434
|
-
const { store_id, ...queryParams } = params;
|
|
1435
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1436
|
-
return apiConfig.httpClient.get(
|
|
1437
|
-
`/v1/stores/${target_store_id}/orders`,
|
|
1438
|
-
{
|
|
1439
|
-
...options,
|
|
1440
|
-
params: queryParams
|
|
1441
|
-
}
|
|
1442
|
-
);
|
|
1443
|
-
},
|
|
1444
|
-
async getQuote(params, options) {
|
|
1445
|
-
const { location, store_id, items, ...rest } = params;
|
|
1446
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1447
|
-
const shipping_address = location ? {
|
|
1448
|
-
country: location.country || "",
|
|
1449
|
-
state: location.state || "",
|
|
1450
|
-
city: location.city || "",
|
|
1451
|
-
postal_code: location.postal_code || "",
|
|
1452
|
-
name: "",
|
|
1453
|
-
street1: "",
|
|
1454
|
-
street2: null
|
|
1455
|
-
} : rest.shipping_address;
|
|
1456
|
-
return apiConfig.httpClient.post(
|
|
1457
|
-
`/v1/stores/${target_store_id}/orders/quote`,
|
|
1458
|
-
{
|
|
1459
|
-
...rest,
|
|
1460
|
-
items: normalizeOrderQuoteItems(items),
|
|
1461
|
-
shipping_address,
|
|
1462
|
-
market: rest.market || apiConfig.market
|
|
1463
|
-
},
|
|
1464
|
-
options
|
|
1465
|
-
);
|
|
1466
|
-
},
|
|
1467
|
-
async getOrderAvailability(params, options) {
|
|
1468
|
-
const { store_id, ...queryParams } = params;
|
|
1469
|
-
const target_store_id = store_id || apiConfig.storeId;
|
|
1470
|
-
return apiConfig.httpClient.get(
|
|
1471
|
-
`/v1/stores/${target_store_id}/orders/availability`,
|
|
1472
|
-
{ ...options, params: queryParams }
|
|
1473
|
-
);
|
|
1474
|
-
},
|
|
1475
|
-
async processRefund(params, options) {
|
|
1476
|
-
return apiConfig.httpClient.post(
|
|
1477
|
-
`/v1/stores/${apiConfig.storeId}/orders/${params.id}/refund`,
|
|
1478
|
-
{ amount: params.amount },
|
|
1479
|
-
options
|
|
1480
|
-
);
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
};
|
|
1484
|
-
|
|
1485
|
-
// src/api/scheduling.ts
|
|
1486
|
-
var normalizeTaxonomyAliases2 = (payload) => {
|
|
1487
|
-
const { filters, ...rest } = payload;
|
|
1488
|
-
return {
|
|
1489
|
-
...rest,
|
|
1490
|
-
...!rest.taxonomies && filters ? { taxonomies: filters } : {}
|
|
1491
|
-
};
|
|
1492
|
-
};
|
|
1493
|
-
var createSchedulingApi = (apiConfig) => {
|
|
1494
|
-
return {
|
|
1495
1384
|
async createService(params, options) {
|
|
1496
1385
|
const { store_id, ...payload } = params;
|
|
1497
1386
|
const target_store_id = store_id || apiConfig.storeId;
|
|
1498
1387
|
return apiConfig.httpClient.post(
|
|
1499
1388
|
`/v1/stores/${target_store_id}/services`,
|
|
1500
|
-
|
|
1389
|
+
normalizeTaxonomyAliases(payload),
|
|
1501
1390
|
options
|
|
1502
1391
|
);
|
|
1503
1392
|
},
|
|
@@ -1506,7 +1395,7 @@ var createSchedulingApi = (apiConfig) => {
|
|
|
1506
1395
|
const target_store_id = store_id || apiConfig.storeId;
|
|
1507
1396
|
return apiConfig.httpClient.put(
|
|
1508
1397
|
`/v1/stores/${target_store_id}/services/${params.id}`,
|
|
1509
|
-
|
|
1398
|
+
normalizeTaxonomyAliases(payload),
|
|
1510
1399
|
options
|
|
1511
1400
|
);
|
|
1512
1401
|
},
|
|
@@ -1543,12 +1432,20 @@ var createSchedulingApi = (apiConfig) => {
|
|
|
1543
1432
|
}
|
|
1544
1433
|
);
|
|
1545
1434
|
},
|
|
1435
|
+
async getServiceAvailability(params, options) {
|
|
1436
|
+
const { store_id, ...queryParams } = params;
|
|
1437
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1438
|
+
return apiConfig.httpClient.get(
|
|
1439
|
+
`/v1/stores/${target_store_id}/services/availability`,
|
|
1440
|
+
{ ...options, params: queryParams }
|
|
1441
|
+
);
|
|
1442
|
+
},
|
|
1546
1443
|
async createProvider(params, options) {
|
|
1547
1444
|
const { store_id, ...payload } = params;
|
|
1548
1445
|
const target_store_id = store_id || apiConfig.storeId;
|
|
1549
1446
|
return apiConfig.httpClient.post(
|
|
1550
1447
|
`/v1/stores/${target_store_id}/providers`,
|
|
1551
|
-
|
|
1448
|
+
normalizeTaxonomyAliases(payload),
|
|
1552
1449
|
options
|
|
1553
1450
|
);
|
|
1554
1451
|
},
|
|
@@ -1557,7 +1454,7 @@ var createSchedulingApi = (apiConfig) => {
|
|
|
1557
1454
|
const target_store_id = store_id || apiConfig.storeId;
|
|
1558
1455
|
return apiConfig.httpClient.put(
|
|
1559
1456
|
`/v1/stores/${target_store_id}/providers/${params.id}`,
|
|
1560
|
-
|
|
1457
|
+
normalizeTaxonomyAliases(payload),
|
|
1561
1458
|
options
|
|
1562
1459
|
);
|
|
1563
1460
|
},
|
|
@@ -1626,6 +1523,96 @@ var createSchedulingApi = (apiConfig) => {
|
|
|
1626
1523
|
`/v1/stores/${target_store_id}/service-providers/${params.id}`,
|
|
1627
1524
|
options
|
|
1628
1525
|
);
|
|
1526
|
+
},
|
|
1527
|
+
async createOrder(params, options) {
|
|
1528
|
+
const { store_id, items, ...rest } = params;
|
|
1529
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1530
|
+
const payload = {
|
|
1531
|
+
...rest,
|
|
1532
|
+
market: rest.market || apiConfig.market,
|
|
1533
|
+
items: normalizeOrderCheckoutItems(items)
|
|
1534
|
+
};
|
|
1535
|
+
return apiConfig.httpClient.post(
|
|
1536
|
+
`/v1/stores/${target_store_id}/orders`,
|
|
1537
|
+
payload,
|
|
1538
|
+
options
|
|
1539
|
+
);
|
|
1540
|
+
},
|
|
1541
|
+
async checkoutOrder(params, options) {
|
|
1542
|
+
const { store_id, items, ...rest } = params;
|
|
1543
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1544
|
+
const payload = {
|
|
1545
|
+
...rest,
|
|
1546
|
+
store_id: target_store_id,
|
|
1547
|
+
market: rest.market || apiConfig.market,
|
|
1548
|
+
items: normalizeOrderCheckoutItems(items)
|
|
1549
|
+
};
|
|
1550
|
+
return apiConfig.httpClient.post(
|
|
1551
|
+
`/v1/stores/${target_store_id}/orders/checkout`,
|
|
1552
|
+
payload,
|
|
1553
|
+
options
|
|
1554
|
+
);
|
|
1555
|
+
},
|
|
1556
|
+
async updateOrder(params, options) {
|
|
1557
|
+
const { store_id, items, ...rest } = params;
|
|
1558
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1559
|
+
const payload = {
|
|
1560
|
+
...rest,
|
|
1561
|
+
...items ? { items: normalizeOrderCheckoutItems(items) } : {}
|
|
1562
|
+
};
|
|
1563
|
+
return apiConfig.httpClient.put(
|
|
1564
|
+
`/v1/stores/${target_store_id}/orders/${params.id}`,
|
|
1565
|
+
payload,
|
|
1566
|
+
options
|
|
1567
|
+
);
|
|
1568
|
+
},
|
|
1569
|
+
async getOrder(params, options) {
|
|
1570
|
+
const target_store_id = params.store_id || apiConfig.storeId;
|
|
1571
|
+
return apiConfig.httpClient.get(
|
|
1572
|
+
`/v1/stores/${target_store_id}/orders/${params.id}`,
|
|
1573
|
+
options
|
|
1574
|
+
);
|
|
1575
|
+
},
|
|
1576
|
+
async getOrders(params, options) {
|
|
1577
|
+
const { store_id, ...queryParams } = params;
|
|
1578
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1579
|
+
return apiConfig.httpClient.get(
|
|
1580
|
+
`/v1/stores/${target_store_id}/orders`,
|
|
1581
|
+
{
|
|
1582
|
+
...options,
|
|
1583
|
+
params: queryParams
|
|
1584
|
+
}
|
|
1585
|
+
);
|
|
1586
|
+
},
|
|
1587
|
+
async getQuote(params, options) {
|
|
1588
|
+
const { location, store_id, items, ...rest } = params;
|
|
1589
|
+
const target_store_id = store_id || apiConfig.storeId;
|
|
1590
|
+
const shipping_address = location ? {
|
|
1591
|
+
country: location.country || "",
|
|
1592
|
+
state: location.state || "",
|
|
1593
|
+
city: location.city || "",
|
|
1594
|
+
postal_code: location.postal_code || "",
|
|
1595
|
+
name: "",
|
|
1596
|
+
street1: "",
|
|
1597
|
+
street2: null
|
|
1598
|
+
} : rest.shipping_address;
|
|
1599
|
+
return apiConfig.httpClient.post(
|
|
1600
|
+
`/v1/stores/${target_store_id}/orders/quote`,
|
|
1601
|
+
{
|
|
1602
|
+
...rest,
|
|
1603
|
+
items: normalizeOrderQuoteItems(items),
|
|
1604
|
+
shipping_address,
|
|
1605
|
+
market: rest.market || apiConfig.market
|
|
1606
|
+
},
|
|
1607
|
+
options
|
|
1608
|
+
);
|
|
1609
|
+
},
|
|
1610
|
+
async processRefund(params, options) {
|
|
1611
|
+
return apiConfig.httpClient.post(
|
|
1612
|
+
`/v1/stores/${apiConfig.storeId}/orders/${params.id}/refund`,
|
|
1613
|
+
{ amount: params.amount },
|
|
1614
|
+
options
|
|
1615
|
+
);
|
|
1629
1616
|
}
|
|
1630
1617
|
};
|
|
1631
1618
|
};
|
|
@@ -1728,7 +1715,7 @@ var createActivityAdminApi = (apiConfig) => ({
|
|
|
1728
1715
|
);
|
|
1729
1716
|
},
|
|
1730
1717
|
async find(params, options) {
|
|
1731
|
-
const store_id = apiConfig.storeId;
|
|
1718
|
+
const store_id = params.store_id || apiConfig.storeId;
|
|
1732
1719
|
const queryParams = {};
|
|
1733
1720
|
if (params.customer_id) queryParams.customer_id = params.customer_id;
|
|
1734
1721
|
if (params.types && params.types.length > 0) queryParams.types = params.types;
|
|
@@ -1764,6 +1751,8 @@ var createCustomerApi = (apiConfig) => {
|
|
|
1764
1751
|
if (params?.limit !== void 0) queryParams.limit = params.limit;
|
|
1765
1752
|
if (params?.cursor) queryParams.cursor = params.cursor;
|
|
1766
1753
|
if (params?.query) queryParams.query = params.query;
|
|
1754
|
+
if (params?.taxonomy_query) queryParams.taxonomy_query = params.taxonomy_query;
|
|
1755
|
+
if (params?.status) queryParams.status = params.status;
|
|
1767
1756
|
if (params?.sort_field) queryParams.sort_field = params.sort_field;
|
|
1768
1757
|
if (params?.sort_direction) queryParams.sort_direction = params.sort_direction;
|
|
1769
1758
|
return apiConfig.httpClient.get(
|
|
@@ -2719,7 +2708,6 @@ function createAdmin(config) {
|
|
|
2719
2708
|
const platformApi = createPlatformApi(apiConfig);
|
|
2720
2709
|
const cmsApi = createCmsApi(apiConfig);
|
|
2721
2710
|
const eshopApi = createEshopApi(apiConfig);
|
|
2722
|
-
const schedulingApi = createSchedulingApi(apiConfig);
|
|
2723
2711
|
const promoCodeApi = createPromoCodeApi(apiConfig);
|
|
2724
2712
|
const crmApi = createCustomerApi(apiConfig);
|
|
2725
2713
|
const locationApi = createLocationApi(apiConfig);
|
|
@@ -2794,26 +2782,26 @@ function createAdmin(config) {
|
|
|
2794
2782
|
find: eshopApi.getOrders,
|
|
2795
2783
|
getQuote: eshopApi.getQuote,
|
|
2796
2784
|
checkout: eshopApi.checkoutOrder,
|
|
2797
|
-
getAvailability: eshopApi.getOrderAvailability,
|
|
2798
2785
|
processRefund: eshopApi.processRefund
|
|
2799
2786
|
},
|
|
2800
2787
|
service: {
|
|
2801
|
-
create:
|
|
2802
|
-
update:
|
|
2803
|
-
delete:
|
|
2804
|
-
get:
|
|
2805
|
-
find:
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2788
|
+
create: eshopApi.createService,
|
|
2789
|
+
update: eshopApi.updateService,
|
|
2790
|
+
delete: eshopApi.deleteService,
|
|
2791
|
+
get: eshopApi.getService,
|
|
2792
|
+
find: eshopApi.getServices,
|
|
2793
|
+
getAvailability: eshopApi.getServiceAvailability,
|
|
2794
|
+
findProviders: eshopApi.findServiceProviders,
|
|
2795
|
+
createProvider: eshopApi.createServiceProvider,
|
|
2796
|
+
updateProvider: eshopApi.updateServiceProvider,
|
|
2797
|
+
deleteProvider: eshopApi.deleteServiceProvider
|
|
2810
2798
|
},
|
|
2811
2799
|
provider: {
|
|
2812
|
-
create:
|
|
2813
|
-
update:
|
|
2814
|
-
delete:
|
|
2815
|
-
get:
|
|
2816
|
-
find:
|
|
2800
|
+
create: eshopApi.createProvider,
|
|
2801
|
+
update: eshopApi.updateProvider,
|
|
2802
|
+
delete: eshopApi.deleteProvider,
|
|
2803
|
+
get: eshopApi.getProvider,
|
|
2804
|
+
find: eshopApi.getProviders
|
|
2817
2805
|
},
|
|
2818
2806
|
promoCode: promoCodeApi
|
|
2819
2807
|
},
|