arky-sdk 0.5.21 → 0.5.22
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +19 -19
- package/dist/types.d.ts +19 -19
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +3 -3
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +3 -3
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -409,7 +409,7 @@ var createBusinessApi = (apiConfig) => {
|
|
|
409
409
|
async setupChannelWebhook(params, options) {
|
|
410
410
|
const businessId = params.businessId || apiConfig.businessId;
|
|
411
411
|
return apiConfig.httpClient.post(
|
|
412
|
-
`/v1/businesses/${businessId}/channels/${params.
|
|
412
|
+
`/v1/businesses/${businessId}/channels/${params.integrationId}/webhook`,
|
|
413
413
|
{ webhookBaseUrl: params.webhookBaseUrl },
|
|
414
414
|
options
|
|
415
415
|
);
|
|
@@ -1312,8 +1312,8 @@ var createPlatformApi = (apiConfig) => {
|
|
|
1312
1312
|
async getCurrencies(options) {
|
|
1313
1313
|
return apiConfig.httpClient.get("/v1/platform/currencies", options);
|
|
1314
1314
|
},
|
|
1315
|
-
async
|
|
1316
|
-
return apiConfig.httpClient.get("/v1/platform/
|
|
1315
|
+
async getIntegrationServices(options) {
|
|
1316
|
+
return apiConfig.httpClient.get("/v1/platform/integration-services", options);
|
|
1317
1317
|
},
|
|
1318
1318
|
async getWebhookEvents(options) {
|
|
1319
1319
|
return apiConfig.httpClient.get("/v1/platform/events", options);
|
|
@@ -1684,15 +1684,15 @@ function getFirstAvailableFCId(variant, quantity = 1) {
|
|
|
1684
1684
|
return inv?.locationId;
|
|
1685
1685
|
}
|
|
1686
1686
|
|
|
1687
|
-
// src/utils/
|
|
1687
|
+
// src/utils/integrations.ts
|
|
1688
1688
|
function getPaymentConfig(configs) {
|
|
1689
1689
|
if (!configs.paymentId) return null;
|
|
1690
|
-
const i = configs.
|
|
1690
|
+
const i = configs.integrations?.find((i2) => i2.id === configs.paymentId);
|
|
1691
1691
|
if (!i || i.provider?.type !== "stripe") return null;
|
|
1692
1692
|
return { publishableKey: i.provider.publishableKey, currency: i.provider.currency };
|
|
1693
1693
|
}
|
|
1694
1694
|
function getAnalyticsConfigs(configs) {
|
|
1695
|
-
return (configs.analyticsIds || []).map((id) => configs.
|
|
1695
|
+
return (configs.analyticsIds || []).map((id) => configs.integrations?.find((i) => i.id === id)).filter((i) => !!i && i.provider?.type === "google_analytics4").map((i) => {
|
|
1696
1696
|
if (i.provider.type === "google_analytics4") {
|
|
1697
1697
|
return { measurementId: i.provider.measurementId };
|
|
1698
1698
|
}
|
|
@@ -1728,8 +1728,8 @@ async function createArkySDK(config) {
|
|
|
1728
1728
|
if (typeof window !== "undefined") {
|
|
1729
1729
|
businessApi.getBusiness({}).then(({ data: business }) => {
|
|
1730
1730
|
const configs = business?.configs || business?.config;
|
|
1731
|
-
if (configs?.
|
|
1732
|
-
for (const i of configs.
|
|
1731
|
+
if (configs?.integrations) {
|
|
1732
|
+
for (const i of configs.integrations) {
|
|
1733
1733
|
if (i.provider?.type === "google_analytics4") {
|
|
1734
1734
|
injectGA4Script(i.provider.measurementId);
|
|
1735
1735
|
}
|