sendblue 3.10.1 → 3.12.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 (263) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +7 -7
  3. package/client.d.mts +46 -7
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +46 -7
  6. package/client.d.ts.map +1 -1
  7. package/client.js +54 -6
  8. package/client.js.map +1 -1
  9. package/client.mjs +54 -6
  10. package/client.mjs.map +1 -1
  11. package/core/streaming.d.mts +33 -0
  12. package/core/streaming.d.mts.map +1 -0
  13. package/core/streaming.d.ts +33 -0
  14. package/core/streaming.d.ts.map +1 -0
  15. package/core/streaming.js +263 -0
  16. package/core/streaming.js.map +1 -0
  17. package/core/streaming.mjs +258 -0
  18. package/core/streaming.mjs.map +1 -0
  19. package/internal/decoders/line.d.mts +17 -0
  20. package/internal/decoders/line.d.mts.map +1 -0
  21. package/internal/decoders/line.d.ts +17 -0
  22. package/internal/decoders/line.d.ts.map +1 -0
  23. package/internal/decoders/line.js +113 -0
  24. package/internal/decoders/line.js.map +1 -0
  25. package/internal/decoders/line.mjs +108 -0
  26. package/internal/decoders/line.mjs.map +1 -0
  27. package/internal/parse.d.mts.map +1 -1
  28. package/internal/parse.d.ts.map +1 -1
  29. package/internal/parse.js +10 -0
  30. package/internal/parse.js.map +1 -1
  31. package/internal/parse.mjs +10 -0
  32. package/internal/parse.mjs.map +1 -1
  33. package/internal/request-options.d.mts +2 -0
  34. package/internal/request-options.d.mts.map +1 -1
  35. package/internal/request-options.d.ts +2 -0
  36. package/internal/request-options.d.ts.map +1 -1
  37. package/internal/request-options.js.map +1 -1
  38. package/internal/request-options.mjs.map +1 -1
  39. package/internal/tslib.js +17 -17
  40. package/package.json +11 -1
  41. package/resources/auth/auth.d.mts +10 -0
  42. package/resources/auth/auth.d.mts.map +1 -0
  43. package/resources/auth/auth.d.ts +10 -0
  44. package/resources/auth/auth.d.ts.map +1 -0
  45. package/resources/auth/auth.js +17 -0
  46. package/resources/auth/auth.js.map +1 -0
  47. package/resources/auth/auth.mjs +12 -0
  48. package/resources/auth/auth.mjs.map +1 -0
  49. package/resources/auth/index.d.mts +3 -0
  50. package/resources/auth/index.d.mts.map +1 -0
  51. package/resources/auth/index.d.ts +3 -0
  52. package/resources/auth/index.d.ts.map +1 -0
  53. package/resources/auth/index.js +9 -0
  54. package/resources/auth/index.js.map +1 -0
  55. package/resources/auth/index.mjs +4 -0
  56. package/resources/auth/index.mjs.map +1 -0
  57. package/resources/auth/tokens.d.mts +77 -0
  58. package/resources/auth/tokens.d.mts.map +1 -0
  59. package/resources/auth/tokens.d.ts +77 -0
  60. package/resources/auth/tokens.d.ts.map +1 -0
  61. package/resources/auth/tokens.js +51 -0
  62. package/resources/auth/tokens.js.map +1 -0
  63. package/resources/auth/tokens.mjs +47 -0
  64. package/resources/auth/tokens.mjs.map +1 -0
  65. package/resources/auth.d.mts +2 -0
  66. package/resources/auth.d.mts.map +1 -0
  67. package/resources/auth.d.ts +2 -0
  68. package/resources/auth.d.ts.map +1 -0
  69. package/resources/auth.js +6 -0
  70. package/resources/auth.js.map +1 -0
  71. package/resources/auth.mjs +3 -0
  72. package/resources/auth.mjs.map +1 -0
  73. package/resources/contacts/contacts.d.mts +8 -0
  74. package/resources/contacts/contacts.d.mts.map +1 -1
  75. package/resources/contacts/contacts.d.ts +8 -0
  76. package/resources/contacts/contacts.d.ts.map +1 -1
  77. package/resources/contacts/contacts.js.map +1 -1
  78. package/resources/contacts/contacts.mjs.map +1 -1
  79. package/resources/events.d.mts +45 -0
  80. package/resources/events.d.mts.map +1 -0
  81. package/resources/events.d.ts +45 -0
  82. package/resources/events.d.ts.map +1 -0
  83. package/resources/events.js +37 -0
  84. package/resources/events.js.map +1 -0
  85. package/resources/events.mjs +33 -0
  86. package/resources/events.mjs.map +1 -0
  87. package/resources/groups.d.mts +25 -0
  88. package/resources/groups.d.mts.map +1 -1
  89. package/resources/groups.d.ts +25 -0
  90. package/resources/groups.d.ts.map +1 -1
  91. package/resources/index.d.mts +8 -2
  92. package/resources/index.d.mts.map +1 -1
  93. package/resources/index.d.ts +8 -2
  94. package/resources/index.d.ts.map +1 -1
  95. package/resources/index.js +13 -1
  96. package/resources/index.js.map +1 -1
  97. package/resources/index.mjs +6 -0
  98. package/resources/index.mjs.map +1 -1
  99. package/resources/lines/call-forwarding.d.mts +3 -0
  100. package/resources/lines/call-forwarding.d.mts.map +1 -1
  101. package/resources/lines/call-forwarding.d.ts +3 -0
  102. package/resources/lines/call-forwarding.d.ts.map +1 -1
  103. package/resources/lines/call-forwarding.js +3 -0
  104. package/resources/lines/call-forwarding.js.map +1 -1
  105. package/resources/lines/call-forwarding.mjs +3 -0
  106. package/resources/lines/call-forwarding.mjs.map +1 -1
  107. package/resources/lines/index.d.mts +1 -1
  108. package/resources/lines/index.d.mts.map +1 -1
  109. package/resources/lines/index.d.ts +1 -1
  110. package/resources/lines/index.d.ts.map +1 -1
  111. package/resources/lines/index.js.map +1 -1
  112. package/resources/lines/index.mjs.map +1 -1
  113. package/resources/lines/lines.d.mts +30 -0
  114. package/resources/lines/lines.d.mts.map +1 -1
  115. package/resources/lines/lines.d.ts +30 -0
  116. package/resources/lines/lines.d.ts.map +1 -1
  117. package/resources/lines/lines.js +15 -0
  118. package/resources/lines/lines.js.map +1 -1
  119. package/resources/lines/lines.mjs +15 -0
  120. package/resources/lines/lines.mjs.map +1 -1
  121. package/resources/location.d.mts +156 -0
  122. package/resources/location.d.mts.map +1 -0
  123. package/resources/location.d.ts +156 -0
  124. package/resources/location.d.ts.map +1 -0
  125. package/resources/location.js +57 -0
  126. package/resources/location.js.map +1 -0
  127. package/resources/location.mjs +53 -0
  128. package/resources/location.mjs.map +1 -0
  129. package/resources/messages.d.mts +507 -9
  130. package/resources/messages.d.mts.map +1 -1
  131. package/resources/messages.d.ts +507 -9
  132. package/resources/messages.d.ts.map +1 -1
  133. package/resources/messages.js +16 -2
  134. package/resources/messages.js.map +1 -1
  135. package/resources/messages.mjs +16 -2
  136. package/resources/messages.mjs.map +1 -1
  137. package/resources/request-location.d.mts +54 -0
  138. package/resources/request-location.d.mts.map +1 -0
  139. package/resources/request-location.d.ts +54 -0
  140. package/resources/request-location.d.ts.map +1 -0
  141. package/resources/request-location.js +30 -0
  142. package/resources/request-location.js.map +1 -0
  143. package/resources/request-location.mjs +26 -0
  144. package/resources/request-location.mjs.map +1 -0
  145. package/resources/send-carousel.d.mts +67 -0
  146. package/resources/send-carousel.d.mts.map +1 -1
  147. package/resources/send-carousel.d.ts +67 -0
  148. package/resources/send-carousel.d.ts.map +1 -1
  149. package/resources/v2/groups.d.mts +82 -0
  150. package/resources/v2/groups.d.mts.map +1 -0
  151. package/resources/v2/groups.d.ts +82 -0
  152. package/resources/v2/groups.d.ts.map +1 -0
  153. package/resources/v2/groups.js +27 -0
  154. package/resources/v2/groups.js.map +1 -0
  155. package/resources/v2/groups.mjs +23 -0
  156. package/resources/v2/groups.mjs.map +1 -0
  157. package/resources/v2/index.d.mts +1 -0
  158. package/resources/v2/index.d.mts.map +1 -1
  159. package/resources/v2/index.d.ts +1 -0
  160. package/resources/v2/index.d.ts.map +1 -1
  161. package/resources/v2/index.js +3 -1
  162. package/resources/v2/index.js.map +1 -1
  163. package/resources/v2/index.mjs +1 -0
  164. package/resources/v2/index.mjs.map +1 -1
  165. package/resources/v2/v2.d.mts +4 -0
  166. package/resources/v2/v2.d.mts.map +1 -1
  167. package/resources/v2/v2.d.ts +4 -0
  168. package/resources/v2/v2.d.ts.map +1 -1
  169. package/resources/v2/v2.js +4 -0
  170. package/resources/v2/v2.js.map +1 -1
  171. package/resources/v2/v2.mjs +4 -0
  172. package/resources/v2/v2.mjs.map +1 -1
  173. package/resources/verified-contacts.d.mts +152 -0
  174. package/resources/verified-contacts.d.mts.map +1 -0
  175. package/resources/verified-contacts.d.ts +152 -0
  176. package/resources/verified-contacts.d.ts.map +1 -0
  177. package/resources/verified-contacts.js +56 -0
  178. package/resources/verified-contacts.js.map +1 -0
  179. package/resources/verified-contacts.mjs +52 -0
  180. package/resources/verified-contacts.mjs.map +1 -0
  181. package/resources/verify/index.d.mts +3 -0
  182. package/resources/verify/index.d.mts.map +1 -0
  183. package/resources/verify/index.d.ts +3 -0
  184. package/resources/verify/index.d.ts.map +1 -0
  185. package/resources/verify/index.js +9 -0
  186. package/resources/verify/index.js.map +1 -0
  187. package/resources/verify/index.mjs +4 -0
  188. package/resources/verify/index.mjs.map +1 -0
  189. package/resources/verify/verifications.d.mts +45 -0
  190. package/resources/verify/verifications.d.mts.map +1 -0
  191. package/resources/verify/verifications.d.ts +45 -0
  192. package/resources/verify/verifications.d.ts.map +1 -0
  193. package/resources/verify/verifications.js +19 -0
  194. package/resources/verify/verifications.js.map +1 -0
  195. package/resources/verify/verifications.mjs +15 -0
  196. package/resources/verify/verifications.mjs.map +1 -0
  197. package/resources/verify/verify.d.mts +10 -0
  198. package/resources/verify/verify.d.mts.map +1 -0
  199. package/resources/verify/verify.d.ts +10 -0
  200. package/resources/verify/verify.d.ts.map +1 -0
  201. package/resources/verify/verify.js +17 -0
  202. package/resources/verify/verify.js.map +1 -0
  203. package/resources/verify/verify.mjs +12 -0
  204. package/resources/verify/verify.mjs.map +1 -0
  205. package/resources/verify.d.mts +2 -0
  206. package/resources/verify.d.mts.map +1 -0
  207. package/resources/verify.d.ts +2 -0
  208. package/resources/verify.d.ts.map +1 -0
  209. package/resources/verify.js +6 -0
  210. package/resources/verify.js.map +1 -0
  211. package/resources/verify.mjs +3 -0
  212. package/resources/verify.mjs.map +1 -0
  213. package/resources/webhooks.d.mts +26 -10
  214. package/resources/webhooks.d.mts.map +1 -1
  215. package/resources/webhooks.d.ts +26 -10
  216. package/resources/webhooks.d.ts.map +1 -1
  217. package/resources/webhooks.js +13 -2
  218. package/resources/webhooks.js.map +1 -1
  219. package/resources/webhooks.mjs +13 -2
  220. package/resources/webhooks.mjs.map +1 -1
  221. package/src/client.ts +116 -15
  222. package/src/core/streaming.ts +319 -0
  223. package/src/internal/decoders/line.ts +135 -0
  224. package/src/internal/parse.ts +14 -0
  225. package/src/internal/request-options.ts +2 -0
  226. package/src/resources/auth/auth.ts +19 -0
  227. package/src/resources/auth/index.ts +4 -0
  228. package/src/resources/auth/tokens.ts +101 -0
  229. package/src/resources/auth.ts +3 -0
  230. package/src/resources/contacts/contacts.ts +10 -0
  231. package/src/resources/events.ts +75 -0
  232. package/src/resources/groups.ts +28 -0
  233. package/src/resources/index.ts +26 -1
  234. package/src/resources/lines/call-forwarding.ts +3 -0
  235. package/src/resources/lines/index.ts +1 -1
  236. package/src/resources/lines/lines.ts +44 -0
  237. package/src/resources/location.ts +237 -0
  238. package/src/resources/messages.ts +634 -9
  239. package/src/resources/request-location.ts +72 -0
  240. package/src/resources/send-carousel.ts +76 -0
  241. package/src/resources/v2/groups.ts +106 -0
  242. package/src/resources/v2/index.ts +1 -0
  243. package/src/resources/v2/v2.ts +6 -0
  244. package/src/resources/verified-contacts.ts +204 -0
  245. package/src/resources/verify/index.ts +9 -0
  246. package/src/resources/verify/verifications.ts +75 -0
  247. package/src/resources/verify/verify.ts +25 -0
  248. package/src/resources/verify.ts +3 -0
  249. package/src/resources/webhooks.ts +27 -10
  250. package/src/streaming.ts +2 -0
  251. package/src/version.ts +1 -1
  252. package/streaming.d.mts +3 -0
  253. package/streaming.d.mts.map +1 -0
  254. package/streaming.d.ts +3 -0
  255. package/streaming.d.ts.map +1 -0
  256. package/streaming.js +6 -0
  257. package/streaming.js.map +1 -0
  258. package/streaming.mjs +3 -0
  259. package/streaming.mjs.map +1 -0
  260. package/version.d.mts +1 -1
  261. package/version.d.ts +1 -1
  262. package/version.js +1 -1
  263. package/version.mjs +1 -1
