sendblue 3.12.0 → 3.14.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 (147) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/groups.d.mts +23 -4
  4. package/resources/groups.d.mts.map +1 -1
  5. package/resources/groups.d.ts +23 -4
  6. package/resources/groups.d.ts.map +1 -1
  7. package/resources/groups.js +6 -1
  8. package/resources/groups.js.map +1 -1
  9. package/resources/groups.mjs +6 -1
  10. package/resources/groups.mjs.map +1 -1
  11. package/resources/v2/groups/groups.d.mts +86 -0
  12. package/resources/v2/groups/groups.d.mts.map +1 -0
  13. package/resources/v2/groups/groups.d.ts +86 -0
  14. package/resources/v2/groups/groups.d.ts.map +1 -0
  15. package/resources/v2/groups/groups.js +35 -0
  16. package/resources/v2/groups/groups.js.map +1 -0
  17. package/resources/v2/groups/groups.mjs +30 -0
  18. package/resources/v2/groups/groups.mjs.map +1 -0
  19. package/resources/v2/groups/index.d.mts +3 -0
  20. package/resources/v2/groups/index.d.mts.map +1 -0
  21. package/resources/v2/groups/index.d.ts +3 -0
  22. package/resources/v2/groups/index.d.ts.map +1 -0
  23. package/resources/v2/groups/index.js +9 -0
  24. package/resources/v2/groups/index.js.map +1 -0
  25. package/resources/v2/groups/index.mjs +4 -0
  26. package/resources/v2/groups/index.mjs.map +1 -0
  27. package/resources/v2/groups/verify/index.d.mts +3 -0
  28. package/resources/v2/groups/verify/index.d.mts.map +1 -0
  29. package/resources/v2/groups/verify/index.d.ts +3 -0
  30. package/resources/v2/groups/verify/index.d.ts.map +1 -0
  31. package/resources/v2/groups/verify/index.js +9 -0
  32. package/resources/v2/groups/verify/index.js.map +1 -0
  33. package/resources/v2/groups/verify/index.mjs +4 -0
  34. package/resources/v2/groups/verify/index.mjs.map +1 -0
  35. package/resources/v2/groups/verify/services/index.d.mts +3 -0
  36. package/resources/v2/groups/verify/services/index.d.mts.map +1 -0
  37. package/resources/v2/groups/verify/services/index.d.ts +3 -0
  38. package/resources/v2/groups/verify/services/index.d.ts.map +1 -0
  39. package/resources/v2/groups/verify/services/index.js +9 -0
  40. package/resources/v2/groups/verify/services/index.js.map +1 -0
  41. package/resources/v2/groups/verify/services/index.mjs +4 -0
  42. package/resources/v2/groups/verify/services/index.mjs.map +1 -0
  43. package/resources/v2/groups/verify/services/services.d.mts +10 -0
  44. package/resources/v2/groups/verify/services/services.d.mts.map +1 -0
  45. package/resources/v2/groups/verify/services/services.d.ts +10 -0
  46. package/resources/v2/groups/verify/services/services.d.ts.map +1 -0
  47. package/resources/v2/groups/verify/services/services.js +17 -0
  48. package/resources/v2/groups/verify/services/services.js.map +1 -0
  49. package/resources/v2/groups/verify/services/services.mjs +12 -0
  50. package/resources/v2/groups/verify/services/services.mjs.map +1 -0
  51. package/resources/v2/groups/verify/services/verifications.d.mts +145 -0
  52. package/resources/v2/groups/verify/services/verifications.d.mts.map +1 -0
  53. package/resources/v2/groups/verify/services/verifications.d.ts +145 -0
  54. package/resources/v2/groups/verify/services/verifications.d.ts.map +1 -0
  55. package/resources/v2/groups/verify/services/verifications.js +57 -0
  56. package/resources/v2/groups/verify/services/verifications.js.map +1 -0
  57. package/resources/v2/groups/verify/services/verifications.mjs +53 -0
  58. package/resources/v2/groups/verify/services/verifications.mjs.map +1 -0
  59. package/resources/v2/groups/verify/services.d.mts +2 -0
  60. package/resources/v2/groups/verify/services.d.mts.map +1 -0
  61. package/resources/v2/groups/verify/services.d.ts +2 -0
  62. package/resources/v2/groups/verify/services.d.ts.map +1 -0
  63. package/resources/v2/groups/verify/services.js +6 -0
  64. package/resources/v2/groups/verify/services.js.map +1 -0
  65. package/resources/v2/groups/verify/services.mjs +3 -0
  66. package/resources/v2/groups/verify/services.mjs.map +1 -0
  67. package/resources/v2/groups/verify/verify.d.mts +10 -0
  68. package/resources/v2/groups/verify/verify.d.mts.map +1 -0
  69. package/resources/v2/groups/verify/verify.d.ts +10 -0
  70. package/resources/v2/groups/verify/verify.d.ts.map +1 -0
  71. package/resources/v2/groups/verify/verify.js +17 -0
  72. package/resources/v2/groups/verify/verify.js.map +1 -0
  73. package/resources/v2/groups/verify/verify.mjs +12 -0
  74. package/resources/v2/groups/verify/verify.mjs.map +1 -0
  75. package/resources/v2/groups/verify.d.mts +2 -0
  76. package/resources/v2/groups/verify.d.mts.map +1 -0
  77. package/resources/v2/groups/verify.d.ts +2 -0
  78. package/resources/v2/groups/verify.d.ts.map +1 -0
  79. package/resources/v2/groups/verify.js +6 -0
  80. package/resources/v2/groups/verify.js.map +1 -0
  81. package/resources/v2/groups/verify.mjs +3 -0
  82. package/resources/v2/groups/verify.mjs.map +1 -0
  83. package/resources/v2/groups.d.mts +1 -81
  84. package/resources/v2/groups.d.mts.map +1 -1
  85. package/resources/v2/groups.d.ts +1 -81
  86. package/resources/v2/groups.d.ts.map +1 -1
  87. package/resources/v2/groups.js +2 -23
  88. package/resources/v2/groups.js.map +1 -1
  89. package/resources/v2/groups.mjs +1 -21
  90. package/resources/v2/groups.mjs.map +1 -1
  91. package/resources/v2/index.d.mts +1 -1
  92. package/resources/v2/index.d.mts.map +1 -1
  93. package/resources/v2/index.d.ts +1 -1
  94. package/resources/v2/index.d.ts.map +1 -1
  95. package/resources/v2/index.js +4 -4
  96. package/resources/v2/index.js.map +1 -1
  97. package/resources/v2/index.mjs +1 -1
  98. package/resources/v2/index.mjs.map +1 -1
  99. package/resources/v2/v2.d.mts +2 -2
  100. package/resources/v2/v2.d.mts.map +1 -1
  101. package/resources/v2/v2.d.ts +2 -2
  102. package/resources/v2/v2.d.ts.map +1 -1
  103. package/resources/v2/v2.js +2 -2
  104. package/resources/v2/v2.js.map +1 -1
  105. package/resources/v2/v2.mjs +2 -2
  106. package/resources/v2/v2.mjs.map +1 -1
  107. package/resources/verify/index.d.mts +1 -1
  108. package/resources/verify/index.d.mts.map +1 -1
  109. package/resources/verify/index.d.ts +1 -1
  110. package/resources/verify/index.d.ts.map +1 -1
  111. package/resources/verify/index.js.map +1 -1
  112. package/resources/verify/index.mjs.map +1 -1
  113. package/resources/verify/verifications.d.mts +172 -1
  114. package/resources/verify/verifications.d.mts.map +1 -1
  115. package/resources/verify/verifications.d.ts +172 -1
  116. package/resources/verify/verifications.d.ts.map +1 -1
  117. package/resources/verify/verifications.js +51 -0
  118. package/resources/verify/verifications.js.map +1 -1
  119. package/resources/verify/verifications.mjs +51 -0
  120. package/resources/verify/verifications.mjs.map +1 -1
  121. package/resources/verify/verify.d.mts +2 -2
  122. package/resources/verify/verify.d.mts.map +1 -1
  123. package/resources/verify/verify.d.ts +2 -2
  124. package/resources/verify/verify.d.ts.map +1 -1
  125. package/resources/verify/verify.js.map +1 -1
  126. package/resources/verify/verify.mjs.map +1 -1
  127. package/src/resources/groups.ts +28 -4
  128. package/src/resources/v2/groups/groups.ts +114 -0
  129. package/src/resources/v2/groups/index.ts +4 -0
  130. package/src/resources/v2/groups/verify/index.ts +4 -0
  131. package/src/resources/v2/groups/verify/services/index.ts +10 -0
  132. package/src/resources/v2/groups/verify/services/services.ts +27 -0
  133. package/src/resources/v2/groups/verify/services/verifications.ts +201 -0
  134. package/src/resources/v2/groups/verify/services.ts +3 -0
  135. package/src/resources/v2/groups/verify/verify.ts +15 -0
  136. package/src/resources/v2/groups/verify.ts +3 -0
  137. package/src/resources/v2/groups.ts +1 -104
  138. package/src/resources/v2/index.ts +1 -1
  139. package/src/resources/v2/v2.ts +2 -2
  140. package/src/resources/verify/index.ts +6 -0
  141. package/src/resources/verify/verifications.ts +233 -0
  142. package/src/resources/verify/verify.ts +12 -0
  143. package/src/version.ts +1 -1
  144. package/version.d.mts +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.js +1 -1
  147. package/version.mjs +1 -1
