@agentforge-io/sdk-server 4.26.0 → 4.28.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.
|
@@ -21,6 +21,12 @@ export declare class CasesResource {
|
|
|
21
21
|
* when unknown or turned off.
|
|
22
22
|
*/
|
|
23
23
|
receipt(token: string): Promise<CaseReceipt>;
|
|
24
|
+
/**
|
|
25
|
+
* `POST /api/v1/cases/receipts/:token/received` — the customer got it (the
|
|
26
|
+
* receipt's «Ya lo recibí»): completes a case the business took. 400 before
|
|
27
|
+
* it was accepted or once closed. Returns the receipt as it is now.
|
|
28
|
+
*/
|
|
29
|
+
receiptReceived(token: string): Promise<CaseReceipt>;
|
|
24
30
|
/**
|
|
25
31
|
* `GET /api/v1/cases/receipts/:token/image.png` — the receipt as a PNG:
|
|
26
32
|
* `wide` (1200×630, what a shared link previews) or `tall` (1080×1350, to send or save).
|
package/dist/resources/cases.js
CHANGED
|
@@ -48,6 +48,14 @@ class CasesResource {
|
|
|
48
48
|
async receipt(token) {
|
|
49
49
|
return this.client.request('GET', `/api/v1/cases/receipts/${encodeURIComponent(token)}`);
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* `POST /api/v1/cases/receipts/:token/received` — the customer got it (the
|
|
53
|
+
* receipt's «Ya lo recibí»): completes a case the business took. 400 before
|
|
54
|
+
* it was accepted or once closed. Returns the receipt as it is now.
|
|
55
|
+
*/
|
|
56
|
+
async receiptReceived(token) {
|
|
57
|
+
return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/received`, {});
|
|
58
|
+
}
|
|
51
59
|
/**
|
|
52
60
|
* `GET /api/v1/cases/receipts/:token/image.png` — the receipt as a PNG:
|
|
53
61
|
* `wide` (1200×630, what a shared link previews) or `tall` (1080×1350, to send or save).
|
|
@@ -6,6 +6,12 @@ export interface SetAppWebhookInput {
|
|
|
6
6
|
events: AppWebhookEventName[];
|
|
7
7
|
/** 32–256 characters; the App keeps it to verify deliveries. */
|
|
8
8
|
secret: string;
|
|
9
|
+
/**
|
|
10
|
+
* Where the App shows a receipt: a URL template with `{token}` and optionally
|
|
11
|
+
* `{team}` (the team's public address), e.g. `https://app.example.com/{team}/r/{token}`.
|
|
12
|
+
* Omit (or null) for none.
|
|
13
|
+
*/
|
|
14
|
+
receiptLink?: string | null;
|
|
9
15
|
}
|
|
10
16
|
export declare class WebhookResource {
|
|
11
17
|
private readonly client;
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
// (AGF-APP-WEBHOOKS). One webhook per App; it receives the events of every
|
|
4
4
|
// tenant the App is installed in, and of its home tenant.
|
|
5
5
|
//
|
|
6
|
-
// - `set({ url, events, secret })` — `PUT /api/v1/webhook`. The
|
|
7
|
-
// its own secret (32–256 chars) and keeps it: the platform never
|
|
8
|
-
// it. Idempotent: calling it on every boot is fine.
|
|
6
|
+
// - `set({ url, events, secret, receiptLink? })` — `PUT /api/v1/webhook`. The
|
|
7
|
+
// App brings its own secret (32–256 chars) and keeps it: the platform never
|
|
8
|
+
// returns it. Idempotent: calling it on every boot is fine. `receiptLink`
|
|
9
|
+
// (AGF-CASE-RECEIPT R5) is where the App shows a receipt; the platform puts
|
|
10
|
+
// it under case notices on channels without the receipt card (WhatsApp…).
|
|
9
11
|
// - `get()` — the current webhook (url, events, active), or null.
|
|
10
12
|
// - `remove()` — stop receiving events.
|
|
11
13
|
//
|
package/dist/types.d.ts
CHANGED
|
@@ -1568,8 +1568,10 @@ export interface CaseType {
|
|
|
1568
1568
|
export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | (string & {});
|
|
1569
1569
|
export interface CaseView {
|
|
1570
1570
|
id: string;
|
|
1571
|
-
/** Per workspace,
|
|
1571
|
+
/** Per workspace, sequential (ordering). People read `code`. */
|
|
1572
1572
|
number: number;
|
|
1573
|
+
/** What people read it by ("Pedido #K7Q2XM"): 6 capitals and digits; the number for a case from before codes. */
|
|
1574
|
+
code: string;
|
|
1573
1575
|
conversationId: string;
|
|
1574
1576
|
teamId: string | null;
|
|
1575
1577
|
type: string;
|
|
@@ -1642,6 +1644,10 @@ export interface CaseReceiptLine {
|
|
|
1642
1644
|
*/
|
|
1643
1645
|
export interface CaseReceipt {
|
|
1644
1646
|
token: string;
|
|
1647
|
+
/** What people read it by ("K7Q2XM"); absent on receipts from before codes (use `number`). */
|
|
1648
|
+
code?: string;
|
|
1649
|
+
/** The customer may say they got it now (it is ready or on its way): `cases.receiptReceived`. */
|
|
1650
|
+
receivable: boolean;
|
|
1645
1651
|
/** 1, then +1 each time the customer changed the case and sent it again (same link). */
|
|
1646
1652
|
revision: number;
|
|
1647
1653
|
/** The business's note on its last move ("listo en 20 min", a rejection reason). */
|
|
@@ -1673,6 +1679,7 @@ export interface CaseReceipt {
|
|
|
1673
1679
|
updatedAt: string;
|
|
1674
1680
|
business: {
|
|
1675
1681
|
name: string;
|
|
1682
|
+
description: string | null;
|
|
1676
1683
|
logoUrl: string | null;
|
|
1677
1684
|
primaryColor: string | null;
|
|
1678
1685
|
accentColor: string | null;
|
|
@@ -1692,6 +1699,8 @@ export type AppWebhookEventName = 'case.submitted' | 'case.state_changed' | 'cas
|
|
|
1692
1699
|
export interface AppWebhook {
|
|
1693
1700
|
url: string;
|
|
1694
1701
|
events: AppWebhookEventName[];
|
|
1702
|
+
/** Where the App shows a receipt (`{team}`, `{token}`), when it set one (AGF-CASE-RECEIPT R5). */
|
|
1703
|
+
receiptLink?: string | null;
|
|
1695
1704
|
active: boolean;
|
|
1696
1705
|
createdAt: string;
|
|
1697
1706
|
updatedAt: string;
|
|
@@ -1712,7 +1721,9 @@ export interface AppWebhookEvent {
|
|
|
1712
1721
|
previousState?: string;
|
|
1713
1722
|
/** `case.customer_request`: the customer asks to change the case (a sent one was reopened) or to cancel an accepted one. */
|
|
1714
1723
|
request?: 'change' | 'cancel';
|
|
1715
|
-
by: 'assistant' | 'business' | 'system';
|
|
1724
|
+
by: 'assistant' | 'business' | 'system' | 'customer';
|
|
1725
|
+
/** What people read it by ("K7Q2XM"). */
|
|
1726
|
+
caseCode?: string;
|
|
1716
1727
|
conversationId: string;
|
|
1717
1728
|
};
|
|
1718
1729
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.28.0",
|
|
4
4
|
"description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|