@@ -1,10 +1,40 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import * as CallForwardingAPI from "./call-forwarding.mjs";
3
3
  import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
+ /**
7
+ * Sendblue line configuration and health state
8
+ */
4
9
  export declare class Lines extends APIResource {
5
10
  callForwarding: CallForwardingAPI.CallForwarding;
11
+ /**
12
+ * Returns the authenticated account's current line membership and latest persisted
13
+ * health transition.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response = await client.lines.getState();
18
+ * ```
19
+ */
20
+ getState(options?: RequestOptions): APIPromise<LineGetStateResponse>;
21
+ }
22
+ export interface LineState {
23
+ assignment: 'assigned' | 'shared' | 'grace_period';
24
+ sendblue_number: string | null;
25
+ status: 'ONLINE' | 'OFFLINE' | 'DEGRADED' | 'UNKNOWN';
26
+ worker_id: string;
27
+ degraded_since?: string | null;
28
+ effective_until?: string | null;
29
+ status_changed_at?: string | null;
30
+ }
31
+ export interface LineGetStateResponse {
32
+ data: Array<LineState>;
33
+ snapshot_at: string;
34
+ status: 'OK';
6
35
  }
7
36
  export declare namespace Lines {
37
+ export { type LineState as LineState, type LineGetStateResponse as LineGetStateResponse };
8
38
  export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
9
39
  }