@@ -5,9 +5,54 @@ import { RequestOptions } from "../../internal/request-options.js";
5
5
  * Sendblue Verify issuance and recovery state
6
6
  */
7
7
  export declare class Verifications extends APIResource {
8
+ /**
9
+ * Creates an inverted-OTP verification for the supplied E.164 phone number. The
10
+ * user must send the returned code from that exact phone number to the returned
11
+ * Sendblue destination number.
12
+ *
13
+ * Include `hosted` to create an origin-bound Hosted Verify widget session.
14
+ * Sendblue API credentials must remain on the customer's backend; only the
15
+ * returned `hosted` values may be sent to the browser. Twilio-compatible clients
16
+ * may alternatively send the API Key ID and API Secret Key with HTTP Basic
17
+ * authentication. Temporary bearer authentication is supported for account-scoped
18
+ * tokens; line-scoped temporary tokens cannot create account-wide Verifications.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const verification =
23
+ * await client.verify.verifications.create(
24
+ * 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
25
+ * { to: '+14155551212' },
26
+ * );
27
+ * ```
28
+ */
29
+ create(serviceSid: string, body: VerificationCreateParams, options?: RequestOptions): APIPromise<VerificationCreateResponse>;
30
+ /**
31
+ * Returns the authoritative status for one Verification owned by the authenticated
32
+ * account. Twilio-compatible clients may send the API Key ID and API Secret Key
33
+ * with HTTP Basic authentication. Temporary bearer authentication is supported for
34
+ * account-scoped tokens; line-scoped temporary tokens cannot retrieve account-wide
35
+ * Verification state.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const verification =
40
+ * await client.verify.verifications.retrieve(
41
+ * 'VRE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
42
+ * { service_sid: 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD' },
43
+ * );
44
+ * ```
45
+ */
46
+ retrieve(verificationSid: string, params: VerificationRetrieveParams, options?: RequestOptions): APIPromise<VerificationRetrieveResponse>;
8
47
  /**
9
48
  * Account-scoped verification state used to recover terminal Verify events after
10
49
  * an SSE gap.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const verifications =
54
+ * await client.verify.verifications.list();
55
+ * ```
11
56
  */
12
57
  list(query?: VerificationListParams | null | undefined, options?: RequestOptions): APIPromise<VerificationListResponse>;
13
58
  }
