@curviate/sdk 0.41.0 → 0.42.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.
- package/CHANGELOG.md +30 -0
- package/README.md +25 -1
- package/dist/index.d.ts +1362 -28
- package/dist/index.js +175 -3
- package/package.json +1 -1
- package/src/generated/types.ts +1240 -84
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,36 @@ Versioning: semantic. Minor for additive changes, patch for bug fixes; no stabil
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.42.0] - 2026-10-07
|
|
13
|
+
|
|
14
|
+
Fixture and types regenerated from the server integration branch (134 paths,
|
|
15
|
+
server `b1c443c6a3a0e1c2a09944be39f01c6921fca46c`), **not** from a deployed
|
|
16
|
+
document: regenerate from deployed staging and confirm an empty diff before
|
|
17
|
+
publishing.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **`drafts` resource** (root-scoped, 7 methods): `create`, `list`, `get`,
|
|
22
|
+
`update`, `delete`, `publish`, `uploadAttachment`. A Draft is a stored,
|
|
23
|
+
editable post that Curviate publishes at `scheduled_at` (ISO 8601 with
|
|
24
|
+
offset, passed through unchanged). `list` takes `status` as an array and
|
|
25
|
+
sends it as the API's comma list; `status: ["published"]` returns publish
|
|
26
|
+
records. `uploadAttachment(id, data, { filename, contentType })` sends a
|
|
27
|
+
file (an MP4 video or PDF up to 50 MiB; an image is capped at 5 MiB) as the raw request body.
|
|
28
|
+
`delete` resolves with `undefined` (204). (`posts.delete` and `comments.delete`
|
|
29
|
+
still hand back the transport's empty buffer under a `void` type; unchanged here.)
|
|
30
|
+
- **Six new error codes** decode to themselves instead of `INTERNAL`:
|
|
31
|
+
`DRAFT_LIMIT_REACHED`, `MEDIA_QUOTA_EXCEEDED`, `ACCOUNT_REQUIRED`,
|
|
32
|
+
`DRAFT_NOT_PUBLISHABLE`, `SCHEDULE_CONFLICT`, `DRAFT_PUBLISHING`.
|
|
33
|
+
- **`post.published` and `post.publish_failed` webhook events** join
|
|
34
|
+
`CurviateEvent` (`PostPublishedPayload`, `PostPublishFailedPayload`).
|
|
35
|
+
Payloads carry ids and times, never post text or media.
|
|
36
|
+
- `Draft*` request and result types are exported.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- The webhook `source` enum includes `post`, from the regenerated types.
|
|
41
|
+
|
|
12
42
|
## [0.41.0] - 2026-10-03
|
|
13
43
|
|
|
14
44
|
Fixture and types regenerated against the deployed staging document
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ await curviate.auth.intent({ seat_id, auth_method: "credentials", credentials: {
|
|
|
46
46
|
The `curviate.account(id)` accessor fixes the `account_id` on every call so you do not have to thread it manually:
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
|
-
// Root-level: tenant-wide operations (accounts, auth, webhooks)
|
|
49
|
+
// Root-level: tenant-wide operations (accounts, auth, webhooks, drafts)
|
|
50
50
|
const { items: accounts } = await curviate.accounts.list();
|
|
51
51
|
|
|
52
52
|
// Account-scoped: all LinkedIn ops under a specific account
|
|
@@ -58,6 +58,30 @@ const me = await acc.users.get("me"); // your own profile
|
|
|
58
58
|
const profile = await acc.users.get("some-user-id"); // someone else's
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
## Drafts and scheduled posts
|
|
62
|
+
|
|
63
|
+
A Draft is a stored, editable, unpublished post. Give it an account and a `scheduled_at` and Curviate publishes it at that time. Drafts are tenant-wide, so `drafts` hangs off the root client (a Draft's `account_id` is a field, and optional). `acc.posts.create()` still publishes immediately and does not schedule.
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const draft = await curviate.drafts.create({
|
|
67
|
+
account_id: "acc_...",
|
|
68
|
+
text: "Three things we learned shipping our first agent integration.",
|
|
69
|
+
scheduled_at: "2026-10-12T09:00:00+02:00", // ISO 8601 with offset; 5 min to 365 days ahead
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// A video or PDF (up to 50 MiB) goes up as the raw body; images (up to 5 MiB) can ride inline as base64.
|
|
73
|
+
await curviate.drafts.uploadAttachment(draft.id, await readFile("clip.mp4"), {
|
|
74
|
+
filename: "clip.mp4",
|
|
75
|
+
contentType: "video/mp4",
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
await curviate.drafts.update(draft.id, { scheduled_at: null }); // unschedule
|
|
79
|
+
const { id: postId } = await curviate.drafts.publish(draft.id); // or publish now
|
|
80
|
+
const { items } = await curviate.drafts.list({ status: ["scheduled", "published"] });
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Refusals carry their own codes: `DRAFT_LIMIT_REACHED`, `MEDIA_QUOTA_EXCEEDED`, `ACCOUNT_REQUIRED`, `DRAFT_NOT_PUBLISHABLE`, `SCHEDULE_CONFLICT` and `DRAFT_PUBLISHING`. A scheduled publish that fails raises the `post.publish_failed` webhook (`post.published` on success); a `failure_code` of `outcome_unknown` means the post may be live, so check the account's posts before retrying.
|
|
84
|
+
|
|
61
85
|
---
|
|
62
86
|
|
|
63
87
|
## First end-to-end call
|