arky-sdk 0.3.119 → 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
@@ -24,7 +24,6 @@ var convertServerErrorToRequestError = (serverError, renameRules) => {
24
24
 
25
25
  // src/utils/queryParams.ts
26
26
  function buildQueryString(params) {
27
- console.log("buildQueryString input:", params);
28
27
  const queryParts = [];
29
28
  Object.entries(params).forEach(([key, value]) => {
30
29
  if (value === null || value === void 0) {
@@ -42,9 +41,7 @@ function buildQueryString(params) {
42
41
  queryParts.push(`${key}=${encodeURIComponent(jsonString)}`);
43
42
  }
44
43
  });
45
- const result = queryParts.length > 0 ? `?${queryParts.join("&")}` : "";
46
- console.log("buildQueryString output:", result);
47
- return result;
44
+ return queryParts.length > 0 ? `?${queryParts.join("&")}` : "";
48
45
  }
49
46
 
50
47
  // src/services/createHttpClient.ts
@@ -732,31 +729,30 @@ var getImageUrl = (imageBlock, isBlock = true) => {
732
729
  // src/api/cms.ts
733
730
  var createCmsApi = (apiConfig) => {
734
731
  return {
735
- // ===== COLLECTIONS =====
736
- async createCollection(params, options) {
732
+ async createNode(params, options) {
737
733
  return apiConfig.httpClient.post(
738
- `/v1/businesses/${apiConfig.businessId}/collections`,
734
+ `/v1/businesses/${apiConfig.businessId}/nodes`,
739
735
  params,
740
736
  options
741
737
  );
742
738
  },
743
- async updateCollection(params, options) {
739
+ async updateNode(params, options) {
744
740
  return apiConfig.httpClient.put(
745
- `/v1/businesses/${apiConfig.businessId}/collections/${params.id}`,
741
+ `/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
746
742
  params,
747
743
  options
748
744
  );
749
745
  },
750
- async deleteCollection(params, options) {
746
+ async deleteNode(params, options) {
751
747
  return apiConfig.httpClient.delete(
752
- `/v1/businesses/${apiConfig.businessId}/collections/${params.id}`,
748
+ `/v1/businesses/${apiConfig.businessId}/nodes/${params.id}`,
753
749
  options
754
750
  );
755
751
  },
756
- async getCollection(params, options) {
752
+ async getNode(params, options) {
757
753
  const formattedId = formatIdOrSlug(params.id, apiConfig);
758
754
  const response = await apiConfig.httpClient.get(
759
- `/v1/businesses/${apiConfig.businessId}/collections/${formattedId}`,
755
+ `/v1/businesses/${apiConfig.businessId}/nodes/${formattedId}`,
760
756
  options
761
757
  );
762
758
  return {
@@ -773,86 +769,54 @@ var createCmsApi = (apiConfig) => {
773
769
  }
774
770
  };
775
771
  },
776
- async getCollections(params, options) {
772
+ async getNodes(params, options) {
777
773
  return apiConfig.httpClient.get(
778
- `/v1/businesses/${apiConfig.businessId}/collections`,
774
+ `/v1/businesses/${apiConfig.businessId}/nodes`,
779
775
  {
780
776
  ...options,
781
777
  params
782
778
  }
783
779
  );
784
780
  },
785
- async generateBlocks(params, options) {
786
- return apiConfig.httpClient.post(
787
- `/v1/businesses/${apiConfig.businessId}/collections/blocks/generate`,
788
- params,
789
- options
790
- );
791
- },
792
- // ===== ENTRIES =====
793
- async getCollectionEntries(params, options) {
794
- const { collectionId, ...queryParams } = params;
781
+ async getNodeChildren(params, options) {
782
+ const { id, ...queryParams } = params;
795
783
  return apiConfig.httpClient.get(
796
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries`,
784
+ `/v1/businesses/${apiConfig.businessId}/nodes/${id}/children`,
797
785
  {
798
786
  ...options,
799
787
  params: queryParams
800
788
  }
801
789
  );
802
790
  },
803
- async createCollectionEntry(params, options) {
804
- const { collectionId, ...payload } = params;
791
+ async generateBlocks(params, options) {
805
792
  return apiConfig.httpClient.post(
806
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries`,
807
- { ...payload, collectionId },
808
- options
809
- );
810
- },
811
- async updateCollectionEntry(params, options) {
812
- const { collectionId, id, ...payload } = params;
813
- return apiConfig.httpClient.put(
814
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${id}`,
815
- { ...payload, collectionId },
816
- options
817
- );
818
- },
819
- async deleteCollectionEntry(params, options) {
820
- return apiConfig.httpClient.delete(
821
- `/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${params.id}`,
822
- options
823
- );
824
- },
825
- async getCollectionEntry(params, options) {
826
- const formattedId = formatIdOrSlug(params.id, apiConfig);
827
- return apiConfig.httpClient.get(
828
- `/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${formattedId}`,
793
+ `/v1/businesses/${apiConfig.businessId}/nodes/blocks/generate`,
794
+ params,
829
795
  options
830
796
  );
831
797
  },
832
- async sendEntry(params, options) {
833
- const { collectionId, entryId, scheduledAt } = params;
798
+ async sendNode(params, options) {
799
+ const { nodeId, scheduledAt } = params;
834
800
  return apiConfig.httpClient.post(
835
- `/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${entryId}/send`,
801
+ `/v1/businesses/${apiConfig.businessId}/nodes/${nodeId}/send`,
836
802
  {
837
803
  businessId: apiConfig.businessId,
838
- entryId,
804
+ nodeId,
839
805
  scheduledAt: scheduledAt ?? Math.floor(Date.now() / 1e3)
840
806
  },
841
807
  options
842
808
  );
843
809
  },
844
- // ===== VARIABLES / METADATA =====
845
810
  async getVariableMetadata(params, options) {
846
811
  return apiConfig.httpClient.get(
847
- `/v1/businesses/${apiConfig.businessId}/collections/types/${params.entryType}/variables`,
812
+ `/v1/businesses/${apiConfig.businessId}/nodes/types/${params.nodeType}/variables`,
848
813
  options
849
814
  );
850
815
  },
851
- // ===== COLLECTION SUBSCRIPTIONS =====
852
- async getCollectionSubscribers(params, options) {
816
+ async getNodeSubscribers(params, options) {
853
817
  const formattedId = formatIdOrSlug(params.id, apiConfig);
854
818
  return apiConfig.httpClient.get(
855
- `/v1/businesses/${apiConfig.businessId}/collections/${formattedId}/subscribers`,
819
+ `/v1/businesses/${apiConfig.businessId}/nodes/${formattedId}/subscribers`,
856
820
  options
857
821
  );
858
822
  }