@@ -21,6 +66,87 @@ export interface VerificationState {
21
66
  date_completed?: string | null;
22
67
  to?: string | null;
23
68
  }
69
+ export interface DeliveryTarget {
70
+ /**
71
+ * Code the expected sender must text to `pool_number`.
72
+ */
73
+ code: string;
74
+ /**
75
+ * Sendblue phone number that should receive the verification code.
76
+ */
77
+ pool_number: string;
78
+ /**
79
+ * Messages/SMS deep link with the destination and code prefilled.
80
+ */
81
+ sms_deep_link: string;
82
+ }
83
+ export interface HostedVerification {
84
+ /**
85
+ * Web-component script URL. Load this value exactly as returned.
86
+ */
87
+ component_script: string;
88
+ /**
89
+ * ISO timestamp when the Verification expires.
90
+ */
91
+ expires_at: string;
92
+ /**
93
+ * Hosted widget session identifier.
94
+ */
95
+ session_id: string;
96
+ /**
97
+ * Origin-bound widget URL containing a one-session bearer token in its fragment.
98
+ * Do not log, persist, or move the token into a query parameter.
99
+ */
100
+ url: string;
101
+ }
102
+ export interface VerificationCreateResponse {
103
+ account_sid: string;
104
+ channel: 'imessage';
105
+ date_created: string;
106
+ date_updated: string;
107
+ /**
108
+ * ISO timestamp when the Verification expires.
109
+ */
110
+ expires_at: string;
111
+ service_sid: string;
112
+ sid: string;
113
+ status: 'pending' | 'approved' | 'expired' | 'canceled';
114
+ /**
115
+ * Expected sender in E.164 format; older durable terminal records may return null.
116
+ */
117
+ to: string | null;
118
+ url: string;
119
+ /**
120
+ * Present while the Verification is pending.
121
+ */
122
+ delivery_target?: DeliveryTarget;
123
+ /**
124
+ * Present only when hosted options were supplied during creation.
125
+ */
126
+ hosted?: HostedVerification;
127
+ }
128
+ export interface VerificationRetrieveResponse {
129
+ account_sid: string;
130
+ channel: 'imessage';
131
+ date_created: string;
132
+ date_updated: string;
133
+ /**
134
+ * ISO timestamp when the Verification expires.
135
+ */
136
+ expires_at: string;
137
+ service_sid: string;
138
+ sid: string;
139
+ status: 'pending' | 'approved' | 'expired' | 'canceled';
140
+ /**
141
+ * Expected sender in E.164 format; older durable terminal records may return null.
142
+ */
143
+ to: string | null;
144
+ url: string;
145
+ /**
146
+ * Present while the Verification is pending.
147
+ */
148
+ delivery_target?: DeliveryTarget;
149
+ }
24
150
  export interface VerificationListResponse {
25
151
  data: Array<VerificationState>;
26
152
  pagination: VerificationListResponse.Pagination;
@@ -34,12 +160,57 @@ export declare namespace VerificationListResponse {
34
160
  offset?: number;
35
161
  }
36
162
  }
