@code.store/arcxp-sdk-ts 5.1.7 → 5.2.0

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.
@@ -1,4 +1,4 @@
1
- import type { ANS } from '../../types/index.js';
1
+ import type { ANS, CirculationReference } from '../../types/index.js';
2
2
  import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';
3
3
  import type { Circulations, CreateDocumentRedirectPayload, CreateExternalRedirectPayload, CreateRedirectPayload, Document, DocumentRedirect, ExternalRedirect, Revision, Revisions, UpdateDraftRevisionPayload } from './types.js';
4
4
  export declare class ArcDraft extends ArcAbstractAPI {
@@ -11,9 +11,11 @@ export declare class ArcDraft extends ArcAbstractAPI {
11
11
  getPublishedRevision(id: string, type?: string): Promise<Revision>;
12
12
  getDraftRevision(id: string, type?: string): Promise<Revision>;
13
13
  getCirculations(id: string, type?: string, after?: string): Promise<Circulations>;
14
+ deleteCirculation(id: string, website: string, type?: string): Promise<CirculationReference>;
14
15
  getRevisions(id: string, type?: string, after?: string): Promise<Revisions>;
15
16
  getRevision(id: string, revisionId: string, type?: string): Promise<Revision>;
16
17
  createRedirect<P extends CreateRedirectPayload, R = P extends CreateExternalRedirectPayload ? ExternalRedirect : P extends CreateDocumentRedirectPayload ? DocumentRedirect : never>(website: string, websiteUrl: string, payload: P): Promise<R>;
17
18
  getRedirect(website: string, websiteUrl: string): Promise<DocumentRedirect | ExternalRedirect>;
19
+ deleteRedirect(website: string, websiteUrl: string): Promise<DocumentRedirect | ExternalRedirect>;
18
20
  updateDraftRevision(id: string, payload: UpdateDraftRevisionPayload, type?: string): Promise<Revision>;
19
21
  }
@@ -7,6 +7,7 @@ export declare class ArcSite extends ArcAbstractAPI {
7
7
  deleteSection(id: string, website: string): Promise<void>;
8
8
  putSection(section: SetSectionPayload): Promise<any>;
9
9
  getWebsites(): Promise<Website[]>;
10
+ deleteWebsite(website: string): Promise<Website>;
10
11
  putLink(link: Link): Promise<Link>;
11
12
  deleteLink(id: string, website: string): Promise<any>;
12
13
  getLinks(params: GetLinksParams): Promise<GetLinksResponse>;
package/dist/index.cjs CHANGED
@@ -232,6 +232,10 @@ class ArcDraft extends ArcAbstractAPI {
232
232
  const { data } = await this.client.get(`/${type}/${id}/circulation`, { params: { after } });
233
233
  return data;
234
234
  }
235
+ async deleteCirculation(id, website, type = 'story') {
236
+ const { data } = await this.client.delete(`/${type}/${id}/circulation/${website}`);
237
+ return data;
238
+ }
235
239
  async getRevisions(id, type = 'story', after) {
236
240
  const { data } = await this.client.get(`/${type}/${id}/revision`, { params: { after } });
237
241
  return data;
@@ -248,6 +252,10 @@ class ArcDraft extends ArcAbstractAPI {
248
252
  const { data } = await this.client.get(`/redirect/${website}/${websiteUrl}`);
249
253
  return data;
250
254
  }
255
+ async deleteRedirect(website, websiteUrl) {
256
+ const { data } = await this.client.delete(`/redirect/${website}/${websiteUrl}`);
257
+ return data;
258
+ }
251
259
  async updateDraftRevision(id, payload, type = 'story') {
252
260
  const { data } = await this.client.put(`/${type}/${id}/revision/draft`, payload);
253
261
  return data;
@@ -786,6 +794,10 @@ class ArcSite extends ArcAbstractAPI {
786
794
  const { data } = await this.client.get('/website');
787
795
  return data;
788
796
  }
797
+ async deleteWebsite(website) {
798
+ const { data } = await this.client.delete(`/website/${website}`);
799
+ return data;
800
+ }
789
801
  async putLink(link) {
790
802
  const { data } = await this.client.put(`/website/${link._website}/link/${link._id}`, link);
791
803
  return data;