@linqapp/sdk 0.1.5 → 0.4.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 (189) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +299 -7
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +299 -7
  6. package/client.d.ts.map +1 -1
  7. package/client.js +294 -12
  8. package/client.js.map +1 -1
  9. package/client.mjs +294 -12
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +69 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +69 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +125 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +118 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/internal/tslib.js +18 -18
  28. package/internal/utils/query.d.mts +5 -0
  29. package/internal/utils/query.d.mts.map +1 -0
  30. package/internal/utils/query.d.ts +5 -0
  31. package/internal/utils/query.d.ts.map +1 -0
  32. package/internal/utils/query.js +23 -0
  33. package/internal/utils/query.js.map +1 -0
  34. package/internal/utils/query.mjs +20 -0
  35. package/internal/utils/query.mjs.map +1 -0
  36. package/internal/utils.d.mts +1 -0
  37. package/internal/utils.d.ts +1 -0
  38. package/internal/utils.js +1 -0
  39. package/internal/utils.js.map +1 -1
  40. package/internal/utils.mjs +1 -0
  41. package/package.json +11 -1
  42. package/pagination.d.mts +2 -0
  43. package/pagination.d.mts.map +1 -0
  44. package/pagination.d.ts +2 -0
  45. package/pagination.d.ts.map +1 -0
  46. package/pagination.js +6 -0
  47. package/pagination.js.map +1 -0
  48. package/pagination.mjs +2 -0
  49. package/pagination.mjs.map +1 -0
  50. package/resources/attachments.d.mts +64 -0
  51. package/resources/attachments.d.mts.map +1 -1
  52. package/resources/attachments.d.ts +64 -0
  53. package/resources/attachments.d.ts.map +1 -1
  54. package/resources/attachments.js +64 -0
  55. package/resources/attachments.js.map +1 -1
  56. package/resources/attachments.mjs +64 -0
  57. package/resources/attachments.mjs.map +1 -1
  58. package/resources/capability.d.mts +12 -9
  59. package/resources/capability.d.mts.map +1 -1
  60. package/resources/capability.d.ts +12 -9
  61. package/resources/capability.d.ts.map +1 -1
  62. package/resources/capability.js +7 -4
  63. package/resources/capability.js.map +1 -1
  64. package/resources/capability.mjs +7 -4
  65. package/resources/capability.mjs.map +1 -1
  66. package/resources/chats/chats.d.mts +76 -97
  67. package/resources/chats/chats.d.mts.map +1 -1
  68. package/resources/chats/chats.d.ts +76 -97
  69. package/resources/chats/chats.d.ts.map +1 -1
  70. package/resources/chats/chats.js +8 -4
  71. package/resources/chats/chats.js.map +1 -1
  72. package/resources/chats/chats.mjs +9 -5
  73. package/resources/chats/chats.mjs.map +1 -1
  74. package/resources/chats/index.d.mts +2 -2
  75. package/resources/chats/index.d.mts.map +1 -1
  76. package/resources/chats/index.d.ts +2 -2
  77. package/resources/chats/index.d.ts.map +1 -1
  78. package/resources/chats/index.js.map +1 -1
  79. package/resources/chats/index.mjs.map +1 -1
  80. package/resources/chats/messages.d.mts +21 -25
  81. package/resources/chats/messages.d.mts.map +1 -1
  82. package/resources/chats/messages.d.ts +21 -25
  83. package/resources/chats/messages.d.ts.map +1 -1
  84. package/resources/chats/messages.js +16 -3
  85. package/resources/chats/messages.js.map +1 -1
  86. package/resources/chats/messages.mjs +16 -3
  87. package/resources/chats/messages.mjs.map +1 -1
  88. package/resources/chats/participants.d.mts +18 -0
  89. package/resources/chats/participants.d.mts.map +1 -1
  90. package/resources/chats/participants.d.ts +18 -0
  91. package/resources/chats/participants.d.ts.map +1 -1
  92. package/resources/chats/participants.js +18 -0
  93. package/resources/chats/participants.js.map +1 -1
  94. package/resources/chats/participants.mjs +18 -0
  95. package/resources/chats/participants.mjs.map +1 -1
  96. package/resources/chats/typing.d.mts +18 -0
  97. package/resources/chats/typing.d.mts.map +1 -1
  98. package/resources/chats/typing.d.ts +18 -0
  99. package/resources/chats/typing.d.ts.map +1 -1
  100. package/resources/chats/typing.js +18 -0
  101. package/resources/chats/typing.js.map +1 -1
  102. package/resources/chats/typing.mjs +18 -0
  103. package/resources/chats/typing.mjs.map +1 -1
  104. package/resources/index.d.mts +4 -3
  105. package/resources/index.d.mts.map +1 -1
  106. package/resources/index.d.ts +4 -3
  107. package/resources/index.d.ts.map +1 -1
  108. package/resources/index.js +3 -1
  109. package/resources/index.js.map +1 -1
  110. package/resources/index.mjs +1 -0
  111. package/resources/index.mjs.map +1 -1
  112. package/resources/messages.d.mts +37 -72
  113. package/resources/messages.d.mts.map +1 -1
  114. package/resources/messages.d.ts +37 -72
  115. package/resources/messages.d.ts.map +1 -1
  116. package/resources/messages.js +34 -4
  117. package/resources/messages.js.map +1 -1
  118. package/resources/messages.mjs +34 -4
  119. package/resources/messages.mjs.map +1 -1
  120. package/resources/phone-numbers.d.mts +9 -0
  121. package/resources/phone-numbers.d.mts.map +1 -1
  122. package/resources/phone-numbers.d.ts +9 -0
  123. package/resources/phone-numbers.d.ts.map +1 -1
  124. package/resources/phone-numbers.js +9 -0
  125. package/resources/phone-numbers.js.map +1 -1
  126. package/resources/phone-numbers.mjs +9 -0
  127. package/resources/phone-numbers.mjs.map +1 -1
  128. package/resources/phonenumbers.d.mts +9 -0
  129. package/resources/phonenumbers.d.mts.map +1 -1
  130. package/resources/phonenumbers.d.ts +9 -0
  131. package/resources/phonenumbers.d.ts.map +1 -1
  132. package/resources/phonenumbers.js +9 -0
  133. package/resources/phonenumbers.js.map +1 -1
  134. package/resources/phonenumbers.mjs +9 -0
  135. package/resources/phonenumbers.mjs.map +1 -1
  136. package/resources/shared.d.mts +51 -0
  137. package/resources/shared.d.mts.map +1 -1
  138. package/resources/shared.d.ts +51 -0
  139. package/resources/shared.d.ts.map +1 -1
  140. package/resources/webhook-events.d.mts +90 -1
  141. package/resources/webhook-events.d.mts.map +1 -1
  142. package/resources/webhook-events.d.ts +90 -1
  143. package/resources/webhook-events.d.ts.map +1 -1
  144. package/resources/webhook-events.js +89 -0
  145. package/resources/webhook-events.js.map +1 -1
  146. package/resources/webhook-events.mjs +89 -0
  147. package/resources/webhook-events.mjs.map +1 -1
  148. package/resources/webhook-subscriptions.d.mts +89 -0
  149. package/resources/webhook-subscriptions.d.mts.map +1 -1
  150. package/resources/webhook-subscriptions.d.ts +89 -0
  151. package/resources/webhook-subscriptions.d.ts.map +1 -1
  152. package/resources/webhook-subscriptions.js +89 -0
  153. package/resources/webhook-subscriptions.js.map +1 -1
  154. package/resources/webhook-subscriptions.mjs +89 -0
  155. package/resources/webhook-subscriptions.mjs.map +1 -1
  156. package/resources/webhooks.d.mts +2506 -0
  157. package/resources/webhooks.d.mts.map +1 -0
  158. package/resources/webhooks.d.ts +2506 -0
  159. package/resources/webhooks.d.ts.map +1 -0
  160. package/resources/webhooks.js +12 -0
  161. package/resources/webhooks.js.map +1 -0
  162. package/resources/webhooks.mjs +8 -0
  163. package/resources/webhooks.mjs.map +1 -0
  164. package/src/client.ts +443 -37
  165. package/src/core/pagination.ts +212 -0
  166. package/src/index.ts +1 -0
  167. package/src/internal/utils/query.ts +23 -0
  168. package/src/internal/utils.ts +1 -0
  169. package/src/pagination.ts +2 -0
  170. package/src/resources/attachments.ts +64 -0
  171. package/src/resources/capability.ts +17 -14
  172. package/src/resources/chats/chats.ts +86 -115
  173. package/src/resources/chats/index.ts +4 -3
  174. package/src/resources/chats/messages.ts +30 -30
  175. package/src/resources/chats/participants.ts +18 -0
  176. package/src/resources/chats/typing.ts +18 -0
  177. package/src/resources/index.ts +55 -10
  178. package/src/resources/messages.ts +49 -90
  179. package/src/resources/phone-numbers.ts +9 -0
  180. package/src/resources/phonenumbers.ts +9 -0
  181. package/src/resources/shared.ts +62 -0
  182. package/src/resources/webhook-events.ts +90 -0
  183. package/src/resources/webhook-subscriptions.ts +89 -0
  184. package/src/resources/webhooks.ts +3089 -0
  185. package/src/version.ts +1 -1
  186. package/version.d.mts +1 -1
  187. package/version.d.ts +1 -1
  188. package/version.js +1 -1
  189. package/version.mjs +1 -1