163
+ export interface VerificationCreateParams {
164
+ /**
165
+ * E.164 phone number that must send the verification message.
166
+ */
167
+ to: string;
168
+ /**
169
+ * Options for an origin-bound Hosted Verify widget session. Nested keys are strict
170
+ * snake_case. `parent_origin` must be an exact HTTPS origin with a DNS hostname.
171
+ * `127.0.0.1` is also accepted, and HTTP is allowed only for `localhost` or
172
+ * `127.0.0.1` development origins. Wildcards and other IP literals are rejected
173
+ * because browsers cannot enforce them as exact CSP `frame-ancestors` sources.
174
+ */
175
+ hosted?: VerificationCreateParams.Hosted;
176
+ }
177
+ export declare namespace VerificationCreateParams {
178
+ /**
179
+ * Options for an origin-bound Hosted Verify widget session. Nested keys are strict
180
+ * snake_case. `parent_origin` must be an exact HTTPS origin with a DNS hostname.
181
+ * `127.0.0.1` is also accepted, and HTTP is allowed only for `localhost` or
182
+ * `127.0.0.1` development origins. Wildcards and other IP literals are rejected
183
+ * because browsers cannot enforce them as exact CSP `frame-ancestors` sources.
184
+ */
185
+ interface Hosted {
186
+ /**
187
+ * Exact website origin allowed to embed the widget, with no path, query, or
188
+ * fragment.
189
+ */
190
+ parent_origin: string;
191
+ /**
192
+ * Six-digit hexadecimal accent color.
193
+ */
194
+ accent_color?: string;
195
+ /**
196
+ * Brand name displayed by the widget. Defaults to Sendblue.
197
+ */
198
+ brand_name?: string;
199
+ theme?: 'light' | 'dark' | 'auto';
200
+ }
201
+ }
202
+ export interface VerificationRetrieveParams {
203
+ /**
204
+ * Verify Service SID.
205
+ */
206
+ service_sid: string;
207
+ }
37
208
  export interface VerificationListParams {
38
209
  limit?: number;
39
210
  offset?: number;
40
211
  updated_at_gte?: string;
41
212
  }
42
213
  export declare namespace Verifications {
43
- export { type VerificationState as VerificationState, type VerificationListResponse as VerificationListResponse, type VerificationListParams as VerificationListParams, };
214
+ export { type VerificationState as VerificationState, type DeliveryTarget as DeliveryTarget, type HostedVerification as HostedVerification, type VerificationCreateResponse as VerificationCreateResponse, type VerificationRetrieveResponse as VerificationRetrieveResponse, type VerificationListResponse as VerificationListResponse, type VerificationCreateParams as VerificationCreateParams, type VerificationRetrieveParams as VerificationRetrieveParams, type VerificationListParams as VerificationListParams, };
44
215
  }
