arky-sdk 0.3.120 → 0.3.121
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 +23 -56
- 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 +23 -56
- 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 +76 -116
- package/dist/types.d.ts +76 -116
- 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
|
}
|