sendblue 3.11.0 → 3.13.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.
- package/CHANGELOG.md +16 -0
- package/client.d.mts +9 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -3
- package/client.d.ts.map +1 -1
- package/client.js +21 -6
- package/client.js.map +1 -1
- package/client.mjs +21 -6
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/v2/groups/groups.d.mts +86 -0
- package/resources/v2/groups/groups.d.mts.map +1 -0
- package/resources/v2/groups/groups.d.ts +86 -0
- package/resources/v2/groups/groups.d.ts.map +1 -0
- package/resources/v2/groups/groups.js +35 -0
- package/resources/v2/groups/groups.js.map +1 -0
- package/resources/v2/groups/groups.mjs +30 -0
- package/resources/v2/groups/groups.mjs.map +1 -0
- package/resources/v2/groups/index.d.mts +3 -0
- package/resources/v2/groups/index.d.mts.map +1 -0
- package/resources/v2/groups/index.d.ts +3 -0
- package/resources/v2/groups/index.d.ts.map +1 -0
- package/resources/v2/groups/index.js +9 -0
- package/resources/v2/groups/index.js.map +1 -0
- package/resources/v2/groups/index.mjs +4 -0
- package/resources/v2/groups/index.mjs.map +1 -0
- package/resources/v2/groups/verify/index.d.mts +3 -0
- package/resources/v2/groups/verify/index.d.mts.map +1 -0
- package/resources/v2/groups/verify/index.d.ts +3 -0
- package/resources/v2/groups/verify/index.d.ts.map +1 -0
- package/resources/v2/groups/verify/index.js +9 -0
- package/resources/v2/groups/verify/index.js.map +1 -0
- package/resources/v2/groups/verify/index.mjs +4 -0
- package/resources/v2/groups/verify/index.mjs.map +1 -0
- package/resources/v2/groups/verify/services/index.d.mts +3 -0
- package/resources/v2/groups/verify/services/index.d.mts.map +1 -0
- package/resources/v2/groups/verify/services/index.d.ts +3 -0
- package/resources/v2/groups/verify/services/index.d.ts.map +1 -0
- package/resources/v2/groups/verify/services/index.js +9 -0
- package/resources/v2/groups/verify/services/index.js.map +1 -0
- package/resources/v2/groups/verify/services/index.mjs +4 -0
- package/resources/v2/groups/verify/services/index.mjs.map +1 -0
- package/resources/v2/groups/verify/services/services.d.mts +10 -0
- package/resources/v2/groups/verify/services/services.d.mts.map +1 -0
- package/resources/v2/groups/verify/services/services.d.ts +10 -0
- package/resources/v2/groups/verify/services/services.d.ts.map +1 -0
- package/resources/v2/groups/verify/services/services.js +17 -0
- package/resources/v2/groups/verify/services/services.js.map +1 -0
- package/resources/v2/groups/verify/services/services.mjs +12 -0
- package/resources/v2/groups/verify/services/services.mjs.map +1 -0
- package/resources/v2/groups/verify/services/verifications.d.mts +145 -0
- package/resources/v2/groups/verify/services/verifications.d.mts.map +1 -0
- package/resources/v2/groups/verify/services/verifications.d.ts +145 -0
- package/resources/v2/groups/verify/services/verifications.d.ts.map +1 -0
- package/resources/v2/groups/verify/services/verifications.js +57 -0
- package/resources/v2/groups/verify/services/verifications.js.map +1 -0
- package/resources/v2/groups/verify/services/verifications.mjs +53 -0
- package/resources/v2/groups/verify/services/verifications.mjs.map +1 -0
- package/resources/v2/groups/verify/services.d.mts +2 -0
- package/resources/v2/groups/verify/services.d.mts.map +1 -0
- package/resources/v2/groups/verify/services.d.ts +2 -0
- package/resources/v2/groups/verify/services.d.ts.map +1 -0
- package/resources/v2/groups/verify/services.js +6 -0
- package/resources/v2/groups/verify/services.js.map +1 -0
- package/resources/v2/groups/verify/services.mjs +3 -0
- package/resources/v2/groups/verify/services.mjs.map +1 -0
- package/resources/v2/groups/verify/verify.d.mts +10 -0
- package/resources/v2/groups/verify/verify.d.mts.map +1 -0
- package/resources/v2/groups/verify/verify.d.ts +10 -0
- package/resources/v2/groups/verify/verify.d.ts.map +1 -0
- package/resources/v2/groups/verify/verify.js +17 -0
- package/resources/v2/groups/verify/verify.js.map +1 -0
- package/resources/v2/groups/verify/verify.mjs +12 -0
- package/resources/v2/groups/verify/verify.mjs.map +1 -0
- package/resources/v2/groups/verify.d.mts +2 -0
- package/resources/v2/groups/verify.d.mts.map +1 -0
- package/resources/v2/groups/verify.d.ts +2 -0
- package/resources/v2/groups/verify.d.ts.map +1 -0
- package/resources/v2/groups/verify.js +6 -0
- package/resources/v2/groups/verify.js.map +1 -0
- package/resources/v2/groups/verify.mjs +3 -0
- package/resources/v2/groups/verify.mjs.map +1 -0
- package/resources/v2/groups.d.mts +1 -81
- package/resources/v2/groups.d.mts.map +1 -1
- package/resources/v2/groups.d.ts +1 -81
- package/resources/v2/groups.d.ts.map +1 -1
- package/resources/v2/groups.js +2 -23
- package/resources/v2/groups.js.map +1 -1
- package/resources/v2/groups.mjs +1 -21
- package/resources/v2/groups.mjs.map +1 -1
- package/resources/v2/index.d.mts +1 -1
- package/resources/v2/index.d.mts.map +1 -1
- package/resources/v2/index.d.ts +1 -1
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/index.js +4 -4
- package/resources/v2/index.js.map +1 -1
- package/resources/v2/index.mjs +1 -1
- package/resources/v2/index.mjs.map +1 -1
- package/resources/v2/v2.d.mts +2 -2
- package/resources/v2/v2.d.mts.map +1 -1
- package/resources/v2/v2.d.ts +2 -2
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +2 -2
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +2 -2
- package/resources/v2/v2.mjs.map +1 -1
- package/resources/verify/index.d.mts +1 -1
- package/resources/verify/index.d.mts.map +1 -1
- package/resources/verify/index.d.ts +1 -1
- package/resources/verify/index.d.ts.map +1 -1
- package/resources/verify/index.js.map +1 -1
- package/resources/verify/index.mjs.map +1 -1
- package/resources/verify/verifications.d.mts +172 -1
- package/resources/verify/verifications.d.mts.map +1 -1
- package/resources/verify/verifications.d.ts +172 -1
- package/resources/verify/verifications.d.ts.map +1 -1
- package/resources/verify/verifications.js +51 -0
- package/resources/verify/verifications.js.map +1 -1
- package/resources/verify/verifications.mjs +51 -0
- package/resources/verify/verifications.mjs.map +1 -1
- package/resources/verify/verify.d.mts +2 -2
- package/resources/verify/verify.d.mts.map +1 -1
- package/resources/verify/verify.d.ts +2 -2
- package/resources/verify/verify.d.ts.map +1 -1
- package/resources/verify/verify.js.map +1 -1
- package/resources/verify/verify.mjs.map +1 -1
- package/src/client.ts +31 -13
- package/src/resources/v2/groups/groups.ts +114 -0
- package/src/resources/v2/groups/index.ts +4 -0
- package/src/resources/v2/groups/verify/index.ts +4 -0
- package/src/resources/v2/groups/verify/services/index.ts +10 -0
- package/src/resources/v2/groups/verify/services/services.ts +27 -0
- package/src/resources/v2/groups/verify/services/verifications.ts +201 -0
- package/src/resources/v2/groups/verify/services.ts +3 -0
- package/src/resources/v2/groups/verify/verify.ts +15 -0
- package/src/resources/v2/groups/verify.ts +3 -0
- package/src/resources/v2/groups.ts +1 -104
- package/src/resources/v2/index.ts +1 -1
- package/src/resources/v2/v2.ts +2 -2
- package/src/resources/verify/index.ts +6 -0
- package/src/resources/verify/verifications.ts +233 -0
- package/src/resources/verify/verify.ts +12 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -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;
|
|
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;
|
|
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,
|
|
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,
|
|
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"}
|
package/src/client.ts
CHANGED
|
@@ -115,6 +115,12 @@ export interface ClientOptions {
|
|
|
115
115
|
*/
|
|
116
116
|
apiSecret?: string | undefined;
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Short-lived bearer token. Use this instead of `apiKey` and `apiSecret`
|
|
120
|
+
* when credentials are issued by a token broker such as Vercel Connect.
|
|
121
|
+
*/
|
|
122
|
+
accessToken?: string | undefined;
|
|
123
|
+
|
|
118
124
|
/**
|
|
119
125
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
120
126
|
*
|
|
@@ -188,8 +194,9 @@ export interface ClientOptions {
|
|
|
188
194
|
* API Client for interfacing with the Sendblue API API.
|
|
189
195
|
*/
|
|
190
196
|
export class SendblueAPI {
|
|
191
|
-
apiKey: string;
|
|
192
|
-
apiSecret: string;
|
|
197
|
+
apiKey: string | undefined;
|
|
198
|
+
apiSecret: string | undefined;
|
|
199
|
+
accessToken: string | undefined;
|
|
193
200
|
|
|
194
201
|
baseURL: string;
|
|
195
202
|
maxRetries: number;
|
|
@@ -216,27 +223,33 @@ export class SendblueAPI {
|
|
|
216
223
|
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
217
224
|
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
218
225
|
*/
|
|
219
|
-
constructor({
|
|
220
|
-
baseURL = readEnv('SENDBLUE_API_BASE_URL'),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
constructor(input: ClientOptions = {}) {
|
|
227
|
+
const { baseURL = readEnv('SENDBLUE_API_BASE_URL'), accessToken, ...opts } = input;
|
|
228
|
+
// An explicitly supplied bearer token takes precedence over ambient
|
|
229
|
+
// key-pair environment variables. Explicitly combining either auth mode is
|
|
230
|
+
// still rejected because it is ambiguous and can leak permanent credentials.
|
|
231
|
+
const apiKey = accessToken === undefined ? input.apiKey ?? readEnv('SENDBLUE_API_API_KEY') : input.apiKey;
|
|
232
|
+
const apiSecret =
|
|
233
|
+
accessToken === undefined ? input.apiSecret ?? readEnv('SENDBLUE_API_API_SECRET') : input.apiSecret;
|
|
234
|
+
if (accessToken !== undefined && (apiKey !== undefined || apiSecret !== undefined)) {
|
|
235
|
+
throw new Errors.SendblueAPIError('accessToken cannot be combined with apiKey or apiSecret.');
|
|
236
|
+
}
|
|
237
|
+
if (accessToken === undefined && apiKey === undefined) {
|
|
226
238
|
throw new Errors.SendblueAPIError(
|
|
227
|
-
|
|
239
|
+
'The SENDBLUE_API_API_KEY environment variable is missing or empty; provide apiKey and apiSecret, or instantiate the client with an accessToken.',
|
|
228
240
|
);
|
|
229
241
|
}
|
|
230
|
-
if (apiSecret === undefined) {
|
|
242
|
+
if (accessToken === undefined && apiSecret === undefined) {
|
|
231
243
|
throw new Errors.SendblueAPIError(
|
|
232
|
-
|
|
244
|
+
'The SENDBLUE_API_API_SECRET environment variable is missing or empty; provide apiKey and apiSecret, or instantiate the client with an accessToken.',
|
|
233
245
|
);
|
|
234
246
|
}
|
|
235
247
|
|
|
236
248
|
const options: ClientOptions = {
|
|
249
|
+
...opts,
|
|
237
250
|
apiKey,
|
|
238
251
|
apiSecret,
|
|
239
|
-
|
|
252
|
+
accessToken,
|
|
240
253
|
baseURL: baseURL || `https://api.sendblue.co`,
|
|
241
254
|
};
|
|
242
255
|
|
|
@@ -271,6 +284,7 @@ export class SendblueAPI {
|
|
|
271
284
|
|
|
272
285
|
this.apiKey = apiKey;
|
|
273
286
|
this.apiSecret = apiSecret;
|
|
287
|
+
this.accessToken = accessToken;
|
|
274
288
|
}
|
|
275
289
|
|
|
276
290
|
/**
|
|
@@ -288,6 +302,7 @@ export class SendblueAPI {
|
|
|
288
302
|
fetchOptions: this.fetchOptions,
|
|
289
303
|
apiKey: this.apiKey,
|
|
290
304
|
apiSecret: this.apiSecret,
|
|
305
|
+
accessToken: this.accessToken,
|
|
291
306
|
...options,
|
|
292
307
|
});
|
|
293
308
|
return client;
|
|
@@ -309,6 +324,9 @@ export class SendblueAPI {
|
|
|
309
324
|
}
|
|
310
325
|
|
|
311
326
|
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
327
|
+
if (this.accessToken !== undefined) {
|
|
328
|
+
return buildHeaders([{ Authorization: `Bearer ${this.accessToken}` }]);
|
|
329
|
+
}
|
|
312
330
|
return buildHeaders([await this.apiKeyAuth(opts), await this.apiSecretAuth(opts)]);
|
|
313
331
|
}
|
|
314
332
|
|
|
@@ -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,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
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
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 '../../../../verify/verifications';
|
|
5
|
+
import { APIPromise } from '../../../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Sendblue Verify issuance and recovery state
|
|
11
|
+
*/
|
|
12
|
+
export class Verifications extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an inverted-OTP verification for the supplied E.164 phone number. The
|
|
15
|
+
* user must send the returned code from that exact phone number to the returned
|
|
16
|
+
* Sendblue destination number.
|
|
17
|
+
*
|
|
18
|
+
* Include `hosted` to create an origin-bound Hosted Verify widget session.
|
|
19
|
+
* Sendblue API credentials must remain on the customer's backend; only the
|
|
20
|
+
* returned `hosted` values may be sent to the browser. Twilio-compatible clients
|
|
21
|
+
* may alternatively send the API Key ID and API Secret Key with HTTP Basic
|
|
22
|
+
* authentication. Temporary bearer authentication is supported for account-scoped
|
|
23
|
+
* tokens; line-scoped temporary tokens cannot create account-wide Verifications.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const verification =
|
|
28
|
+
* await client.v2.groups.verify.services.verifications.create(
|
|
29
|
+
* 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
|
|
30
|
+
* { to: '+14155551212' },
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
create(
|
|
35
|
+
serviceSid: string,
|
|
36
|
+
body: VerificationCreateParams,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<VerificationCreateResponse> {
|
|
39
|
+
return this._client.post(path`/api/v2/verify/services/${serviceSid}/verifications`, { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the authoritative status for one Verification owned by the authenticated
|
|
44
|
+
* account. Twilio-compatible clients may send the API Key ID and API Secret Key
|
|
45
|
+
* with HTTP Basic authentication. Temporary bearer authentication is supported for
|
|
46
|
+
* account-scoped tokens; line-scoped temporary tokens cannot retrieve account-wide
|
|
47
|
+
* Verification state.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const verification =
|
|
52
|
+
* await client.v2.groups.verify.services.verifications.retrieve(
|
|
53
|
+
* 'VRE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD',
|
|
54
|
+
* { service_sid: 'SVE1CB97d8EBbDbaAae6d9B1ca0D1cFaAD' },
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
retrieve(
|
|
59
|
+
verificationSid: string,
|
|
60
|
+
params: VerificationRetrieveParams,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): APIPromise<VerificationRetrieveResponse> {
|
|
63
|
+
const { service_sid } = params;
|
|
64
|
+
return this._client.get(
|
|
65
|
+
path`/api/v2/verify/services/${service_sid}/verifications/${verificationSid}`,
|
|
66
|
+
options,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface VerificationCreateResponse {
|
|
72
|
+
account_sid: string;
|
|
73
|
+
|
|
74
|
+
channel: 'imessage';
|
|
75
|
+
|
|
76
|
+
date_created: string;
|
|
77
|
+
|
|
78
|
+
date_updated: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* ISO timestamp when the Verification expires.
|
|
82
|
+
*/
|
|
83
|
+
expires_at: string;
|
|
84
|
+
|
|
85
|
+
service_sid: string;
|
|
86
|
+
|
|
87
|
+
sid: string;
|
|
88
|
+
|
|
89
|
+
status: 'pending' | 'approved' | 'expired' | 'canceled';
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Expected sender in E.164 format; older durable terminal records may return null.
|
|
93
|
+
*/
|
|
94
|
+
to: string | null;
|
|
95
|
+
|
|
96
|
+
url: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Present while the Verification is pending.
|
|
100
|
+
*/
|
|
101
|
+
delivery_target?: VerificationsAPI.DeliveryTarget;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Present only when hosted options were supplied during creation.
|
|
105
|
+
*/
|
|
106
|
+
hosted?: VerificationsAPI.HostedVerification;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface VerificationRetrieveResponse {
|
|
110
|
+
account_sid: string;
|
|
111
|
+
|
|
112
|
+
channel: 'imessage';
|
|
113
|
+
|
|
114
|
+
date_created: string;
|
|
115
|
+
|
|
116
|
+
date_updated: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* ISO timestamp when the Verification expires.
|
|
120
|
+
*/
|
|
121
|
+
expires_at: string;
|
|
122
|
+
|
|
123
|
+
service_sid: string;
|
|
124
|
+
|
|
125
|
+
sid: string;
|
|
126
|
+
|
|
127
|
+
status: 'pending' | 'approved' | 'expired' | 'canceled';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Expected sender in E.164 format; older durable terminal records may return null.
|
|
131
|
+
*/
|
|
132
|
+
to: string | null;
|
|
133
|
+
|
|
134
|
+
url: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Present while the Verification is pending.
|
|
138
|
+
*/
|
|
139
|
+
delivery_target?: VerificationsAPI.DeliveryTarget;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface VerificationCreateParams {
|
|
143
|
+
/**
|
|
144
|
+
* E.164 phone number that must send the verification message.
|
|
145
|
+
*/
|
|
146
|
+
to: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Options for an origin-bound Hosted Verify widget session. Nested keys are strict
|
|
150
|
+
* snake_case. `parent_origin` must be an exact HTTPS origin with a DNS hostname.
|
|
151
|
+
* `127.0.0.1` is also accepted, and HTTP is allowed only for `localhost` or
|
|
152
|
+
* `127.0.0.1` development origins. Wildcards and other IP literals are rejected
|
|
153
|
+
* because browsers cannot enforce them as exact CSP `frame-ancestors` sources.
|
|
154
|
+
*/
|
|
155
|
+
hosted?: VerificationCreateParams.Hosted;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export namespace VerificationCreateParams {
|
|
159
|
+
/**
|
|
160
|
+
* Options for an origin-bound Hosted Verify widget session. Nested keys are strict
|
|
161
|
+
* snake_case. `parent_origin` must be an exact HTTPS origin with a DNS hostname.
|
|
162
|
+
* `127.0.0.1` is also accepted, and HTTP is allowed only for `localhost` or
|
|
163
|
+
* `127.0.0.1` development origins. Wildcards and other IP literals are rejected
|
|
164
|
+
* because browsers cannot enforce them as exact CSP `frame-ancestors` sources.
|
|
165
|
+
*/
|
|
166
|
+
export interface Hosted {
|
|
167
|
+
/**
|
|
168
|
+
* Exact website origin allowed to embed the widget, with no path, query, or
|
|
169
|
+
* fragment.
|
|
170
|
+
*/
|
|
171
|
+
parent_origin: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Six-digit hexadecimal accent color.
|
|
175
|
+
*/
|
|
176
|
+
accent_color?: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Brand name displayed by the widget. Defaults to Sendblue.
|
|
180
|
+
*/
|
|
181
|
+
brand_name?: string;
|
|
182
|
+
|
|
183
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface VerificationRetrieveParams {
|
|
188
|
+
/**
|
|
189
|
+
* Verify Service SID.
|
|
190
|
+
*/
|
|
191
|
+
service_sid: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export declare namespace Verifications {
|
|
195
|
+
export {
|
|
196
|
+
type VerificationCreateResponse as VerificationCreateResponse,
|
|
197
|
+
type VerificationRetrieveResponse as VerificationRetrieveResponse,
|
|
198
|
+
type VerificationCreateParams as VerificationCreateParams,
|
|
199
|
+
type VerificationRetrieveParams as VerificationRetrieveParams,
|
|
200
|
+
};
|
|
201
|
+
}
|