@zavudev/sdk 0.58.1 → 0.59.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.
Files changed (220) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +18 -0
  3. package/client.d.mts +2 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +2 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +2 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +21 -1
  12. package/src/client.ts +2 -0
  13. package/src/types.ts +29 -12
  14. package/src/v2/index.ts +4 -0
  15. package/src/v2/resources/agents/agents.ts +142 -0
  16. package/src/v2/resources/agents/channels.ts +66 -0
  17. package/src/v2/resources/agents/index.ts +18 -0
  18. package/src/v2/resources/agents.ts +3 -0
  19. package/src/v2/resources/campaigns/campaigns.ts +178 -0
  20. package/src/v2/resources/campaigns/index.ts +27 -0
  21. package/src/v2/resources/campaigns/recipients.ts +62 -0
  22. package/src/v2/resources/campaigns.ts +3 -0
  23. package/src/v2/resources/channels.ts +156 -0
  24. package/src/v2/resources/contacts.ts +112 -0
  25. package/src/v2/resources/conversations.ts +89 -0
  26. package/src/v2/resources/email-domains.ts +107 -0
  27. package/src/v2/resources/functions.ts +73 -0
  28. package/src/v2/resources/index.ts +138 -0
  29. package/src/v2/resources/messages.ts +129 -0
  30. package/src/v2/resources/numbers.ts +74 -0
  31. package/src/v2/resources/templates.ts +104 -0
  32. package/src/v2/resources/webhook.ts +102 -0
  33. package/src/v2/types.ts +2429 -0
  34. package/src/v2/v2.ts +315 -0
  35. package/src/v2.ts +3 -0
  36. package/src/version.ts +1 -1
  37. package/types.d.mts +29 -12
  38. package/types.d.mts.map +1 -1
  39. package/types.d.ts +29 -12
  40. package/types.d.ts.map +1 -1
  41. package/v2/index.d.mts +3 -0
  42. package/v2/index.d.mts.map +1 -0
  43. package/v2/index.d.ts +3 -0
  44. package/v2/index.d.ts.map +1 -0
  45. package/v2/index.js +9 -0
  46. package/v2/index.js.map +1 -0
  47. package/v2/index.mjs +4 -0
  48. package/v2/index.mjs.map +1 -0
  49. package/v2/resources/agents/agents.d.mts +81 -0
  50. package/v2/resources/agents/agents.d.mts.map +1 -0
  51. package/v2/resources/agents/agents.d.ts +81 -0
  52. package/v2/resources/agents/agents.d.ts.map +1 -0
  53. package/v2/resources/agents/agents.js +88 -0
  54. package/v2/resources/agents/agents.js.map +1 -0
  55. package/v2/resources/agents/agents.mjs +83 -0
  56. package/v2/resources/agents/agents.mjs.map +1 -0
  57. package/v2/resources/agents/channels.d.mts +39 -0
  58. package/v2/resources/agents/channels.d.mts.map +1 -0
  59. package/v2/resources/agents/channels.d.ts +39 -0
  60. package/v2/resources/agents/channels.d.ts.map +1 -0
  61. package/v2/resources/agents/channels.js +44 -0
  62. package/v2/resources/agents/channels.js.map +1 -0
  63. package/v2/resources/agents/channels.mjs +40 -0
  64. package/v2/resources/agents/channels.mjs.map +1 -0
  65. package/v2/resources/agents/index.d.mts +3 -0
  66. package/v2/resources/agents/index.d.mts.map +1 -0
  67. package/v2/resources/agents/index.d.ts +3 -0
  68. package/v2/resources/agents/index.d.ts.map +1 -0
  69. package/v2/resources/agents/index.js +9 -0
  70. package/v2/resources/agents/index.js.map +1 -0
  71. package/v2/resources/agents/index.mjs +4 -0
  72. package/v2/resources/agents/index.mjs.map +1 -0
  73. package/v2/resources/agents.d.mts +2 -0
  74. package/v2/resources/agents.d.mts.map +1 -0
  75. package/v2/resources/agents.d.ts +2 -0
  76. package/v2/resources/agents.d.ts.map +1 -0
  77. package/v2/resources/agents.js +6 -0
  78. package/v2/resources/agents.js.map +1 -0
  79. package/v2/resources/agents.mjs +3 -0
  80. package/v2/resources/agents.mjs.map +1 -0
  81. package/v2/resources/campaigns/campaigns.d.mts +100 -0
  82. package/v2/resources/campaigns/campaigns.d.mts.map +1 -0
  83. package/v2/resources/campaigns/campaigns.d.ts +100 -0
  84. package/v2/resources/campaigns/campaigns.d.ts.map +1 -0
  85. package/v2/resources/campaigns/campaigns.js +106 -0
  86. package/v2/resources/campaigns/campaigns.js.map +1 -0
  87. package/v2/resources/campaigns/campaigns.mjs +101 -0
  88. package/v2/resources/campaigns/campaigns.mjs.map +1 -0
  89. package/v2/resources/campaigns/index.d.mts +3 -0
  90. package/v2/resources/campaigns/index.d.mts.map +1 -0
  91. package/v2/resources/campaigns/index.d.ts +3 -0
  92. package/v2/resources/campaigns/index.d.ts.map +1 -0
  93. package/v2/resources/campaigns/index.js +9 -0
  94. package/v2/resources/campaigns/index.js.map +1 -0
  95. package/v2/resources/campaigns/index.mjs +4 -0
  96. package/v2/resources/campaigns/index.mjs.map +1 -0
  97. package/v2/resources/campaigns/recipients.d.mts +43 -0
  98. package/v2/resources/campaigns/recipients.d.mts.map +1 -0
  99. package/v2/resources/campaigns/recipients.d.ts +43 -0
  100. package/v2/resources/campaigns/recipients.d.ts.map +1 -0
  101. package/v2/resources/campaigns/recipients.js +41 -0
  102. package/v2/resources/campaigns/recipients.js.map +1 -0
  103. package/v2/resources/campaigns/recipients.mjs +37 -0
  104. package/v2/resources/campaigns/recipients.mjs.map +1 -0
  105. package/v2/resources/campaigns.d.mts +2 -0
  106. package/v2/resources/campaigns.d.mts.map +1 -0
  107. package/v2/resources/campaigns.d.ts +2 -0
  108. package/v2/resources/campaigns.d.ts.map +1 -0
  109. package/v2/resources/campaigns.js +6 -0
  110. package/v2/resources/campaigns.js.map +1 -0
  111. package/v2/resources/campaigns.mjs +3 -0
  112. package/v2/resources/campaigns.mjs.map +1 -0
  113. package/v2/resources/channels.d.mts +101 -0
  114. package/v2/resources/channels.d.mts.map +1 -0
  115. package/v2/resources/channels.d.ts +101 -0
  116. package/v2/resources/channels.d.ts.map +1 -0
  117. package/v2/resources/channels.js +107 -0
  118. package/v2/resources/channels.js.map +1 -0
  119. package/v2/resources/channels.mjs +103 -0
  120. package/v2/resources/channels.mjs.map +1 -0
  121. package/v2/resources/contacts.d.mts +62 -0
  122. package/v2/resources/contacts.d.mts.map +1 -0
  123. package/v2/resources/contacts.d.ts +62 -0
  124. package/v2/resources/contacts.d.ts.map +1 -0
  125. package/v2/resources/contacts.js +66 -0
  126. package/v2/resources/contacts.js.map +1 -0
  127. package/v2/resources/contacts.mjs +62 -0
  128. package/v2/resources/contacts.mjs.map +1 -0
  129. package/v2/resources/conversations.d.mts +51 -0
  130. package/v2/resources/conversations.d.mts.map +1 -0
  131. package/v2/resources/conversations.d.ts +51 -0
  132. package/v2/resources/conversations.d.ts.map +1 -0
  133. package/v2/resources/conversations.js +55 -0
  134. package/v2/resources/conversations.js.map +1 -0
  135. package/v2/resources/conversations.mjs +51 -0
  136. package/v2/resources/conversations.mjs.map +1 -0
  137. package/v2/resources/email-domains.d.mts +72 -0
  138. package/v2/resources/email-domains.d.mts.map +1 -0
  139. package/v2/resources/email-domains.d.ts +72 -0
  140. package/v2/resources/email-domains.d.ts.map +1 -0
  141. package/v2/resources/email-domains.js +80 -0
  142. package/v2/resources/email-domains.js.map +1 -0
  143. package/v2/resources/email-domains.mjs +76 -0
  144. package/v2/resources/email-domains.mjs.map +1 -0
  145. package/v2/resources/functions.d.mts +41 -0
  146. package/v2/resources/functions.d.mts.map +1 -0
  147. package/v2/resources/functions.d.ts +41 -0
  148. package/v2/resources/functions.d.ts.map +1 -0
  149. package/v2/resources/functions.js +41 -0
  150. package/v2/resources/functions.js.map +1 -0
  151. package/v2/resources/functions.mjs +37 -0
  152. package/v2/resources/functions.mjs.map +1 -0
  153. package/v2/resources/index.d.mts +12 -0
  154. package/v2/resources/index.d.mts.map +1 -0
  155. package/v2/resources/index.d.ts +12 -0
  156. package/v2/resources/index.d.ts.map +1 -0
  157. package/v2/resources/index.js +27 -0
  158. package/v2/resources/index.js.map +1 -0
  159. package/v2/resources/index.mjs +13 -0
  160. package/v2/resources/index.mjs.map +1 -0
  161. package/v2/resources/messages.d.mts +82 -0
  162. package/v2/resources/messages.d.mts.map +1 -0
  163. package/v2/resources/messages.d.ts +82 -0
  164. package/v2/resources/messages.d.ts.map +1 -0
  165. package/v2/resources/messages.js +74 -0
  166. package/v2/resources/messages.js.map +1 -0
  167. package/v2/resources/messages.mjs +70 -0
  168. package/v2/resources/messages.mjs.map +1 -0
  169. package/v2/resources/numbers.d.mts +46 -0
  170. package/v2/resources/numbers.d.mts.map +1 -0
  171. package/v2/resources/numbers.d.ts +46 -0
  172. package/v2/resources/numbers.d.ts.map +1 -0
  173. package/v2/resources/numbers.js +41 -0
  174. package/v2/resources/numbers.js.map +1 -0
  175. package/v2/resources/numbers.mjs +37 -0
  176. package/v2/resources/numbers.mjs.map +1 -0
  177. package/v2/resources/templates.d.mts +56 -0
  178. package/v2/resources/templates.d.mts.map +1 -0
  179. package/v2/resources/templates.d.ts +56 -0
  180. package/v2/resources/templates.d.ts.map +1 -0
  181. package/v2/resources/templates.js +61 -0
  182. package/v2/resources/templates.js.map +1 -0
  183. package/v2/resources/templates.mjs +57 -0
  184. package/v2/resources/templates.mjs.map +1 -0
  185. package/v2/resources/webhook.d.mts +67 -0
  186. package/v2/resources/webhook.d.mts.map +1 -0
  187. package/v2/resources/webhook.d.ts +67 -0
  188. package/v2/resources/webhook.d.ts.map +1 -0
  189. package/v2/resources/webhook.js +70 -0
  190. package/v2/resources/webhook.js.map +1 -0
  191. package/v2/resources/webhook.mjs +66 -0
  192. package/v2/resources/webhook.mjs.map +1 -0
  193. package/v2/types.d.mts +2188 -0
  194. package/v2/types.d.mts.map +1 -0
  195. package/v2/types.d.ts +2188 -0
  196. package/v2/types.d.ts.map +1 -0
  197. package/v2/types.js +4 -0
  198. package/v2/types.js.map +1 -0
  199. package/v2/types.mjs +3 -0
  200. package/v2/types.mjs.map +1 -0
  201. package/v2/v2.d.mts +40 -0
  202. package/v2/v2.d.mts.map +1 -0
  203. package/v2/v2.d.ts +40 -0
  204. package/v2/v2.d.ts.map +1 -0
  205. package/v2/v2.js +47 -0
  206. package/v2/v2.js.map +1 -0
  207. package/v2/v2.mjs +42 -0
  208. package/v2/v2.mjs.map +1 -0
  209. package/v2.d.mts +2 -0
  210. package/v2.d.mts.map +1 -0
  211. package/v2.d.ts +2 -0
  212. package/v2.d.ts.map +1 -0
  213. package/v2.js +6 -0
  214. package/v2.js.map +1 -0
  215. package/v2.mjs +3 -0
  216. package/v2.mjs.map +1 -0
  217. package/version.d.mts +1 -1
  218. package/version.d.ts +1 -1
  219. package/version.js +1 -1
  220. package/version.mjs +1 -1
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Agents = void 0;
5
+ const tslib_1 = require("../../../internal/tslib.js");
6
+ const resource_1 = require("../../../core/resource.js");
7
+ const pagination_1 = require("../../../core/pagination.js");
8
+ const headers_1 = require("../../../internal/headers.js");
9
+ const path_1 = require("../../../internal/utils/path.js");
10
+ const ChannelsAPI = tslib_1.__importStar(require("./channels.js"));
11
+ class Agents extends resource_1.APIResource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.channels = new ChannelsAPI.Channels(this._client);
15
+ }
16
+ /**
17
+ * List agents
18
+ *
19
+ * `GET /v2/agents`
20
+ */
21
+ list(query = {}, options) {
22
+ return this._client.getAPIList('/v2/agents', (pagination_1.Cursor), { query, ...options });
23
+ }
24
+ /**
25
+ * Create an agent
26
+ *
27
+ * Connect it to an address with `POST /v2/agents/{agentId}/channels`.
28
+ *
29
+ * `POST /v2/agents`
30
+ */
31
+ create(body, options) {
32
+ return this._client.post('/v2/agents', { body, ...options });
33
+ }
34
+ /**
35
+ * Get an agent
36
+ *
37
+ * `GET /v2/agents/{agentId}`
38
+ */
39
+ retrieve(agentID, options) {
40
+ return this._client.get((0, path_1.path) `/v2/agents/${agentID}`, options);
41
+ }
42
+ /**
43
+ * Update an agent
44
+ *
45
+ * `PATCH /v2/agents/{agentId}`
46
+ */
47
+ update(agentID, body = {}, options) {
48
+ return this._client.patch((0, path_1.path) `/v2/agents/${agentID}`, { body, ...options });
49
+ }
50
+ /**
51
+ * Delete an agent
52
+ *
53
+ * As `DELETE /v1/agents/{agentId}`.
54
+ *
55
+ * `DELETE /v2/agents/{agentId}`
56
+ */
57
+ delete(agentID, options) {
58
+ return this._client.delete((0, path_1.path) `/v2/agents/${agentID}`, {
59
+ ...options,
60
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
61
+ });
62
+ }
63
+ /**
64
+ * Test an agent
65
+ *
66
+ * Run the agent's prompt, model and knowledge base against a message and return
67
+ * the reply instead of delivering it. Nothing is delivered and no execution is
68
+ * recorded.
69
+ *
70
+ * **Billed like a live reply.** On an agent with the `zavu` provider the run is
71
+ * charged to your balance at the same price per token, and refused with `402
72
+ * insufficient_balance` at a balance of zero; on a bring-your-own-key agent it
73
+ * costs your provider. `cost` on the response is what it charged. Runs are rate
74
+ * limited per project (`429`).
75
+ *
76
+ * **Tools.** By default the model is offered the agent's enabled tools but none is
77
+ * run: if it picks one, the reply stops there and `plannedToolCalls` says which,
78
+ * with what arguments. Set `executeTools` to run them. That reaches your real
79
+ * handlers, with whatever they cost and change; read `executedToolCalls`.
80
+ *
81
+ * `POST /v2/agents/{agentId}/test`
82
+ */
83
+ test(agentID, body, options) {
84
+ return this._client.post((0, path_1.path) `/v2/agents/${agentID}/test`, { body, ...options });
85
+ }
86
+ }
87
+ exports.Agents = Agents;
88
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/v2/resources/agents/agents.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;;AAE9G,wDAAqD;AAErD,4DAA+D;AAC/D,0DAAyD;AAEzD,0DAAoD;AAEpD,mEAA0C;AAG1C,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,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,IAAA,WAAI,EAAA,cAAc,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AArFD,wBAqFC"}
@@ -0,0 +1,83 @@
1
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { Cursor } from "../../../core/pagination.mjs";
4
+ import { buildHeaders } from "../../../internal/headers.mjs";
5
+ import { path } from "../../../internal/utils/path.mjs";
6
+ import * as ChannelsAPI from "./channels.mjs";
7
+ export class Agents extends APIResource {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.channels = new ChannelsAPI.Channels(this._client);
11
+ }
12
+ /**
13
+ * List agents
14
+ *
15
+ * `GET /v2/agents`
16
+ */
17
+ list(query = {}, options) {
18
+ return this._client.getAPIList('/v2/agents', (Cursor), { query, ...options });
19
+ }
20
+ /**
21
+ * Create an agent
22
+ *
23
+ * Connect it to an address with `POST /v2/agents/{agentId}/channels`.
24
+ *
25
+ * `POST /v2/agents`
26
+ */
27
+ create(body, options) {
28
+ return this._client.post('/v2/agents', { body, ...options });
29
+ }
30
+ /**
31
+ * Get an agent
32
+ *
33
+ * `GET /v2/agents/{agentId}`
34
+ */
35
+ retrieve(agentID, options) {
36
+ return this._client.get(path `/v2/agents/${agentID}`, options);
37
+ }
38
+ /**
39
+ * Update an agent
40
+ *
41
+ * `PATCH /v2/agents/{agentId}`
42
+ */
43
+ update(agentID, body = {}, options) {
44
+ return this._client.patch(path `/v2/agents/${agentID}`, { body, ...options });
45
+ }
46
+ /**
47
+ * Delete an agent
48
+ *
49
+ * As `DELETE /v1/agents/{agentId}`.
50
+ *
51
+ * `DELETE /v2/agents/{agentId}`
52
+ */
53
+ delete(agentID, options) {
54
+ return this._client.delete(path `/v2/agents/${agentID}`, {
55
+ ...options,
56
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
57
+ });
58
+ }
59
+ /**
60
+ * Test an agent
61
+ *
62
+ * Run the agent's prompt, model and knowledge base against a message and return
63
+ * the reply instead of delivering it. Nothing is delivered and no execution is
64
+ * recorded.
65
+ *
66
+ * **Billed like a live reply.** On an agent with the `zavu` provider the run is
67
+ * charged to your balance at the same price per token, and refused with `402
68
+ * insufficient_balance` at a balance of zero; on a bring-your-own-key agent it
69
+ * costs your provider. `cost` on the response is what it charged. Runs are rate
70
+ * limited per project (`429`).
71
+ *
72
+ * **Tools.** By default the model is offered the agent's enabled tools but none is
73
+ * run: if it picks one, the reply stops there and `plannedToolCalls` says which,
74
+ * with what arguments. Set `executeTools` to run them. That reaches your real
75
+ * handlers, with whatever they cost and change; read `executedToolCalls`.
76
+ *
77
+ * `POST /v2/agents/{agentId}/test`
78
+ */
79
+ test(agentID, body, options) {
80
+ return this._client.post(path `/v2/agents/${agentID}/test`, { body, ...options });
81
+ }
82
+ }
83
+ //# sourceMappingURL=agents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.mjs","sourceRoot":"","sources":["../../../src/v2/resources/agents/agents.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,MAAM,EAAe,qCAAiC;AAC/D,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,OAAO,KAAK,WAAW,uBAAmB;AAG1C,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoF1E,CAAC;IAlFC;;;;OAIG;IACH,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAA,MAAa,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAe,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,OAAe,EACf,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,cAAc,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,OAAe,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,cAAc,OAAO,EAAE,EAAE;YACtD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,OAAe,EAAE,IAAqB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,cAAc,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ import type * as T from "../../types.mjs";
5
+ import { type ChannelType } from "../messages.mjs";
6
+ export declare class Channels extends APIResource {
7
+ /**
8
+ * Connect an address
9
+ *
10
+ * Make the agent answer on an address. Connecting `{address, type}` connects the
11
+ * whole channel group that entry belongs to (the entries of `GET /v2/channels`
12
+ * that share its `v1SenderId`): the agent then answers on each transport of that
13
+ * group that its `triggerOnChannels` allows, which `channels` on the agent lists.
14
+ * `type` is what picks the group when two groups share the address.
15
+ *
16
+ * An address answers with one agent at a time; connecting one already answered by
17
+ * another agent returns `400` naming that agent.
18
+ *
19
+ * `POST /v2/agents/{agentId}/channels`
20
+ */
21
+ connect(agentID: string, body: ChannelConnectParams, options?: RequestOptions): APIPromise<ChannelConnectResponse>;
22
+ /**
23
+ * Disconnect an address
24
+ *
25
+ * Stop the agent answering on the address. This disconnects the channel group
26
+ * behind `{address, type}`, so every transport of that group stops reaching the
27
+ * agent. An agent created on /v1 for a sender keeps that sender: its addresses
28
+ * cannot be disconnected here, and that answers `400`.
29
+ *
30
+ * `DELETE /v2/agents/{agentId}/channels/{address}/{type}`
31
+ */
32
+ disconnect(agentID: string, address: string, type: ChannelType, options?: RequestOptions): APIPromise<void>;
33
+ }
34
+ export type ChannelConnectParams = T.AgentsChannelsConnectParams;
35
+ export type ChannelConnectResponse = T.ConnectAgentChannelV2Response;
36
+ export declare namespace Channels {
37
+ export { type ChannelConnectParams as ChannelConnectParams, type ChannelConnectResponse as ChannelConnectResponse, };
38
+ }
39
+ //# sourceMappingURL=channels.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.mts","sourceRoot":"","sources":["../../../src/v2/resources/agents/channels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,OAAO,KAAK,KAAK,CAAC,wBAAoB;AACtC,OAAO,EAAE,KAAK,WAAW,EAAE,wBAAoB;AAE/C,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;OASG;IACH,UAAU,CACR,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAMpB;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,2BAA2B,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,6BAA6B,CAAC;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,39 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ import type * as T from "../../types.js";
5
+ import { type ChannelType } from "../messages.js";
6
+ export declare class Channels extends APIResource {
7
+ /**
8
+ * Connect an address
9
+ *
10
+ * Make the agent answer on an address. Connecting `{address, type}` connects the
11
+ * whole channel group that entry belongs to (the entries of `GET /v2/channels`
12
+ * that share its `v1SenderId`): the agent then answers on each transport of that
13
+ * group that its `triggerOnChannels` allows, which `channels` on the agent lists.
14
+ * `type` is what picks the group when two groups share the address.
15
+ *
16
+ * An address answers with one agent at a time; connecting one already answered by
17
+ * another agent returns `400` naming that agent.
18
+ *
19
+ * `POST /v2/agents/{agentId}/channels`
20
+ */
21
+ connect(agentID: string, body: ChannelConnectParams, options?: RequestOptions): APIPromise<ChannelConnectResponse>;
22
+ /**
23
+ * Disconnect an address
24
+ *
25
+ * Stop the agent answering on the address. This disconnects the channel group
26
+ * behind `{address, type}`, so every transport of that group stops reaching the
27
+ * agent. An agent created on /v1 for a sender keeps that sender: its addresses
28
+ * cannot be disconnected here, and that answers `400`.
29
+ *
30
+ * `DELETE /v2/agents/{agentId}/channels/{address}/{type}`
31
+ */
32
+ disconnect(agentID: string, address: string, type: ChannelType, options?: RequestOptions): APIPromise<void>;
33
+ }
34
+ export type ChannelConnectParams = T.AgentsChannelsConnectParams;
35
+ export type ChannelConnectResponse = T.ConnectAgentChannelV2Response;
36
+ export declare namespace Channels {
37
+ export { type ChannelConnectParams as ChannelConnectParams, type ChannelConnectResponse as ChannelConnectResponse, };
38
+ }
39
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../../src/v2/resources/agents/channels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAEnE,OAAO,KAAK,KAAK,CAAC,uBAAoB;AACtC,OAAO,EAAE,KAAK,WAAW,EAAE,uBAAoB;AAE/C,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;OASG;IACH,UAAU,CACR,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAMpB;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,2BAA2B,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,6BAA6B,CAAC;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Channels = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const headers_1 = require("../../../internal/headers.js");
7
+ const path_1 = require("../../../internal/utils/path.js");
8
+ class Channels extends resource_1.APIResource {
9
+ /**
10
+ * Connect an address
11
+ *
12
+ * Make the agent answer on an address. Connecting `{address, type}` connects the
13
+ * whole channel group that entry belongs to (the entries of `GET /v2/channels`
14
+ * that share its `v1SenderId`): the agent then answers on each transport of that
15
+ * group that its `triggerOnChannels` allows, which `channels` on the agent lists.
16
+ * `type` is what picks the group when two groups share the address.
17
+ *
18
+ * An address answers with one agent at a time; connecting one already answered by
19
+ * another agent returns `400` naming that agent.
20
+ *
21
+ * `POST /v2/agents/{agentId}/channels`
22
+ */
23
+ connect(agentID, body, options) {
24
+ return this._client.post((0, path_1.path) `/v2/agents/${agentID}/channels`, { body, ...options });
25
+ }
26
+ /**
27
+ * Disconnect an address
28
+ *
29
+ * Stop the agent answering on the address. This disconnects the channel group
30
+ * behind `{address, type}`, so every transport of that group stops reaching the
31
+ * agent. An agent created on /v1 for a sender keeps that sender: its addresses
32
+ * cannot be disconnected here, and that answers `400`.
33
+ *
34
+ * `DELETE /v2/agents/{agentId}/channels/{address}/{type}`
35
+ */
36
+ disconnect(agentID, address, type, options) {
37
+ return this._client.delete((0, path_1.path) `/v2/agents/${agentID}/channels/${address}/${type}`, {
38
+ ...options,
39
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
40
+ });
41
+ }
42
+ }
43
+ exports.Channels = Channels;
44
+ //# sourceMappingURL=channels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../src/v2/resources/agents/channels.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAIpD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,OAAe,EACf,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CACR,OAAe,EACf,OAAe,EACf,IAAiB,EACjB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,aAAa,OAAO,IAAI,IAAI,EAAE,EAAE;YAClF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA5CD,4BA4CC"}
@@ -0,0 +1,40 @@
1
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { buildHeaders } from "../../../internal/headers.mjs";
4
+ import { path } from "../../../internal/utils/path.mjs";
5
+ export class Channels extends APIResource {
6
+ /**
7
+ * Connect an address
8
+ *
9
+ * Make the agent answer on an address. Connecting `{address, type}` connects the
10
+ * whole channel group that entry belongs to (the entries of `GET /v2/channels`
11
+ * that share its `v1SenderId`): the agent then answers on each transport of that
12
+ * group that its `triggerOnChannels` allows, which `channels` on the agent lists.
13
+ * `type` is what picks the group when two groups share the address.
14
+ *
15
+ * An address answers with one agent at a time; connecting one already answered by
16
+ * another agent returns `400` naming that agent.
17
+ *
18
+ * `POST /v2/agents/{agentId}/channels`
19
+ */
20
+ connect(agentID, body, options) {
21
+ return this._client.post(path `/v2/agents/${agentID}/channels`, { body, ...options });
22
+ }
23
+ /**
24
+ * Disconnect an address
25
+ *
26
+ * Stop the agent answering on the address. This disconnects the channel group
27
+ * behind `{address, type}`, so every transport of that group stops reaching the
28
+ * agent. An agent created on /v1 for a sender keeps that sender: its addresses
29
+ * cannot be disconnected here, and that answers `400`.
30
+ *
31
+ * `DELETE /v2/agents/{agentId}/channels/{address}/{type}`
32
+ */
33
+ disconnect(agentID, address, type, options) {
34
+ return this._client.delete(path `/v2/agents/${agentID}/channels/${address}/${type}`, {
35
+ ...options,
36
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
37
+ });
38
+ }
39
+ }
40
+ //# sourceMappingURL=channels.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.mjs","sourceRoot":"","sources":["../../../src/v2/resources/agents/channels.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAIpD,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,OAAO,CACL,OAAe,EACf,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,cAAc,OAAO,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CACR,OAAe,EACf,OAAe,EACf,IAAiB,EACjB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,cAAc,OAAO,aAAa,OAAO,IAAI,IAAI,EAAE,EAAE;YAClF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { Agents, type AgentListParams, type Agent, type AgentsCursor, type AgentProvider, type AgentVoiceConfig, type AgentCreateParams, type AgentCreateResponse, type AgentRetrieveResponse, type AgentUpdateParams, type AgentUpdateResponse, type AgentTestParams, type AgentTestResponse, } from "./agents.mjs";
2
+ export { Channels, type ChannelConnectParams, type ChannelConnectResponse } from "./channels.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/v2/resources/agents/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,qBAAiB;AAClB,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,uBAAmB"}
@@ -0,0 +1,3 @@
1
+ export { Agents, type AgentListParams, type Agent, type AgentsCursor, type AgentProvider, type AgentVoiceConfig, type AgentCreateParams, type AgentCreateResponse, type AgentRetrieveResponse, type AgentUpdateParams, type AgentUpdateResponse, type AgentTestParams, type AgentTestResponse, } from "./agents.js";
2
+ export { Channels, type ChannelConnectParams, type ChannelConnectResponse } from "./channels.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v2/resources/agents/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,oBAAiB;AAClB,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,sBAAmB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Channels = exports.Agents = void 0;
5
+ var agents_1 = require("./agents.js");
6
+ Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
7
+ var channels_1 = require("./channels.js");
8
+ Object.defineProperty(exports, "Channels", { enumerable: true, get: function () { return channels_1.Channels; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/resources/agents/index.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,sCAckB;AAbhB,gGAAA,MAAM,OAAA;AAcR,0CAA8F;AAArF,oGAAA,QAAQ,OAAA"}
@@ -0,0 +1,4 @@
1
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
2
+ export { Agents, } from "./agents.mjs";
3
+ export { Channels } from "./channels.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/v2/resources/agents/index.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EACL,MAAM,GAaP,qBAAiB;AAClB,OAAO,EAAE,QAAQ,EAA0D,uBAAmB"}
@@ -0,0 +1,2 @@
1
+ export * from "./agents/index.mjs";
2
+ //# sourceMappingURL=agents.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.mts","sourceRoot":"","sources":["../../src/v2/resources/agents.ts"],"names":[],"mappings":"AAEA,mCAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "./agents/index.js";
2
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/v2/resources/agents.ts"],"names":[],"mappings":"AAEA,kCAA+B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./agents/index.js"), exports);
6
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/v2/resources/agents.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,4DAA+B"}
@@ -0,0 +1,3 @@
1
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
2
+ export * from "./agents/index.mjs";
3
+ //# sourceMappingURL=agents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.mjs","sourceRoot":"","sources":["../../src/v2/resources/agents.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,mCAA+B"}
@@ -0,0 +1,100 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { Cursor, PagePromise } from "../../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../../internal/request-options.mjs";
5
+ import type * as T from "../../types.mjs";
6
+ import * as RecipientsAPI from "./recipients.mjs";
7
+ import { Recipients, type RecipientAddParams, type RecipientAddResponse, type BroadcastContactInput, type BroadcastContactsAddResponse } from "./recipients.mjs";
8
+ export declare class Campaigns extends APIResource {
9
+ recipients: RecipientsAPI.Recipients;
10
+ /**
11
+ * List campaigns
12
+ *
13
+ * Campaigns of this project, newest first, as `GET /v1/broadcasts`, each with
14
+ * `from` instead of `senderId`. Cursor pagination: pass `nextCursor` back as
15
+ * `cursor`.
16
+ *
17
+ * `GET /v2/campaigns`
18
+ */
19
+ list(query?: CampaignListParams | null | undefined, options?: RequestOptions): PagePromise<BroadcastsCursor, Broadcast>;
20
+ /**
21
+ * Create a campaign
22
+ *
23
+ * A campaign is a /v1 broadcast; the id works on `/v1/broadcasts/{broadcastId}`.
24
+ * Runs `POST /v1/broadcasts` with the sender resolved from `from`. A repeated
25
+ * `idempotencyKey` answers `409 conflict` with the original in `details.campaign`.
26
+ * A `channel` the resolved sender does not carry (`smart`: no channel at all) is
27
+ * refused at creation with `409 no_channel`, as on `POST /v2/messages`, rather
28
+ * than created and failed at send. `from` with a `channel` it does not carry (a
29
+ * `sms` campaign `from: "sms_oneway"`) is that same `409 no_channel`, in the words
30
+ * `POST /v2/messages` uses (`details.connected`, and `sms` vs `sms_oneway` told
31
+ * apart); `channel` only picks between senders that share an address, it never
32
+ * makes an existing address `404`.
33
+ *
34
+ * `POST /v2/campaigns`
35
+ */
36
+ create(body: CampaignCreateParams, options?: RequestOptions): APIPromise<CampaignCreateResponse>;
37
+ /**
38
+ * Get a campaign
39
+ *
40
+ * `GET /v2/campaigns/{campaignId}`
41
+ */
42
+ retrieve(campaignID: string, options?: RequestOptions): APIPromise<CampaignRetrieveResponse>;
43
+ /**
44
+ * Delete a draft campaign
45
+ *
46
+ * Deletes a campaign that is still a `draft`, as `DELETE
47
+ * /v1/broadcasts/{broadcastId}`. Any other status is refused with `409
48
+ * invalid_status` (`details.status`): a campaign that was sent or cancelled is
49
+ * kept as the record of what went out, and one still in review, scheduled or
50
+ * sending is cancelled with `POST /v2/campaigns/{campaignId}/cancel`
51
+ * (`details.recommendation`). /v1 refuses the same with a `400`.
52
+ *
53
+ * `DELETE /v2/campaigns/{campaignId}`
54
+ */
55
+ delete(campaignID: string, options?: RequestOptions): APIPromise<void>;
56
+ /**
57
+ * Send or schedule a campaign
58
+ *
59
+ * Same review rules as `POST /v1/broadcasts/{broadcastId}/send`: a WhatsApp
60
+ * campaign on an approved template starts directly, email starts once automated
61
+ * review passes, other channels wait for a person. Omit `scheduledAt` to send now.
62
+ *
63
+ * `POST /v2/campaigns/{campaignId}/send`
64
+ */
65
+ send(campaignID: string, body?: CampaignSendParams | null | undefined, options?: RequestOptions): APIPromise<CampaignSendResponse>;
66
+ /**
67
+ * Get campaign progress
68
+ *
69
+ * `GET /v2/campaigns/{campaignId}/progress`
70
+ */
71
+ progress(campaignID: string, options?: RequestOptions): APIPromise<CampaignProgressResponse>;
72
+ /**
73
+ * Cancel a campaign
74
+ *
75
+ * As `POST /v1/broadcasts/{broadcastId}/cancel`. Recipients not yet sent are
76
+ * skipped; messages already queued may still be delivered.
77
+ *
78
+ * `POST /v2/campaigns/{campaignId}/cancel`
79
+ */
80
+ cancel(campaignID: string, options?: RequestOptions): APIPromise<CampaignCancelResponse>;
81
+ }
82
+ export type CampaignListParams = T.CampaignsListParams;
83
+ export type Broadcast = T.Broadcast;
84
+ export type BroadcastsCursor = Cursor<T.Broadcast>;
85
+ export type BroadcastChannel = T.BroadcastChannel;
86
+ export type BroadcastContent = T.BroadcastContent;
87
+ export type BroadcastMessageType = T.BroadcastMessageType;
88
+ export type BroadcastStatus = T.BroadcastStatus;
89
+ export type CampaignCreateParams = T.CampaignsCreateParams;
90
+ export type CampaignCreateResponse = T.CreateCampaignV2Response;
91
+ export type CampaignRetrieveResponse = T.GetCampaignV2Response;
92
+ export type CampaignSendParams = T.CampaignsSendParams;
93
+ export type CampaignSendResponse = T.SendCampaignV2Response;
94
+ export type CampaignProgressResponse = T.BroadcastProgress;
95
+ export type BroadcastProgress = T.BroadcastProgress;
96
+ export type CampaignCancelResponse = T.CancelCampaignV2Response;
97
+ export declare namespace Campaigns {
98
+ export { type Broadcast as Broadcast, type BroadcastChannel as BroadcastChannel, type BroadcastContent as BroadcastContent, type BroadcastMessageType as BroadcastMessageType, type BroadcastProgress as BroadcastProgress, type BroadcastStatus as BroadcastStatus, type BroadcastsCursor as BroadcastsCursor, type CampaignCancelResponse as CampaignCancelResponse, type CampaignCreateParams as CampaignCreateParams, type CampaignCreateResponse as CampaignCreateResponse, type CampaignListParams as CampaignListParams, type CampaignProgressResponse as CampaignProgressResponse, type CampaignRetrieveResponse as CampaignRetrieveResponse, type CampaignSendParams as CampaignSendParams, type CampaignSendResponse as CampaignSendResponse, Recipients as Recipients, type RecipientAddParams as RecipientAddParams, type RecipientAddResponse as RecipientAddResponse, type BroadcastContactInput as BroadcastContactInput, type BroadcastContactsAddResponse as BroadcastContactsAddResponse, };
99
+ }
100
+ //# sourceMappingURL=campaigns.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"campaigns.d.mts","sourceRoot":"","sources":["../../../src/v2/resources/campaigns/campaigns.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qCAAiC;AAE/D,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAEnE,OAAO,KAAK,KAAK,CAAC,wBAAoB;AACtC,OAAO,KAAK,aAAa,yBAAqB;AAC9C,OAAO,EACL,UAAU,EACV,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EAClC,yBAAqB;AAEtB,qBAAa,SAAU,SAAQ,WAAW;IACxC,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAElF;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gBAAgB,EAAE,SAAS,CAAC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