10
40
  //# sourceMappingURL=lines.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lines.d.mts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,8BAA0B;AAE3B,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,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;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,IAAI,CAAC;CACd;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;IAE1F,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -1,10 +1,40 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
2
  import * as CallForwardingAPI from "./call-forwarding.js";
3
3
  import { CallForwarding, CallForwardingDeleteResponse, CallForwardingRetrieveResponse, CallForwardingUpdateParams, CallForwardingUpdateResponse } from "./call-forwarding.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { RequestOptions } from "../../internal/request-options.js";
6
+ /**
7
+ * Sendblue line configuration and health state
8
+ */
4
9
  export declare class Lines extends APIResource {
5
10
  callForwarding: CallForwardingAPI.CallForwarding;
11
+ /**
12
+ * Returns the authenticated account's current line membership and latest persisted
13
+ * health transition.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response = await client.lines.getState();
18
+ * ```
19
+ */
20
+ getState(options?: RequestOptions): APIPromise<LineGetStateResponse>;
21
+ }
22
+ export interface LineState {
23
+ assignment: 'assigned' | 'shared' | 'grace_period';
24
+ sendblue_number: string | null;
25
+ status: 'ONLINE' | 'OFFLINE' | 'DEGRADED' | 'UNKNOWN';
26
+ worker_id: string;
27
+ degraded_since?: string | null;
28
+ effective_until?: string | null;
29
+ status_changed_at?: string | null;
30
+ }
31
+ export interface LineGetStateResponse {
32
+ data: Array<LineState>;
33
+ snapshot_at: string;
34
+ status: 'OK';
6
35
  }
