botshield-sdk 1.2.4 → 1.3.1
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 +22 -0
- package/README.md +47 -13
- package/client.d.mts +4 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +7 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sdk.d.mts +148 -7
- package/resources/sdk.d.mts.map +1 -1
- package/resources/sdk.d.ts +148 -7
- package/resources/sdk.d.ts.map +1 -1
- package/resources/sdk.js +17 -3
- package/resources/sdk.js.map +1 -1
- package/resources/sdk.mjs +17 -3
- package/resources/sdk.mjs.map +1 -1
- package/resources/verification.d.mts +65 -7
- package/resources/verification.d.mts.map +1 -1
- package/resources/verification.d.ts +65 -7
- package/resources/verification.d.ts.map +1 -1
- package/resources/verification.js +8 -6
- package/resources/verification.js.map +1 -1
- package/resources/verification.mjs +8 -6
- package/resources/verification.mjs.map +1 -1
- package/src/client.ts +12 -0
- package/src/resources/index.ts +6 -0
- package/src/resources/sdk.ts +213 -9
- package/src/resources/verification.ts +94 -8
- 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
package/resources/sdk.d.mts
CHANGED
|
@@ -6,34 +6,175 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class SDK extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Create
|
|
9
|
+
* Create an Anchor Grant Window (legacy: session token)
|
|
10
10
|
*/
|
|
11
11
|
createSession(body: SDKCreateSessionParams, options?: RequestOptions): APIPromise<SDKCreateSessionResponse>;
|
|
12
12
|
/**
|
|
13
|
-
* Create a verification
|
|
13
|
+
* Create a verification request (scope/action-scoped)
|
|
14
14
|
*/
|
|
15
15
|
createVerificationLink(body: SDKCreateVerificationLinkParams, options?: RequestOptions): APIPromise<SDKCreateVerificationLinkResponse>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Revoke an Anchor Grant Window token (legacy: logout session)
|
|
18
18
|
*/
|
|
19
19
|
logout(body: SDKLogoutParams, options?: RequestOptions): APIPromise<SDKLogoutResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Soft-expires an active or pending verification for a given scope and user. Use
|
|
22
|
+
* this when a 409 conflict from create-verification-link indicates an existing
|
|
23
|
+
* pending verification is blocking a new request.
|
|
24
|
+
*/
|
|
25
|
+
revokeVerification(body: SDKRevokeVerificationParams, options?: RequestOptions): APIPromise<SDKRevokeVerificationResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a verification receipt (JWT) and return its claims
|
|
28
|
+
*/
|
|
29
|
+
verifyToken(body: SDKVerifyTokenParams, options?: RequestOptions): APIPromise<SDKVerifyTokenResponse>;
|
|
20
30
|
}
|
|
21
31
|
export interface SDKCreateSessionResponse {
|
|
22
|
-
data:
|
|
32
|
+
data: SDKCreateSessionResponse.Data;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace SDKCreateSessionResponse {
|
|
35
|
+
interface Data {
|
|
36
|
+
anchor_grant_expires_at: string;
|
|
37
|
+
anchor_grant_expires_in_seconds: number;
|
|
38
|
+
/**
|
|
39
|
+
* Canonical grant token (Bearer bss\_\*). Not an auth session.
|
|
40
|
+
*/
|
|
41
|
+
anchor_grant_token: string;
|
|
42
|
+
expires_at: string;
|
|
43
|
+
expires_in_seconds: number;
|
|
44
|
+
organization: Data.Organization;
|
|
45
|
+
/**
|
|
46
|
+
* Legacy alias of anchor_grant_token (kept for backward compatibility).
|
|
47
|
+
*/
|
|
48
|
+
session_token: string;
|
|
49
|
+
}
|
|
50
|
+
namespace Data {
|
|
51
|
+
interface Organization {
|
|
52
|
+
/**
|
|
53
|
+
* Clerk Organization ID (partner)
|
|
54
|
+
*/
|
|
55
|
+
id: string;
|
|
56
|
+
environment: string;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
23
59
|
}
|
|
24
60
|
export interface SDKCreateVerificationLinkResponse {
|
|
25
|
-
data:
|
|
61
|
+
data: SDKCreateVerificationLinkResponse.Data;
|
|
62
|
+
}
|
|
63
|
+
export declare namespace SDKCreateVerificationLinkResponse {
|
|
64
|
+
interface Data {
|
|
65
|
+
deep_link: string;
|
|
66
|
+
expires_at: string;
|
|
67
|
+
organization: Data.Organization;
|
|
68
|
+
qr_code_url: string;
|
|
69
|
+
request_id: string;
|
|
70
|
+
web_url: string;
|
|
71
|
+
/**
|
|
72
|
+
* Auth mode used for this verification
|
|
73
|
+
*/
|
|
74
|
+
auth_mode?: 'email' | 'anonymous';
|
|
75
|
+
/**
|
|
76
|
+
* Explicit action scope. Evaluated at action time.
|
|
77
|
+
*/
|
|
78
|
+
scope?: string;
|
|
79
|
+
sdk_type?: 'signal' | 'presence';
|
|
80
|
+
}
|
|
81
|
+
namespace Data {
|
|
82
|
+
interface Organization {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
26
86
|
}
|
|
27
87
|
export interface SDKLogoutResponse {
|
|
28
|
-
|
|
88
|
+
success: boolean;
|
|
89
|
+
message?: string;
|
|
90
|
+
revoked_at?: string;
|
|
91
|
+
token_found?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface SDKRevokeVerificationResponse {
|
|
94
|
+
data: SDKRevokeVerificationResponse.Data;
|
|
95
|
+
}
|
|
96
|
+
export declare namespace SDKRevokeVerificationResponse {
|
|
97
|
+
interface Data {
|
|
98
|
+
/**
|
|
99
|
+
* Number of pending verifications that were revoked
|
|
100
|
+
*/
|
|
101
|
+
revoked_count: number;
|
|
102
|
+
success: boolean;
|
|
103
|
+
message?: string;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export interface SDKVerifyTokenResponse {
|
|
107
|
+
claims?: SDKVerifyTokenResponse.Claims;
|
|
108
|
+
reason?: string;
|
|
109
|
+
valid?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace SDKVerifyTokenResponse {
|
|
112
|
+
interface Claims {
|
|
113
|
+
auth_mode?: 'email' | 'anonymous';
|
|
114
|
+
botshield_user_id?: string;
|
|
115
|
+
expires_at?: number;
|
|
116
|
+
issued_at?: number;
|
|
117
|
+
organization_id?: string;
|
|
118
|
+
partner_user_id?: string;
|
|
119
|
+
request_id?: string;
|
|
120
|
+
timestamp?: string;
|
|
121
|
+
user_email?: string;
|
|
122
|
+
verified?: boolean;
|
|
123
|
+
}
|
|
29
124
|
}
|
|
30
125
|
export interface SDKCreateSessionParams {
|
|
126
|
+
metadata?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
};
|
|
129
|
+
partner_user_id?: string;
|
|
31
130
|
}
|
|
32
131
|
export interface SDKCreateVerificationLinkParams {
|
|
132
|
+
/**
|
|
133
|
+
* Returning anonymous user: pass back the botshield_user_id from a previous
|
|
134
|
+
* verification to skip onboarding
|
|
135
|
+
*/
|
|
136
|
+
botshield_user_id?: string;
|
|
137
|
+
metadata?: {
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Auth mode: email = Clerk OAuth+passkey, anonymous = direct WebAuthn (no PII)
|
|
142
|
+
*/
|
|
143
|
+
mode?: 'email' | 'anonymous';
|
|
144
|
+
return_url?: string;
|
|
145
|
+
scope?: string;
|
|
146
|
+
sdk_type?: 'signal' | 'presence';
|
|
147
|
+
user_email?: string;
|
|
148
|
+
webhook_url?: string;
|
|
33
149
|
}
|
|
34
150
|
export interface SDKLogoutParams {
|
|
151
|
+
/**
|
|
152
|
+
* Legacy field name. Provide the anchor grant token (bss\_\*).
|
|
153
|
+
*/
|
|
154
|
+
session_token: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SDKRevokeVerificationParams {
|
|
157
|
+
/**
|
|
158
|
+
* The scope/action name to revoke pending verifications for
|
|
159
|
+
*/
|
|
160
|
+
scope: string;
|
|
161
|
+
/**
|
|
162
|
+
* Partner user ID to match. At least one of user_email or partner_user_id is
|
|
163
|
+
* required.
|
|
164
|
+
*/
|
|
165
|
+
partner_user_id?: string;
|
|
166
|
+
/**
|
|
167
|
+
* User email to match. At least one of user_email or partner_user_id is required.
|
|
168
|
+
*/
|
|
169
|
+
user_email?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface SDKVerifyTokenParams {
|
|
172
|
+
/**
|
|
173
|
+
* The JWT verification receipt to validate
|
|
174
|
+
*/
|
|
175
|
+
token: string;
|
|
35
176
|
}
|
|
36
177
|
export declare namespace SDK {
|
|
37
|
-
export { type SDKCreateSessionResponse as SDKCreateSessionResponse, type SDKCreateVerificationLinkResponse as SDKCreateVerificationLinkResponse, type SDKLogoutResponse as SDKLogoutResponse, type SDKCreateSessionParams as SDKCreateSessionParams, type SDKCreateVerificationLinkParams as SDKCreateVerificationLinkParams, type SDKLogoutParams as SDKLogoutParams, };
|
|
178
|
+
export { type SDKCreateSessionResponse as SDKCreateSessionResponse, type SDKCreateVerificationLinkResponse as SDKCreateVerificationLinkResponse, type SDKLogoutResponse as SDKLogoutResponse, type SDKRevokeVerificationResponse as SDKRevokeVerificationResponse, type SDKVerifyTokenResponse as SDKVerifyTokenResponse, type SDKCreateSessionParams as SDKCreateSessionParams, type SDKCreateVerificationLinkParams as SDKCreateVerificationLinkParams, type SDKLogoutParams as SDKLogoutParams, type SDKRevokeVerificationParams as SDKRevokeVerificationParams, type SDKVerifyTokenParams as SDKVerifyTokenParams, };
|
|
38
179
|
}
|
|
39
180
|
//# sourceMappingURL=sdk.d.mts.map
|
package/resources/sdk.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.mts","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],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EG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAE7B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAEjC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/sdk.d.ts
CHANGED
|
@@ -6,34 +6,175 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class SDK extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Create
|
|
9
|
+
* Create an Anchor Grant Window (legacy: session token)
|
|
10
10
|
*/
|
|
11
11
|
createSession(body: SDKCreateSessionParams, options?: RequestOptions): APIPromise<SDKCreateSessionResponse>;
|
|
12
12
|
/**
|
|
13
|
-
* Create a verification
|
|
13
|
+
* Create a verification request (scope/action-scoped)
|
|
14
14
|
*/
|
|
15
15
|
createVerificationLink(body: SDKCreateVerificationLinkParams, options?: RequestOptions): APIPromise<SDKCreateVerificationLinkResponse>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Revoke an Anchor Grant Window token (legacy: logout session)
|
|
18
18
|
*/
|
|
19
19
|
logout(body: SDKLogoutParams, options?: RequestOptions): APIPromise<SDKLogoutResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Soft-expires an active or pending verification for a given scope and user. Use
|
|
22
|
+
* this when a 409 conflict from create-verification-link indicates an existing
|
|
23
|
+
* pending verification is blocking a new request.
|
|
24
|
+
*/
|
|
25
|
+
revokeVerification(body: SDKRevokeVerificationParams, options?: RequestOptions): APIPromise<SDKRevokeVerificationResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a verification receipt (JWT) and return its claims
|
|
28
|
+
*/
|
|
29
|
+
verifyToken(body: SDKVerifyTokenParams, options?: RequestOptions): APIPromise<SDKVerifyTokenResponse>;
|
|
20
30
|
}
|
|
21
31
|
export interface SDKCreateSessionResponse {
|
|
22
|
-
data:
|
|
32
|
+
data: SDKCreateSessionResponse.Data;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace SDKCreateSessionResponse {
|
|
35
|
+
interface Data {
|
|
36
|
+
anchor_grant_expires_at: string;
|
|
37
|
+
anchor_grant_expires_in_seconds: number;
|
|
38
|
+
/**
|
|
39
|
+
* Canonical grant token (Bearer bss\_\*). Not an auth session.
|
|
40
|
+
*/
|
|
41
|
+
anchor_grant_token: string;
|
|
42
|
+
expires_at: string;
|
|
43
|
+
expires_in_seconds: number;
|
|
44
|
+
organization: Data.Organization;
|
|
45
|
+
/**
|
|
46
|
+
* Legacy alias of anchor_grant_token (kept for backward compatibility).
|
|
47
|
+
*/
|
|
48
|
+
session_token: string;
|
|
49
|
+
}
|
|
50
|
+
namespace Data {
|
|
51
|
+
interface Organization {
|
|
52
|
+
/**
|
|
53
|
+
* Clerk Organization ID (partner)
|
|
54
|
+
*/
|
|
55
|
+
id: string;
|
|
56
|
+
environment: string;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
23
59
|
}
|
|
24
60
|
export interface SDKCreateVerificationLinkResponse {
|
|
25
|
-
data:
|
|
61
|
+
data: SDKCreateVerificationLinkResponse.Data;
|
|
62
|
+
}
|
|
63
|
+
export declare namespace SDKCreateVerificationLinkResponse {
|
|
64
|
+
interface Data {
|
|
65
|
+
deep_link: string;
|
|
66
|
+
expires_at: string;
|
|
67
|
+
organization: Data.Organization;
|
|
68
|
+
qr_code_url: string;
|
|
69
|
+
request_id: string;
|
|
70
|
+
web_url: string;
|
|
71
|
+
/**
|
|
72
|
+
* Auth mode used for this verification
|
|
73
|
+
*/
|
|
74
|
+
auth_mode?: 'email' | 'anonymous';
|
|
75
|
+
/**
|
|
76
|
+
* Explicit action scope. Evaluated at action time.
|
|
77
|
+
*/
|
|
78
|
+
scope?: string;
|
|
79
|
+
sdk_type?: 'signal' | 'presence';
|
|
80
|
+
}
|
|
81
|
+
namespace Data {
|
|
82
|
+
interface Organization {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
26
86
|
}
|
|
27
87
|
export interface SDKLogoutResponse {
|
|
28
|
-
|
|
88
|
+
success: boolean;
|
|
89
|
+
message?: string;
|
|
90
|
+
revoked_at?: string;
|
|
91
|
+
token_found?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface SDKRevokeVerificationResponse {
|
|
94
|
+
data: SDKRevokeVerificationResponse.Data;
|
|
95
|
+
}
|
|
96
|
+
export declare namespace SDKRevokeVerificationResponse {
|
|
97
|
+
interface Data {
|
|
98
|
+
/**
|
|
99
|
+
* Number of pending verifications that were revoked
|
|
100
|
+
*/
|
|
101
|
+
revoked_count: number;
|
|
102
|
+
success: boolean;
|
|
103
|
+
message?: string;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export interface SDKVerifyTokenResponse {
|
|
107
|
+
claims?: SDKVerifyTokenResponse.Claims;
|
|
108
|
+
reason?: string;
|
|
109
|
+
valid?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace SDKVerifyTokenResponse {
|
|
112
|
+
interface Claims {
|
|
113
|
+
auth_mode?: 'email' | 'anonymous';
|
|
114
|
+
botshield_user_id?: string;
|
|
115
|
+
expires_at?: number;
|
|
116
|
+
issued_at?: number;
|
|
117
|
+
organization_id?: string;
|
|
118
|
+
partner_user_id?: string;
|
|
119
|
+
request_id?: string;
|
|
120
|
+
timestamp?: string;
|
|
121
|
+
user_email?: string;
|
|
122
|
+
verified?: boolean;
|
|
123
|
+
}
|
|
29
124
|
}
|
|
30
125
|
export interface SDKCreateSessionParams {
|
|
126
|
+
metadata?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
};
|
|
129
|
+
partner_user_id?: string;
|
|
31
130
|
}
|
|
32
131
|
export interface SDKCreateVerificationLinkParams {
|
|
132
|
+
/**
|
|
133
|
+
* Returning anonymous user: pass back the botshield_user_id from a previous
|
|
134
|
+
* verification to skip onboarding
|
|
135
|
+
*/
|
|
136
|
+
botshield_user_id?: string;
|
|
137
|
+
metadata?: {
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Auth mode: email = Clerk OAuth+passkey, anonymous = direct WebAuthn (no PII)
|
|
142
|
+
*/
|
|
143
|
+
mode?: 'email' | 'anonymous';
|
|
144
|
+
return_url?: string;
|
|
145
|
+
scope?: string;
|
|
146
|
+
sdk_type?: 'signal' | 'presence';
|
|
147
|
+
user_email?: string;
|
|
148
|
+
webhook_url?: string;
|
|
33
149
|
}
|
|
34
150
|
export interface SDKLogoutParams {
|
|
151
|
+
/**
|
|
152
|
+
* Legacy field name. Provide the anchor grant token (bss\_\*).
|
|
153
|
+
*/
|
|
154
|
+
session_token: string;
|
|
155
|
+
}
|
|
156
|
+
export interface SDKRevokeVerificationParams {
|
|
157
|
+
/**
|
|
158
|
+
* The scope/action name to revoke pending verifications for
|
|
159
|
+
*/
|
|
160
|
+
scope: string;
|
|
161
|
+
/**
|
|
162
|
+
* Partner user ID to match. At least one of user_email or partner_user_id is
|
|
163
|
+
* required.
|
|
164
|
+
*/
|
|
165
|
+
partner_user_id?: string;
|
|
166
|
+
/**
|
|
167
|
+
* User email to match. At least one of user_email or partner_user_id is required.
|
|
168
|
+
*/
|
|
169
|
+
user_email?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface SDKVerifyTokenParams {
|
|
172
|
+
/**
|
|
173
|
+
* The JWT verification receipt to validate
|
|
174
|
+
*/
|
|
175
|
+
token: string;
|
|
35
176
|
}
|
|
36
177
|
export declare namespace SDK {
|
|
37
|
-
export { type SDKCreateSessionResponse as SDKCreateSessionResponse, type SDKCreateVerificationLinkResponse as SDKCreateVerificationLinkResponse, type SDKLogoutResponse as SDKLogoutResponse, type SDKCreateSessionParams as SDKCreateSessionParams, type SDKCreateVerificationLinkParams as SDKCreateVerificationLinkParams, type SDKLogoutParams as SDKLogoutParams, };
|
|
178
|
+
export { type SDKCreateSessionResponse as SDKCreateSessionResponse, type SDKCreateVerificationLinkResponse as SDKCreateVerificationLinkResponse, type SDKLogoutResponse as SDKLogoutResponse, type SDKRevokeVerificationResponse as SDKRevokeVerificationResponse, type SDKVerifyTokenResponse as SDKVerifyTokenResponse, type SDKCreateSessionParams as SDKCreateSessionParams, type SDKCreateVerificationLinkParams as SDKCreateVerificationLinkParams, type SDKLogoutParams as SDKLogoutParams, type SDKRevokeVerificationParams as SDKRevokeVerificationParams, type SDKVerifyTokenParams as SDKVerifyTokenParams, };
|
|
38
179
|
}
|
|
39
180
|
//# sourceMappingURL=sdk.d.ts.map
|
package/resources/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,GAAI,SAAQ,WAAW;IAClC;;OAEG;IACH,aAAa,CACX,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;OAEG;IACH,sBAAsB,CACpB,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,GAAI,SAAQ,WAAW;IAClC;;OAEG;IACH,aAAa,CACX,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;OAEG;IACH,sBAAsB,CACpB,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAItF;;;;OAIG;IACH,kBAAkB,CAChB,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAI5C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EA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AG,OAAO,CAAA;KAAE,CAAC;IAEtC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAE7B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAEjC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/sdk.js
CHANGED
|
@@ -8,23 +8,37 @@ const resource_1 = require("../core/resource.js");
|
|
|
8
8
|
*/
|
|
9
9
|
class SDK extends resource_1.APIResource {
|
|
10
10
|
/**
|
|
11
|
-
* Create
|
|
11
|
+
* Create an Anchor Grant Window (legacy: session token)
|
|
12
12
|
*/
|
|
13
13
|
createSession(body, options) {
|
|
14
14
|
return this._client.post('/sdk/create-session', { body, ...options });
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Create a verification
|
|
17
|
+
* Create a verification request (scope/action-scoped)
|
|
18
18
|
*/
|
|
19
19
|
createVerificationLink(body, options) {
|
|
20
20
|
return this._client.post('/sdk/create-verification-link', { body, ...options });
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Revoke an Anchor Grant Window token (legacy: logout session)
|
|
24
24
|
*/
|
|
25
25
|
logout(body, options) {
|
|
26
26
|
return this._client.post('/sdk/logout', { body, ...options });
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Soft-expires an active or pending verification for a given scope and user. Use
|
|
30
|
+
* this when a 409 conflict from create-verification-link indicates an existing
|
|
31
|
+
* pending verification is blocking a new request.
|
|
32
|
+
*/
|
|
33
|
+
revokeVerification(body, options) {
|
|
34
|
+
return this._client.post('/sdk/revoke-verification', { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Validate a verification receipt (JWT) and return its claims
|
|
38
|
+
*/
|
|
39
|
+
verifyToken(body, options) {
|
|
40
|
+
return this._client.post('/sdk/verify-token', { body, ...options });
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
exports.SDK = SDK;
|
|
30
44
|
//# sourceMappingURL=sdk.js.map
|
package/resources/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;GAEG;AACH,MAAa,GAAI,SAAQ,sBAAW;IAClC;;OAEG;IACH,aAAa,CACX,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAA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;IACH,WAAW,CAAC,IAA0B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AA9CD,kBA8CC"}
|
package/resources/sdk.mjs
CHANGED
|
@@ -5,22 +5,36 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
5
5
|
*/
|
|
6
6
|
export class SDK extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create
|
|
8
|
+
* Create an Anchor Grant Window (legacy: session token)
|
|
9
9
|
*/
|
|
10
10
|
createSession(body, options) {
|
|
11
11
|
return this._client.post('/sdk/create-session', { body, ...options });
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Create a verification
|
|
14
|
+
* Create a verification request (scope/action-scoped)
|
|
15
15
|
*/
|
|
16
16
|
createVerificationLink(body, options) {
|
|
17
17
|
return this._client.post('/sdk/create-verification-link', { body, ...options });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Revoke an Anchor Grant Window token (legacy: logout session)
|
|
21
21
|
*/
|
|
22
22
|
logout(body, options) {
|
|
23
23
|
return this._client.post('/sdk/logout', { body, ...options });
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Soft-expires an active or pending verification for a given scope and user. Use
|
|
27
|
+
* this when a 409 conflict from create-verification-link indicates an existing
|
|
28
|
+
* pending verification is blocking a new request.
|
|
29
|
+
*/
|
|
30
|
+
revokeVerification(body, options) {
|
|
31
|
+
return this._client.post('/sdk/revoke-verification', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validate a verification receipt (JWT) and return its claims
|
|
35
|
+
*/
|
|
36
|
+
verifyToken(body, options) {
|
|
37
|
+
return this._client.post('/sdk/verify-token', { body, ...options });
|
|
38
|
+
}
|
|
25
39
|
}
|
|
26
40
|
//# sourceMappingURL=sdk.mjs.map
|
package/resources/sdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.mjs","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,WAAW;IAClC;;OAEG;IACH,aAAa,CACX,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,sBAAsB,CACpB,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"sdk.mjs","sourceRoot":"","sources":["../src/resources/sdk.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;GAEG;AACH,MAAM,OAAO,GAAI,SAAQ,WAAW;IAClC;;OAEG;IACH,aAAa,CACX,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,sBAAsB,CACpB,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAChB,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAA0B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -6,21 +6,79 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Verification extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Poll for the current status of a verification request. Returns the full
|
|
10
|
+
* verification event including token on completion.
|
|
10
11
|
*/
|
|
11
|
-
getStatus(options?: RequestOptions): APIPromise<VerificationGetStatusResponse>;
|
|
12
|
+
getStatus(query: VerificationGetStatusParams, options?: RequestOptions): APIPromise<VerificationGetStatusResponse>;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Check whether a user exists in BotShield and has a registered passkey before
|
|
15
|
+
* initiating verification.
|
|
14
16
|
*/
|
|
15
|
-
lookupUserByEmail(options?: RequestOptions): APIPromise<VerificationLookupUserByEmailResponse>;
|
|
17
|
+
lookupUserByEmail(query: VerificationLookupUserByEmailParams, options?: RequestOptions): APIPromise<VerificationLookupUserByEmailResponse>;
|
|
16
18
|
}
|
|
17
19
|
export interface VerificationGetStatusResponse {
|
|
18
|
-
|
|
20
|
+
found: boolean;
|
|
21
|
+
status: 'pending' | 'completed' | 'expired' | 'failed' | 'not_found';
|
|
22
|
+
auth_mode?: 'email' | 'anonymous';
|
|
23
|
+
created_at?: string;
|
|
24
|
+
error_message?: string;
|
|
25
|
+
expires_at?: string;
|
|
26
|
+
metadata?: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
organization_id?: string;
|
|
30
|
+
partner_user_id?: string;
|
|
31
|
+
presence_address?: string;
|
|
32
|
+
request_id?: string;
|
|
33
|
+
scope?: string;
|
|
34
|
+
sdk_type?: 'signal' | 'presence';
|
|
35
|
+
/**
|
|
36
|
+
* Signed JWT verification receipt (present when status=completed)
|
|
37
|
+
*/
|
|
38
|
+
signed_token?: string;
|
|
39
|
+
user_email?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Legacy alias for signed_token
|
|
42
|
+
*/
|
|
43
|
+
verification_token?: string;
|
|
44
|
+
verified_at?: string;
|
|
19
45
|
}
|
|
20
46
|
export interface VerificationLookupUserByEmailResponse {
|
|
21
|
-
data:
|
|
47
|
+
data: VerificationLookupUserByEmailResponse.Data;
|
|
48
|
+
}
|
|
49
|
+
export declare namespace VerificationLookupUserByEmailResponse {
|
|
50
|
+
interface Data {
|
|
51
|
+
/**
|
|
52
|
+
* Whether a user with this email exists in Clerk
|
|
53
|
+
*/
|
|
54
|
+
found: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the user has registered passkeys
|
|
57
|
+
*/
|
|
58
|
+
has_passkey: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the user account is active (not banned/deleted)
|
|
61
|
+
*/
|
|
62
|
+
is_active: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Clerk user ID (only present if found)
|
|
65
|
+
*/
|
|
66
|
+
clerk_user_id?: string;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export interface VerificationGetStatusParams {
|
|
70
|
+
/**
|
|
71
|
+
* The verification request ID from create-verification-link
|
|
72
|
+
*/
|
|
73
|
+
request_id: string;
|
|
74
|
+
}
|
|
75
|
+
export interface VerificationLookupUserByEmailParams {
|
|
76
|
+
/**
|
|
77
|
+
* The user's email address
|
|
78
|
+
*/
|
|
79
|
+
email: string;
|
|
22
80
|
}
|
|
23
81
|
export declare namespace Verification {
|
|
24
|
-
export { type VerificationGetStatusResponse as VerificationGetStatusResponse, type VerificationLookupUserByEmailResponse as VerificationLookupUserByEmailResponse, };
|
|
82
|
+
export { type VerificationGetStatusResponse as VerificationGetStatusResponse, type VerificationLookupUserByEmailResponse as VerificationLookupUserByEmailResponse, type VerificationGetStatusParams as VerificationGetStatusParams, type VerificationLookupUserByEmailParams as VerificationLookupUserByEmailParams, };
|
|
25
83
|
}
|
|
26
84
|
//# sourceMappingURL=verification.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.d.mts","sourceRoot":"","sources":["../src/resources/verification.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"verification.d.mts","sourceRoot":"","sources":["../src/resources/verification.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;OAGG;IACH,SAAS,CACP,KAAK,EAAE,2BAA2B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAI5C;;;OAGG;IACH,iBAAiB,CACf,KAAK,EAAE,mCAAmC,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qCAAqC,CAAC;CAGrD;AAED,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,OAAO,CAAC;IAEf,MAAM,EAAE,SAAS,GAAG,W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K,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;CACH"}
|
|
@@ -6,21 +6,79 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Verification extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Poll for the current status of a verification request. Returns the full
|
|
10
|
+
* verification event including token on completion.
|
|
10
11
|
*/
|
|
11
|
-
getStatus(options?: RequestOptions): APIPromise<VerificationGetStatusResponse>;
|
|
12
|
+
getStatus(query: VerificationGetStatusParams, options?: RequestOptions): APIPromise<VerificationGetStatusResponse>;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Check whether a user exists in BotShield and has a registered passkey before
|
|
15
|
+
* initiating verification.
|
|
14
16
|
*/
|
|
15
|
-
lookupUserByEmail(options?: RequestOptions): APIPromise<VerificationLookupUserByEmailResponse>;
|
|
17
|
+
lookupUserByEmail(query: VerificationLookupUserByEmailParams, options?: RequestOptions): APIPromise<VerificationLookupUserByEmailResponse>;
|
|
16
18
|
}
|
|
17
19
|
export interface VerificationGetStatusResponse {
|
|
18
|
-
|
|
20
|
+
found: boolean;
|
|
21
|
+
status: 'pending' | 'completed' | 'expired' | 'failed' | 'not_found';
|
|
22
|
+
auth_mode?: 'email' | 'anonymous';
|
|
23
|
+
created_at?: string;
|
|
24
|
+
error_message?: string;
|
|
25
|
+
expires_at?: string;
|
|
26
|
+
metadata?: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
organization_id?: string;
|
|
30
|
+
partner_user_id?: string;
|
|
31
|
+
presence_address?: string;
|
|
32
|
+
request_id?: string;
|
|
33
|
+
scope?: string;
|
|
34
|
+
sdk_type?: 'signal' | 'presence';
|
|
35
|
+
/**
|
|
36
|
+
* Signed JWT verification receipt (present when status=completed)
|
|
37
|
+
*/
|
|
38
|
+
signed_token?: string;
|
|
39
|
+
user_email?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Legacy alias for signed_token
|
|
42
|
+
*/
|
|
43
|
+
verification_token?: string;
|
|
44
|
+
verified_at?: string;
|
|
19
45
|
}
|
|
20
46
|
export interface VerificationLookupUserByEmailResponse {
|
|
21
|
-
data:
|
|
47
|
+
data: VerificationLookupUserByEmailResponse.Data;
|
|
48
|
+
}
|
|
49
|
+
export declare namespace VerificationLookupUserByEmailResponse {
|
|
50
|
+
interface Data {
|
|
51
|
+
/**
|
|
52
|
+
* Whether a user with this email exists in Clerk
|
|
53
|
+
*/
|
|
54
|
+
found: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the user has registered passkeys
|
|
57
|
+
*/
|
|
58
|
+
has_passkey: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the user account is active (not banned/deleted)
|
|
61
|
+
*/
|
|
62
|
+
is_active: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Clerk user ID (only present if found)
|
|
65
|
+
*/
|
|
66
|
+
clerk_user_id?: string;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export interface VerificationGetStatusParams {
|
|
70
|
+
/**
|
|
71
|
+
* The verification request ID from create-verification-link
|
|
72
|
+
*/
|
|
73
|
+
request_id: string;
|
|
74
|
+
}
|
|
75
|
+
export interface VerificationLookupUserByEmailParams {
|
|
76
|
+
/**
|
|
77
|
+
* The user's email address
|
|
78
|
+
*/
|
|
79
|
+
email: string;
|
|
22
80
|
}
|
|
23
81
|
export declare namespace Verification {
|
|
24
|
-
export { type VerificationGetStatusResponse as VerificationGetStatusResponse, type VerificationLookupUserByEmailResponse as VerificationLookupUserByEmailResponse, };
|
|
82
|
+
export { type VerificationGetStatusResponse as VerificationGetStatusResponse, type VerificationLookupUserByEmailResponse as VerificationLookupUserByEmailResponse, type VerificationGetStatusParams as VerificationGetStatusParams, type VerificationLookupUserByEmailParams as VerificationLookupUserByEmailParams, };
|
|
25
83
|
}
|
|
26
84
|
//# sourceMappingURL=verification.d.ts.map
|