45
216
  //# sourceMappingURL=verifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifications.d.ts","sourceRoot":"","sources":["../../src/resources/verify/verifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;CAGxC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAErB,WAAW,EAAE,MAAM,CAAC;IAEpB,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE/B,UAAU,EAAE,wBAAwB,CAAC,UAAU,CAAC;IAEhD,MAAM,EAAE,IAAI,CAAC;CACd;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,UAAU;QACzB,KA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,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -3,13 +3,64 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Verifications = void 0;
5
5
  const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
6
7
  /**
7
8
  * Sendblue Verify issuance and recovery state
8
9
  */
9
10
  class Verifications extends resource_1.APIResource {
11
+ /**
12
+ * Creates an inverted-OTP verification for the supplied E.164 phone number. The
13
+ * user must send the returned code from that exact phone number to the returned
14
+ * Sendblue destination number.
15
+ *
16
+ * Include `hosted` to create an origin-bound Hosted Verify widget session.
17
+ * Sendblue API credentials must remain on the customer's backend; only the
18
+ * returned `hosted` values may be sent to the browser. Twilio-compatible clients
19
+ * may alternatively send the API Key ID and API Secret Key with HTTP Basic
20
+ * authentication. Temporary bearer authentication is supported for account-scoped
21
+ * tokens; line-scoped temporary tokens cannot create account-wide Verifications.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const verification =
26
+ * await client.verify.verifications.create(
27
+ * 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
28
+ * { to: '+14155551212' },
29
+ * );
30
+ * ```
31
+ */
32
+ create(serviceSid, body, options) {
33
+ return this._client.post((0, path_1.path) `/api/v2/verify/services/${serviceSid}/verifications`, { body, ...options });
34
+ }
35
+ /**
36
+ * Returns the authoritative status for one Verification owned by the authenticated
37
+ * account. Twilio-compatible clients may send the API Key ID and API Secret Key
38
+ * with HTTP Basic authentication. Temporary bearer authentication is supported for
39
+ * account-scoped tokens; line-scoped temporary tokens cannot retrieve account-wide
40
+ * Verification state.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const verification =
45
+ * await client.verify.verifications.retrieve(
46
+ * 'VRE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
47
+ * { service_sid: 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD' },
48
+ * );
49
+ * ```
50
+ */
51
+ retrieve(verificationSid, params, options) {
52
+ const { service_sid } = params;
53
+ return this._client.get((0, path_1.path) `/api/v2/verify/services/${service_sid}/verifications/${verificationSid}`, options);
54
+ }
10
55
  /**
11
56
  * Account-scoped verification state used to recover terminal Verify events after
12
57
  * an SSE gap.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const verifications =
62
+ * await client.verify.verifications.list();
63
+ * ```
13
64
  */
14
65
  list(query = {}, options) {
15
66
  return this._client.get('/api/v2/verify/verifications', { query, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"verifications.js","sourceRoot":"","sources":["../../src/resources/verify/verifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD;;GAEG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;OAGG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AAXD,sCAWC"}
1
+ {"version":3,"file":"verifications.js","sourceRoot":"","sources":["../../src/resources/verify/verifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CACJ,UAAkB,EAClB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,2BAA2B,UAAU,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CACN,eAAuB,EACvB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,WAAI,EAAA,2BAA2B,WAAW,kBAAkB,eAAe,EAAE,EAC7E,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AA1ED,sCA0EC"}
@@ -1,12 +1,63 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
3
4
  /**
4
5
  * Sendblue Verify issuance and recovery state
5
6
  */
6
7
  export class Verifications extends APIResource {
8
+ /**
9
+ * Creates an inverted-OTP verification for the supplied E.164 phone number. The
10
+ * user must send the returned code from that exact phone number to the returned
11
+ * Sendblue destination number.
12
+ *
13
+ * Include `hosted` to create an origin-bound Hosted Verify widget session.
14
+ * Sendblue API credentials must remain on the customer's backend; only the
15
+ * returned `hosted` values may be sent to the browser. Twilio-compatible clients
16
+ * may alternatively send the API Key ID and API Secret Key with HTTP Basic
17
+ * authentication. Temporary bearer authentication is supported for account-scoped
18
+ * tokens; line-scoped temporary tokens cannot create account-wide Verifications.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const verification =
23
+ * await client.verify.verifications.create(
24
+ * 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
25
+ * { to: '+14155551212' },
26
+ * );
27
+ * ```
28
+ */
29
+ create(serviceSid, body, options) {
30
+ return this._client.post(path `/api/v2/verify/services/${serviceSid}/verifications`, { body, ...options });
31
+ }
32
+ /**
33
+ * Returns the authoritative status for one Verification owned by the authenticated
34
+ * account. Twilio-compatible clients may send the API Key ID and API Secret Key
35
+ * with HTTP Basic authentication. Temporary bearer authentication is supported for
36
+ * account-scoped tokens; line-scoped temporary tokens cannot retrieve account-wide
37
+ * Verification state.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const verification =
42
+ * await client.verify.verifications.retrieve(
43
+ * 'VRE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
44
+ * { service_sid: 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD' },
45
+ * );
46
+ * ```
47
+ */
48
+ retrieve(verificationSid, params, options) {
49
+ const { service_sid } = params;
50
+ return this._client.get(path `/api/v2/verify/services/${service_sid}/verifications/${verificationSid}`, options);
51
+ }
7
52
  /**
8
53
  * Account-scoped verification state used to recover terminal Verify events after
9
54
  * an SSE gap.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const verifications =
59
+ * await client.verify.verifications.list();
60
+ * ```
10
61
  */
11
62
  list(query = {}, options) {
12
63
  return this._client.get('/api/v2/verify/verifications', { query, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"verifications.mjs","sourceRoot":"","sources":["../../src/resources/verify/verifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;OAGG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
1
+ {"version":3,"file":"verifications.mjs","sourceRoot":"","sources":["../../src/resources/verify/verifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CACJ,UAAkB,EAClB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,2BAA2B,UAAU,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CACN,eAAuB,EACvB,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAI,CAAA,2BAA2B,WAAW,kBAAkB,eAAe,EAAE,EAC7E,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
@@ -1,10 +1,10 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import * as VerificationsAPI from "./verifications.mjs";
3
- import { VerificationListParams, VerificationListResponse, VerificationState, Verifications } from "./verifications.mjs";
3
+ import { DeliveryTarget, HostedVerification, VerificationCreateParams, VerificationCreateResponse, VerificationListParams, VerificationListResponse, VerificationRetrieveParams, VerificationRetrieveResponse, VerificationState, Verifications } from "./verifications.mjs";
4
4
  export declare class Verify extends APIResource {
5
5
  verifications: VerificationsAPI.Verifications;
6
6
  }
7
7
  export declare namespace Verify {
8
- export { Verifications as Verifications, type VerificationState as VerificationState, type VerificationListResponse as VerificationListResponse, type VerificationListParams as VerificationListParams, };
8
+ export { Verifications as Verifications, type VerificationState as VerificationState, type DeliveryTarget as DeliveryTarget, type HostedVerification as HostedVerification, type VerificationCreateResponse as VerificationCreateResponse, type VerificationRetrieveResponse as VerificationRetrieveResponse, type VerificationListResponse as VerificationListResponse, type VerificationCreateParams as VerificationCreateParams, type VerificationRetrieveParams as VerificationRetrieveParams, type VerificationListParams as VerificationListParams, };
9
9
  }
10
10
  //# sourceMappingURL=verify.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.mts","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,4BAAwB;AACpD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACd,4BAAwB;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;CAClG;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
1
+ {"version":3,"file":"verify.d.mts","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,4BAAwB;AACpD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,aAAa,EACd,4BAAwB;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;CAClG;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1,10 +1,10 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
2
  import * as VerificationsAPI from "./verifications.js";
3
- import { VerificationListParams, VerificationListResponse, VerificationState, Verifications } from "./verifications.js";
3
+ import { DeliveryTarget, HostedVerification, VerificationCreateParams, VerificationCreateResponse, VerificationListParams, VerificationListResponse, VerificationRetrieveParams, VerificationRetrieveResponse, VerificationState, Verifications } from "./verifications.js";
4
4
  export declare class Verify extends APIResource {
5
5
  verifications: VerificationsAPI.Verifications;
6
6
  }
7
7
  export declare namespace Verify {
8
- export { Verifications as Verifications, type VerificationState as VerificationState, type VerificationListResponse as VerificationListResponse, type VerificationListParams as VerificationListParams, };
8
+ export { Verifications as Verifications, type VerificationState as VerificationState, type DeliveryTarget as DeliveryTarget, type HostedVerification as HostedVerification, type VerificationCreateResponse as VerificationCreateResponse, type VerificationRetrieveResponse as VerificationRetrieveResponse, type VerificationListResponse as VerificationListResponse, type VerificationCreateParams as VerificationCreateParams, type VerificationRetrieveParams as VerificationRetrieveParams, type VerificationListParams as VerificationListParams, };
9
9
  }
10
10
  //# sourceMappingURL=verify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,gBAAgB,2BAAwB;AACpD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,EACd,2BAAwB;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;CAClG;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,gBAAgB,2BAAwB;AACpD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,aAAa,EACd,2BAAwB;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;CAClG;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6EAAoD;AACpD,sDAKyB;AAEzB,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAFD,wBAEC;AAED,MAAM,CAAC,aAAa,GAAG,6BAAa,CAAC"}
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6EAAoD;AACpD,sDAWyB;AAEzB,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAFD,wBAEC;AAED,MAAM,CAAC,aAAa,GAAG,6BAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"verify.mjs","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,4BAAwB;AACpD,OAAO,EAIL,aAAa,GACd,4BAAwB;AAEzB,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAED,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC"}
1
+ {"version":3,"file":"verify.mjs","sourceRoot":"","sources":["../../src/resources/verify/verify.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,gBAAgB,4BAAwB;AACpD,OAAO,EAUL,aAAa,GACd,4BAAwB;AAEzB,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAED,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC"}
@@ -10,7 +10,12 @@ import { RequestOptions } from '../internal/request-options';
10
10
  */
11
11
  export class Groups extends APIResource {
12
12
  /**
13
- * Add or manage participants in a group chat (beta feature)
13
+ * Add an external participant to, or remove one from, an existing iMessage group
14
+ * chat (beta feature). Success is reported only after the change is verified on
15
+ * the device: the group's persisted membership changed and Sendblue's participant
16
+ * state matches it. Removal requires the group to have at least four total members
17
+ * before the operation and does not require the group's creator. Only iMessage
18
+ * groups are supported.
14
19
  *
15
20
  * @example
16
21
  * ```ts
@@ -45,7 +50,15 @@ export class Groups extends APIResource {
45
50
  }
46
51
 
47
52
  export interface GroupModifyResponse {
48
- message?: string;
53
+ error?: string | null;
54
+
55
+ error_message?: string | null;
56
+
57
+ group_id?: string;
58
+
59
+ modify_type?: string;
60
+
61
+ number?: string;
49
62
 
50
63
  status?: string;
51
64
  }
@@ -59,12 +72,23 @@ export interface GroupModifyParams {
59
72
  /**
60
73
  * Type of modification to perform
61
74
  */
62
- modify_type: 'add_recipient';
75
+ modify_type: 'add_recipient' | 'remove_recipient';
63
76
 
64
77
  /**
65
- * Phone number to add/modify in E.164 format
78
+ * External participant to add or remove, in E.164 format (or an iMessage email
79
+ * address). Company-owned lines cannot be added or removed.
66
80
  */
67
81
  number: string;
82
+
83
+ /**
84
+ * The Sendblue line to act from. It must belong to the account and already be a
85
+ * participant of the group. Free API accounts must provide it. Other accounts may
86
+ * omit it only when exactly one account line participates in the group. With no
87
+ * participating account line the request fails with `line_not_registered`; with
88
+ * multiple lines it fails with `ambiguous_sending_line`. No change is attempted in
89
+ * either case.
90
+ */
91
+ from_number?: string;
68
92
  }
69
93
 
70
94
  export interface GroupSendMessageParams {
@@ -0,0 +1,114 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as VerifyAPI from './verify/verify';
5
+ import { Verify } from './verify/verify';
6
+ import { APIPromise } from '../../../core/api-promise';
7
+ import { RequestOptions } from '../../../internal/request-options';
8
+ import { path } from '../../../internal/utils/path';
9
+
10
+ /**
11
+ * Operations for group messaging (beta)
12
+ */
13
+ export class Groups extends APIResource {
14
+ verify: VerifyAPI.Verify = new VerifyAPI.Verify(this._client);
15
+
16
+ /**
17
+ * Retrieve the current complete membership for a group owned by the authenticated
18
+ * account.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const group = await client.v2.groups.retrieve(
23
+ * 'sb_group_608acc54-d0d7-4b41-8092-9ff6e1e70455',
24
+ * );
25
+ * ```
26
+ */
27
+ retrieve(groupID: string, options?: RequestOptions): APIPromise<GroupRetrieveResponse> {
28
+ return this._client.get(path`/api/v2/groups/${groupID}`, options);
29
+ }
30
+ }
31
+
32
+ export interface GroupRetrieveResponse {
33
+ data?: GroupRetrieveResponse.Data;
34
+
35
+ status?: string;
36
+ }
37
+
38
+ export namespace GroupRetrieveResponse {
39
+ export interface Data {
40
+ created_at?: string;
41
+
42
+ group_id?: string;
43
+
44
+ group_name?: string;
45
+
46
+ latest_comm_at?: string | null;
47
+
48
+ latest_message_id?: string | null;
49
+
50
+ /**
51
+ * Convenience list of resolved participant phone numbers. Participants with
52
+ * email-only handles remain in participants but are omitted here.
53
+ */
54
+ participant_numbers?: Array<string>;
55
+
56
+ participants?: Array<Data.Participant>;
57
+
58
+ updated_at?: string;
59
+
60
+ /**
61
+ * Worker-local iMessage group identifier when known
62
+ */
63
+ worker_group_id?: string | null;
64
+ }
65
+
66
+ export namespace Data {
67
+ export interface Participant {
68
+ /**
69
+ * Contact ID when this participant is linked to a contact
70
+ */
71
+ contact_id?: string | null;
72
+
73
+ /**
74
+ * Raw participant handle, usually an E.164 phone number but sometimes an iMessage
75
+ * email handle
76
+ */
77
+ handle?: string | null;
78
+
79
+ /**
80
+ * Contact or seat display name when available
81
+ */
82
+ name?: string | null;
83
+
84
+ /**
85
+ * Unique participant row identifier
86
+ */
87
+ participant_id?: string;
88
+
89
+ /**
90
+ * Resolved participant phone number, preferring the stored group phone handle and
91
+ * falling back to contact phone. Email handles remain available in handle.
92
+ */
93
+ phone?: string | null;
94
+
95
+ /**
96
+ * Seat ID when this participant is a team member
97
+ */
98
+ seat_id?: string | null;
99
+
100
+ /**
101
+ * Participant kind
102
+ */
103
+ type?: 'contact' | 'seat';
104
+ }
105
+ }
106
+ }
107
+
108
+ Groups.Verify = Verify;
109
+
110
+ export declare namespace Groups {
111
+ export { type GroupRetrieveResponse as GroupRetrieveResponse };
112
+
113
+ export { Verify as Verify };
114
+ }
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Groups, type GroupRetrieveResponse } from './groups';
4
+ export { Verify } from './verify/index';
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Services } from './services/index';
4
+ export { Verify } from './verify';
@@ -0,0 +1,10 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Services } from './services';
4
+ export {
5
+ Verifications,
6
+ type VerificationCreateResponse,
7
+ type VerificationRetrieveResponse,
8
+ type VerificationCreateParams,
9
+ type VerificationRetrieveParams,
10
+ } from './verifications';
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../../../core/resource';
4
+ import * as VerificationsAPI from './verifications';
5
+ import {
6
+ VerificationCreateParams,
7
+ VerificationCreateResponse,
8
+ VerificationRetrieveParams,
9
+ VerificationRetrieveResponse,
10
+ Verifications,
11
+ } from './verifications';
12
+
13
+ export class Services extends APIResource {
14
+ verifications: VerificationsAPI.Verifications = new VerificationsAPI.Verifications(this._client);
15
+ }
16
+
17
+ Services.Verifications = Verifications;
18
+
19
+ export declare namespace Services {
20
+ export {
21
+ Verifications as Verifications,
22
+ type VerificationCreateResponse as VerificationCreateResponse,
23
+ type VerificationRetrieveResponse as VerificationRetrieveResponse,
24
+ type VerificationCreateParams as VerificationCreateParams,
25
+ type VerificationRetrieveParams as VerificationRetrieveParams,
26
+ };
27
+ }