@awesomate/sdk 0.64.0 → 0.65.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/dist/index.d.ts +33 -10
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* Docs: https://hub.awesomate.ai/docs/sdk/
|
|
27
27
|
*/
|
|
28
28
|
/** This package's version, sent to the hub with every server call. */
|
|
29
|
-
export declare const VERSION = "0.
|
|
29
|
+
export declare const VERSION = "0.65.0";
|
|
30
30
|
/** Augmented by the generated awesomate.d.ts, so each kind's rows are typed. */
|
|
31
31
|
export interface Kinds {
|
|
32
32
|
}
|
|
@@ -1111,16 +1111,13 @@ export declare class AwesomateClient {
|
|
|
1111
1111
|
* Null when there is none (an id that is not one never reaches the hub).
|
|
1112
1112
|
*/
|
|
1113
1113
|
get: (id: string) => Promise<EmailDetail | null>;
|
|
1114
|
-
/**
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1114
|
+
/**
|
|
1115
|
+
* A new draft to list `topic` (a key from `lists()`). `checks.blockers` must be empty before a
|
|
1116
|
+
* person can approve it. `send_at` proposes when it goes (see `EmailDraftInput`).
|
|
1117
|
+
*/
|
|
1118
|
+
draft: (input: EmailDraftInput) => Promise<EmailDraft>;
|
|
1119
1119
|
/** Replace a draft. Once someone approved it, it is refused: a person changes it in the hub. */
|
|
1120
|
-
update: (id: string, input:
|
|
1121
|
-
topic: string;
|
|
1122
|
-
doc: EmailDoc;
|
|
1123
|
-
}) => Promise<EmailDraft>;
|
|
1120
|
+
update: (id: string, input: EmailDraftInput) => Promise<EmailDraft>;
|
|
1124
1121
|
/**
|
|
1125
1122
|
* Throw a draft away. A draft only: an approved, sending or sent email throws `unavailable`
|
|
1126
1123
|
* (server code `not_a_draft`, the case in `reason`). Nothing is deleted: the draft is stopped
|
|
@@ -3637,6 +3634,19 @@ export interface EmailSeriesWrite {
|
|
|
3637
3634
|
pending?: true;
|
|
3638
3635
|
job_id?: string;
|
|
3639
3636
|
}
|
|
3637
|
+
/** What `emails.draft()` and `emails.update()` take. */
|
|
3638
|
+
export interface EmailDraftInput {
|
|
3639
|
+
/** The list's key, from `emails.lists()`. */
|
|
3640
|
+
topic: string;
|
|
3641
|
+
doc: EmailDoc;
|
|
3642
|
+
/**
|
|
3643
|
+
* A proposed time it goes: a date and time on the business's own clock (`'2026-10-21T09:00'`) or an
|
|
3644
|
+
* instant with its offset, a few minutes to 60 days ahead; `null` clears it. Only a proposal: the
|
|
3645
|
+
* person who approves it in the hub confirms or changes the time. Needs scheduled emails on the
|
|
3646
|
+
* account (`unavailable`, server code `feature_unavailable`, otherwise). A bad time saves nothing.
|
|
3647
|
+
*/
|
|
3648
|
+
send_at?: string | null;
|
|
3649
|
+
}
|
|
3640
3650
|
/** A draft, from `emails.draft()` or `emails.update()`. */
|
|
3641
3651
|
export interface EmailDraft {
|
|
3642
3652
|
id: string;
|
|
@@ -3655,6 +3665,13 @@ export interface EmailDraft {
|
|
|
3655
3665
|
reviewUrl: string;
|
|
3656
3666
|
/** What happens next, to tell the owner. */
|
|
3657
3667
|
next: string;
|
|
3668
|
+
/** The proposed time, when one was given and kept. */
|
|
3669
|
+
send_at?: string | null;
|
|
3670
|
+
send_tz?: string | null;
|
|
3671
|
+
/** "Wed 21 Oct, 9:00 am (Sydney time)". */
|
|
3672
|
+
send_when?: string | null;
|
|
3673
|
+
/** Set when the draft was saved but the time given with it was not: why, in a sentence to pass on. */
|
|
3674
|
+
send_at_refused?: string;
|
|
3658
3675
|
}
|
|
3659
3676
|
/** One email, from `emails.get()`. */
|
|
3660
3677
|
export interface EmailDetail {
|
|
@@ -3676,6 +3693,12 @@ export interface EmailDetail {
|
|
|
3676
3693
|
reviewUrl: string;
|
|
3677
3694
|
/** Opens, clicks, bounces and replies over time, once sent; null when it could not be read. */
|
|
3678
3695
|
timeline: unknown;
|
|
3696
|
+
/** When it goes: a draft's proposed time, or the approved one. Null to go when approved. */
|
|
3697
|
+
send_at?: string | null;
|
|
3698
|
+
/** The same time in words, in the zone it was chosen in. */
|
|
3699
|
+
send_when?: string | null;
|
|
3700
|
+
/** Approved and waiting for its time. */
|
|
3701
|
+
scheduled?: boolean;
|
|
3679
3702
|
}
|
|
3680
3703
|
/** `emails.discard()`: the draft is stopped and left out of the lists. */
|
|
3681
3704
|
export interface EmailDiscarded {
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* Docs: https://hub.awesomate.ai/docs/sdk/
|
|
27
27
|
*/
|
|
28
28
|
/** This package's version, sent to the hub with every server call. */
|
|
29
|
-
export const VERSION = '0.
|
|
29
|
+
export const VERSION = '0.65.0';
|
|
30
30
|
const DEFAULT_BASE = 'https://hub.awesomate.ai';
|
|
31
31
|
/** The one check for a platform `watch_url` (mirrored in the hub's awesomate-knowledge.ts and its MCP). */
|
|
32
32
|
const WATCH_URL = /^https:\/\/[^\s"'<>]+$/i;
|
|
@@ -801,7 +801,10 @@ export class AwesomateClient {
|
|
|
801
801
|
return null;
|
|
802
802
|
return nullIfMissing(this.request('GET', `/api/my-crm/v1/emails/${encodeURIComponent(String(id))}`));
|
|
803
803
|
},
|
|
804
|
-
/**
|
|
804
|
+
/**
|
|
805
|
+
* A new draft to list `topic` (a key from `lists()`). `checks.blockers` must be empty before a
|
|
806
|
+
* person can approve it. `send_at` proposes when it goes (see `EmailDraftInput`).
|
|
807
|
+
*/
|
|
805
808
|
draft: (input) => this.request('POST', '/api/my-crm/v1/emails', input, false),
|
|
806
809
|
/** Replace a draft. Once someone approved it, it is refused: a person changes it in the hub. */
|
|
807
810
|
update: async (id, input) => this.request('PATCH', `/api/my-crm/v1/emails/${emailId(id)}`, input, false),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesomate/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"description": "Your own Awesomate data from Node and the browser: query contacts and app data with generated types, and sign your app's own users in",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|