casedev 0.54.0 → 0.56.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 (199) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent/agent.d.mts +0 -4
  12. package/resources/agent/agent.d.mts.map +1 -1
  13. package/resources/agent/agent.d.ts +0 -4
  14. package/resources/agent/agent.d.ts.map +1 -1
  15. package/resources/agent/agent.js +0 -4
  16. package/resources/agent/agent.js.map +1 -1
  17. package/resources/agent/agent.mjs +0 -4
  18. package/resources/agent/agent.mjs.map +1 -1
  19. package/resources/agent/index.d.mts +0 -1
  20. package/resources/agent/index.d.mts.map +1 -1
  21. package/resources/agent/index.d.ts +0 -1
  22. package/resources/agent/index.d.ts.map +1 -1
  23. package/resources/agent/index.js +1 -3
  24. package/resources/agent/index.js.map +1 -1
  25. package/resources/agent/index.mjs +0 -1
  26. package/resources/agent/index.mjs.map +1 -1
  27. package/resources/index.d.mts +1 -0
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +1 -0
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +3 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +1 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/webhooks/index.d.mts +3 -0
  36. package/resources/webhooks/index.d.mts.map +1 -0
  37. package/resources/webhooks/index.d.ts +3 -0
  38. package/resources/webhooks/index.d.ts.map +1 -0
  39. package/resources/webhooks/index.js +9 -0
  40. package/resources/webhooks/index.js.map +1 -0
  41. package/resources/webhooks/index.mjs +4 -0
  42. package/resources/webhooks/index.mjs.map +1 -0
  43. package/resources/webhooks/v1/deliveries.d.mts +42 -0
  44. package/resources/webhooks/v1/deliveries.d.mts.map +1 -0
  45. package/resources/webhooks/v1/deliveries.d.ts +42 -0
  46. package/resources/webhooks/v1/deliveries.d.ts.map +1 -0
  47. package/resources/webhooks/v1/deliveries.js +48 -0
  48. package/resources/webhooks/v1/deliveries.js.map +1 -0
  49. package/resources/webhooks/v1/deliveries.mjs +44 -0
  50. package/resources/webhooks/v1/deliveries.mjs.map +1 -0
  51. package/resources/webhooks/v1/endpoints.d.mts +121 -0
  52. package/resources/webhooks/v1/endpoints.d.mts.map +1 -0
  53. package/resources/webhooks/v1/endpoints.d.ts +121 -0
  54. package/resources/webhooks/v1/endpoints.d.ts.map +1 -0
  55. package/resources/webhooks/v1/endpoints.js +96 -0
  56. package/resources/webhooks/v1/endpoints.js.map +1 -0
  57. package/resources/webhooks/v1/endpoints.mjs +92 -0
  58. package/resources/webhooks/v1/endpoints.mjs.map +1 -0
  59. package/resources/webhooks/v1/event-types.d.mts +15 -0
  60. package/resources/webhooks/v1/event-types.d.mts.map +1 -0
  61. package/resources/webhooks/v1/event-types.d.ts +15 -0
  62. package/resources/webhooks/v1/event-types.d.ts.map +1 -0
  63. package/resources/webhooks/v1/event-types.js +24 -0
  64. package/resources/webhooks/v1/event-types.js.map +1 -0
  65. package/resources/webhooks/v1/event-types.mjs +20 -0
  66. package/resources/webhooks/v1/event-types.mjs.map +1 -0
  67. package/resources/webhooks/v1/index.d.mts +5 -0
  68. package/resources/webhooks/v1/index.d.mts.map +1 -0
  69. package/resources/webhooks/v1/index.d.ts +5 -0
  70. package/resources/webhooks/v1/index.d.ts.map +1 -0
  71. package/resources/webhooks/v1/index.js +13 -0
  72. package/resources/webhooks/v1/index.js.map +1 -0
  73. package/resources/webhooks/v1/index.mjs +6 -0
  74. package/resources/webhooks/v1/index.mjs.map +1 -0
  75. package/resources/webhooks/v1/v1.d.mts +18 -0
  76. package/resources/webhooks/v1/v1.d.mts.map +1 -0
  77. package/resources/webhooks/v1/v1.d.ts +18 -0
  78. package/resources/webhooks/v1/v1.d.ts.map +1 -0
  79. package/resources/webhooks/v1/v1.js +25 -0
  80. package/resources/webhooks/v1/v1.js.map +1 -0
  81. package/resources/webhooks/v1/v1.mjs +20 -0
  82. package/resources/webhooks/v1/v1.mjs.map +1 -0
  83. package/resources/webhooks/v1.d.mts +2 -0
  84. package/resources/webhooks/v1.d.mts.map +1 -0
  85. package/resources/webhooks/v1.d.ts +2 -0
  86. package/resources/webhooks/v1.d.ts.map +1 -0
  87. package/resources/{agent/v2.js → webhooks/v1.js} +2 -2
  88. package/resources/webhooks/v1.js.map +1 -0
  89. package/resources/{agent/v2.mjs → webhooks/v1.mjs} +2 -2
  90. package/resources/webhooks/v1.mjs.map +1 -0
  91. package/resources/webhooks/webhooks.d.mts +10 -0
  92. package/resources/webhooks/webhooks.d.mts.map +1 -0
  93. package/resources/webhooks/webhooks.d.ts +10 -0
  94. package/resources/webhooks/webhooks.d.ts.map +1 -0
  95. package/resources/webhooks/webhooks.js +17 -0
  96. package/resources/webhooks/webhooks.js.map +1 -0
  97. package/resources/webhooks/webhooks.mjs +12 -0
  98. package/resources/webhooks/webhooks.mjs.map +1 -0
  99. package/resources/webhooks.d.mts +2 -0
  100. package/resources/webhooks.d.mts.map +1 -0
  101. package/resources/webhooks.d.ts +2 -0
  102. package/resources/webhooks.d.ts.map +1 -0
  103. package/resources/{agent/v2/chat.js → webhooks.js} +3 -3
  104. package/resources/webhooks.js.map +1 -0
  105. package/resources/webhooks.mjs +3 -0
  106. package/resources/webhooks.mjs.map +1 -0
  107. package/src/client.ts +5 -0
  108. package/src/resources/agent/agent.ts +0 -6
  109. package/src/resources/agent/index.ts +0 -1
  110. package/src/resources/index.ts +1 -0
  111. package/{resources/agent/v2/chat.mjs → src/resources/webhooks/index.ts} +3 -2
  112. package/src/resources/webhooks/v1/deliveries.ts +74 -0
  113. package/src/resources/webhooks/v1/endpoints.ts +204 -0
  114. package/src/resources/webhooks/v1/event-types.ts +23 -0
  115. package/src/resources/webhooks/v1/index.ts +13 -0
  116. package/src/resources/webhooks/v1/v1.ts +45 -0
  117. package/src/resources/{agent/v2.ts → webhooks/v1.ts} +1 -1
  118. package/src/resources/webhooks/webhooks.ts +15 -0
  119. package/src/resources/{agent/v2/chat.ts → webhooks.ts} +1 -1
  120. package/src/version.ts +1 -1
  121. package/version.d.mts +1 -1
  122. package/version.d.ts +1 -1
  123. package/version.js +1 -1
  124. package/version.mjs +1 -1
  125. package/resources/agent/v2/chat/chat.d.mts +0 -196
  126. package/resources/agent/v2/chat/chat.d.mts.map +0 -1
  127. package/resources/agent/v2/chat/chat.d.ts +0 -196
  128. package/resources/agent/v2/chat/chat.d.ts.map +0 -1
  129. package/resources/agent/v2/chat/chat.js +0 -117
  130. package/resources/agent/v2/chat/chat.js.map +0 -1
  131. package/resources/agent/v2/chat/chat.mjs +0 -112
  132. package/resources/agent/v2/chat/chat.mjs.map +0 -1
  133. package/resources/agent/v2/chat/files.d.mts +0 -42
  134. package/resources/agent/v2/chat/files.d.mts.map +0 -1
  135. package/resources/agent/v2/chat/files.d.ts +0 -42
  136. package/resources/agent/v2/chat/files.d.ts.map +0 -1
  137. package/resources/agent/v2/chat/files.js +0 -33
  138. package/resources/agent/v2/chat/files.js.map +0 -1
  139. package/resources/agent/v2/chat/files.mjs +0 -29
  140. package/resources/agent/v2/chat/files.mjs.map +0 -1
  141. package/resources/agent/v2/chat/index.d.mts +0 -3
  142. package/resources/agent/v2/chat/index.d.mts.map +0 -1
  143. package/resources/agent/v2/chat/index.d.ts +0 -3
  144. package/resources/agent/v2/chat/index.d.ts.map +0 -1
  145. package/resources/agent/v2/chat/index.js +0 -9
  146. package/resources/agent/v2/chat/index.js.map +0 -1
  147. package/resources/agent/v2/chat/index.mjs +0 -4
  148. package/resources/agent/v2/chat/index.mjs.map +0 -1
  149. package/resources/agent/v2/chat.d.mts +0 -2
  150. package/resources/agent/v2/chat.d.mts.map +0 -1
  151. package/resources/agent/v2/chat.d.ts +0 -2
  152. package/resources/agent/v2/chat.d.ts.map +0 -1
  153. package/resources/agent/v2/chat.js.map +0 -1
  154. package/resources/agent/v2/chat.mjs.map +0 -1
  155. package/resources/agent/v2/execute.d.mts +0 -58
  156. package/resources/agent/v2/execute.d.mts.map +0 -1
  157. package/resources/agent/v2/execute.d.ts +0 -58
  158. package/resources/agent/v2/execute.d.ts.map +0 -1
  159. package/resources/agent/v2/execute.js +0 -20
  160. package/resources/agent/v2/execute.js.map +0 -1
  161. package/resources/agent/v2/execute.mjs +0 -16
  162. package/resources/agent/v2/execute.mjs.map +0 -1
  163. package/resources/agent/v2/index.d.mts +0 -5
  164. package/resources/agent/v2/index.d.mts.map +0 -1
  165. package/resources/agent/v2/index.d.ts +0 -5
  166. package/resources/agent/v2/index.d.ts.map +0 -1
  167. package/resources/agent/v2/index.js +0 -13
  168. package/resources/agent/v2/index.js.map +0 -1
  169. package/resources/agent/v2/index.mjs +0 -6
  170. package/resources/agent/v2/index.mjs.map +0 -1
  171. package/resources/agent/v2/run.d.mts +0 -73
  172. package/resources/agent/v2/run.d.mts.map +0 -1
  173. package/resources/agent/v2/run.d.ts +0 -73
  174. package/resources/agent/v2/run.d.ts.map +0 -1
  175. package/resources/agent/v2/run.js +0 -51
  176. package/resources/agent/v2/run.js.map +0 -1
  177. package/resources/agent/v2/run.mjs +0 -47
  178. package/resources/agent/v2/run.mjs.map +0 -1
  179. package/resources/agent/v2/v2.d.mts +0 -18
  180. package/resources/agent/v2/v2.d.mts.map +0 -1
  181. package/resources/agent/v2/v2.d.ts +0 -18
  182. package/resources/agent/v2/v2.d.ts.map +0 -1
  183. package/resources/agent/v2/v2.js +0 -25
  184. package/resources/agent/v2/v2.js.map +0 -1
  185. package/resources/agent/v2/v2.mjs +0 -20
  186. package/resources/agent/v2/v2.mjs.map +0 -1
  187. package/resources/agent/v2.d.mts +0 -2
  188. package/resources/agent/v2.d.mts.map +0 -1
  189. package/resources/agent/v2.d.ts +0 -2
  190. package/resources/agent/v2.d.ts.map +0 -1
  191. package/resources/agent/v2.js.map +0 -1
  192. package/resources/agent/v2.mjs.map +0 -1
  193. package/src/resources/agent/v2/chat/chat.ts +0 -314
  194. package/src/resources/agent/v2/chat/files.ts +0 -63
  195. package/src/resources/agent/v2/chat/index.ts +0 -17
  196. package/src/resources/agent/v2/execute.ts +0 -91
  197. package/src/resources/agent/v2/index.ts +0 -28
  198. package/src/resources/agent/v2/run.ts +0 -137
  199. package/src/resources/agent/v2/v2.ts +0 -75
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,EAAE;OACT,EAAE,OAAO,EAAE;OACX,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAE;OACV,EAAE,KAAK,EAAE;OACT,EAAE,GAAG,EAA6B;OAClC,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE;OACX,EAAE,MAAM,EAAE;OACV,EAAE,GAAG,EAAE;OACP,EAAE,SAAS,EAAE;OACb,EAAE,MAAM,EAAE;OACV,EACL,MAAM,GASP;OACM,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAmC;OAC3C,EAAE,SAAS,EAAE;OACb,EAAE,KAAK,EAAE;OACT,EACL,KAAK,GAiBN;OACM,EAAE,KAAK,EAAE"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,EAAE;OACT,EAAE,OAAO,EAAE;OACX,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAE;OACV,EAAE,KAAK,EAAE;OACT,EAAE,GAAG,EAA6B;OAClC,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE;OACX,EAAE,MAAM,EAAE;OACV,EAAE,GAAG,EAAE;OACP,EAAE,SAAS,EAAE;OACb,EAAE,MAAM,EAAE;OACV,EACL,MAAM,GASP;OACM,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAmC;OAC3C,EAAE,SAAS,EAAE;OACb,EAAE,KAAK,EAAE;OACT,EACL,KAAK,GAiBN;OACM,EAAE,KAAK,EAAE;OACT,EAAE,QAAQ,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { V1 } from "./v1/index.mjs";
2
+ export { Webhooks } from "./webhooks.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"OAEO,EAAE,EAAE,EAAE;OACN,EAAE,QAAQ,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { V1 } from "./v1/index.js";
2
+ export { Webhooks } from "./webhooks.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"OAEO,EAAE,EAAE,EAAE;OACN,EAAE,QAAQ,EAAE"}
@@ -0,0 +1,9 @@
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.Webhooks = exports.V1 = void 0;
5
+ var index_1 = require("./v1/index.js");
6
+ Object.defineProperty(exports, "V1", { enumerable: true, get: function () { return index_1.V1; } });
7
+ var webhooks_1 = require("./webhooks.js");
8
+ Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,uCAAgC;AAAvB,2FAAA,EAAE,OAAA;AACX,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { V1 } from "./v1/index.mjs";
3
+ export { Webhooks } from "./webhooks.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/webhooks/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,EAAE,EAAE;OACN,EAAE,QAAQ,EAAE"}
@@ -0,0 +1,42 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ /**
5
+ * Webhook endpoint management
6
+ */
7
+ export declare class Deliveries extends APIResource {
8
+ /**
9
+ * Get webhook delivery
10
+ */
11
+ retrieve(id: string, options?: RequestOptions): APIPromise<void>;
12
+ /**
13
+ * Returns delivery attempts for the organization, newest first. Filter by
14
+ * endpoint_id or status to narrow results.
15
+ */
16
+ list(query?: DeliveryListParams | null | undefined, options?: RequestOptions): APIPromise<void>;
17
+ /**
18
+ * Re-sends the original event to its endpoint. The payload is reconstructed from
19
+ * the delivery record (same eventId, eventType, and occurred_at). Replay
20
+ * deliveries include a Case.dev replay marker header so receivers can distinguish
21
+ * replays from first-time deliveries. Uses the endpoint's current signing secret —
22
+ * not the one in force at the original delivery time.
23
+ */
24
+ replay(id: string, body?: DeliveryReplayParams | null | undefined, options?: RequestOptions): APIPromise<void>;
25
+ }
26
+ export interface DeliveryListParams {
27
+ endpoint_id?: string;
28
+ limit?: number;
29
+ status?: 'pending' | 'delivered' | 'failed';
30
+ }
31
+ export interface DeliveryReplayParams {
32
+ /**
33
+ * Override payload to deliver. Must only be supplied when the delivery record
34
+ * lacks enough context to reconstruct the original event (rare). Defaults to an
35
+ * empty data envelope.
36
+ */
37
+ payload?: unknown;
38
+ }
39
+ export declare namespace Deliveries {
40
+ export { type DeliveryListParams as DeliveryListParams, type DeliveryReplayParams as DeliveryReplayParams };
41
+ }
42
+ //# sourceMappingURL=deliveries.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.d.mts","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/deliveries.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOhE;;;OAGG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQnG;;;;;;OAMG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAOpB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC7C;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC7G"}
@@ -0,0 +1,42 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ /**
5
+ * Webhook endpoint management
6
+ */
7
+ export declare class Deliveries extends APIResource {
8
+ /**
9
+ * Get webhook delivery
10
+ */
11
+ retrieve(id: string, options?: RequestOptions): APIPromise<void>;
12
+ /**
13
+ * Returns delivery attempts for the organization, newest first. Filter by
14
+ * endpoint_id or status to narrow results.
15
+ */
16
+ list(query?: DeliveryListParams | null | undefined, options?: RequestOptions): APIPromise<void>;
17
+ /**
18
+ * Re-sends the original event to its endpoint. The payload is reconstructed from
19
+ * the delivery record (same eventId, eventType, and occurred_at). Replay
20
+ * deliveries include a Case.dev replay marker header so receivers can distinguish
21
+ * replays from first-time deliveries. Uses the endpoint's current signing secret —
22
+ * not the one in force at the original delivery time.
23
+ */
24
+ replay(id: string, body?: DeliveryReplayParams | null | undefined, options?: RequestOptions): APIPromise<void>;
25
+ }
26
+ export interface DeliveryListParams {
27
+ endpoint_id?: string;
28
+ limit?: number;
29
+ status?: 'pending' | 'delivered' | 'failed';
30
+ }
31
+ export interface DeliveryReplayParams {
32
+ /**
33
+ * Override payload to deliver. Must only be supplied when the delivery record
34
+ * lacks enough context to reconstruct the original event (rare). Defaults to an
35
+ * empty data envelope.
36
+ */
37
+ payload?: unknown;
38
+ }
39
+ export declare namespace Deliveries {
40
+ export { type DeliveryListParams as DeliveryListParams, type DeliveryReplayParams as DeliveryReplayParams };
41
+ }
42
+ //# sourceMappingURL=deliveries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/deliveries.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOhE;;;OAGG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQnG;;;;;;OAMG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CAAC;CAOpB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC7C;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC7G"}
@@ -0,0 +1,48 @@
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.Deliveries = 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
+ * Webhook endpoint management
10
+ */
11
+ class Deliveries extends resource_1.APIResource {
12
+ /**
13
+ * Get webhook delivery
14
+ */
15
+ retrieve(id, options) {
16
+ return this._client.get((0, path_1.path) `/webhooks/v1/deliveries/${id}`, {
17
+ ...options,
18
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
19
+ });
20
+ }
21
+ /**
22
+ * Returns delivery attempts for the organization, newest first. Filter by
23
+ * endpoint_id or status to narrow results.
24
+ */
25
+ list(query = {}, options) {
26
+ return this._client.get('/webhooks/v1/deliveries', {
27
+ query,
28
+ ...options,
29
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
30
+ });
31
+ }
32
+ /**
33
+ * Re-sends the original event to its endpoint. The payload is reconstructed from
34
+ * the delivery record (same eventId, eventType, and occurred_at). Replay
35
+ * deliveries include a Case.dev replay marker header so receivers can distinguish
36
+ * replays from first-time deliveries. Uses the endpoint's current signing secret —
37
+ * not the one in force at the original delivery time.
38
+ */
39
+ replay(id, body = {}, options) {
40
+ return this._client.post((0, path_1.path) `/webhooks/v1/deliveries/${id}/replay`, {
41
+ body,
42
+ ...options,
43
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
44
+ });
45
+ }
46
+ }
47
+ exports.Deliveries = Deliveries;
48
+ //# sourceMappingURL=deliveries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.js","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/deliveries.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,UAAW,SAAQ,sBAAW;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,2BAA2B,EAAE,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,QAA+C,EAAE,EAAE,OAAwB;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACjD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,EAAU,EACV,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,2BAA2B,EAAE,SAAS,EAAE;YACnE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAzCD,gCAyCC"}
@@ -0,0 +1,44 @@
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
+ * Webhook endpoint management
7
+ */
8
+ export class Deliveries extends APIResource {
9
+ /**
10
+ * Get webhook delivery
11
+ */
12
+ retrieve(id, options) {
13
+ return this._client.get(path `/webhooks/v1/deliveries/${id}`, {
14
+ ...options,
15
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
16
+ });
17
+ }
18
+ /**
19
+ * Returns delivery attempts for the organization, newest first. Filter by
20
+ * endpoint_id or status to narrow results.
21
+ */
22
+ list(query = {}, options) {
23
+ return this._client.get('/webhooks/v1/deliveries', {
24
+ query,
25
+ ...options,
26
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
27
+ });
28
+ }
29
+ /**
30
+ * Re-sends the original event to its endpoint. The payload is reconstructed from
31
+ * the delivery record (same eventId, eventType, and occurred_at). Replay
32
+ * deliveries include a Case.dev replay marker header so receivers can distinguish
33
+ * replays from first-time deliveries. Uses the endpoint's current signing secret —
34
+ * not the one in force at the original delivery time.
35
+ */
36
+ replay(id, body = {}, options) {
37
+ return this._client.post(path `/webhooks/v1/deliveries/${id}/replay`, {
38
+ body,
39
+ ...options,
40
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
41
+ });
42
+ }
43
+ }
44
+ //# sourceMappingURL=deliveries.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.mjs","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/deliveries.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,2BAA2B,EAAE,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,QAA+C,EAAE,EAAE,OAAwB;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACjD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,EAAU,EACV,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,2BAA2B,EAAE,SAAS,EAAE;YACnE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,121 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ /**
5
+ * Webhook endpoint management
6
+ */
7
+ export declare class Endpoints extends APIResource {
8
+ /**
9
+ * Creates a webhook endpoint that receives platform events matching the supplied
10
+ * event-type filters. Returns the generated signing secret ONCE — the response is
11
+ * the only time it is shown in plaintext.
12
+ */
13
+ create(body: EndpointCreateParams, options?: RequestOptions): APIPromise<void>;
14
+ /**
15
+ * Get webhook endpoint
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<void>;
18
+ /**
19
+ * Partially updates a webhook endpoint. Any omitted field is left unchanged.
20
+ * Signing secrets are rotated via the separate /rotate_secret endpoint.
21
+ */
22
+ update(id: string, body: EndpointUpdateParams, options?: RequestOptions): APIPromise<void>;
23
+ /**
24
+ * Returns the organization's webhook endpoints, newest first. Signing secrets are
25
+ * never included.
26
+ */
27
+ list(query?: EndpointListParams | null | undefined, options?: RequestOptions): APIPromise<void>;
28
+ /**
29
+ * Soft-deletes a webhook endpoint. Delivery stops immediately and the endpoint no
30
+ * longer appears in list results. Delivery history is preserved (and can be
31
+ * fetched via GET /deliveries with the endpoint_id filter) so audit trails and
32
+ * post-mortem debugging remain possible.
33
+ */
34
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
35
+ /**
36
+ * Generates a new signing secret for the endpoint. The previous secret remains
37
+ * valid until `previousSecretExpiresInSec` elapses (default 24h, max 30 days).
38
+ * During the grace window deliveries are signed with both secrets so receivers can
39
+ * migrate without downtime. Returns the new secret — this is the only time it is
40
+ * shown in plaintext.
41
+ */
42
+ rotateSecret(id: string, body?: EndpointRotateSecretParams | null | undefined, options?: RequestOptions): APIPromise<void>;
43
+ /**
44
+ * Synchronously delivers a synthetic `webhook.test` event to the endpoint and
45
+ * returns the HTTP result. No retries. Useful for validating that a new endpoint
46
+ * is reachable and its signature verifier works. The delivery is not persisted in
47
+ * the delivery history.
48
+ */
49
+ test(id: string, body?: EndpointTestParams | null | undefined, options?: RequestOptions): APIPromise<void>;
50
+ }
51
+ export interface EndpointCreateParams {
52
+ /**
53
+ * Glob patterns of event types to deliver (e.g. "vault._", "ocr.job.completed",
54
+ * "_")
55
+ */
56
+ eventTypeFilters: Array<string>;
57
+ /**
58
+ * HTTPS callback URL that will receive event deliveries
59
+ */
60
+ url: string;
61
+ /**
62
+ * Human-readable label for this endpoint
63
+ */
64
+ description?: string;
65
+ /**
66
+ * Optional per-resource allowlists. If vaultIds is set, only events for those
67
+ * vaults are delivered. Same for matterIds.
68
+ */
69
+ resourceScopes?: EndpointCreateParams.ResourceScopes;
70
+ }
71
+ export declare namespace EndpointCreateParams {
72
+ /**
73
+ * Optional per-resource allowlists. If vaultIds is set, only events for those
74
+ * vaults are delivered. Same for matterIds.
75
+ */
76
+ interface ResourceScopes {
77
+ matterIds?: Array<string>;
78
+ vaultIds?: Array<string>;
79
+ }
80
+ }
81
+ export interface EndpointUpdateParams {
82
+ description?: string | null;
83
+ eventTypeFilters?: Array<string>;
84
+ resourceScopes?: EndpointUpdateParams.ResourceScopes | null;
85
+ status?: 'active' | 'disabled';
86
+ url?: string;
87
+ }
88
+ export declare namespace EndpointUpdateParams {
89
+ interface ResourceScopes {
90
+ matterIds?: Array<string>;
91
+ vaultIds?: Array<string>;
92
+ }
93
+ }
94
+ export interface EndpointListParams {
95
+ limit?: number;
96
+ /**
97
+ * Filter by endpoint status
98
+ */
99
+ status?: 'active' | 'disabled' | 'auto_disabled';
100
+ }
101
+ export interface EndpointRotateSecretParams {
102
+ /**
103
+ * How long (seconds) the old secret continues to be accepted. 0 invalidates
104
+ * immediately. Default: 86400 (24h).
105
+ */
106
+ previousSecretExpiresInSec?: number;
107
+ }
108
+ export interface EndpointTestParams {
109
+ /**
110
+ * Event type to simulate. Defaults to "webhook.test".
111
+ */
112
+ eventType?: string;
113
+ /**
114
+ * Custom `data` payload. Defaults to a small placeholder.
115
+ */
116
+ payload?: unknown;
117
+ }
118
+ export declare namespace Endpoints {
119
+ export { type EndpointCreateParams as EndpointCreateParams, type EndpointUpdateParams as EndpointUpdateParams, type EndpointListParams as EndpointListParams, type EndpointRotateSecretParams as EndpointRotateSecretParams, type EndpointTestParams as EndpointTestParams, };
120
+ }
121
+ //# sourceMappingURL=endpoints.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.mts","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/endpoints.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ9E;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOhE;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ1F;;;OAGG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQnG;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO9D;;;;;;OAMG;IACH,YAAY,CACV,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,0BAA0B,GAAG,IAAI,GAAG,SAAc,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,IAAI,CA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IACzC;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,121 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ /**
5
+ * Webhook endpoint management
6
+ */
7
+ export declare class Endpoints extends APIResource {
8
+ /**
9
+ * Creates a webhook endpoint that receives platform events matching the supplied
10
+ * event-type filters. Returns the generated signing secret ONCE — the response is
11
+ * the only time it is shown in plaintext.
12
+ */
13
+ create(body: EndpointCreateParams, options?: RequestOptions): APIPromise<void>;
14
+ /**
15
+ * Get webhook endpoint
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<void>;
18
+ /**
19
+ * Partially updates a webhook endpoint. Any omitted field is left unchanged.
20
+ * Signing secrets are rotated via the separate /rotate_secret endpoint.
21
+ */
22
+ update(id: string, body: EndpointUpdateParams, options?: RequestOptions): APIPromise<void>;
23
+ /**
24
+ * Returns the organization's webhook endpoints, newest first. Signing secrets are
25
+ * never included.
26
+ */
27
+ list(query?: EndpointListParams | null | undefined, options?: RequestOptions): APIPromise<void>;
28
+ /**
29
+ * Soft-deletes a webhook endpoint. Delivery stops immediately and the endpoint no
30
+ * longer appears in list results. Delivery history is preserved (and can be
31
+ * fetched via GET /deliveries with the endpoint_id filter) so audit trails and
32
+ * post-mortem debugging remain possible.
33
+ */
34
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
35
+ /**
36
+ * Generates a new signing secret for the endpoint. The previous secret remains
37
+ * valid until `previousSecretExpiresInSec` elapses (default 24h, max 30 days).
38
+ * During the grace window deliveries are signed with both secrets so receivers can
39
+ * migrate without downtime. Returns the new secret — this is the only time it is
40
+ * shown in plaintext.
41
+ */
42
+ rotateSecret(id: string, body?: EndpointRotateSecretParams | null | undefined, options?: RequestOptions): APIPromise<void>;
43
+ /**
44
+ * Synchronously delivers a synthetic `webhook.test` event to the endpoint and
45
+ * returns the HTTP result. No retries. Useful for validating that a new endpoint
46
+ * is reachable and its signature verifier works. The delivery is not persisted in
47
+ * the delivery history.
48
+ */
49
+ test(id: string, body?: EndpointTestParams | null | undefined, options?: RequestOptions): APIPromise<void>;
50
+ }
51
+ export interface EndpointCreateParams {
52
+ /**
53
+ * Glob patterns of event types to deliver (e.g. "vault._", "ocr.job.completed",
54
+ * "_")
55
+ */
56
+ eventTypeFilters: Array<string>;
57
+ /**
58
+ * HTTPS callback URL that will receive event deliveries
59
+ */
60
+ url: string;
61
+ /**
62
+ * Human-readable label for this endpoint
63
+ */
64
+ description?: string;
65
+ /**
66
+ * Optional per-resource allowlists. If vaultIds is set, only events for those
67
+ * vaults are delivered. Same for matterIds.
68
+ */
69
+ resourceScopes?: EndpointCreateParams.ResourceScopes;
70
+ }
71
+ export declare namespace EndpointCreateParams {
72
+ /**
73
+ * Optional per-resource allowlists. If vaultIds is set, only events for those
74
+ * vaults are delivered. Same for matterIds.
75
+ */
76
+ interface ResourceScopes {
77
+ matterIds?: Array<string>;
78
+ vaultIds?: Array<string>;
79
+ }
80
+ }
81
+ export interface EndpointUpdateParams {
82
+ description?: string | null;
83
+ eventTypeFilters?: Array<string>;
84
+ resourceScopes?: EndpointUpdateParams.ResourceScopes | null;
85
+ status?: 'active' | 'disabled';
86
+ url?: string;
87
+ }
88
+ export declare namespace EndpointUpdateParams {
89
+ interface ResourceScopes {
90
+ matterIds?: Array<string>;
91
+ vaultIds?: Array<string>;
92
+ }
93
+ }
94
+ export interface EndpointListParams {
95
+ limit?: number;
96
+ /**
97
+ * Filter by endpoint status
98
+ */
99
+ status?: 'active' | 'disabled' | 'auto_disabled';
100
+ }
101
+ export interface EndpointRotateSecretParams {
102
+ /**
103
+ * How long (seconds) the old secret continues to be accepted. 0 invalidates
104
+ * immediately. Default: 86400 (24h).
105
+ */
106
+ previousSecretExpiresInSec?: number;
107
+ }
108
+ export interface EndpointTestParams {
109
+ /**
110
+ * Event type to simulate. Defaults to "webhook.test".
111
+ */
112
+ eventType?: string;
113
+ /**
114
+ * Custom `data` payload. Defaults to a small placeholder.
115
+ */
116
+ payload?: unknown;
117
+ }
118
+ export declare namespace Endpoints {
119
+ export { type EndpointCreateParams as EndpointCreateParams, type EndpointUpdateParams as EndpointUpdateParams, type EndpointListParams as EndpointListParams, type EndpointRotateSecretParams as EndpointRotateSecretParams, type EndpointTestParams as EndpointTestParams, };
120
+ }
121
+ //# sourceMappingURL=endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/endpoints.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ9E;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOhE;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,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MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,cAAc;QAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE1B,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,eAAe,CAAC;CAClD;AAED,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,96 @@
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.Endpoints = 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
+ * Webhook endpoint management
10
+ */
11
+ class Endpoints extends resource_1.APIResource {
12
+ /**
13
+ * Creates a webhook endpoint that receives platform events matching the supplied
14
+ * event-type filters. Returns the generated signing secret ONCE — the response is
15
+ * the only time it is shown in plaintext.
16
+ */
17
+ create(body, options) {
18
+ return this._client.post('/webhooks/v1/endpoints', {
19
+ body,
20
+ ...options,
21
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
22
+ });
23
+ }
24
+ /**
25
+ * Get webhook endpoint
26
+ */
27
+ retrieve(id, options) {
28
+ return this._client.get((0, path_1.path) `/webhooks/v1/endpoints/${id}`, {
29
+ ...options,
30
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
31
+ });
32
+ }
33
+ /**
34
+ * Partially updates a webhook endpoint. Any omitted field is left unchanged.
35
+ * Signing secrets are rotated via the separate /rotate_secret endpoint.
36
+ */
37
+ update(id, body, options) {
38
+ return this._client.patch((0, path_1.path) `/webhooks/v1/endpoints/${id}`, {
39
+ body,
40
+ ...options,
41
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
42
+ });
43
+ }
44
+ /**
45
+ * Returns the organization's webhook endpoints, newest first. Signing secrets are
46
+ * never included.
47
+ */
48
+ list(query = {}, options) {
49
+ return this._client.get('/webhooks/v1/endpoints', {
50
+ query,
51
+ ...options,
52
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
53
+ });
54
+ }
55
+ /**
56
+ * Soft-deletes a webhook endpoint. Delivery stops immediately and the endpoint no
57
+ * longer appears in list results. Delivery history is preserved (and can be
58
+ * fetched via GET /deliveries with the endpoint_id filter) so audit trails and
59
+ * post-mortem debugging remain possible.
60
+ */
61
+ delete(id, options) {
62
+ return this._client.delete((0, path_1.path) `/webhooks/v1/endpoints/${id}`, {
63
+ ...options,
64
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
65
+ });
66
+ }
67
+ /**
68
+ * Generates a new signing secret for the endpoint. The previous secret remains
69
+ * valid until `previousSecretExpiresInSec` elapses (default 24h, max 30 days).
70
+ * During the grace window deliveries are signed with both secrets so receivers can
71
+ * migrate without downtime. Returns the new secret — this is the only time it is
72
+ * shown in plaintext.
73
+ */
74
+ rotateSecret(id, body = {}, options) {
75
+ return this._client.post((0, path_1.path) `/webhooks/v1/endpoints/${id}/rotate_secret`, {
76
+ body,
77
+ ...options,
78
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
79
+ });
80
+ }
81
+ /**
82
+ * Synchronously delivers a synthetic `webhook.test` event to the endpoint and
83
+ * returns the HTTP result. No retries. Useful for validating that a new endpoint
84
+ * is reachable and its signature verifier works. The delivery is not persisted in
85
+ * the delivery history.
86
+ */
87
+ test(id, body = {}, options) {
88
+ return this._client.post((0, path_1.path) `/webhooks/v1/endpoints/${id}/test`, {
89
+ body,
90
+ ...options,
91
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
92
+ });
93
+ }
94
+ }
95
+ exports.Endpoints = Endpoints;
96
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/resources/webhooks/v1/endpoints.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;OAIG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE;YACjD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,EAAE,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,O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