arky-sdk 0.7.66 → 0.7.67
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 +50 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -2
- package/dist/index.d.ts +57 -2
- package/dist/index.js +50 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1903,6 +1903,49 @@ var createTaxonomyApi = (apiConfig) => {
|
|
|
1903
1903
|
};
|
|
1904
1904
|
};
|
|
1905
1905
|
|
|
1906
|
+
// src/api/analytics.ts
|
|
1907
|
+
var createAnalyticsApi = (apiConfig) => {
|
|
1908
|
+
return {
|
|
1909
|
+
async getSummary(params, options) {
|
|
1910
|
+
return apiConfig.httpClient.get(
|
|
1911
|
+
`/v1/businesses/${apiConfig.businessId}/analytics/summary`,
|
|
1912
|
+
{
|
|
1913
|
+
...options,
|
|
1914
|
+
params: params || {}
|
|
1915
|
+
}
|
|
1916
|
+
);
|
|
1917
|
+
},
|
|
1918
|
+
async getSeries(params, options) {
|
|
1919
|
+
const { metrics, ...rest } = params;
|
|
1920
|
+
return apiConfig.httpClient.get(
|
|
1921
|
+
`/v1/businesses/${apiConfig.businessId}/analytics/series`,
|
|
1922
|
+
{
|
|
1923
|
+
...options,
|
|
1924
|
+
params: { ...rest, metrics: metrics.join(",") }
|
|
1925
|
+
}
|
|
1926
|
+
);
|
|
1927
|
+
},
|
|
1928
|
+
async getTopEntities(params, options) {
|
|
1929
|
+
return apiConfig.httpClient.get(
|
|
1930
|
+
`/v1/businesses/${apiConfig.businessId}/analytics/top`,
|
|
1931
|
+
{
|
|
1932
|
+
...options,
|
|
1933
|
+
params
|
|
1934
|
+
}
|
|
1935
|
+
);
|
|
1936
|
+
},
|
|
1937
|
+
async getStatusBreakdown(params, options) {
|
|
1938
|
+
return apiConfig.httpClient.get(
|
|
1939
|
+
`/v1/businesses/${apiConfig.businessId}/analytics/status`,
|
|
1940
|
+
{
|
|
1941
|
+
...options,
|
|
1942
|
+
params
|
|
1943
|
+
}
|
|
1944
|
+
);
|
|
1945
|
+
}
|
|
1946
|
+
};
|
|
1947
|
+
};
|
|
1948
|
+
|
|
1906
1949
|
// src/api/storefront.ts
|
|
1907
1950
|
function groupCartToItems(cart) {
|
|
1908
1951
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -2749,7 +2792,7 @@ function getFirstAvailableFCId(variant, quantity = 1) {
|
|
|
2749
2792
|
}
|
|
2750
2793
|
|
|
2751
2794
|
// src/index.ts
|
|
2752
|
-
var SDK_VERSION = "0.7.
|
|
2795
|
+
var SDK_VERSION = "0.7.67";
|
|
2753
2796
|
var SUPPORTED_FRAMEWORKS = [
|
|
2754
2797
|
"astro",
|
|
2755
2798
|
"react",
|
|
@@ -2840,6 +2883,7 @@ async function createAdmin(config) {
|
|
|
2840
2883
|
const formApi = createFormApi(apiConfig);
|
|
2841
2884
|
const taxonomyApi = createTaxonomyApi(apiConfig);
|
|
2842
2885
|
const emailTemplateApi = createEmailTemplateApi(apiConfig);
|
|
2886
|
+
const analyticsApi = createAnalyticsApi(apiConfig);
|
|
2843
2887
|
const sdk = {
|
|
2844
2888
|
auth: authApi,
|
|
2845
2889
|
account: accountApi,
|
|
@@ -2986,7 +3030,11 @@ async function createAdmin(config) {
|
|
|
2986
3030
|
}
|
|
2987
3031
|
},
|
|
2988
3032
|
analytics: {
|
|
2989
|
-
track
|
|
3033
|
+
track,
|
|
3034
|
+
getSummary: analyticsApi.getSummary,
|
|
3035
|
+
getSeries: analyticsApi.getSeries,
|
|
3036
|
+
getTopEntities: analyticsApi.getTopEntities,
|
|
3037
|
+
getStatusBreakdown: analyticsApi.getStatusBreakdown
|
|
2990
3038
|
},
|
|
2991
3039
|
setBusinessId: (businessId) => {
|
|
2992
3040
|
apiConfig.businessId = businessId;
|