@zavudev/sdk 0.58.0 → 0.59.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.
Files changed (220) hide show
  1. package/CHANGELOG.md +27 -1
  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 +8 -4
  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 +2412 -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 +8 -4
  38. package/types.d.mts.map +1 -1
  39. package/types.d.ts +8 -4
  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 +2171 -0
  194. package/v2/types.d.mts.map +1 -0
  195. package/v2/types.d.ts +2171 -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,41 @@
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
+ /** Configure Zavu Functions. */
7
+ export declare class Functions extends APIResource {
8
+ /**
9
+ * List functions
10
+ *
11
+ * The project's functions, newest first.
12
+ *
13
+ * `GET /v2/functions`
14
+ */
15
+ list(query?: FunctionListParams | null | undefined, options?: RequestOptions): PagePromise<ZavuFunctionsCursor, ZavuFunction>;
16
+ /**
17
+ * Get a function
18
+ *
19
+ * `GET /v2/functions/{functionId}`
20
+ */
21
+ retrieve(functionID: string, options?: RequestOptions): APIPromise<FunctionRetrieveResponse>;
22
+ /**
23
+ * Configure a function
24
+ *
25
+ * Name, description, timeout, memory, architecture, pause and the HTTP endpoint,
26
+ * with the same rules as the dashboard's Settings tab.
27
+ *
28
+ * `PATCH /v2/functions/{functionId}`
29
+ */
30
+ update(functionID: string, body?: FunctionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<FunctionUpdateResponse>;
31
+ }
32
+ export type FunctionListParams = T.FunctionsListParams;
33
+ export type ZavuFunction = T.ZavuFunction;
34
+ export type ZavuFunctionsCursor = Cursor<T.ZavuFunction>;
35
+ export type FunctionRetrieveResponse = T.GetFunctionV2Response;
36
+ export type FunctionUpdateParams = T.FunctionsUpdateParams;
37
+ export type FunctionUpdateResponse = T.UpdateFunctionV2Response;
38
+ export declare namespace Functions {
39
+ export { type FunctionListParams as FunctionListParams, type FunctionRetrieveResponse as FunctionRetrieveResponse, type FunctionUpdateParams as FunctionUpdateParams, type FunctionUpdateResponse as FunctionUpdateResponse, type ZavuFunction as ZavuFunction, type ZavuFunctionsCursor as ZavuFunctionsCursor, };
40
+ }
41
+ //# sourceMappingURL=functions.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.mts","sourceRoot":"","sources":["../../src/v2/resources/functions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,kCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,qBAAiB;AAEnC,gCAAgC;AAChC,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;OAMG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAIjD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAI5F;;;;;;;OAOG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAGtC;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,qBAAqB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,qBAAqB,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEhE,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,41 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { Cursor, PagePromise } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ import type * as T from "../types.js";
6
+ /** Configure Zavu Functions. */
7
+ export declare class Functions extends APIResource {
8
+ /**
9
+ * List functions
10
+ *
11
+ * The project's functions, newest first.
12
+ *
13
+ * `GET /v2/functions`
14
+ */
15
+ list(query?: FunctionListParams | null | undefined, options?: RequestOptions): PagePromise<ZavuFunctionsCursor, ZavuFunction>;
16
+ /**
17
+ * Get a function
18
+ *
19
+ * `GET /v2/functions/{functionId}`
20
+ */
21
+ retrieve(functionID: string, options?: RequestOptions): APIPromise<FunctionRetrieveResponse>;
22
+ /**
23
+ * Configure a function
24
+ *
25
+ * Name, description, timeout, memory, architecture, pause and the HTTP endpoint,
26
+ * with the same rules as the dashboard's Settings tab.
27
+ *
28
+ * `PATCH /v2/functions/{functionId}`
29
+ */
30
+ update(functionID: string, body?: FunctionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<FunctionUpdateResponse>;
31
+ }
32
+ export type FunctionListParams = T.FunctionsListParams;
33
+ export type ZavuFunction = T.ZavuFunction;
34
+ export type ZavuFunctionsCursor = Cursor<T.ZavuFunction>;
35
+ export type FunctionRetrieveResponse = T.GetFunctionV2Response;
36
+ export type FunctionUpdateParams = T.FunctionsUpdateParams;
37
+ export type FunctionUpdateResponse = T.UpdateFunctionV2Response;
38
+ export declare namespace Functions {
39
+ export { type FunctionListParams as FunctionListParams, type FunctionRetrieveResponse as FunctionRetrieveResponse, type FunctionUpdateParams as FunctionUpdateParams, type FunctionUpdateResponse as FunctionUpdateResponse, type ZavuFunction as ZavuFunction, type ZavuFunctionsCursor as ZavuFunctionsCursor, };
40
+ }
41
+ //# sourceMappingURL=functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/v2/resources/functions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,iCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,oBAAiB;AAEnC,gCAAgC;AAChC,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;OAMG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAIjD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAI5F;;;;;;;OAOG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAGtC;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,YAAY,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,qBAAqB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,qBAAqB,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,wBAAwB,CAAC;AAEhE,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,41 @@
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.Functions = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ /** Configure Zavu Functions. */
9
+ class Functions extends resource_1.APIResource {
10
+ /**
11
+ * List functions
12
+ *
13
+ * The project's functions, newest first.
14
+ *
15
+ * `GET /v2/functions`
16
+ */
17
+ list(query = {}, options) {
18
+ return this._client.getAPIList('/v2/functions', (pagination_1.Cursor), { query, ...options });
19
+ }
20
+ /**
21
+ * Get a function
22
+ *
23
+ * `GET /v2/functions/{functionId}`
24
+ */
25
+ retrieve(functionID, options) {
26
+ return this._client.get((0, path_1.path) `/v2/functions/${functionID}`, options);
27
+ }
28
+ /**
29
+ * Configure a function
30
+ *
31
+ * Name, description, timeout, memory, architecture, pause and the HTTP endpoint,
32
+ * with the same rules as the dashboard's Settings tab.
33
+ *
34
+ * `PATCH /v2/functions/{functionId}`
35
+ */
36
+ update(functionID, body = {}, options) {
37
+ return this._client.patch((0, path_1.path) `/v2/functions/${functionID}`, { body, ...options });
38
+ }
39
+ }
40
+ exports.Functions = Functions;
41
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/v2/resources/functions.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,qDAAkD;AAElD,yDAA4D;AAE5D,uDAAiD;AAGjD,gCAAgC;AAChC,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;OAMG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,mBAAoB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,UAAkB,EAClB,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,iBAAiB,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAvCD,8BAuCC"}
@@ -0,0 +1,37 @@
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 { path } from "../../internal/utils/path.mjs";
5
+ /** Configure Zavu Functions. */
6
+ export class Functions extends APIResource {
7
+ /**
8
+ * List functions
9
+ *
10
+ * The project's functions, newest first.
11
+ *
12
+ * `GET /v2/functions`
13
+ */
14
+ list(query = {}, options) {
15
+ return this._client.getAPIList('/v2/functions', (Cursor), { query, ...options });
16
+ }
17
+ /**
18
+ * Get a function
19
+ *
20
+ * `GET /v2/functions/{functionId}`
21
+ */
22
+ retrieve(functionID, options) {
23
+ return this._client.get(path `/v2/functions/${functionID}`, options);
24
+ }
25
+ /**
26
+ * Configure a function
27
+ *
28
+ * Name, description, timeout, memory, architecture, pause and the HTTP endpoint,
29
+ * with the same rules as the dashboard's Settings tab.
30
+ *
31
+ * `PATCH /v2/functions/{functionId}`
32
+ */
33
+ update(functionID, body = {}, options) {
34
+ return this._client.patch(path `/v2/functions/${functionID}`, { body, ...options });
35
+ }
36
+ }
37
+ //# sourceMappingURL=functions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.mjs","sourceRoot":"","sources":["../../src/v2/resources/functions.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,MAAM,EAAe,kCAA8B;AAE5D,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAGjD,gCAAgC;AAChC,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;OAMG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,MAAoB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,UAAkB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,UAAkB,EAClB,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,iBAAiB,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ export { Messages, type MessageSendParams, type MessageSendResponse, type ChannelTypeRequest, type EmailAttachmentInput, type Message, type MessageContent, type MessageType, type Routing, type SendMessageResponse, type MessageListParams, type MessagesCursor, type ChannelType, type MessageStatus, type MessageRetrieveResponse, } from "./messages.mjs";
2
+ export { Conversations, type ConversationListParams, type Conversation, type ConversationsCursor, type ConversationRetrieveResponse, type ConversationListMessagesParams, type ConversationMarkAsReadResponse, } from "./conversations.mjs";
3
+ export { Contacts, type ContactListParams, type Contact, type ContactsCursor, type ContactChannel, type ContactCreateParams, type ContactCreateResponse, type ContactChannelInput, type ContactRetrieveResponse, type ContactUpdateParams, type ContactUpdateResponse, } from "./contacts.mjs";
4
+ export { Channels, type ChannelListParams, type ChannelEntry, type ChannelEntriesCursor, type ChannelConnectParams, type ChannelConnectResponse, type ChannelRetrieveResponse, type ActivatableChannel, type ChannelActivateResponse, type ChannelDeactivateResponse, } from "./channels.mjs";
5
+ export { Templates, type TemplateListParams, type Template, type TemplatesCursor, type WhatsAppCategory, type TemplateCreateParams, type TemplateCreateResponse, type TemplateRetrieveResponse, type TemplateSubmitParams, type TemplateSubmitResponse, } from "./templates.mjs";
6
+ export { Campaigns, type CampaignListParams, type Broadcast, type BroadcastsCursor, type BroadcastChannel, type BroadcastContent, type BroadcastMessageType, type BroadcastStatus, type CampaignCreateParams, type CampaignCreateResponse, type CampaignRetrieveResponse, type CampaignSendParams, type CampaignSendResponse, type CampaignProgressResponse, type BroadcastProgress, type CampaignCancelResponse, } from "./campaigns/campaigns.mjs";
7
+ export { Webhook, type WebhookRetrieveResponse, type ProjectWebhookV2, type SenderWebhookV1, type WebhookSetParams, type WebhookSetResponse, type WebhookEvent, type WebhookSignatureVersion, type WebhookRotateSecretResponse, } from "./webhook.mjs";
8
+ 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/agents.mjs";
9
+ export { Numbers, type NumberSearchAvailableParams, type NumberSearchAvailableResponse, type AvailablePhoneNumber, type PhoneNumberType, type NumberPurchaseParams, type NumberPurchaseResponse, type ErrorBody, type OwnedPhoneNumber, } from "./numbers.mjs";
10
+ export { EmailDomains, type EmailDomainListResponse, type EmailDomain, type EmailDomainCreateParams, type EmailDomainCreateResponse, type EmailDomainRetrieveResponse, type EmailDomainVerifyResponse, } from "./email-domains.mjs";
11
+ export { Functions, type FunctionListParams, type ZavuFunction, type ZavuFunctionsCursor, type FunctionRetrieveResponse, type FunctionUpdateParams, type FunctionUpdateResponse, } from "./functions.mjs";
12
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/v2/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,uBAAuB,GAC7B,uBAAmB;AACpB,OAAO,EACL,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,GACpC,4BAAwB;AACzB,OAAO,E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ACN,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,4BAAwB;AACzB,OAAO,EACL,OAAO,EACP,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,gBAAgB,GACtB,sBAAkB;AACnB,OAAO,EACL,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B,4BAAwB;AACzB,OAAO,EACL,SAAS,EACT,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,wBAAoB"}
@@ -0,0 +1,12 @@
1
+ export { Messages, type MessageSendParams, type MessageSendResponse, type ChannelTypeRequest, type EmailAttachmentInput, type Message, type MessageContent, type MessageType, type Routing, type SendMessageResponse, type MessageListParams, type MessagesCursor, type ChannelType, type MessageStatus, type MessageRetrieveResponse, } from "./messages.js";
2
+ export { Conversations, type ConversationListParams, type Conversation, type ConversationsCursor, type ConversationRetrieveResponse, type ConversationListMessagesParams, type ConversationMarkAsReadResponse, } from "./conversations.js";
3
+ export { Contacts, type ContactListParams, type Contact, type ContactsCursor, type ContactChannel, type ContactCreateParams, type ContactCreateResponse, type ContactChannelInput, type ContactRetrieveResponse, type ContactUpdateParams, type ContactUpdateResponse, } from "./contacts.js";
4
+ export { Channels, type ChannelListParams, type ChannelEntry, type ChannelEntriesCursor, type ChannelConnectParams, type ChannelConnectResponse, type ChannelRetrieveResponse, type ActivatableChannel, type ChannelActivateResponse, type ChannelDeactivateResponse, } from "./channels.js";
5
+ export { Templates, type TemplateListParams, type Template, type TemplatesCursor, type WhatsAppCategory, type TemplateCreateParams, type TemplateCreateResponse, type TemplateRetrieveResponse, type TemplateSubmitParams, type TemplateSubmitResponse, } from "./templates.js";
6
+ export { Campaigns, type CampaignListParams, type Broadcast, type BroadcastsCursor, type BroadcastChannel, type BroadcastContent, type BroadcastMessageType, type BroadcastStatus, type CampaignCreateParams, type CampaignCreateResponse, type CampaignRetrieveResponse, type CampaignSendParams, type CampaignSendResponse, type CampaignProgressResponse, type BroadcastProgress, type CampaignCancelResponse, } from "./campaigns/campaigns.js";
7
+ export { Webhook, type WebhookRetrieveResponse, type ProjectWebhookV2, type SenderWebhookV1, type WebhookSetParams, type WebhookSetResponse, type WebhookEvent, type WebhookSignatureVersion, type WebhookRotateSecretResponse, } from "./webhook.js";
8
+ 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/agents.js";
9
+ export { Numbers, type NumberSearchAvailableParams, type NumberSearchAvailableResponse, type AvailablePhoneNumber, type PhoneNumberType, type NumberPurchaseParams, type NumberPurchaseResponse, type ErrorBody, type OwnedPhoneNumber, } from "./numbers.js";
10
+ export { EmailDomains, type EmailDomainListResponse, type EmailDomain, type EmailDomainCreateParams, type EmailDomainCreateResponse, type EmailDomainRetrieveResponse, type EmailDomainVerifyResponse, } from "./email-domains.js";
11
+ export { Functions, type FunctionListParams, type ZavuFunction, type ZavuFunctionsCursor, type FunctionRetrieveResponse, type FunctionUpdateParams, type FunctionUpdateResponse, } from "./functions.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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AK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,uBAAoB"}
@@ -0,0 +1,27 @@
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.Functions = exports.EmailDomains = exports.Numbers = exports.Agents = exports.Webhook = exports.Campaigns = exports.Templates = exports.Channels = exports.Contacts = exports.Conversations = exports.Messages = void 0;
5
+ var messages_1 = require("./messages.js");
6
+ Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
7
+ var conversations_1 = require("./conversations.js");
8
+ Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
9
+ var contacts_1 = require("./contacts.js");
10
+ Object.defineProperty(exports, "Contacts", { enumerable: true, get: function () { return contacts_1.Contacts; } });
11
+ var channels_1 = require("./channels.js");
12
+ Object.defineProperty(exports, "Channels", { enumerable: true, get: function () { return channels_1.Channels; } });
13
+ var templates_1 = require("./templates.js");
14
+ Object.defineProperty(exports, "Templates", { enumerable: true, get: function () { return templates_1.Templates; } });
15
+ var campaigns_1 = require("./campaigns/campaigns.js");
16
+ Object.defineProperty(exports, "Campaigns", { enumerable: true, get: function () { return campaigns_1.Campaigns; } });
17
+ var webhook_1 = require("./webhook.js");
18
+ Object.defineProperty(exports, "Webhook", { enumerable: true, get: function () { return webhook_1.Webhook; } });
19
+ var agents_1 = require("./agents/agents.js");
20
+ Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
21
+ var numbers_1 = require("./numbers.js");
22
+ Object.defineProperty(exports, "Numbers", { enumerable: true, get: function () { return numbers_1.Numbers; } });
23
+ var email_domains_1 = require("./email-domains.js");
24
+ Object.defineProperty(exports, "EmailDomains", { enumerable: true, get: function () { return email_domains_1.EmailDomains; } });
25
+ var functions_1 = require("./functions.js");
26
+ Object.defineProperty(exports, "Functions", { enumerable: true, get: function () { return functions_1.Functions; } });
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/resources/index.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,0CAgBoB;AAflB,oGAAA,QAAQ,OAAA;AAgBV,oDAQyB;AAPvB,8GAAA,aAAa,OAAA;AAQf,0CAYoB;AAXlB,oGAAA,QAAQ,OAAA;AAYV,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,4CAWqB;AAVnB,sGAAA,SAAS,OAAA;AAWX,sDAiB+B;AAhB7B,sGAAA,SAAS,OAAA;AAiBX,wCAUmB;AATjB,kGAAA,OAAO,OAAA;AAUT,6CAcyB;AAbvB,gGAAA,MAAM,OAAA;AAcR,wCAUmB;AATjB,kGAAA,OAAO,OAAA;AAUT,oDAQyB;AAPvB,6GAAA,YAAY,OAAA;AAQd,4CAQqB;AAPnB,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,13 @@
1
+ // Generated by zavu-codegen from apps/docs/api-reference/v2/openapi.json. Do not edit: run `bun run codegen`.
2
+ export { Messages, } from "./messages.mjs";
3
+ export { Conversations, } from "./conversations.mjs";
4
+ export { Contacts, } from "./contacts.mjs";
5
+ export { Channels, } from "./channels.mjs";
6
+ export { Templates, } from "./templates.mjs";
7
+ export { Campaigns, } from "./campaigns/campaigns.mjs";
8
+ export { Webhook, } from "./webhook.mjs";
9
+ export { Agents, } from "./agents/agents.mjs";
10
+ export { Numbers, } from "./numbers.mjs";
11
+ export { EmailDomains, } from "./email-domains.mjs";
12
+ export { Functions, } from "./functions.mjs";
13
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/v2/resources/index.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EACL,QAAQ,GAeT,uBAAmB;AACpB,OAAO,EACL,aAAa,GAOd,4BAAwB;AACzB,OAAO,EACL,QAAQ,GAWT,uBAAmB;AACpB,OAAO,EACL,QAAQ,GAUT,uBAAmB;AACpB,OAAO,EACL,SAAS,GAUV,wBAAoB;AACrB,OAAO,EACL,SAAS,GAgBV,kCAA8B;AAC/B,OAAO,EACL,OAAO,GASR,sBAAkB;AACnB,OAAO,EACL,MAAM,GAaP,4BAAwB;AACzB,OAAO,EACL,OAAO,GASR,sBAAkB;AACnB,OAAO,EACL,YAAY,GAOb,4BAAwB;AACzB,OAAO,EACL,SAAS,GAOV,wBAAoB"}
@@ -0,0 +1,82 @@
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
+ /** Send, list and read messages. */
7
+ export declare class Messages extends APIResource {
8
+ /**
9
+ * Send a message
10
+ *
11
+ * Send one message. The body is the /v1 message body plus `from` and
12
+ * `conversationId`. There is no `Zavu-Sender` header.
13
+ *
14
+ * **Where it leaves from:** `conversationId` if given, else `from` (an address),
15
+ * else the project default. See `from` for ambiguous addresses.
16
+ *
17
+ * **Which transport:** decided by the first branch that applies, and reported in
18
+ * `routing.reason`: a test-mode key uses the WhatsApp sandbox; an email-address
19
+ * `to` uses email; a WhatsApp-only `messageType` uses WhatsApp; an explicit
20
+ * `channel` is used as given; otherwise the fixed order over the sender's ACTIVE
21
+ * transports (for a phone number: WhatsApp, then SMS, then one-way SMS). The order
22
+ * ignores price and the 24-hour window. A `channel` that contradicts the recipient
23
+ * (an email `to` on anything but `email`, or `channel: "email"` with a phone
24
+ * number or chat id) or a WhatsApp-only `messageType` is refused with `400`; /v1
25
+ * overrides the first and last silently.
26
+ *
27
+ * **When nothing can send** the answer is always `409 no_channel`, whatever the
28
+ * reason: no channel at all, an explicit `channel` that is not connected, an email
29
+ * `to` without an email channel, a WhatsApp-only `messageType` without WhatsApp.
30
+ * `details.connect` lists what this project can connect to reach `to`, with the
31
+ * exact call for each (`POST /v2/channels`, `POST /v2/numbers`), and the message
32
+ * never names an address that carries nothing.
33
+ *
34
+ * **Fallback** from WhatsApp to SMS, when enabled, happens after this call
35
+ * returned, once the WhatsApp send fails. It is not visible in `routing`; read
36
+ * `attemptedChannels` on the message or wait for the webhooks. Before falling back
37
+ * to SMS, a message sent through /v2 is checked for an approved 10DLC campaign (+1
38
+ * numbers) and an active connection; when either is missing it stays `failed` with
39
+ * `errorCode` `TEN_DLC_REQUIRED` or `CHANNEL_INACTIVE`.
40
+ *
41
+ * Limits, risk review, pricing and verification are exactly /v1's: see `POST
42
+ * /v1/messages`.
43
+ *
44
+ * `POST /v2/messages`
45
+ */
46
+ send(body?: MessageSendParams | null | undefined, options?: RequestOptions): APIPromise<MessageSendResponse>;
47
+ /**
48
+ * List messages
49
+ *
50
+ * List messages of this project, newest first.
51
+ *
52
+ * `GET /v2/messages`
53
+ */
54
+ list(query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
55
+ /**
56
+ * Get a message
57
+ *
58
+ * A message, with `from` and `to` naming addresses, plus `attemptedChannels` and
59
+ * `riskHold`.
60
+ *
61
+ * `GET /v2/messages/{messageId}`
62
+ */
63
+ retrieve(messageID: string, options?: RequestOptions): APIPromise<MessageRetrieveResponse>;
64
+ }
65
+ export type MessageSendParams = T.MessagesSendParams;
66
+ export type MessageSendResponse = T.SendMessageResponse;
67
+ export type ChannelTypeRequest = T.ChannelTypeRequest;
68
+ export type EmailAttachmentInput = T.EmailAttachmentInput;
69
+ export type Message = T.Message;
70
+ export type MessageContent = T.MessageContent;
71
+ export type MessageType = T.MessageType;
72
+ export type Routing = T.Routing;
73
+ export type SendMessageResponse = T.SendMessageResponse;
74
+ export type MessageListParams = T.MessagesListParams;
75
+ export type MessagesCursor = Cursor<T.Message>;
76
+ export type ChannelType = T.ChannelType;
77
+ export type MessageStatus = T.MessageStatus;
78
+ export type MessageRetrieveResponse = T.GetMessageV2Response;
79
+ export declare namespace Messages {
80
+ export { type ChannelType as ChannelType, type ChannelTypeRequest as ChannelTypeRequest, type EmailAttachmentInput as EmailAttachmentInput, type Message as Message, type MessageContent as MessageContent, type MessageListParams as MessageListParams, type MessageRetrieveResponse as MessageRetrieveResponse, type MessageSendParams as MessageSendParams, type MessageSendResponse as MessageSendResponse, type MessageStatus as MessageStatus, type MessageType as MessageType, type MessagesCursor as MessagesCursor, type Routing as Routing, type SendMessageResponse as SendMessageResponse, };
81
+ }
82
+ //# sourceMappingURL=messages.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/v2/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,kCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,qBAAiB;AAEnC,oCAAoC;AACpC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CACF,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;OAMG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAIvC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAG3F;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,kBAAkB,CAAC;AAErD,MA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,EACvB,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,82 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { Cursor, PagePromise } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ import type * as T from "../types.js";
6
+ /** Send, list and read messages. */
7
+ export declare class Messages extends APIResource {
8
+ /**
9
+ * Send a message
10
+ *
11
+ * Send one message. The body is the /v1 message body plus `from` and
12
+ * `conversationId`. There is no `Zavu-Sender` header.
13
+ *
14
+ * **Where it leaves from:** `conversationId` if given, else `from` (an address),
15
+ * else the project default. See `from` for ambiguous addresses.
16
+ *
17
+ * **Which transport:** decided by the first branch that applies, and reported in
18
+ * `routing.reason`: a test-mode key uses the WhatsApp sandbox; an email-address
19
+ * `to` uses email; a WhatsApp-only `messageType` uses WhatsApp; an explicit
20
+ * `channel` is used as given; otherwise the fixed order over the sender's ACTIVE
21
+ * transports (for a phone number: WhatsApp, then SMS, then one-way SMS). The order
22
+ * ignores price and the 24-hour window. A `channel` that contradicts the recipient
23
+ * (an email `to` on anything but `email`, or `channel: "email"` with a phone
24
+ * number or chat id) or a WhatsApp-only `messageType` is refused with `400`; /v1
25
+ * overrides the first and last silently.
26
+ *
27
+ * **When nothing can send** the answer is always `409 no_channel`, whatever the
28
+ * reason: no channel at all, an explicit `channel` that is not connected, an email
29
+ * `to` without an email channel, a WhatsApp-only `messageType` without WhatsApp.
30
+ * `details.connect` lists what this project can connect to reach `to`, with the
31
+ * exact call for each (`POST /v2/channels`, `POST /v2/numbers`), and the message
32
+ * never names an address that carries nothing.
33
+ *
34
+ * **Fallback** from WhatsApp to SMS, when enabled, happens after this call
35
+ * returned, once the WhatsApp send fails. It is not visible in `routing`; read
36
+ * `attemptedChannels` on the message or wait for the webhooks. Before falling back
37
+ * to SMS, a message sent through /v2 is checked for an approved 10DLC campaign (+1
38
+ * numbers) and an active connection; when either is missing it stays `failed` with
39
+ * `errorCode` `TEN_DLC_REQUIRED` or `CHANNEL_INACTIVE`.
40
+ *
41
+ * Limits, risk review, pricing and verification are exactly /v1's: see `POST
42
+ * /v1/messages`.
43
+ *
44
+ * `POST /v2/messages`
45
+ */
46
+ send(body?: MessageSendParams | null | undefined, options?: RequestOptions): APIPromise<MessageSendResponse>;
47
+ /**
48
+ * List messages
49
+ *
50
+ * List messages of this project, newest first.
51
+ *
52
+ * `GET /v2/messages`
53
+ */
54
+ list(query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesCursor, Message>;
55
+ /**
56
+ * Get a message
57
+ *
58
+ * A message, with `from` and `to` naming addresses, plus `attemptedChannels` and
59
+ * `riskHold`.
60
+ *
61
+ * `GET /v2/messages/{messageId}`
62
+ */
63
+ retrieve(messageID: string, options?: RequestOptions): APIPromise<MessageRetrieveResponse>;
64
+ }
65
+ export type MessageSendParams = T.MessagesSendParams;
66
+ export type MessageSendResponse = T.SendMessageResponse;
67
+ export type ChannelTypeRequest = T.ChannelTypeRequest;
68
+ export type EmailAttachmentInput = T.EmailAttachmentInput;
69
+ export type Message = T.Message;
70
+ export type MessageContent = T.MessageContent;
71
+ export type MessageType = T.MessageType;
72
+ export type Routing = T.Routing;
73
+ export type SendMessageResponse = T.SendMessageResponse;
74
+ export type MessageListParams = T.MessagesListParams;
75
+ export type MessagesCursor = Cursor<T.Message>;
76
+ export type ChannelType = T.ChannelType;
77
+ export type MessageStatus = T.MessageStatus;
78
+ export type MessageRetrieveResponse = T.GetMessageV2Response;
79
+ export declare namespace Messages {
80
+ export { type ChannelType as ChannelType, type ChannelTypeRequest as ChannelTypeRequest, type EmailAttachmentInput as EmailAttachmentInput, type Message as Message, type MessageContent as MessageContent, type MessageListParams as MessageListParams, type MessageRetrieveResponse as MessageRetrieveResponse, type MessageSendParams as MessageSendParams, type MessageSendResponse as MessageSendResponse, type MessageStatus as MessageStatus, type MessageType as MessageType, type MessagesCursor as MessagesCursor, type Routing as Routing, type SendMessageResponse as SendMessageResponse, };
81
+ }
82
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/v2/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,iCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,OAAO,KAAK,KAAK,CAAC,oBAAiB;AAEnC,oCAAoC;AACpC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CACF,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAIlC;;;;;;OAMG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAIvC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAG3F;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,kBAAkB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,mBAAmB,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,oBAAoB,CAAC;AAE1D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAEhC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,cAAc,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;AAExC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,mBAAmB,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,kBAAkB,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,aAAa,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,oBAAoB,CAAC;AAE7D,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,74 @@
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.Messages = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ /** Send, list and read messages. */
9
+ class Messages extends resource_1.APIResource {
10
+ /**
11
+ * Send a message
12
+ *
13
+ * Send one message. The body is the /v1 message body plus `from` and
14
+ * `conversationId`. There is no `Zavu-Sender` header.
15
+ *
16
+ * **Where it leaves from:** `conversationId` if given, else `from` (an address),
17
+ * else the project default. See `from` for ambiguous addresses.
18
+ *
19
+ * **Which transport:** decided by the first branch that applies, and reported in
20
+ * `routing.reason`: a test-mode key uses the WhatsApp sandbox; an email-address
21
+ * `to` uses email; a WhatsApp-only `messageType` uses WhatsApp; an explicit
22
+ * `channel` is used as given; otherwise the fixed order over the sender's ACTIVE
23
+ * transports (for a phone number: WhatsApp, then SMS, then one-way SMS). The order
24
+ * ignores price and the 24-hour window. A `channel` that contradicts the recipient
25
+ * (an email `to` on anything but `email`, or `channel: "email"` with a phone
26
+ * number or chat id) or a WhatsApp-only `messageType` is refused with `400`; /v1
27
+ * overrides the first and last silently.
28
+ *
29
+ * **When nothing can send** the answer is always `409 no_channel`, whatever the
30
+ * reason: no channel at all, an explicit `channel` that is not connected, an email
31
+ * `to` without an email channel, a WhatsApp-only `messageType` without WhatsApp.
32
+ * `details.connect` lists what this project can connect to reach `to`, with the
33
+ * exact call for each (`POST /v2/channels`, `POST /v2/numbers`), and the message
34
+ * never names an address that carries nothing.
35
+ *
36
+ * **Fallback** from WhatsApp to SMS, when enabled, happens after this call
37
+ * returned, once the WhatsApp send fails. It is not visible in `routing`; read
38
+ * `attemptedChannels` on the message or wait for the webhooks. Before falling back
39
+ * to SMS, a message sent through /v2 is checked for an approved 10DLC campaign (+1
40
+ * numbers) and an active connection; when either is missing it stays `failed` with
41
+ * `errorCode` `TEN_DLC_REQUIRED` or `CHANNEL_INACTIVE`.
42
+ *
43
+ * Limits, risk review, pricing and verification are exactly /v1's: see `POST
44
+ * /v1/messages`.
45
+ *
46
+ * `POST /v2/messages`
47
+ */
48
+ send(body = {}, options) {
49
+ return this._client.post('/v2/messages', { body, ...options });
50
+ }
51
+ /**
52
+ * List messages
53
+ *
54
+ * List messages of this project, newest first.
55
+ *
56
+ * `GET /v2/messages`
57
+ */
58
+ list(query = {}, options) {
59
+ return this._client.getAPIList('/v2/messages', (pagination_1.Cursor), { query, ...options });
60
+ }
61
+ /**
62
+ * Get a message
63
+ *
64
+ * A message, with `from` and `to` naming addresses, plus `attemptedChannels` and
65
+ * `riskHold`.
66
+ *
67
+ * `GET /v2/messages/{messageId}`
68
+ */
69
+ retrieve(messageID, options) {
70
+ return this._client.get((0, path_1.path) `/v2/messages/${messageID}`, options);
71
+ }
72
+ }
73
+ exports.Messages = Messages;
74
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/v2/resources/messages.ts"],"names":[],"mappings":";AAAA,8GAA8G;;;AAE9G,qDAAkD;AAElD,yDAA4D;AAE5D,uDAAiD;AAGjD,oCAAoC;AACpC,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CACF,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,mBAAe,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AAvED,4BAuEC"}
@@ -0,0 +1,70 @@
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 { path } from "../../internal/utils/path.mjs";
5
+ /** Send, list and read messages. */
6
+ export class Messages extends APIResource {
7
+ /**
8
+ * Send a message
9
+ *
10
+ * Send one message. The body is the /v1 message body plus `from` and
11
+ * `conversationId`. There is no `Zavu-Sender` header.
12
+ *
13
+ * **Where it leaves from:** `conversationId` if given, else `from` (an address),
14
+ * else the project default. See `from` for ambiguous addresses.
15
+ *
16
+ * **Which transport:** decided by the first branch that applies, and reported in
17
+ * `routing.reason`: a test-mode key uses the WhatsApp sandbox; an email-address
18
+ * `to` uses email; a WhatsApp-only `messageType` uses WhatsApp; an explicit
19
+ * `channel` is used as given; otherwise the fixed order over the sender's ACTIVE
20
+ * transports (for a phone number: WhatsApp, then SMS, then one-way SMS). The order
21
+ * ignores price and the 24-hour window. A `channel` that contradicts the recipient
22
+ * (an email `to` on anything but `email`, or `channel: "email"` with a phone
23
+ * number or chat id) or a WhatsApp-only `messageType` is refused with `400`; /v1
24
+ * overrides the first and last silently.
25
+ *
26
+ * **When nothing can send** the answer is always `409 no_channel`, whatever the
27
+ * reason: no channel at all, an explicit `channel` that is not connected, an email
28
+ * `to` without an email channel, a WhatsApp-only `messageType` without WhatsApp.
29
+ * `details.connect` lists what this project can connect to reach `to`, with the
30
+ * exact call for each (`POST /v2/channels`, `POST /v2/numbers`), and the message
31
+ * never names an address that carries nothing.
32
+ *
33
+ * **Fallback** from WhatsApp to SMS, when enabled, happens after this call
34
+ * returned, once the WhatsApp send fails. It is not visible in `routing`; read
35
+ * `attemptedChannels` on the message or wait for the webhooks. Before falling back
36
+ * to SMS, a message sent through /v2 is checked for an approved 10DLC campaign (+1
37
+ * numbers) and an active connection; when either is missing it stays `failed` with
38
+ * `errorCode` `TEN_DLC_REQUIRED` or `CHANNEL_INACTIVE`.
39
+ *
40
+ * Limits, risk review, pricing and verification are exactly /v1's: see `POST
41
+ * /v1/messages`.
42
+ *
43
+ * `POST /v2/messages`
44
+ */
45
+ send(body = {}, options) {
46
+ return this._client.post('/v2/messages', { body, ...options });
47
+ }
48
+ /**
49
+ * List messages
50
+ *
51
+ * List messages of this project, newest first.
52
+ *
53
+ * `GET /v2/messages`
54
+ */
55
+ list(query = {}, options) {
56
+ return this._client.getAPIList('/v2/messages', (Cursor), { query, ...options });
57
+ }
58
+ /**
59
+ * Get a message
60
+ *
61
+ * A message, with `from` and `to` naming addresses, plus `attemptedChannels` and
62
+ * `riskHold`.
63
+ *
64
+ * `GET /v2/messages/{messageId}`
65
+ */
66
+ retrieve(messageID, options) {
67
+ return this._client.get(path `/v2/messages/${messageID}`, options);
68
+ }
69
+ }
70
+ //# sourceMappingURL=messages.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/v2/resources/messages.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,MAAM,EAAe,kCAA8B;AAE5D,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAGjD,oCAAoC;AACpC,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CACF,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,MAAe,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF"}