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 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
- // ===== COLLECTIONS =====
733
- async createCollection(params, options) {
732
+ async createNode(params, options) {
734
733
  return apiConfig.httpClient.post(
735
- `/v1/businesses/${apiConfig.businessId}/collections`,
734
+ `/v1/businesses/${apiConfig.businessId}/nodes`,
736
735
  params,
737
736
  options
738
737
  );
739
738
  },
740
- async updateCollection(params, options) {
739
+ async updateNode(params, options) {
741
740
  return apiConfig.httpClient.put(
742
- `/v1/businesses/${apiConfig.businessId}/collections/${params.id}`,
741
+ `/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
743
742
  params,
744
743
  options
745
744
  );
746
745
  },
747
- async deleteCollection(params, options) {
746
+ async deleteNode(params, options) {
748
747
  return apiConfig.httpClient.delete(
749
- `/v1/businesses/${apiConfig.businessId}/collections/${params.id}`,
748
+ `/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
750
749
  options
751
750
  );
752
751
  },
753
- async getCollection(params, options) {
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}/collections/${formattedId}`,
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 getCollections(params, options) {
772
+ async getNodes(params, options) {
774
773
  return apiConfig.httpClient.get(
775
- `/v1/businesses/${apiConfig.businessId}/collections`,
774
+ `/v1/businesses/${apiConfig.businessId}/nodes`,
776
775
  {
777
776
  ...options,
778
777
  params
779
778
  }
780
779
  );
781
780
  },
782
- async generateBlocks(params, options) {
783
- return apiConfig.httpClient.post(
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}/collections/${collectionId}/entries`,
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 createCollectionEntry(params, options) {
801
- const { collectionId, ...payload } = params;
791
+ async generateBlocks(params, options) {
802
792
  return apiConfig.httpClient.post(
803
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries`,
804
- { ...payload, collectionId },
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 sendEntry(params, options) {
830
- const { collectionId, entryId, scheduledAt } = params;
798
+ async sendNode(params, options) {
799
+ const { nodeId, scheduledAt } = params;
831
800
  return apiConfig.httpClient.post(
832
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${entryId}/send`,
801
+ `/v1/businesses/${apiConfig.businessId}/nodes/${nodeId}/send`,
833
802
  {
834
803
  businessId: apiConfig.businessId,
835
- entryId,
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}/collections/types/${params.entryType}/variables`,
812
+ `/v1/businesses/${apiConfig.businessId}/nodes/types/${params.nodeType}/variables`,
845
813
  options
846
814
  );
847
815
  },
848
- // ===== COLLECTION SUBSCRIPTIONS =====
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}/collections/${formattedId}/subscribers`,
819
+ `/v1/businesses/${apiConfig.businessId}/nodes/${formattedId}/subscribers`,
853
820
  options
854
821
  );
855
822
  }