Skip to content

Commit 27779a6

Browse files
committed
DraftAPI.getCirculations added
1 parent 11f16a6 commit 27779a6

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
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+
## 4.35.0
4+
5+
### Minor Changes
6+
7+
- DraftAPI.getCirculations added
8+
39
## 4.34.1
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": "4.34.1",
3+
"version": "4.35.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": "commonjs",
66
"main": "./dist/index.js",

src/api/draft/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
22
import type {
3+
Circulations,
34
CreateDocumentRedirectPayload,
45
CreateExternalRedirectPayload,
56
CreateRedirectPayload,
@@ -45,6 +46,11 @@ export class ArcDraft extends ArcAbstractAPI {
4546
return data;
4647
}
4748

49+
async getCirculations(id: string, type = 'story', after?: string) {
50+
const { data } = await this.client.get<Circulations>(`/${type}/${id}/circulation`, { params: { after } });
51+
return data;
52+
}
53+
4854
async createRedirect<
4955
P extends CreateRedirectPayload,
5056
R = P extends CreateExternalRedirectPayload

src/api/draft/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { AStory } from '../../types/story';
2+
import type { CirculationReference } from '../migration-center/types';
23

34
export type CreateExternalRedirectPayload = {
45
redirect_to: string;
@@ -53,3 +54,8 @@ export type UpdateDraftRevisionPayload = {
5354
ans: AStory;
5455
type: 'DRAFT';
5556
};
57+
58+
export type Circulations = {
59+
circulations: CirculationReference[];
60+
last?: string;
61+
};

0 commit comments

Comments
 (0)