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