@@ -1,6 +1,15 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import { APIPromise } from "../core/api-promise.js";
3
3
  import { RequestOptions } from "../internal/request-options.js";
4
+ /**
5
+ * Phone Numbers represent the phone numbers assigned to your partner account.
6
+ *
7
+ * Use the list phone numbers endpoint to discover which phone numbers are available
8
+ * for sending messages.
9
+ *
10
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
11
+ * in the `from` field.
12
+ */
4
13
  export declare class PhoneNumbers extends APIResource {
5
14
  /**
6
15
  * Returns all phone numbers assigned to the authenticated partner. Use this
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
1
+ {"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
@@ -3,6 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PhoneNumbers = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ /**
7
+ * Phone Numbers represent the phone numbers assigned to your partner account.
8
+ *
9
+ * Use the list phone numbers endpoint to discover which phone numbers are available
10
+ * for sending messages.
11
+ *
12
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
13
+ * in the `from` field.
14
+ */
6
15
  class PhoneNumbers extends resource_1.APIResource {
7
16
  /**
8
17
  * Returns all phone numbers assigned to the authenticated partner. Use this
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AATD,oCASC"}
1
+ {"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AATD,oCASC"}
@@ -1,5 +1,14 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
+ /**
4
+ * Phone Numbers represent the phone numbers assigned to your partner account.
5
+ *
6
+ * Use the list phone numbers endpoint to discover which phone numbers are available
7
+ * for sending messages.
8
+ *
9
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
10
+ * in the `from` field.
11
+ */
3
12
  export class PhoneNumbers extends APIResource {
4
13
  /**
5
14
  * Returns all phone numbers assigned to the authenticated partner. Use this
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
1
+ {"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
@@ -1,6 +1,15 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import { APIPromise } from "../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../internal/request-options.mjs";
4
+ /**
5
+ * Phone Numbers represent the phone numbers assigned to your partner account.
6
+ *
7
+ * Use the list phone numbers endpoint to discover which phone numbers are available
8
+ * for sending messages.
9
+ *
10
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
11
+ * in the `from` field.
12
+ */
4
13
  export declare class Phonenumbers extends APIResource {
5
14
  /**
6
15
  * **Deprecated.** Use `GET /v3/phone_numbers` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"phonenumbers.d.mts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
1
+ {"version":3,"file":"phonenumbers.d.mts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
@@ -1,6 +1,15 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import { APIPromise } from "../core/api-promise.js";
3
3
  import { RequestOptions } from "../internal/request-options.js";
4
+ /**
5
+ * Phone Numbers represent the phone numbers assigned to your partner account.
6
+ *
7
+ * Use the list phone numbers endpoint to discover which phone numbers are available
8
+ * for sending messages.
9
+ *
10
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
11
+ * in the `from` field.
12
+ */
4
13
  export declare class Phonenumbers extends APIResource {
5
14
  /**
6
15
  * **Deprecated.** Use `GET /v3/phone_numbers` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"phonenumbers.d.ts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
1
+ {"version":3,"file":"phonenumbers.d.ts","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;KAC9B;IAED,UAAiB,WAAW,CAAC;QAC3B,UAAiB,YAAY;YAC3B;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,GAAG,EAAE,OAAO,CAAC;YAEb;;eAEG;YACH,KAAK,EAAE,OAAO,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
@@ -3,6 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Phonenumbers = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ /**
7
+ * Phone Numbers represent the phone numbers assigned to your partner account.
8
+ *
9
+ * Use the list phone numbers endpoint to discover which phone numbers are available
10
+ * for sending messages.
11
+ *
12
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
13
+ * in the `from` field.
14
+ */
6
15
  class Phonenumbers extends resource_1.APIResource {
7
16
  /**
8
17
  * **Deprecated.** Use `GET /v3/phone_numbers` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"phonenumbers.js","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AATD,oCASC"}
1
+ {"version":3,"file":"phonenumbers.js","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AATD,oCASC"}
@@ -1,5 +1,14 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
+ /**
4
+ * Phone Numbers represent the phone numbers assigned to your partner account.
5
+ *
6
+ * Use the list phone numbers endpoint to discover which phone numbers are available
7
+ * for sending messages.
8
+ *
9
+ * When creating chats, listing chats, or sending a voice memo, use one of your assigned phone numbers
10
+ * in the `from` field.
11
+ */
3
12
  export class Phonenumbers extends APIResource {
4
13
  /**
5
14
  * **Deprecated.** Use `GET /v3/phone_numbers` instead.
@@ -1 +1 @@
1
- {"version":3,"file":"phonenumbers.mjs","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
1
+ {"version":3,"file":"phonenumbers.mjs","sourceRoot":"","sources":["../src/resources/phonenumbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF"}
@@ -1,5 +1,56 @@
1
+ import * as MessagesAPI from "./messages.mjs";
2
+ /**
3
+ * A media attachment part
4
+ */
5
+ export interface MediaPartResponse {
6
+ /**
7
+ * Unique attachment identifier
8
+ */
9
+ id: string;
10
+ /**
11
+ * Original filename
12
+ */
13
+ filename: string;
14
+ /**
15
+ * MIME type of the file
16
+ */
17
+ mime_type: string;
18
+ /**
19
+ * Reactions on this message part
20
+ */
21
+ reactions: Array<MessagesAPI.Reaction> | null;
22
+ /**
23
+ * File size in bytes
24
+ */
25
+ size_bytes: number;
26
+ /**
27
+ * Indicates this is a media attachment part
28
+ */
29
+ type: 'media';
30
+ /**
31
+ * Presigned URL for downloading the attachment (expires in 1 hour).
32
+ */
33
+ url: string;
34
+ }
1
35
  /**
2
36
  * Messaging service type
3
37
  */
4
38
  export type ServiceType = 'iMessage' | 'SMS' | 'RCS';
39
+ /**
40
+ * A text message part
41
+ */
42
+ export interface TextPartResponse {
43
+ /**
44
+ * Reactions on this message part
45
+ */
46
+ reactions: Array<MessagesAPI.Reaction> | null;
47
+ /**
48
+ * Indicates this is a text message part
49
+ */
50
+ type: 'text';
51
+ /**
52
+ * The text content
53
+ */
54
+ value: string;
55
+ }
5
56
  //# sourceMappingURL=shared.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,WAAW;AAEvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,5 +1,56 @@
1
+ import * as MessagesAPI from "./messages.js";
2
+ /**
3
+ * A media attachment part
4
+ */
5
+ export interface MediaPartResponse {
6
+ /**
7
+ * Unique attachment identifier
8
+ */
9
+ id: string;
10
+ /**
11
+ * Original filename
12
+ */
13
+ filename: string;
14
+ /**
15
+ * MIME type of the file
16
+ */
17
+ mime_type: string;
18
+ /**
19
+ * Reactions on this message part
20
+ */
21
+ reactions: Array<MessagesAPI.Reaction> | null;
22
+ /**
23
+ * File size in bytes
24
+ */
25
+ size_bytes: number;
26
+ /**
27
+ * Indicates this is a media attachment part
28
+ */
29
+ type: 'media';
30
+ /**
31
+ * Presigned URL for downloading the attachment (expires in 1 hour).
32
+ */
33
+ url: string;
34
+ }
1
35
  /**
2
36
  * Messaging service type
3
37
  */
4
38
  export type ServiceType = 'iMessage' | 'SMS' | 'RCS';
39
+ /**
40
+ * A text message part
41
+ */
42
+ export interface TextPartResponse {
43
+ /**
44
+ * Reactions on this message part
45
+ */
46
+ reactions: Array<MessagesAPI.Reaction> | null;
47
+ /**
48
+ * Indicates this is a text message part
49
+ */
50
+ type: 'text';
51
+ /**
52
+ * The text content
53
+ */
54
+ value: string;
55
+ }
5
56
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,WAAW;AAEvB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,6 +1,95 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import { APIPromise } from "../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../internal/request-options.mjs";
4
+ /**
5
+ * Webhook Subscriptions allow you to receive real-time notifications when events
6
+ * occur on your account.
7
+ *
8
+ * Configure webhook endpoints to receive events such as messages sent/received,
9
+ * delivery status changes, reactions, typing indicators, and more.
10
+ *
11
+ * Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
12
+ * ~2 hours with exponential backoff. Each event includes a unique ID for
13
+ * deduplication.
14
+ *
15
+ * ## Webhook Headers
16
+ *
17
+ * Each webhook request includes the following headers:
18
+ *
19
+ * | Header | Description |
20
+ * |--------|-------------|
21
+ * | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
22
+ * | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
23
+ * | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
24
+ * | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
25
+ *
26
+ * ## Verifying Webhook Signatures
27
+ *
28
+ * All webhooks are signed using HMAC-SHA256. You should always verify the signature
29
+ * to ensure the webhook originated from Linq and hasn't been tampered with.
30
+ *
31
+ * **Signature Construction:**
32
+ *
33
+ * The signature is computed over a concatenation of the timestamp and payload:
34
+ *
35
+ * ```
36
+ * {timestamp}.{payload}
37
+ * ```
38
+ *
39
+ * Where:
40
+ * - `timestamp` is the value from the `X-Webhook-Timestamp` header
41
+ * - `payload` is the raw JSON request body (exact bytes, not re-serialized)
42
+ *
43
+ * **Verification Steps:**
44
+ *
45
+ * 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
46
+ * 2. Get the raw request body bytes (do not parse and re-serialize)
47
+ * 3. Concatenate: `"{timestamp}.{payload}"`
48
+ * 4. Compute HMAC-SHA256 using your signing secret as the key
49
+ * 5. Hex-encode the result and compare with `X-Webhook-Signature`
50
+ * 6. Use constant-time comparison to prevent timing attacks
51
+ *
52
+ * **Example (Python):**
53
+ *
54
+ * ```python
55
+ * import hmac
56
+ * import hashlib
57
+ *
58
+ * def verify_webhook(signing_secret, payload, timestamp, signature):
59
+ * message = f"{timestamp}.{payload.decode('utf-8')}"
60
+ * expected = hmac.new(
61
+ * signing_secret.encode('utf-8'),
62
+ * message.encode('utf-8'),
63
+ * hashlib.sha256
64
+ * ).hexdigest()
65
+ * return hmac.compare_digest(expected, signature)
66
+ * ```
67
+ *
68
+ * **Example (Node.js):**
69
+ *
70
+ * ```javascript
71
+ * const crypto = require('crypto');
72
+ *
73
+ * function verifyWebhook(signingSecret, payload, timestamp, signature) {
74
+ * const message = `${timestamp}.${payload}`;
75
+ * const expected = crypto
76
+ * .createHmac('sha256', signingSecret)
77
+ * .update(message)
78
+ * .digest('hex');
79
+ * return crypto.timingSafeEqual(
80
+ * Buffer.from(expected),
81
+ * Buffer.from(signature)
82
+ * );
83
+ * }
84
+ * ```
85
+ *
86
+ * **Security Best Practices:**
87
+ *
88
+ * - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
89
+ * - Always use constant-time comparison for signature verification
90
+ * - Store your signing secret securely (e.g., environment variable, secrets manager)
91
+ * - Return a 2xx status code quickly, then process the webhook asynchronously
92
+ */
4
93
  export declare class WebhookEvents extends APIResource {
5
94
  /**
6
95
  * Returns all available webhook event types that can be subscribed to. Use this
@@ -12,7 +101,7 @@ export declare class WebhookEvents extends APIResource {
12
101
  /**
13
102
  * Valid webhook event types that can be subscribed to
14
103
  */
15
- export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
104
+ export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
16
105
  export interface WebhookEventListResponse {
17
106
  /**
18
107
  * URL to the webhook events documentation
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
1
+ {"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -1,6 +1,95 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import { APIPromise } from "../core/api-promise.js";
3
3
  import { RequestOptions } from "../internal/request-options.js";
4
+ /**
5
+ * Webhook Subscriptions allow you to receive real-time notifications when events
6
+ * occur on your account.
7
+ *
8
+ * Configure webhook endpoints to receive events such as messages sent/received,
9
+ * delivery status changes, reactions, typing indicators, and more.
10
+ *
11
+ * Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
12
+ * ~2 hours with exponential backoff. Each event includes a unique ID for
13
+ * deduplication.
14
+ *
15
+ * ## Webhook Headers
16
+ *
17
+ * Each webhook request includes the following headers:
18
+ *
19
+ * | Header | Description |
20
+ * |--------|-------------|
21
+ * | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
22
+ * | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
23
+ * | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
24
+ * | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
25
+ *
26
+ * ## Verifying Webhook Signatures
27
+ *
28
+ * All webhooks are signed using HMAC-SHA256. You should always verify the signature
29
+ * to ensure the webhook originated from Linq and hasn't been tampered with.
30
+ *
31
+ * **Signature Construction:**
32
+ *
33
+ * The signature is computed over a concatenation of the timestamp and payload:
34
+ *
35
+ * ```
36
+ * {timestamp}.{payload}
37
+ * ```
38
+ *
39
+ * Where:
40
+ * - `timestamp` is the value from the `X-Webhook-Timestamp` header
41
+ * - `payload` is the raw JSON request body (exact bytes, not re-serialized)
42
+ *
43
+ * **Verification Steps:**
44
+ *
45
+ * 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
46
+ * 2. Get the raw request body bytes (do not parse and re-serialize)
47
+ * 3. Concatenate: `"{timestamp}.{payload}"`
48
+ * 4. Compute HMAC-SHA256 using your signing secret as the key
49
+ * 5. Hex-encode the result and compare with `X-Webhook-Signature`
50
+ * 6. Use constant-time comparison to prevent timing attacks
51
+ *
52
+ * **Example (Python):**
53
+ *
54
+ * ```python
55
+ * import hmac
56
+ * import hashlib
57
+ *
58
+ * def verify_webhook(signing_secret, payload, timestamp, signature):
59
+ * message = f"{timestamp}.{payload.decode('utf-8')}"
60
+ * expected = hmac.new(
61
+ * signing_secret.encode('utf-8'),
62
+ * message.encode('utf-8'),
63
+ * hashlib.sha256
64
+ * ).hexdigest()
65
+ * return hmac.compare_digest(expected, signature)
66
+ * ```
67
+ *
68
+ * **Example (Node.js):**
69
+ *
70
+ * ```javascript
71
+ * const crypto = require('crypto');
72
+ *
73
+ * function verifyWebhook(signingSecret, payload, timestamp, signature) {
74
+ * const message = `${timestamp}.${payload}`;
75
+ * const expected = crypto
76
+ * .createHmac('sha256', signingSecret)
77
+ * .update(message)
78
+ * .digest('hex');
79
+ * return crypto.timingSafeEqual(
80
+ * Buffer.from(expected),
81
+ * Buffer.from(signature)
82
+ * );
83
+ * }
84
+ * ```
85
+ *
86
+ * **Security Best Practices:**
87
+ *
88
+ * - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
89
+ * - Always use constant-time comparison for signature verification
90
+ * - Store your signing secret securely (e.g., environment variable, secrets manager)
91
+ * - Return a 2xx status code quickly, then process the webhook asynchronously
92
+ */
4
93
  export declare class WebhookEvents extends APIResource {
5
94
  /**
6
95
  * Returns all available webhook event types that can be subscribed to. Use this
@@ -12,7 +101,7 @@ export declare class WebhookEvents extends APIResource {
12
101
  /**
13
102
  * Valid webhook event types that can be subscribed to
14
103
  */
15
- export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
104
+ export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated';
16
105
  export interface WebhookEventListResponse {
17
106
  /**
18
107
  * URL to the webhook events documentation
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
1
+ {"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,0DAA0D,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -3,6 +3,95 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.WebhookEvents = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ /**
7
+ * Webhook Subscriptions allow you to receive real-time notifications when events
8
+ * occur on your account.
9
+ *
10
+ * Configure webhook endpoints to receive events such as messages sent/received,
11
+ * delivery status changes, reactions, typing indicators, and more.
12
+ *
13
+ * Failed deliveries (5xx, 429, network errors) are retried up to 10 times over
14
+ * ~2 hours with exponential backoff. Each event includes a unique ID for
15
+ * deduplication.
16
+ *
17
+ * ## Webhook Headers
18
+ *
19
+ * Each webhook request includes the following headers:
20
+ *
21
+ * | Header | Description |
22
+ * |--------|-------------|
23
+ * | `X-Webhook-Event` | The event type (e.g., `message.sent`, `message.received`) |
24
+ * | `X-Webhook-Subscription-ID` | Your webhook subscription ID |
25
+ * | `X-Webhook-Timestamp` | Unix timestamp (seconds) when the webhook was sent |
26
+ * | `X-Webhook-Signature` | HMAC-SHA256 signature for verification |
27
+ *
28
+ * ## Verifying Webhook Signatures
29
+ *
30
+ * All webhooks are signed using HMAC-SHA256. You should always verify the signature
31
+ * to ensure the webhook originated from Linq and hasn't been tampered with.
32
+ *
33
+ * **Signature Construction:**
34
+ *
35
+ * The signature is computed over a concatenation of the timestamp and payload:
36
+ *
37
+ * ```
38
+ * {timestamp}.{payload}
39
+ * ```
40
+ *
41
+ * Where:
42
+ * - `timestamp` is the value from the `X-Webhook-Timestamp` header
43
+ * - `payload` is the raw JSON request body (exact bytes, not re-serialized)
44
+ *
45
+ * **Verification Steps:**
46
+ *
47
+ * 1. Extract the `X-Webhook-Timestamp` and `X-Webhook-Signature` headers
48
+ * 2. Get the raw request body bytes (do not parse and re-serialize)
49
+ * 3. Concatenate: `"{timestamp}.{payload}"`
50
+ * 4. Compute HMAC-SHA256 using your signing secret as the key
51
+ * 5. Hex-encode the result and compare with `X-Webhook-Signature`
52
+ * 6. Use constant-time comparison to prevent timing attacks
53
+ *
54
+ * **Example (Python):**
55
+ *
56
+ * ```python
57
+ * import hmac
58
+ * import hashlib
59
+ *
60
+ * def verify_webhook(signing_secret, payload, timestamp, signature):
61
+ * message = f"{timestamp}.{payload.decode('utf-8')}"
62
+ * expected = hmac.new(
63
+ * signing_secret.encode('utf-8'),
64
+ * message.encode('utf-8'),
65
+ * hashlib.sha256
66
+ * ).hexdigest()
67
+ * return hmac.compare_digest(expected, signature)
68
+ * ```
69
+ *
70
+ * **Example (Node.js):**
71
+ *
72
+ * ```javascript
73
+ * const crypto = require('crypto');
74
+ *
75
+ * function verifyWebhook(signingSecret, payload, timestamp, signature) {
76
+ * const message = `${timestamp}.${payload}`;
77
+ * const expected = crypto
78
+ * .createHmac('sha256', signingSecret)
79
+ * .update(message)
80
+ * .digest('hex');
81
+ * return crypto.timingSafeEqual(
82
+ * Buffer.from(expected),
83
+ * Buffer.from(signature)
84
+ * );
85
+ * }
86
+ * ```
87
+ *
88
+ * **Security Best Practices:**
89
+ *
90
+ * - Reject webhooks with timestamps older than 5 minutes to prevent replay attacks
91
+ * - Always use constant-time comparison for signature verification
92
+ * - Store your signing secret securely (e.g., environment variable, secrets manager)
93
+ * - Return a 2xx status code quickly, then process the webhook asynchronously
94
+ */
6
95
  class WebhookEvents extends resource_1.APIResource {
7
96
  /**
8
97
  * Returns all available webhook event types that can be subscribed to. Use this
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-events.js","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AATD,sCASC"}
1
+ {"version":3,"file":"webhook-events.js","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AATD,sCASC"}