7
36
  export declare namespace Lines {
37
+ export { type LineState as LineState, type LineGetStateResponse as LineGetStateResponse };
8
38
  export { CallForwarding as CallForwarding, type CallForwardingRetrieveResponse as CallForwardingRetrieveResponse, type CallForwardingUpdateResponse as CallForwardingUpdateResponse, type CallForwardingDeleteResponse as CallForwardingDeleteResponse, type CallForwardingUpdateParams as CallForwardingUpdateParams, };
9
39
  }
10
40
  //# sourceMappingURL=lines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,iBAAiB,6BAA0B;AACvD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,6BAA0B;AAE3B,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAsD;CACvG;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
1
+ {"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,iBAAiB,6BAA0B;AACvD,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC7B,6BAA0B;AAC3B,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAsD;IAEtG;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAGrE;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,UAAU,GAAG,QAAQ,GAAG,cAAc,CAAC;IAEnD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAEtD,SAAS,EAAE,MAAM,CAAC;IAElB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,IAAI,CAAC;CACd;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,SAAS,IAAI,SAAS,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;IAE1F,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -6,11 +6,26 @@ const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
7
  const CallForwardingAPI = tslib_1.__importStar(require("./call-forwarding.js"));
8
8
  const call_forwarding_1 = require("./call-forwarding.js");
9
+ /**
10
+ * Sendblue line configuration and health state
11
+ */
9
12
  class Lines extends resource_1.APIResource {
10
13
  constructor() {
11
14
  super(...arguments);
12
15
  this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
13
16
  }
17
+ /**
18
+ * Returns the authenticated account's current line membership and latest persisted
19
+ * health transition.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const response = await client.lines.getState();
24
+ * ```
25
+ */
26
+ getState(options) {
27
+ return this._client.get('/api/v2/lines/state', options);
28
+ }
14
29
  }
15
30
  exports.Lines = Lines;
16
31
  Lines.CallForwarding = call_forwarding_1.CallForwarding;
@@ -1 +1 @@
1
- {"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gFAAuD;AACvD,0DAM2B;AAE3B,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxG,CAAC;CAAA;AAFD,sBAEC;AAED,KAAK,CAAC,cAAc,GAAG,gCAAc,CAAC"}
1
+ {"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,gFAAuD;AACvD,0DAM2B;AAI3B;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAcxG,CAAC;IAZC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAfD,sBAeC;AA0BD,KAAK,CAAC,cAAc,GAAG,gCAAc,CAAC"}
@@ -2,11 +2,26 @@
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as CallForwardingAPI from "./call-forwarding.mjs";
4
4
  import { CallForwarding, } from "./call-forwarding.mjs";
5
+ /**
6
+ * Sendblue line configuration and health state
7
+ */
5
8
  export class Lines extends APIResource {
6
9
  constructor() {
7
10
  super(...arguments);
8
11
  this.callForwarding = new CallForwardingAPI.CallForwarding(this._client);
9
12
  }
13
+ /**
14
+ * Returns the authenticated account's current line membership and latest persisted
15
+ * health transition.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const response = await client.lines.getState();
20
+ * ```
21
+ */
22
+ getState(options) {
23
+ return this._client.get('/api/v2/lines/state', options);
24
+ }
10
25
  }
11
26
  Lines.CallForwarding = CallForwarding;
12
27
  //# sourceMappingURL=lines.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,GAKf,8BAA0B;AAE3B,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxG,CAAC;CAAA;AAED,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"lines.mjs","sourceRoot":"","sources":["../../src/resources/lines/lines.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EACL,cAAc,GAKf,8BAA0B;AAI3B;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAcxG,CAAC;IAZC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AA0BD,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC"}
@@ -0,0 +1,156 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { Stream } from "../core/streaming.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ /**
6
+ * Operations for sending and managing messages
7
+ */
8
+ export declare class Location extends APIResource {
9
+ /**
10
+ * Read the current Find My location for one contact if that contact already shares
11
+ * with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
12
+ * endpoint.
13
+ */
14
+ retrieve(number: string, query: LocationRetrieveParams, options?: RequestOptions): APIPromise<LocationRetrieveResponse>;
15
+ /**
16
+ * Read the current Find My locations already shared with a dedicated Mac-backed
17
+ * Sendblue number. Shared lines cannot use this endpoint.
18
+ */
19
+ list(query: LocationListParams, options?: RequestOptions): APIPromise<LocationListResponse>;
20
+ /**
21
+ * Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
22
+ * sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
23
+ * this endpoint.
24
+ *
25
+ * The stream has no client-visible duration. It remains open while the client is
26
+ * connected, authorized, and the worker is available. Comment heartbeats are sent
27
+ * every 15 seconds. Clients should reconnect with their normal credentials after a
28
+ * network interruption or a `worker_disconnected` completion. Location events are
29
+ * live-only and may repeat across internal native-watch renewals.
30
+ *
31
+ * Named events and their JSON `data` payloads:
32
+ *
33
+ * - `ready`: the native watch is active.
34
+ * - `location`: a location state or fix.
35
+ * - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
36
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
37
+ * should tolerate additional completion reasons.
38
+ * - `error`: the watch failed after the SSE response started.
39
+ */
40
+ watch(number: string, query: LocationWatchParams, options?: RequestOptions): APIPromise<Stream<LocationWatchResponse>>;
41
+ }
42
+ export interface LocationRetrieveResponse {
43
+ from_number?: string;
44
+ location?: LocationRetrieveResponse.Location;
45
+ number?: string;
46
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
47
+ status?: 'OK';
48
+ }
49
+ export declare namespace LocationRetrieveResponse {
50
+ interface Location {
51
+ accuracy?: number;
52
+ address?: string | null;
53
+ altitude?: number;
54
+ expiresAt?: string;
55
+ latitude?: number;
56
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
57
+ longitude?: number;
58
+ /**
59
+ * Present when cached data is returned after a refresh error
60
+ */
61
+ refreshError?: string;
62
+ timestamp?: string;
63
+ }
64
+ }
65
+ export interface LocationListResponse {
66
+ from_number?: string;
67
+ locations?: Array<LocationListResponse.Location>;
68
+ status?: 'OK';
69
+ }
70
+ export declare namespace LocationListResponse {
71
+ interface Location {
72
+ location?: Location.Location;
73
+ number?: string;
74
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
75
+ }
76
+ namespace Location {
77
+ interface Location {
78
+ accuracy?: number;
79
+ address?: string | null;
80
+ altitude?: number;
81
+ expiresAt?: string;
82
+ latitude?: number;
83
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
84
+ longitude?: number;
85
+ /**
86
+ * Present when cached data is returned after a refresh error
87
+ */
88
+ refreshError?: string;
89
+ timestamp?: string;
90
+ }
91
+ }
92
+ }
93
+ /**
94
+ * JSON data payload from one named event in a live-location SSE stream
95
+ */
96
+ export interface LocationWatchResponse {
97
+ /**
98
+ * Sendblue line receiving the shared location
99
+ */
100
+ from_number?: string;
101
+ location?: LocationWatchResponse.Location;
102
+ /**
103
+ * Human-readable watch failure
104
+ */
105
+ message?: string;
106
+ /**
107
+ * Contact whose location is being watched or changed
108
+ */
109
+ number?: string;
110
+ /**
111
+ * Why the stream ended normally. Known values are `sharing_ended`,
112
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
113
+ * should tolerate additional values.
114
+ */
115
+ reason?: string;
116
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
117
+ status?: 'OK' | 'ERROR';
118
+ }
119
+ export declare namespace LocationWatchResponse {
120
+ interface Location {
121
+ accuracy?: number;
122
+ address?: string | null;
123
+ altitude?: number;
124
+ expiresAt?: string;
125
+ latitude?: number;
126
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
127
+ longitude?: number;
128
+ /**
129
+ * Present when cached data is returned after a refresh error
130
+ */
131
+ refreshError?: string;
132
+ timestamp?: string;
133
+ }
134
+ }
135
+ export interface LocationRetrieveParams {
136
+ /**
137
+ * Your Sendblue number in E.164 format
138
+ */
139
+ from_number: string;
140
+ }
141
+ export interface LocationListParams {
142
+ /**
143
+ * Your Sendblue number in E.164 format
144
+ */
145
+ from_number: string;
146
+ }
147
+ export interface LocationWatchParams {
148
+ /**
149
+ * Your supported Sendblue number in E.164 format
150
+ */
151
+ from_number: string;
152
+ }
153
+ export declare namespace Location {
154
+ export { type LocationRetrieveResponse as LocationRetrieveResponse, type LocationListResponse as LocationListResponse, type LocationWatchResponse as LocationWatchResponse, type LocationRetrieveParams as LocationRetrieveParams, type LocationListParams as LocationListParams, type LocationWatchParams as LocationWatchParams, };
155
+ }
156
+ //# sourceMappingURL=location.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.mts","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,MAAM,EAAE,8BAA0B;AAE3C,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC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AAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;QAEzD,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,156 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { Stream } from "../core/streaming.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ /**
6
+ * Operations for sending and managing messages
7
+ */
8
+ export declare class Location extends APIResource {
9
+ /**
10
+ * Read the current Find My location for one contact if that contact already shares
11
+ * with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
12
+ * endpoint.
13
+ */
14
+ retrieve(number: string, query: LocationRetrieveParams, options?: RequestOptions): APIPromise<LocationRetrieveResponse>;
15
+ /**
16
+ * Read the current Find My locations already shared with a dedicated Mac-backed
17
+ * Sendblue number. Shared lines cannot use this endpoint.
18
+ */
19
+ list(query: LocationListParams, options?: RequestOptions): APIPromise<LocationListResponse>;
20
+ /**
21
+ * Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
22
+ * sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
23
+ * this endpoint.
24
+ *
25
+ * The stream has no client-visible duration. It remains open while the client is
26
+ * connected, authorized, and the worker is available. Comment heartbeats are sent
27
+ * every 15 seconds. Clients should reconnect with their normal credentials after a
28
+ * network interruption or a `worker_disconnected` completion. Location events are
29
+ * live-only and may repeat across internal native-watch renewals.
30
+ *
31
+ * Named events and their JSON `data` payloads:
32
+ *
33
+ * - `ready`: the native watch is active.
34
+ * - `location`: a location state or fix.
35
+ * - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
36
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
37
+ * should tolerate additional completion reasons.
38
+ * - `error`: the watch failed after the SSE response started.
39
+ */
40
+ watch(number: string, query: LocationWatchParams, options?: RequestOptions): APIPromise<Stream<LocationWatchResponse>>;
41
+ }
42
+ export interface LocationRetrieveResponse {
43
+ from_number?: string;
44
+ location?: LocationRetrieveResponse.Location;
45
+ number?: string;
46
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
47
+ status?: 'OK';
48
+ }
49
+ export declare namespace LocationRetrieveResponse {
50
+ interface Location {
51
+ accuracy?: number;
52
+ address?: string | null;
53
+ altitude?: number;
54
+ expiresAt?: string;
55
+ latitude?: number;
56
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
57
+ longitude?: number;
58
+ /**
59
+ * Present when cached data is returned after a refresh error
60
+ */
61
+ refreshError?: string;
62
+ timestamp?: string;
63
+ }
64
+ }
65
+ export interface LocationListResponse {
66
+ from_number?: string;
67
+ locations?: Array<LocationListResponse.Location>;
68
+ status?: 'OK';
69
+ }
70
+ export declare namespace LocationListResponse {
71
+ interface Location {
72
+ location?: Location.Location;
73
+ number?: string;
74
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
75
+ }
76
+ namespace Location {
77
+ interface Location {
78
+ accuracy?: number;
79
+ address?: string | null;
80
+ altitude?: number;
81
+ expiresAt?: string;
82
+ latitude?: number;
83
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
84
+ longitude?: number;
85
+ /**
86
+ * Present when cached data is returned after a refresh error
87
+ */
88
+ refreshError?: string;
89
+ timestamp?: string;
90
+ }
91
+ }
92
+ }
93
+ /**
94
+ * JSON data payload from one named event in a live-location SSE stream
95
+ */
96
+ export interface LocationWatchResponse {
97
+ /**
98
+ * Sendblue line receiving the shared location
99
+ */
100
+ from_number?: string;
101
+ location?: LocationWatchResponse.Location;
102
+ /**
103
+ * Human-readable watch failure
104
+ */
105
+ message?: string;
106
+ /**
107
+ * Contact whose location is being watched or changed
108
+ */
109
+ number?: string;
110
+ /**
111
+ * Why the stream ended normally. Known values are `sharing_ended`,
112
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
113
+ * should tolerate additional values.
114
+ */
115
+ reason?: string;
116
+ state?: 'not_shared' | 'shared_no_fix_yet' | 'shared_with_fix';
117
+ status?: 'OK' | 'ERROR';
118
+ }
119
+ export declare namespace LocationWatchResponse {
120
+ interface Location {
121
+ accuracy?: number;
122
+ address?: string | null;
123
+ altitude?: number;
124
+ expiresAt?: string;
125
+ latitude?: number;
126
+ locationType?: 'shallow' | 'live' | 'legacy' | 'unknown';
127
+ longitude?: number;
128
+ /**
129
+ * Present when cached data is returned after a refresh error
130
+ */
131
+ refreshError?: string;
132
+ timestamp?: string;
133
+ }
134
+ }
135
+ export interface LocationRetrieveParams {
136
+ /**
137
+ * Your Sendblue number in E.164 format
138
+ */
139
+ from_number: string;
140
+ }
141
+ export interface LocationListParams {
142
+ /**
143
+ * Your Sendblue number in E.164 format
144
+ */
145
+ from_number: string;
146
+ }
147
+ export interface LocationWatchParams {
148
+ /**
149
+ * Your supported Sendblue number in E.164 format
150
+ */
151
+ from_number: string;
152
+ }
153
+ export declare namespace Location {
154
+ export { type LocationRetrieveResponse as LocationRetrieveResponse, type LocationListResponse as LocationListResponse, type LocationWatchResponse as LocationWatchResponse, type LocationRetrieveParams as LocationRetrieveParams, type LocationListParams as LocationListParams, type LocationWatchParams as LocationWatchParams, };
155
+ }
156
+ //# sourceMappingURL=location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,MAAM,EAAE,6BAA0B;AAE3C,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI3F;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,mBAAmB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;CAQ7C;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC;IAE7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,YAAY,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;IAE/D,MAAM,CAAC,EAAE,IAAI,CAAC;CACf;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,QAAQ;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAExB,QAAQ,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KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Location = 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
+ /**
9
+ * Operations for sending and managing messages
10
+ */
11
+ class Location extends resource_1.APIResource {
12
+ /**
13
+ * Read the current Find My location for one contact if that contact already shares
14
+ * with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
15
+ * endpoint.
16
+ */
17
+ retrieve(number, query, options) {
18
+ return this._client.get((0, path_1.path) `/api/location/${number}`, { query, ...options });
19
+ }
20
+ /**
21
+ * Read the current Find My locations already shared with a dedicated Mac-backed
22
+ * Sendblue number. Shared lines cannot use this endpoint.
23
+ */
24
+ list(query, options) {
25
+ return this._client.get('/api/location', { query, ...options });
26
+ }
27
+ /**
28
+ * Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
29
+ * sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
30
+ * this endpoint.
31
+ *
32
+ * The stream has no client-visible duration. It remains open while the client is
33
+ * connected, authorized, and the worker is available. Comment heartbeats are sent
34
+ * every 15 seconds. Clients should reconnect with their normal credentials after a
35
+ * network interruption or a `worker_disconnected` completion. Location events are
36
+ * live-only and may repeat across internal native-watch renewals.
37
+ *
38
+ * Named events and their JSON `data` payloads:
39
+ *
40
+ * - `ready`: the native watch is active.
41
+ * - `location`: a location state or fix.
42
+ * - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
43
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
44
+ * should tolerate additional completion reasons.
45
+ * - `error`: the watch failed after the SSE response started.
46
+ */
47
+ watch(number, query, options) {
48
+ return this._client.get((0, path_1.path) `/api/location/${number}/watch`, {
49
+ query,
50
+ ...options,
51
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
52
+ stream: true,
53
+ });
54
+ }
55
+ }
56
+ exports.Location = Location;
57
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAc,EACd,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAyB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAc,EACd,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,iBAAiB,MAAM,QAAQ,EAAE;YAC3D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;CACF;AAtDD,4BAsDC"}
@@ -0,0 +1,53 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { buildHeaders } from "../internal/headers.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ /**
6
+ * Operations for sending and managing messages
7
+ */
8
+ export class Location extends APIResource {
9
+ /**
10
+ * Read the current Find My location for one contact if that contact already shares
11
+ * with a dedicated Mac-backed Sendblue number. Shared lines cannot use this
12
+ * endpoint.
13
+ */
14
+ retrieve(number, query, options) {
15
+ return this._client.get(path `/api/location/${number}`, { query, ...options });
16
+ }
17
+ /**
18
+ * Read the current Find My locations already shared with a dedicated Mac-backed
19
+ * Sendblue number. Shared lines cannot use this endpoint.
20
+ */
21
+ list(query, options) {
22
+ return this._client.get('/api/location', { query, ...options });
23
+ }
24
+ /**
25
+ * Open a Server-Sent Events (SSE) stream for live Find My updates from one contact
26
+ * sharing with a dedicated Mac-backed Sendblue number. Shared lines cannot use
27
+ * this endpoint.
28
+ *
29
+ * The stream has no client-visible duration. It remains open while the client is
30
+ * connected, authorized, and the worker is available. Comment heartbeats are sent
31
+ * every 15 seconds. Clients should reconnect with their normal credentials after a
32
+ * network interruption or a `worker_disconnected` completion. Location events are
33
+ * live-only and may repeat across internal native-watch renewals.
34
+ *
35
+ * Named events and their JSON `data` payloads:
36
+ *
37
+ * - `ready`: the native watch is active.
38
+ * - `location`: a location state or fix.
39
+ * - `complete`: the watch ended normally. Known reasons are `sharing_ended`,
40
+ * `authorization_revoked`, `worker_disconnected`, and `watch_ended`. Clients
41
+ * should tolerate additional completion reasons.
42
+ * - `error`: the watch failed after the SSE response started.
43
+ */
44
+ watch(number, query, options) {
45
+ return this._client.get(path `/api/location/${number}/watch`, {
46
+ query,
47
+ ...options,
48
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
49
+ stream: true,
50
+ });
51
+ }
52
+ }
53
+ //# sourceMappingURL=location.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.mjs","sourceRoot":"","sources":["../src/resources/location.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,QAAQ,CACN,MAAc,EACd,KAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAyB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CACH,MAAc,EACd,KAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,iBAAiB,MAAM,QAAQ,EAAE;YAC3D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;CACF"}