Skip to content

Commit 7e2bd11

Browse files
committed
Site.deleteWebsite and Draft.deleteCirculation methods
1 parent a4fe37b commit 7e2bd11

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @code.store/arcxp-sdk-ts
22

3+
## 5.2.0
4+
5+
### Minor Changes
6+
7+
- Site.deleteWebsite and Draft.deleteCirculation methods
8+
39
## 5.1.8
410

511
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code.store/arcxp-sdk-ts",
3-
"version": "5.1.8",
3+
"version": "5.2.0",
44
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
55
"type": "module",
66
"main": "./dist/index.js",

src/api/draft/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ANS } from '../../types/index.js';
1+
import type { ANS, CirculationReference } from '../../types/index.js';
22
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';
33
import type {
44
Circulations,
@@ -58,6 +58,12 @@ export class ArcDraft extends ArcAbstractAPI {
5858
return data;
5959
}
6060

61+
async deleteCirculation(id: string, website: string, type = 'story') {
62+
const { data } = await this.client.delete<CirculationReference>(`/${type}/${id}/circulation/${website}`);
63+
64+
return data;
65+
}
66+
6167
async getRevisions(id: string, type = 'story', after?: string) {
6268
const { data } = await this.client.get<Revisions>(`/${type}/${id}/revision`, { params: { after } });
6369
return data;

src/api/site/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ export class ArcSite extends ArcAbstractAPI {
4545
return data;
4646
}
4747

48+
async deleteWebsite(website: string) {
49+
const { data } = await this.client.delete<Website>(`/website/${website}`);
50+
51+
return data;
52+
}
53+
4854
async putLink(link: Link) {
4955
const { data } = await this.client.put<Link>(`/website/${link._website}/link/${link._id}`, link);
5056

0 commit comments

Comments
 (0)