@arbol-ai/sdk 2.2.0 → 2.3.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/README.md CHANGED
@@ -82,7 +82,8 @@ Releases of a new OpenAPI are automatic, from the API down to the CLI:
82
82
  regenerates `src/` with Forge, records the OpenAPI in `arbol.openapi`, and takes the highest version
83
83
  on npm with the minor raised and the patch at 0 (2.1.0, 2.2.0, 2.3.0, …). It verifies the result,
84
84
  commits `Release <version>` to `main` as Arbol, and publishes `@arbol-ai/sdk` to npm with
85
- [Publish](.github/workflows/publish.yml), with a provenance statement.
85
+ [Publish](.github/workflows/publish.yml). Package access stays public while the source repository is
86
+ private. Provenance is disabled because npm does not support it for private source repositories.
86
87
  3. **CLI.** After publishing, Publish sends
87
88
  [project-arbol-cli](https://github.com/getarbol/project-arbol-cli) a `repository_dispatch`
88
89
  `sdk-release` with `{ "version": "<published version>", "openapi": { "release": "…", "sha256": "…" } }`,
@@ -1,5 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
2
+ import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
3
  import { type RaizBusinessHours, type RaizPhoneNumber } from "../models.js";
4
4
  import { type RaizChannel, type RaizChannelPage, type RaizWidgetSettingsInput } from "./models.js";
5
5
  export interface ClientOptions extends BaseClientOptions {
@@ -9,6 +9,28 @@ export interface ClientOptions extends BaseClientOptions {
9
9
  baseUrl: string;
10
10
  }
11
11
  export interface Client {
12
+ /**
13
+ * Add a channel
14
+ *
15
+ * Add a channel. `whatsapp` creates a pending channel and a setup link
16
+ * (`setup.url`) where the business connects its WhatsApp number; call
17
+ * `verify_channel` once that is done. `voice` connects a platform phone
18
+ * number (`platform_number`) or the organization's own carrier over SIP
19
+ * (`sip_trunk`) at once (SIP credentials are passed on once and never
20
+ * stored). `web` creates the chat widget with its configuration. With an
21
+ * Agent, traffic is on by default. Done in Settings → Channels or the REST
22
+ * API; not an AI tool.
23
+ */
24
+ create(request: CreateRequest, options?: RequestOptions): Promise<CreateResponse>;
25
+ /**
26
+ * Delete a channel
27
+ *
28
+ * Remove a channel; its conversations remain. A phone number stops receiving
29
+ * and placing calls (the number stays in the platform account, where Arbol
30
+ * staff can release it); a WhatsApp number stops sending messages to Raíz. To
31
+ * pause traffic instead, switch it off with `update_channel`. Not an AI tool.
32
+ */
33
+ delete(request: DeleteRequest, options?: RequestOptions): Promise<DeleteResponse>;
12
34
  /**
13
35
  * Get a channel
14
36
  *
@@ -34,6 +56,17 @@ export interface Client {
34
56
  * and assignment.
35
57
  */
36
58
  list(request?: ListRequest, options?: RequestOptions): Promise<ListResponse>;
59
+ /**
60
+ * Renew a WhatsApp setup link
61
+ *
62
+ * Issue a new setup link for a pending WhatsApp channel, returned in `setup`,
63
+ * when the previous one was lost or must go to someone else; the previous
64
+ * link stops working. The setup is checked first: if the business already
65
+ * connected its number, the channel is completed as `verify_channel` does and
66
+ * no link is returned. A channel that is not a pending WhatsApp number fails
67
+ * with INVALID_STATE or CHANNEL_TYPE_MISMATCH. Not an AI tool.
68
+ */
69
+ renewSetup(request: RenewSetupRequest, options?: RequestOptions): Promise<RenewSetupResponse>;
37
70
  /**
38
71
  * Update a channel
39
72
  *
@@ -61,6 +94,58 @@ export interface Client {
61
94
  }
62
95
  export declare function createClient(options: ClientOptions): Client;
63
96
  export declare function bind(transport: Transport): Client;
97
+ export type CreateRequest = {
98
+ agentId?: string;
99
+ channelType: "whatsapp";
100
+ inboundEnabled?: boolean;
101
+ name?: string;
102
+ outboundEnabled?: boolean;
103
+ } | {
104
+ agentId?: string;
105
+ channelType: "voice";
106
+ endpoint: {
107
+ kind: "platform_number";
108
+ label?: string;
109
+ phoneNumber: RaizPhoneNumber;
110
+ } | {
111
+ address: string;
112
+ kind: "sip_trunk";
113
+ label?: string;
114
+ mediaEncryption?: "disabled" | "allowed" | "required";
115
+ password?: string;
116
+ phoneNumber: RaizPhoneNumber;
117
+ transport?: "auto" | "udp" | "tcp" | "tls";
118
+ username?: string;
119
+ };
120
+ inboundEnabled?: boolean;
121
+ name?: string;
122
+ outboundEnabled?: boolean;
123
+ } | {
124
+ agentId?: string;
125
+ channelType: "web";
126
+ inboundEnabled?: boolean;
127
+ name?: string;
128
+ outboundEnabled?: boolean;
129
+ widget: RaizWidgetSettingsInput;
130
+ };
131
+ export interface CreateResponse {
132
+ data: RaizChannel;
133
+ error: null;
134
+ metadata: ResponseMetadata;
135
+ success: true;
136
+ }
137
+ export interface DeleteRequest {
138
+ /**
139
+ * Channel id.
140
+ */
141
+ channelId: string;
142
+ }
143
+ export interface DeleteResponse {
144
+ data: DeletedObject;
145
+ error: null;
146
+ metadata: ResponseMetadata;
147
+ success: true;
148
+ }
64
149
  export interface GetRequest {
65
150
  /**
66
151
  * Channel id.
@@ -114,6 +199,18 @@ export interface ListResponse {
114
199
  metadata: ResponseMetadata;
115
200
  success: true;
116
201
  }
202
+ export interface RenewSetupRequest {
203
+ /**
204
+ * Channel id.
205
+ */
206
+ channelId: string;
207
+ }
208
+ export interface RenewSetupResponse {
209
+ data: RaizChannel;
210
+ error: null;
211
+ metadata: ResponseMetadata;
212
+ success: true;
213
+ }
117
214
  export interface UpdateRequest {
118
215
  agentId?: string | null;
119
216
  aiCoveragePercent?: number;
@@ -8,12 +8,29 @@ export function createClient(options) {
8
8
  }
9
9
  export function bind(transport) {
10
10
  return {
11
+ create: (request, options) => transport.send(CreateOperation, request, options),
12
+ delete: (request, options) => transport.send(DeleteOperation, request, options),
11
13
  get: (request, options) => transport.send(GetOperation, request, options),
12
14
  list: (request, options) => transport.send(ListOperation, request, options),
15
+ renewSetup: (request, options) => transport.send(RenewSetupOperation, request, options),
13
16
  update: (request, options) => transport.send(UpdateOperation, request, options),
14
17
  verify: (request, options) => transport.send(VerifyOperation, request, options),
15
18
  };
16
19
  }
20
+ const CreateOperation = {
21
+ method: "POST",
22
+ route: "/v1/raiz/channels/create",
23
+ body: "flat",
24
+ response: object([["data", null, () => RaizChannelCodec]]),
25
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
26
+ };
27
+ const DeleteOperation = {
28
+ method: "DELETE",
29
+ route: "/v1/raiz/channels/delete",
30
+ body: "flat",
31
+ response: null,
32
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
33
+ };
17
34
  const GetOperation = {
18
35
  method: "GET",
19
36
  route: "/v1/raiz/channels/get",
@@ -28,6 +45,13 @@ const ListOperation = {
28
45
  response: object([["data", null, () => RaizChannelPageCodec]]),
29
46
  errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
30
47
  };
48
+ const RenewSetupOperation = {
49
+ method: "POST",
50
+ route: "/v1/raiz/channels/renew-setup",
51
+ body: "flat",
52
+ response: object([["data", null, () => RaizChannelCodec]]),
53
+ errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
54
+ };
31
55
  const UpdateOperation = {
32
56
  method: "PATCH",
33
57
  route: "/v1/raiz/channels/update",
@@ -1,5 +1,5 @@
1
1
  export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
- export type { Client, ClientOptions, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, VerifyRequest, VerifyResponse, } from "./client.js";
4
+ export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, GetRequest, GetResponse, ListRequest, ListResponse, RenewSetupRequest, RenewSetupResponse, UpdateRequest, UpdateResponse, VerifyRequest, VerifyResponse, } from "./client.js";
5
5
  export type { RaizChannel, RaizChannelAgent, RaizChannelPage, RaizWidgetAgentChoice, RaizWidgetClientTool, RaizWidgetCopy, RaizWidgetField, RaizWidgetSettings, RaizWidgetSettingsInput, RaizWidgetTranslations, } from "./models.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbol-ai/sdk",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "The Arbol API for TypeScript and JavaScript, generated by Cloudflare Forge from the platform's public OpenAPI.",
5
5
  "keywords": [
6
6
  "arbol",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public",
36
- "provenance": true
36
+ "provenance": false
37
37
  },
38
38
  "scripts": {
39
39
  "forge": "cargo install --quiet --locked --git https://github.com/cloudflare/forge --rev 7f86447210b7bea3779bfdab3cd5655eade0eadb --root .forge forge",
@@ -50,8 +50,8 @@
50
50
  "packageManager": "bun@1.4.3",
51
51
  "arbol": {
52
52
  "openapi": {
53
- "release": "1.20261019.214511",
54
- "sha256": "84dc23076d7f8fcdd9fc8ff13bb53ba4093f93613e32d3097f43fecf50e4f0d3"
53
+ "release": "1.20261020.151758",
54
+ "sha256": "5b020e784bbc5ad68a94649af77543cd8c2b16717386ba15b59a9f7b7c71fe53"
55
55
  }
56
56
  }
57
57
  }