@chatlychat/sdk-node 0.1.0 → 0.2.1
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 +73 -7
- package/dist/errors.d.ts +113 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +177 -0
- package/dist/errors.js.map +1 -0
- package/dist/identity.d.ts +21 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +30 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +51 -165
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -271
- package/dist/index.js.map +1 -1
- package/dist/pagination.d.ts +32 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +43 -0
- package/dist/pagination.js.map +1 -0
- package/dist/resources.d.ts +237 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +183 -0
- package/dist/resources.js.map +1 -0
- package/dist/transport.d.ts +63 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +178 -0
- package/dist/transport.js.map +1 -0
- package/dist/webhooks.d.ts +35 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +47 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +22 -22
- package/dist/index.spec.d.ts +0 -2
- package/dist/index.spec.d.ts.map +0 -1
- package/dist/index.spec.js +0 -315
- package/dist/index.spec.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,g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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Query, Transport } from './transport.js';
|
|
2
|
+
export interface PageQuery {
|
|
3
|
+
cursor?: string;
|
|
4
|
+
limit?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Page<T> {
|
|
7
|
+
items: ReadonlyArray<T>;
|
|
8
|
+
nextCursor: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** A list method as the auto-paginator sees it: give me a cursor, get a page. */
|
|
11
|
+
export type PageFetcher<T> = (cursor: string | undefined) => Promise<Page<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Walk every page of a cursor-paginated list.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* for await (const contact of chatly.contacts.listAll()) { … }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Two safeguards, both earned. It stops when `nextCursor` is null — and also
|
|
20
|
+
* when the server hands back a cursor it already gave us, which would
|
|
21
|
+
* otherwise be an infinite loop issuing the same request forever. And it never
|
|
22
|
+
* paginates on `id`: ids in this product are a mix of UUID v4 and v7, so id
|
|
23
|
+
* order is not time order and keyset paging on it silently reorders results.
|
|
24
|
+
* Eighteen list endpoints were doing exactly that.
|
|
25
|
+
*/
|
|
26
|
+
export declare function autoPaginate<T>(fetchPage: PageFetcher<T>): AsyncGenerator<T, void, void>;
|
|
27
|
+
/** Build a list namespace's two shapes — one page, and every page — from one path. */
|
|
28
|
+
export declare function listable<T>(transport: Transport, path: string, extra?: Query): {
|
|
29
|
+
list: (query?: PageQuery & Query) => Promise<Page<T>>;
|
|
30
|
+
listAll: (query?: Query) => AsyncGenerator<T, void, void>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,iFAAiF;AACjF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E;;;;;;;;;;;;;GAaG;AACH,wBAAuB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAqB/F;AAED,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,CAAC,EACxB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,KAAU,GAChB;IACD,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;CAC3D,CAQA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walk every page of a cursor-paginated list.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* for await (const contact of chatly.contacts.listAll()) { … }
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Two safeguards, both earned. It stops when `nextCursor` is null — and also
|
|
9
|
+
* when the server hands back a cursor it already gave us, which would
|
|
10
|
+
* otherwise be an infinite loop issuing the same request forever. And it never
|
|
11
|
+
* paginates on `id`: ids in this product are a mix of UUID v4 and v7, so id
|
|
12
|
+
* order is not time order and keyset paging on it silently reorders results.
|
|
13
|
+
* Eighteen list endpoints were doing exactly that.
|
|
14
|
+
*/
|
|
15
|
+
export async function* autoPaginate(fetchPage) {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
let cursor;
|
|
18
|
+
for (;;) {
|
|
19
|
+
const page = await fetchPage(cursor);
|
|
20
|
+
for (const item of page.items) {
|
|
21
|
+
yield item;
|
|
22
|
+
}
|
|
23
|
+
const next = page.nextCursor;
|
|
24
|
+
if (next === null || next === undefined || next === '') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (seen.has(next)) {
|
|
28
|
+
throw new Error(`Chatly pagination stopped: the server repeated cursor "${next}". ` +
|
|
29
|
+
'Continuing would issue the same request forever.');
|
|
30
|
+
}
|
|
31
|
+
seen.add(next);
|
|
32
|
+
cursor = next;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Build a list namespace's two shapes — one page, and every page — from one path. */
|
|
36
|
+
export function listable(transport, path, extra = {}) {
|
|
37
|
+
const list = (query = {}) => transport.get(path, { ...extra, ...query });
|
|
38
|
+
return {
|
|
39
|
+
list,
|
|
40
|
+
listAll: (query = {}) => autoPaginate((cursor) => list({ ...query, ...(cursor === undefined ? {} : { cursor }) })),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAI,SAAyB;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,IAAI,MAA0B,CAAC;IAC/B,SAAS,CAAC;QACR,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC;QACb,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAC7B,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YACvD,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,0DAA0D,IAAI,KAAK;gBACjE,kDAAkD,CACrD,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,QAAQ,CACtB,SAAoB,EACpB,IAAY,EACZ,QAAe,EAAE;IAKjB,MAAM,IAAI,GAAG,CAAC,QAA2B,EAAE,EAAoB,EAAE,CAC/D,SAAS,CAAC,GAAG,CAAU,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACvD,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,CAAC,QAAe,EAAE,EAAE,EAAE,CAC7B,YAAY,CAAI,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;KAC/F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { type Page, type PageQuery } from './pagination.js';
|
|
2
|
+
import type { Query, Transport } from './transport.js';
|
|
3
|
+
/**
|
|
4
|
+
* ── These shapes are READ OFF THE ZOD SCHEMAS, not guessed ───────────────
|
|
5
|
+
*
|
|
6
|
+
* The API validates every body with zod and zod DROPS unknown keys. A write
|
|
7
|
+
* with the wrong key name therefore returns 200 having done nothing, which no
|
|
8
|
+
* caller can distinguish from success. Three of this SDK's own writes were
|
|
9
|
+
* built that way until the Ruby SDK's author read the controllers:
|
|
10
|
+
*
|
|
11
|
+
* contacts.merge sent { sourceContactId } — schema wants { mergedId }
|
|
12
|
+
* contacts.addTags sent { tags: [...] } — schema wants { tag }, ONE
|
|
13
|
+
* contacts.unsubscribe sent { } — `unsubscribed` is REQUIRED
|
|
14
|
+
*
|
|
15
|
+
* The first two silently did nothing. The third 400'd, which is the lucky
|
|
16
|
+
* case. If you add a method here, open the schema.
|
|
17
|
+
*/
|
|
18
|
+
export interface MergeContactInput {
|
|
19
|
+
/** The contact to merge INTO the target, and then retire. `contactMergeSchema`. */
|
|
20
|
+
mergedId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface UnsubscribeContactInput {
|
|
23
|
+
/** Required. `false` re-subscribes. */
|
|
24
|
+
unsubscribed: boolean;
|
|
25
|
+
reason?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AgentHandlingInput {
|
|
28
|
+
/** `setAgentHandlingSchema` — the settable states, not the read states. */
|
|
29
|
+
state: string;
|
|
30
|
+
reason?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface ScheduleMessageInput {
|
|
33
|
+
body: string;
|
|
34
|
+
/** ISO 8601 with offset. */
|
|
35
|
+
sendAt: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ContactInput {
|
|
38
|
+
externalId?: string;
|
|
39
|
+
email?: string;
|
|
40
|
+
phone?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
attributes?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export interface MessageInput {
|
|
45
|
+
conversationId: string;
|
|
46
|
+
body: string;
|
|
47
|
+
/**
|
|
48
|
+
* Mirrors `messageKindSchema`, all five members.
|
|
49
|
+
*
|
|
50
|
+
* `attachment_only` was missing here — the union listed four — so TypeScript
|
|
51
|
+
* refused the one kind you send when there are no words, only a file.
|
|
52
|
+
*/
|
|
53
|
+
kind?: 'text' | 'rich' | 'note' | 'system_event' | 'attachment_only';
|
|
54
|
+
}
|
|
55
|
+
export interface MergeTicketsInput {
|
|
56
|
+
/**
|
|
57
|
+
* The ticket that LOSES — it is closed and its history moves to the one in
|
|
58
|
+
* the path. `{ loserId }`, not `{ sourceTicketId }`: a merge can only be
|
|
59
|
+
* read one way and the route is `:winnerId/merge`.
|
|
60
|
+
*/
|
|
61
|
+
loserId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface TrackEventInput {
|
|
64
|
+
contactId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
properties?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
/** Query for `events.list` — a page, optionally one contact's. */
|
|
69
|
+
export interface EventListQuery extends PageQuery {
|
|
70
|
+
/** Restrict the stream to one contact. Omit for the whole workspace. */
|
|
71
|
+
contactId?: string;
|
|
72
|
+
}
|
|
73
|
+
/** A result shape we do not model field-by-field. The API validates; we pass through. */
|
|
74
|
+
export type Unmodelled = Record<string, unknown>;
|
|
75
|
+
export declare function contactsResource(t: Transport): {
|
|
76
|
+
get: (id: string) => Promise<Unmodelled>;
|
|
77
|
+
upsert: (body: ContactInput) => Promise<Unmodelled>;
|
|
78
|
+
/** Up to the API's documented batch ceiling per call. One idempotency key covers the batch. */
|
|
79
|
+
bulkUpsert: (contacts: ReadonlyArray<ContactInput>) => Promise<Unmodelled>;
|
|
80
|
+
merge: (id: string, body: MergeContactInput) => Promise<Unmodelled>;
|
|
81
|
+
/**
|
|
82
|
+
* Add ONE tag. The route's body is `{ tag }`, singular.
|
|
83
|
+
*
|
|
84
|
+
* Kept plural in the cross-language manifest (`contacts.add_tags`) because
|
|
85
|
+
* eight SDKs have locked that name, but the wire shape is one tag per
|
|
86
|
+
* call: loop for several. This sent `{ tags: [...] }`, which zod dropped,
|
|
87
|
+
* so it returned 200 and added nothing.
|
|
88
|
+
*/
|
|
89
|
+
addTags: (id: string, tag: string) => Promise<Unmodelled>;
|
|
90
|
+
removeTag: (id: string, tag: string) => Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Opt the contact out of outbound email, or back in.
|
|
93
|
+
*
|
|
94
|
+
* `unsubscribed` is required — there is no default, and omitting it is a
|
|
95
|
+
* 400. Honoured across campaigns and workflows.
|
|
96
|
+
*/
|
|
97
|
+
unsubscribe: (id: string, body: UnsubscribeContactInput) => Promise<Unmodelled>;
|
|
98
|
+
/** The contact's timeline: conversations, events, tickets, in one ordered read. */
|
|
99
|
+
journey: (id: string, query?: Query) => Promise<Unmodelled>;
|
|
100
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
101
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
102
|
+
};
|
|
103
|
+
export declare function conversationsResource(t: Transport): {
|
|
104
|
+
get: (id: string) => Promise<Unmodelled>;
|
|
105
|
+
/**
|
|
106
|
+
* Read a thread before replying to it.
|
|
107
|
+
*
|
|
108
|
+
* The MCP server has exposed this as `get_messages` since it shipped and
|
|
109
|
+
* the SDK did not, so an integrator writing "read the conversation, then
|
|
110
|
+
* decide" against the SDK had to hand-roll the request while the same
|
|
111
|
+
* capability sat behind a tool call.
|
|
112
|
+
*/
|
|
113
|
+
messages: (conversationId: string, query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
114
|
+
send: (body: MessageInput) => Promise<Unmodelled>;
|
|
115
|
+
/** Open conversations with no agent reply yet — the queue a bot or a rota works from. */
|
|
116
|
+
unattended: (query?: Query) => Promise<Unmodelled>;
|
|
117
|
+
/** Is a human or a bot driving this thread right now. */
|
|
118
|
+
agentHandling: (id: string) => Promise<Unmodelled>;
|
|
119
|
+
/** Hand the thread to a bot, or take it back. `{ state, reason? }`. */
|
|
120
|
+
setAgentHandling: (id: string, body: AgentHandlingInput) => Promise<Unmodelled>;
|
|
121
|
+
/** Drafts the AI produced for this thread, newest first. */
|
|
122
|
+
generatedReplies: (id: string, query?: Query) => Promise<Unmodelled>;
|
|
123
|
+
/** Ask for a draft now. Returns the draft; it is not sent until you send it. */
|
|
124
|
+
generateReply: (id: string, body?: Unmodelled) => Promise<Unmodelled>;
|
|
125
|
+
scheduledMessages: (id: string, query?: Query) => Promise<Unmodelled>;
|
|
126
|
+
scheduleMessage: (id: string, body: ScheduleMessageInput) => Promise<Unmodelled>;
|
|
127
|
+
cancelScheduled: (scheduledId: string) => Promise<void>;
|
|
128
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
129
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
130
|
+
};
|
|
131
|
+
export declare function ticketsResource(t: Transport): {
|
|
132
|
+
comments: (id: string, query?: Query) => Promise<Unmodelled>;
|
|
133
|
+
/** The ticket auto-created from a conversation, if there is one. */
|
|
134
|
+
forConversation: (conversationId: string) => Promise<Unmodelled>;
|
|
135
|
+
queues: () => Promise<Unmodelled>;
|
|
136
|
+
/** `id` is the WINNER; the body names the loser. */
|
|
137
|
+
merge: (id: string, body: MergeTicketsInput) => Promise<Unmodelled>;
|
|
138
|
+
split: (id: string, body: Unmodelled) => Promise<Unmodelled>;
|
|
139
|
+
/** One status, assignee or queue change applied to many tickets under one key. */
|
|
140
|
+
bulk: (body: Unmodelled) => Promise<Unmodelled>;
|
|
141
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
142
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
143
|
+
};
|
|
144
|
+
export declare function macrosResource(t: Transport): {
|
|
145
|
+
create: (body: Unmodelled) => Promise<Unmodelled>;
|
|
146
|
+
update: (id: string, body: Unmodelled) => Promise<Unmodelled>;
|
|
147
|
+
delete: (id: string) => Promise<void>;
|
|
148
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
149
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
150
|
+
};
|
|
151
|
+
export declare function kbResource(t: Transport): {
|
|
152
|
+
/** One article by slug — the same slug the help centre serves it under. */
|
|
153
|
+
article: (slug: string) => Promise<Unmodelled>;
|
|
154
|
+
collections: () => Promise<Unmodelled>;
|
|
155
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
156
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
157
|
+
};
|
|
158
|
+
export declare function searchResource(t: Transport): {
|
|
159
|
+
/** Full-text across contacts, conversations, messages, tickets and the KB. */
|
|
160
|
+
query: (q: string, opts?: Query) => Promise<Unmodelled>;
|
|
161
|
+
/**
|
|
162
|
+
* Help-centre articles only.
|
|
163
|
+
*
|
|
164
|
+
* Sends `kinds=kb` as a repeated PLAIN key. It used to send `kinds[]=kb`,
|
|
165
|
+
* and `searchQuerySchema` is an object schema, so zod stripped the
|
|
166
|
+
* bracketed key and the search ran UNNARROWED — this method returned
|
|
167
|
+
* contacts, conversations, messages and tickets with a 200 and nothing to
|
|
168
|
+
* indicate the filter had been ignored. The MCP server's `search_kb` tool
|
|
169
|
+
* and the dashboard sent the same spelling. The schema now folds
|
|
170
|
+
* `kinds[]` and a scalar `kinds` as well, but the plain repeated key is
|
|
171
|
+
* the form to send.
|
|
172
|
+
*/
|
|
173
|
+
kb: (q: string, opts?: Query) => Promise<Unmodelled>;
|
|
174
|
+
};
|
|
175
|
+
export declare function eventsResource(t: Transport): {
|
|
176
|
+
track: (input: TrackEventInput) => Promise<Unmodelled>;
|
|
177
|
+
/**
|
|
178
|
+
* Read back what was tracked — the same `/v1/cdp/events` collection
|
|
179
|
+
* `track` writes to, cursor-paginated newest-first.
|
|
180
|
+
*
|
|
181
|
+
* The SDK could write events and never read them, so "did my tracking
|
|
182
|
+
* call actually land?" had no answer outside the dashboard. Pass
|
|
183
|
+
* `contactId` to scope the stream to one person.
|
|
184
|
+
*/
|
|
185
|
+
list: (query?: EventListQuery) => Promise<Page<Unmodelled>>;
|
|
186
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
187
|
+
};
|
|
188
|
+
export declare function webhooksResource(t: Transport): {
|
|
189
|
+
/** One delivery, with its request, response and attempt history. */
|
|
190
|
+
delivery: (id: string) => Promise<Unmodelled>;
|
|
191
|
+
/** Send it again. The receiver sees the same payload with a fresh signature. */
|
|
192
|
+
redeliver: (id: string) => Promise<Unmodelled>;
|
|
193
|
+
list: (query?: PageQuery & Query) => Promise<Page<Unmodelled>>;
|
|
194
|
+
listAll: (query?: Query) => AsyncGenerator<Unmodelled, void, void>;
|
|
195
|
+
};
|
|
196
|
+
export declare function reportsResource(t: Transport): {
|
|
197
|
+
overview: (query?: Query) => Promise<Unmodelled>;
|
|
198
|
+
agents: (query?: Query) => Promise<Unmodelled>;
|
|
199
|
+
conversationsByDay: (query?: Query) => Promise<Unmodelled>;
|
|
200
|
+
sla: (query?: Query) => Promise<Unmodelled>;
|
|
201
|
+
};
|
|
202
|
+
export declare function channelsResource(t: Transport): {
|
|
203
|
+
list: (query?: Query) => Promise<Unmodelled>;
|
|
204
|
+
get: (id: string) => Promise<Unmodelled>;
|
|
205
|
+
};
|
|
206
|
+
export declare function billingResource(t: Transport): {
|
|
207
|
+
/** The plan catalogue this deployment can actually sell. */
|
|
208
|
+
plans: () => Promise<Unmodelled>;
|
|
209
|
+
/** Current period usage, including AI spend against the workspace ceiling. */
|
|
210
|
+
usage: (query?: Query) => Promise<Unmodelled>;
|
|
211
|
+
};
|
|
212
|
+
export declare function workspaceResource(t: Transport): {
|
|
213
|
+
settings: () => Promise<Unmodelled>;
|
|
214
|
+
labels: () => Promise<Unmodelled>;
|
|
215
|
+
inboxes: () => Promise<Unmodelled>;
|
|
216
|
+
/**
|
|
217
|
+
* One team's roster. The only team read an API key can make.
|
|
218
|
+
*
|
|
219
|
+
* The workspace-wide `GET /v1/teams` list carries no `@AllowApiKey()` —
|
|
220
|
+
* it reads a calling user id, and a key is not a person — so it answers
|
|
221
|
+
* every key with 403. This manifest listed it anyway for a day, because
|
|
222
|
+
* the script that derived the key-accessible surface took the nearest
|
|
223
|
+
* `@AllowApiKey()` in either direction and credited the list route with
|
|
224
|
+
* the decorator belonging to this one. Get a team id from a workflow, an
|
|
225
|
+
* inbox's `settings.routingTeamId`, or a conversation's `teamId`.
|
|
226
|
+
*/
|
|
227
|
+
teamMembers: (teamId: string) => Promise<Unmodelled>;
|
|
228
|
+
/**
|
|
229
|
+
* The workspace's skill taxonomy — the distinct labels routing matches on.
|
|
230
|
+
*
|
|
231
|
+
* `GET /v1/agents` has no handler at all; the agents controller serves
|
|
232
|
+
* only `/agents/skills` and `/agents/{userId}/skills`. There is no
|
|
233
|
+
* key-accessible way to list the people with a seat here.
|
|
234
|
+
*/
|
|
235
|
+
agentSkills: () => Promise<Unmodelled>;
|
|
236
|
+
};
|
|
237
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAsBvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,uCAAuC;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,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,gBAAgB,CAAC,CAAC,EAAE,SAAS;mBAE3B,KAAK;cACT,MAAM;EAEnB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS;IAExC,4DAA4D;;IAE5D,8EAA8E;oBAC/D,KAAK;EAEvB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS;;;;IAK1C;;;;;;;;;;OAUG;0BACmB,MAAM;IAE5B;;;;;;OAMG;;EAGN"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { listable } from './pagination.js';
|
|
2
|
+
export function contactsResource(t) {
|
|
3
|
+
return {
|
|
4
|
+
...listable(t, '/v1/contacts'),
|
|
5
|
+
get: (id) => t.get(`/v1/contacts/${encodeURIComponent(id)}`),
|
|
6
|
+
upsert: (body) => t.post('/v1/contacts', body),
|
|
7
|
+
/** Up to the API's documented batch ceiling per call. One idempotency key covers the batch. */
|
|
8
|
+
bulkUpsert: (contacts) => t.post('/v1/contacts/bulk', { contacts }),
|
|
9
|
+
merge: (id, body) => t.post(`/v1/contacts/${encodeURIComponent(id)}/merge`, body),
|
|
10
|
+
/**
|
|
11
|
+
* Add ONE tag. The route's body is `{ tag }`, singular.
|
|
12
|
+
*
|
|
13
|
+
* Kept plural in the cross-language manifest (`contacts.add_tags`) because
|
|
14
|
+
* eight SDKs have locked that name, but the wire shape is one tag per
|
|
15
|
+
* call: loop for several. This sent `{ tags: [...] }`, which zod dropped,
|
|
16
|
+
* so it returned 200 and added nothing.
|
|
17
|
+
*/
|
|
18
|
+
addTags: (id, tag) => t.post(`/v1/contacts/${encodeURIComponent(id)}/tags`, { tag }),
|
|
19
|
+
removeTag: (id, tag) => t.del(`/v1/contacts/${encodeURIComponent(id)}/tags/${encodeURIComponent(tag)}`),
|
|
20
|
+
/**
|
|
21
|
+
* Opt the contact out of outbound email, or back in.
|
|
22
|
+
*
|
|
23
|
+
* `unsubscribed` is required — there is no default, and omitting it is a
|
|
24
|
+
* 400. Honoured across campaigns and workflows.
|
|
25
|
+
*/
|
|
26
|
+
unsubscribe: (id, body) => t.post(`/v1/contacts/${encodeURIComponent(id)}/unsubscribe`, body),
|
|
27
|
+
/** The contact's timeline: conversations, events, tickets, in one ordered read. */
|
|
28
|
+
journey: (id, query = {}) => t.get(`/v1/contacts/${encodeURIComponent(id)}/journey`, query),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function conversationsResource(t) {
|
|
32
|
+
return {
|
|
33
|
+
...listable(t, '/v1/conversations'),
|
|
34
|
+
get: (id) => t.get(`/v1/conversations/${encodeURIComponent(id)}`),
|
|
35
|
+
/**
|
|
36
|
+
* Read a thread before replying to it.
|
|
37
|
+
*
|
|
38
|
+
* The MCP server has exposed this as `get_messages` since it shipped and
|
|
39
|
+
* the SDK did not, so an integrator writing "read the conversation, then
|
|
40
|
+
* decide" against the SDK had to hand-roll the request while the same
|
|
41
|
+
* capability sat behind a tool call.
|
|
42
|
+
*/
|
|
43
|
+
messages: (conversationId, query = {}) => t.get(`/v1/conversations/${encodeURIComponent(conversationId)}/messages`, query),
|
|
44
|
+
send: (body) => t.post(`/v1/conversations/${encodeURIComponent(body.conversationId)}/messages`, body),
|
|
45
|
+
/** Open conversations with no agent reply yet — the queue a bot or a rota works from. */
|
|
46
|
+
unattended: (query = {}) => t.get('/v1/conversations/unattended', query),
|
|
47
|
+
/** Is a human or a bot driving this thread right now. */
|
|
48
|
+
agentHandling: (id) => t.get(`/v1/conversations/${encodeURIComponent(id)}/agent-handling`),
|
|
49
|
+
/** Hand the thread to a bot, or take it back. `{ state, reason? }`. */
|
|
50
|
+
setAgentHandling: (id, body) => t.put(`/v1/conversations/${encodeURIComponent(id)}/agent-handling`, body),
|
|
51
|
+
/** Drafts the AI produced for this thread, newest first. */
|
|
52
|
+
generatedReplies: (id, query = {}) => t.get(`/v1/conversations/${encodeURIComponent(id)}/generated-replies`, query),
|
|
53
|
+
/** Ask for a draft now. Returns the draft; it is not sent until you send it. */
|
|
54
|
+
generateReply: (id, body = {}) => t.post(`/v1/conversations/${encodeURIComponent(id)}/generated-replies`, body),
|
|
55
|
+
scheduledMessages: (id, query = {}) => t.get(`/v1/conversations/${encodeURIComponent(id)}/scheduled-messages`, query),
|
|
56
|
+
scheduleMessage: (id, body) => t.post(`/v1/conversations/${encodeURIComponent(id)}/scheduled-messages`, body),
|
|
57
|
+
cancelScheduled: (scheduledId) => t.del(`/v1/conversations/scheduled-messages/${encodeURIComponent(scheduledId)}`),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function ticketsResource(t) {
|
|
61
|
+
return {
|
|
62
|
+
...listable(t, '/v1/tickets'),
|
|
63
|
+
comments: (id, query = {}) => t.get(`/v1/tickets/${encodeURIComponent(id)}/comments`, query),
|
|
64
|
+
/** The ticket auto-created from a conversation, if there is one. */
|
|
65
|
+
forConversation: (conversationId) => t.get(`/v1/tickets/for-conversation/${encodeURIComponent(conversationId)}`),
|
|
66
|
+
queues: () => t.get('/v1/tickets/queues'),
|
|
67
|
+
/** `id` is the WINNER; the body names the loser. */
|
|
68
|
+
merge: (id, body) => t.post(`/v1/tickets/${encodeURIComponent(id)}/merge`, body),
|
|
69
|
+
split: (id, body) => t.post(`/v1/tickets/${encodeURIComponent(id)}/split`, body),
|
|
70
|
+
/** One status, assignee or queue change applied to many tickets under one key. */
|
|
71
|
+
bulk: (body) => t.post('/v1/tickets/bulk', body),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function macrosResource(t) {
|
|
75
|
+
return {
|
|
76
|
+
...listable(t, '/v1/macros'),
|
|
77
|
+
create: (body) => t.post('/v1/macros', body),
|
|
78
|
+
update: (id, body) => t.patch(`/v1/macros/${encodeURIComponent(id)}`, body),
|
|
79
|
+
delete: (id) => t.del(`/v1/macros/${encodeURIComponent(id)}`),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export function kbResource(t) {
|
|
83
|
+
return {
|
|
84
|
+
...listable(t, '/v1/kb/articles'),
|
|
85
|
+
/** One article by slug — the same slug the help centre serves it under. */
|
|
86
|
+
article: (slug) => t.get(`/v1/kb/articles/${encodeURIComponent(slug)}`),
|
|
87
|
+
collections: () => t.get('/v1/kb/collections'),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export function searchResource(t) {
|
|
91
|
+
return {
|
|
92
|
+
/** Full-text across contacts, conversations, messages, tickets and the KB. */
|
|
93
|
+
query: (q, opts = {}) => t.get('/v1/search', { q, ...opts }),
|
|
94
|
+
/**
|
|
95
|
+
* Help-centre articles only.
|
|
96
|
+
*
|
|
97
|
+
* Sends `kinds=kb` as a repeated PLAIN key. It used to send `kinds[]=kb`,
|
|
98
|
+
* and `searchQuerySchema` is an object schema, so zod stripped the
|
|
99
|
+
* bracketed key and the search ran UNNARROWED — this method returned
|
|
100
|
+
* contacts, conversations, messages and tickets with a 200 and nothing to
|
|
101
|
+
* indicate the filter had been ignored. The MCP server's `search_kb` tool
|
|
102
|
+
* and the dashboard sent the same spelling. The schema now folds
|
|
103
|
+
* `kinds[]` and a scalar `kinds` as well, but the plain repeated key is
|
|
104
|
+
* the form to send.
|
|
105
|
+
*/
|
|
106
|
+
kb: (q, opts = {}) => t.get('/v1/search', { q, kinds: ['kb'], ...opts }),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function eventsResource(t) {
|
|
110
|
+
const page = listable(t, '/v1/cdp/events');
|
|
111
|
+
return {
|
|
112
|
+
track: (input) => t.post('/v1/cdp/events', input),
|
|
113
|
+
/**
|
|
114
|
+
* Read back what was tracked — the same `/v1/cdp/events` collection
|
|
115
|
+
* `track` writes to, cursor-paginated newest-first.
|
|
116
|
+
*
|
|
117
|
+
* The SDK could write events and never read them, so "did my tracking
|
|
118
|
+
* call actually land?" had no answer outside the dashboard. Pass
|
|
119
|
+
* `contactId` to scope the stream to one person.
|
|
120
|
+
*/
|
|
121
|
+
list: (query = {}) => page.list(query),
|
|
122
|
+
listAll: page.listAll,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function webhooksResource(t) {
|
|
126
|
+
return {
|
|
127
|
+
...listable(t, '/v1/webhooks/deliveries'),
|
|
128
|
+
/** One delivery, with its request, response and attempt history. */
|
|
129
|
+
delivery: (id) => t.get(`/v1/webhooks/deliveries/${encodeURIComponent(id)}`),
|
|
130
|
+
/** Send it again. The receiver sees the same payload with a fresh signature. */
|
|
131
|
+
redeliver: (id) => t.post(`/v1/webhooks/deliveries/${encodeURIComponent(id)}/redeliver`),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function reportsResource(t) {
|
|
135
|
+
return {
|
|
136
|
+
overview: (query = {}) => t.get('/v1/reports/overview', query),
|
|
137
|
+
agents: (query = {}) => t.get('/v1/reports/agents', query),
|
|
138
|
+
conversationsByDay: (query = {}) => t.get('/v1/reports/conversations-by-day', query),
|
|
139
|
+
sla: (query = {}) => t.get('/v1/reports/sla', query),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export function channelsResource(t) {
|
|
143
|
+
return {
|
|
144
|
+
list: (query = {}) => t.get('/v1/channels', query),
|
|
145
|
+
get: (id) => t.get(`/v1/channels/${encodeURIComponent(id)}`),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export function billingResource(t) {
|
|
149
|
+
return {
|
|
150
|
+
/** The plan catalogue this deployment can actually sell. */
|
|
151
|
+
plans: () => t.get('/v1/billing/plans'),
|
|
152
|
+
/** Current period usage, including AI spend against the workspace ceiling. */
|
|
153
|
+
usage: (query = {}) => t.get('/v1/billing/usage', query),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export function workspaceResource(t) {
|
|
157
|
+
return {
|
|
158
|
+
settings: () => t.get('/v1/workspace/settings'),
|
|
159
|
+
labels: () => t.get('/v1/labels'),
|
|
160
|
+
inboxes: () => t.get('/v1/inboxes'),
|
|
161
|
+
/**
|
|
162
|
+
* One team's roster. The only team read an API key can make.
|
|
163
|
+
*
|
|
164
|
+
* The workspace-wide `GET /v1/teams` list carries no `@AllowApiKey()` —
|
|
165
|
+
* it reads a calling user id, and a key is not a person — so it answers
|
|
166
|
+
* every key with 403. This manifest listed it anyway for a day, because
|
|
167
|
+
* the script that derived the key-accessible surface took the nearest
|
|
168
|
+
* `@AllowApiKey()` in either direction and credited the list route with
|
|
169
|
+
* the decorator belonging to this one. Get a team id from a workflow, an
|
|
170
|
+
* inbox's `settings.routingTeamId`, or a conversation's `teamId`.
|
|
171
|
+
*/
|
|
172
|
+
teamMembers: (teamId) => t.get(`/v1/teams/${encodeURIComponent(teamId)}/members`),
|
|
173
|
+
/**
|
|
174
|
+
* The workspace's skill taxonomy — the distinct labels routing matches on.
|
|
175
|
+
*
|
|
176
|
+
* `GET /v1/agents` has no handler at all; the agents controller serves
|
|
177
|
+
* only `/agents/skills` and `/agents/{userId}/skills`. There is no
|
|
178
|
+
* key-accessible way to list the people with a seat here.
|
|
179
|
+
*/
|
|
180
|
+
agentSkills: () => t.get('/v1/agents/skills'),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA6B,MAAM,iBAAiB,CAAC;AAyGtE,MAAM,UAAU,gBAAgB,CAAC,CAAY;IAC3C,OAAO;QACL,GAAG,QAAQ,CAAa,CAAC,EAAE,cAAc,CAAC;QAC1C,GAAG,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;QAChF,MAAM,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAa,cAAc,EAAE,IAAI,CAAC;QACxE,+FAA+F;QAC/F,UAAU,EAAE,CAAC,QAAqC,EAAE,EAAE,CACpD,CAAC,CAAC,IAAI,CAAa,mBAAmB,EAAE,E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AK,CAAC;QACrE,GAAG,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;KACjF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,CAAY;IAC1C,OAAO;QACL,4DAA4D;QAC5D,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,mBAAmB,CAAC;QACnD,8EAA8E;QAC9E,KAAK,EAAE,CAAC,QAAe,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,mBAAmB,EAAE,KAAK,CAAC;KAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,CAAY;IAC5C,OAAO;QACL,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,wBAAwB,CAAC;QAC3D,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,YAAY,CAAC;QAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,aAAa,CAAC;QAC/C;;;;;;;;;;WAUG;QACH,WAAW,EAAE,CAAC,MAAc,EAAE,EAAE,CAC9B,CAAC,CAAC,GAAG,CAAa,aAAa,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC;QACtE;;;;;;WAMG;QACH,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAa,mBAAmB,CAAC;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Production. Never a dev or example host — see the note in {@link Transport}. */
|
|
2
|
+
export declare const DEFAULT_API_URL = "https://api.chatlychat.com";
|
|
3
|
+
/** The package version, stamped into `User-Agent` so our logs can see SDK age. */
|
|
4
|
+
export declare const SDK_VERSION = "0.2.1";
|
|
5
|
+
export interface RetryPolicy {
|
|
6
|
+
/** Total attempts, including the first. `1` disables retrying. */
|
|
7
|
+
readonly attempts: number;
|
|
8
|
+
/** First backoff, doubled per attempt. Jitter is applied on top. */
|
|
9
|
+
readonly baseDelayMs: number;
|
|
10
|
+
/** Ceiling for a single backoff, before jitter. */
|
|
11
|
+
readonly maxDelayMs: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_RETRY: RetryPolicy;
|
|
14
|
+
export interface TransportOptions {
|
|
15
|
+
readonly apiKey: string;
|
|
16
|
+
readonly apiUrl?: string;
|
|
17
|
+
readonly timeoutMs?: number;
|
|
18
|
+
readonly fetchFn?: typeof fetch;
|
|
19
|
+
readonly retry?: Partial<RetryPolicy>;
|
|
20
|
+
/** Test seam. Defaults to a real timer; a test passes a no-op. */
|
|
21
|
+
readonly sleepFn?: (ms: number) => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export type Query = Record<string, string | number | boolean | undefined | ReadonlyArray<string>>;
|
|
24
|
+
/**
|
|
25
|
+
* One HTTP concern, in one place: auth, idempotency, retry, error mapping.
|
|
26
|
+
*
|
|
27
|
+
* Resource namespaces hold no HTTP logic at all — they build a path and a
|
|
28
|
+
* body and hand both here. That is what makes the retry policy and the error
|
|
29
|
+
* model uniform across 55 routes instead of per-method.
|
|
30
|
+
*/
|
|
31
|
+
export declare class Transport {
|
|
32
|
+
private readonly base;
|
|
33
|
+
private readonly headers;
|
|
34
|
+
private readonly timeoutMs;
|
|
35
|
+
private readonly fetchFn;
|
|
36
|
+
private readonly retry;
|
|
37
|
+
private readonly sleepFn;
|
|
38
|
+
/**
|
|
39
|
+
* When set, every write uses this exact `Idempotency-Key` instead of a fresh
|
|
40
|
+
* UUID. Set by `ChatlyClient.withIdempotencyKey`, which returns a client
|
|
41
|
+
* sharing this transport's configuration with a pinned key.
|
|
42
|
+
*/
|
|
43
|
+
readonly pinnedIdempotencyKey: string | null;
|
|
44
|
+
constructor(opts: TransportOptions, pinnedIdempotencyKey?: string | null);
|
|
45
|
+
/** A copy of this transport with a pinned idempotency key. */
|
|
46
|
+
withPinnedKey(key: string): Transport;
|
|
47
|
+
get<T>(path: string, query?: Query): Promise<T>;
|
|
48
|
+
post<T>(path: string, body?: unknown, query?: Query): Promise<T>;
|
|
49
|
+
patch<T>(path: string, body?: unknown, query?: Query): Promise<T>;
|
|
50
|
+
put<T>(path: string, body?: unknown, query?: Query): Promise<T>;
|
|
51
|
+
del<T>(path: string, query?: Query): Promise<T>;
|
|
52
|
+
/**
|
|
53
|
+
* The escape hatch, and the one method every other method goes through.
|
|
54
|
+
*
|
|
55
|
+
* 85 of the 140 key-accessible routes have no typed method here. Without a
|
|
56
|
+
* public way in, reaching one means abandoning the SDK and hand-rolling
|
|
57
|
+
* HTTP with a bearer token — losing the retry policy, the error model and
|
|
58
|
+
* the idempotency contract in the process.
|
|
59
|
+
*/
|
|
60
|
+
send<T>(method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE', path: string, query?: Query, body?: unknown): Promise<T>;
|
|
61
|
+
private attempt;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAYA,mFAAmF;AACnF,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,kFAAkF;AAClF,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,aAAa,EAAE,WAAkE,CAAC;AAE/F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,C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