arky-sdk 0.3.67 → 0.3.69
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 +12 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -22
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +6 -6
- package/dist/types.d.ts +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -772,59 +772,49 @@ var createCmsApi = (apiConfig) => {
|
|
|
772
772
|
);
|
|
773
773
|
},
|
|
774
774
|
// ===== ENTRIES =====
|
|
775
|
-
// Note: Backend uses /entries NOT /collections/{id}/entries
|
|
776
775
|
async getCollectionEntries(params, options) {
|
|
777
776
|
const { collectionId, ...queryParams } = params;
|
|
778
|
-
const finalParams = collectionId ? { ...queryParams, owner: `collection:${collectionId}` } : queryParams;
|
|
779
777
|
return apiConfig.httpClient.get(
|
|
780
|
-
`/v1/businesses/${apiConfig.businessId}/entries`,
|
|
778
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries`,
|
|
781
779
|
{
|
|
782
780
|
...options,
|
|
783
|
-
params:
|
|
781
|
+
params: queryParams
|
|
784
782
|
}
|
|
785
783
|
);
|
|
786
784
|
},
|
|
787
785
|
async createCollectionEntry(params, options) {
|
|
788
|
-
const { collectionId,
|
|
789
|
-
const payload = {
|
|
790
|
-
...rest,
|
|
791
|
-
owner: owner || (collectionId ? `collection:${collectionId}` : void 0)
|
|
792
|
-
};
|
|
786
|
+
const { collectionId, ...payload } = params;
|
|
793
787
|
return apiConfig.httpClient.post(
|
|
794
|
-
`/v1/businesses/${apiConfig.businessId}/entries`,
|
|
795
|
-
payload,
|
|
788
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries`,
|
|
789
|
+
{ ...payload, collectionId },
|
|
796
790
|
options
|
|
797
791
|
);
|
|
798
792
|
},
|
|
799
793
|
async updateCollectionEntry(params, options) {
|
|
800
|
-
const {
|
|
801
|
-
const payload = {
|
|
802
|
-
...rest,
|
|
803
|
-
owner: owner || (collectionId ? `collection:${collectionId}` : void 0)
|
|
804
|
-
};
|
|
794
|
+
const { collectionId, id, ...payload } = params;
|
|
805
795
|
return apiConfig.httpClient.put(
|
|
806
|
-
`/v1/businesses/${apiConfig.businessId}/entries/${id}`,
|
|
807
|
-
payload,
|
|
796
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${id}`,
|
|
797
|
+
{ ...payload, collectionId },
|
|
808
798
|
options
|
|
809
799
|
);
|
|
810
800
|
},
|
|
811
801
|
async deleteCollectionEntry(params, options) {
|
|
812
802
|
return apiConfig.httpClient.delete(
|
|
813
|
-
`/v1/businesses/${apiConfig.businessId}/entries/${params.id}`,
|
|
803
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${params.id}`,
|
|
814
804
|
options
|
|
815
805
|
);
|
|
816
806
|
},
|
|
817
807
|
async getCollectionEntry(params, options) {
|
|
818
808
|
const formattedId = formatIdOrSlug(params.id, apiConfig);
|
|
819
809
|
return apiConfig.httpClient.get(
|
|
820
|
-
`/v1/businesses/${apiConfig.businessId}/entries/${formattedId}`,
|
|
810
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${params.collectionId}/entries/${formattedId}`,
|
|
821
811
|
options
|
|
822
812
|
);
|
|
823
813
|
},
|
|
824
814
|
async sendEntry(params, options) {
|
|
825
|
-
const { entryId, scheduledAt } = params;
|
|
815
|
+
const { collectionId, entryId, scheduledAt } = params;
|
|
826
816
|
return apiConfig.httpClient.post(
|
|
827
|
-
`/v1/businesses/${apiConfig.businessId}/entries/${entryId}/send`,
|
|
817
|
+
`/v1/businesses/${apiConfig.businessId}/collections/${collectionId}/entries/${entryId}/send`,
|
|
828
818
|
{
|
|
829
819
|
businessId: apiConfig.businessId,
|
|
830
820
|
entryId,
|