arky-sdk 0.3.120 → 0.3.122
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 +25 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -13
- package/dist/index.d.ts +9 -13
- package/dist/index.js +25 -80
- package/dist/index.js.map +1 -1
- package/dist/types.cjs +21 -30
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +113 -145
- package/dist/types.d.ts +113 -145
- package/dist/types.js +21 -29
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -729,31 +729,30 @@ var getImageUrl = (imageBlock, isBlock = true) => {
|
|
|
729
729
|
// src/api/cms.ts
|
|
730
730
|
var createCmsApi = (apiConfig) => {
|
|
731
731
|
return {
|
|
732
|
-
|
|
733
|
-
async createCollection(params, options) {
|
|
732
|
+
async createNode(params, options) {
|
|
734
733
|
return apiConfig.httpClient.post(
|
|
735
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
734
|
+
`/v1/businesses/${apiConfig.businessId}/nodes`,
|
|
736
735
|
params,
|
|
737
736
|
options
|
|
738
737
|
);
|
|
739
738
|
},
|
|
740
|
-
async
|
|
739
|
+
async updateNode(params, options) {
|
|
741
740
|
return apiConfig.httpClient.put(
|
|
742
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
741
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
|
|
743
742
|
params,
|
|
744
743
|
options
|
|
745
744
|
);
|
|
746
745
|
},
|
|
747
|
-
async
|
|
746
|
+
async deleteNode(params, options) {
|
|
748
747
|
return apiConfig.httpClient.delete(
|
|
749
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
748
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
|
|
750
749
|
options
|
|
751
750
|
);
|
|
752
751
|
},
|
|
753
|
-
async
|
|
752
|
+
async getNode(params, options) {
|
|
754
753
|
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
755
754
|
const response = await apiConfig.httpClient.get(
|
|
756
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
755
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${formattedId}`,
|
|
757
756
|
options
|
|
758
757
|
);
|
|
759
758
|
return {
|
|
@@ -770,86 +769,54 @@ var createCmsApi = (apiConfig) => {
|
|
|
770
769
|
}
|
|
771
770
|
};
|
|
772
771
|
},
|
|
773
|
-
async
|
|
772
|
+
async getNodes(params, options) {
|
|
774
773
|
return apiConfig.httpClient.get(
|
|
775
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
774
|
+
`/v1/businesses/${apiConfig.businessId}/nodes`,
|
|
776
775
|
{
|
|
777
776
|
...options,
|
|
778
777
|
params
|
|
779
778
|
}
|
|
780
779
|
);
|
|
781
780
|
},
|
|
782
|
-
async
|
|
783
|
-
|
|
784
|
-
`/v1/businesses/${apiConfig.businessId}/collections/blocks/generate`,
|
|
785
|
-
params,
|
|
786
|
-
options
|
|
787
|
-
);
|
|
788
|
-
},
|
|
789
|
-
// ===== ENTRIES =====
|
|
790
|
-
async getCollectionEntries(params, options) {
|
|
791
|
-
const { collectionId, ...queryParams } = params;
|
|
781
|
+
async getNodeChildren(params, options) {
|
|
782
|
+
const { id, ...queryParams } = params;
|
|
792
783
|
return apiConfig.httpClient.get(
|
|
793
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
784
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${id}/children`,
|
|
794
785
|
{
|
|
795
786
|
...options,
|
|
796
787
|
params: queryParams
|
|
797
788
|
}
|
|
798
789
|
);
|
|
799
790
|
},
|
|
800
|
-
async
|
|
801
|
-
const { collectionId, ...payload } = params;
|
|
791
|
+
async generateBlocks(params, options) {
|
|
802
792
|
return apiConfig.httpClient.post(
|
|
803
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
804
|
-
|
|
805
|
-
options
|
|
806
|
-
);
|
|
807
|
-
},
|
|
808
|
-
async updateCollectionEntry(params, options) {
|
|
809
|
-
const { collectionId, id, ...payload } = params;
|
|
810
|
-
return apiConfig.httpClient.put(
|
|
811
|
-
`/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${id}`,
|
|
812
|
-
{ ...payload, collectionId },
|
|
813
|
-
options
|
|
814
|
-
);
|
|
815
|
-
},
|
|
816
|
-
async deleteCollectionEntry(params, options) {
|
|
817
|
-
return apiConfig.httpClient.delete(
|
|
818
|
-
`/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${params.id}`,
|
|
819
|
-
options
|
|
820
|
-
);
|
|
821
|
-
},
|
|
822
|
-
async getCollectionEntry(params, options) {
|
|
823
|
-
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
824
|
-
return apiConfig.httpClient.get(
|
|
825
|
-
`/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${formattedId}`,
|
|
793
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/blocks/generate`,
|
|
794
|
+
params,
|
|
826
795
|
options
|
|
827
796
|
);
|
|
828
797
|
},
|
|
829
|
-
async
|
|
830
|
-
const {
|
|
798
|
+
async sendNode(params, options) {
|
|
799
|
+
const { nodeId, scheduledAt } = params;
|
|
831
800
|
return apiConfig.httpClient.post(
|
|
832
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
801
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${nodeId}/send`,
|
|
833
802
|
{
|
|
834
803
|
businessId: apiConfig.businessId,
|
|
835
|
-
|
|
804
|
+
nodeId,
|
|
836
805
|
scheduledAt: scheduledAt ?? Math.floor(Date.now() / 1e3)
|
|
837
806
|
},
|
|
838
807
|
options
|
|
839
808
|
);
|
|
840
809
|
},
|
|
841
|
-
// ===== VARIABLES / METADATA =====
|
|
842
810
|
async getVariableMetadata(params, options) {
|
|
843
811
|
return apiConfig.httpClient.get(
|
|
844
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
812
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/types/${params.nodeType}/variables`,
|
|
845
813
|
options
|
|
846
814
|
);
|
|
847
815
|
},
|
|
848
|
-
|
|
849
|
-
async getCollectionSubscribers(params, options) {
|
|
816
|
+
async getNodeSubscribers(params, options) {
|
|
850
817
|
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
851
818
|
return apiConfig.httpClient.get(
|
|
852
|
-
`/v1/businesses/${apiConfig.businessId}/
|
|
819
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${formattedId}/subscribers`,
|
|
853
820
|
options
|
|
854
821
|
);
|
|
855
822
|
}
|
|
@@ -882,21 +849,10 @@ var createEshopApi = (apiConfig) => {
|
|
|
882
849
|
},
|
|
883
850
|
async getProduct(params, options) {
|
|
884
851
|
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
885
|
-
|
|
852
|
+
return apiConfig.httpClient.get(
|
|
886
853
|
`/v1/businesses/${apiConfig.businessId}/products/${formattedId}`,
|
|
887
854
|
options
|
|
888
855
|
);
|
|
889
|
-
return {
|
|
890
|
-
...response,
|
|
891
|
-
getName() {
|
|
892
|
-
const locale = apiConfig.locale;
|
|
893
|
-
return response.name?.[locale] || response.name?.en || response.name || "";
|
|
894
|
-
},
|
|
895
|
-
getDescription() {
|
|
896
|
-
const locale = apiConfig.locale;
|
|
897
|
-
return response.description?.[locale] || response.description?.en || response.description || "";
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
856
|
},
|
|
901
857
|
async getProducts(params, options) {
|
|
902
858
|
return apiConfig.httpClient.get(
|
|
@@ -1076,21 +1032,10 @@ var createReservationApi = (apiConfig) => {
|
|
|
1076
1032
|
},
|
|
1077
1033
|
async getService(params, options) {
|
|
1078
1034
|
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
1079
|
-
|
|
1035
|
+
return apiConfig.httpClient.get(
|
|
1080
1036
|
`/v1/businesses/${apiConfig.businessId}/services/${formattedId}`,
|
|
1081
1037
|
options
|
|
1082
1038
|
);
|
|
1083
|
-
return {
|
|
1084
|
-
...response,
|
|
1085
|
-
getName() {
|
|
1086
|
-
const locale = apiConfig.locale;
|
|
1087
|
-
return response.name?.[locale] || response.name?.en || response.name || "";
|
|
1088
|
-
},
|
|
1089
|
-
getDescription() {
|
|
1090
|
-
const locale = apiConfig.locale;
|
|
1091
|
-
return response.description?.[locale] || response.description?.en || response.description || "";
|
|
1092
|
-
}
|
|
1093
|
-
};
|
|
1094
1039
|
},
|
|
1095
1040
|
async getServices(params, options) {
|
|
1096
1041
|
return apiConfig.httpClient.get(
|