botshield-sdk 1.2.3 → 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.
Files changed (93) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +47 -13
  3. package/client.d.mts +23 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +23 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +26 -17
  8. package/client.js.map +1 -1
  9. package/client.mjs +26 -17
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/query.d.mts +5 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +5 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +23 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +20 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +7 -1
  25. package/resources/devices.d.mts +3 -0
  26. package/resources/devices.d.mts.map +1 -1
  27. package/resources/devices.d.ts +3 -0
  28. package/resources/devices.d.ts.map +1 -1
  29. package/resources/devices.js +3 -0
  30. package/resources/devices.js.map +1 -1
  31. package/resources/devices.mjs +3 -0
  32. package/resources/devices.mjs.map +1 -1
  33. package/resources/index.d.mts +2 -2
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +2 -2
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/organizations.d.mts +3 -0
  40. package/resources/organizations.d.mts.map +1 -1
  41. package/resources/organizations.d.ts +3 -0
  42. package/resources/organizations.d.ts.map +1 -1
  43. package/resources/organizations.js +3 -0
  44. package/resources/organizations.js.map +1 -1
  45. package/resources/organizations.mjs +3 -0
  46. package/resources/organizations.mjs.map +1 -1
  47. package/resources/pass.d.mts +3 -0
  48. package/resources/pass.d.mts.map +1 -1
  49. package/resources/pass.d.ts +3 -0
  50. package/resources/pass.d.ts.map +1 -1
  51. package/resources/pass.js +3 -0
  52. package/resources/pass.js.map +1 -1
  53. package/resources/pass.mjs +3 -0
  54. package/resources/pass.mjs.map +1 -1
  55. package/resources/sdk.d.mts +151 -7
  56. package/resources/sdk.d.mts.map +1 -1
  57. package/resources/sdk.d.ts +151 -7
  58. package/resources/sdk.d.ts.map +1 -1
  59. package/resources/sdk.js +20 -3
  60. package/resources/sdk.js.map +1 -1
  61. package/resources/sdk.mjs +20 -3
  62. package/resources/sdk.mjs.map +1 -1
  63. package/resources/users.d.mts +3 -0
  64. package/resources/users.d.mts.map +1 -1
  65. package/resources/users.d.ts +3 -0
  66. package/resources/users.d.ts.map +1 -1
  67. package/resources/users.js +3 -0
  68. package/resources/users.js.map +1 -1
  69. package/resources/users.mjs +3 -0
  70. package/resources/users.mjs.map +1 -1
  71. package/resources/verification.d.mts +68 -7
  72. package/resources/verification.d.mts.map +1 -1
  73. package/resources/verification.d.ts +68 -7
  74. package/resources/verification.d.ts.map +1 -1
  75. package/resources/verification.js +11 -6
  76. package/resources/verification.js.map +1 -1
  77. package/resources/verification.mjs +11 -6
  78. package/resources/verification.mjs.map +1 -1
  79. package/src/client.ts +41 -22
  80. package/src/internal/utils/query.ts +23 -0
  81. package/src/internal/utils.ts +1 -0
  82. package/src/resources/devices.ts +3 -0
  83. package/src/resources/index.ts +6 -0
  84. package/src/resources/organizations.ts +3 -0
  85. package/src/resources/pass.ts +3 -0
  86. package/src/resources/sdk.ts +216 -9
  87. package/src/resources/users.ts +3 -0
  88. package/src/resources/verification.ts +97 -8
  89. package/src/version.ts +1 -1
  90. package/version.d.mts +1 -1
  91. package/version.d.ts +1 -1
  92. package/version.js +1 -1
  93. package/version.mjs +1 -1
@@ -4,6 +4,9 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * SDK integration endpoints
9
+ */
7
10
  export class Users extends APIResource {
8
11
  /**
9
12
  * POST /users/update-metadata
@@ -4,33 +4,122 @@ import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
+ /**
8
+ * Verification status and lookup
9
+ */
7
10
  export class Verification extends APIResource {
8
11
  /**
9
- * Check verification status
12
+ * Poll for the current status of a verification request. Returns the full
13
+ * verification event including token on completion.
10
14
  */
11
- getStatus(options?: RequestOptions): APIPromise<VerificationGetStatusResponse> {
12
- return this._client.get('/verification/status', options);
15
+ getStatus(
16
+ query: VerificationGetStatusParams,
17
+ options?: RequestOptions,
18
+ ): APIPromise<VerificationGetStatusResponse> {
19
+ return this._client.get('/verification/status', { query, ...options });
13
20
  }
14
21
 
15
22
  /**
16
- * Look up user by email
23
+ * Check whether a user exists in BotShield and has a registered passkey before
24
+ * initiating verification.
17
25
  */
18
- lookupUserByEmail(options?: RequestOptions): APIPromise<VerificationLookupUserByEmailResponse> {
19
- return this._client.get('/verification/lookup-user-by-email', options);
26
+ lookupUserByEmail(
27
+ query: VerificationLookupUserByEmailParams,
28
+ options?: RequestOptions,
29
+ ): APIPromise<VerificationLookupUserByEmailResponse> {
30
+ return this._client.get('/verification/lookup-user-by-email', { query, ...options });
20
31
  }
21
32
  }
22
33
 
23
34
  export interface VerificationGetStatusResponse {
24
- data: unknown;
35
+ found: boolean;
36
+
37
+ status: 'pending' | 'completed' | 'expired' | 'failed' | 'not_found';
38
+
39
+ auth_mode?: 'email' | 'anonymous';
40
+
41
+ created_at?: string;
42
+
43
+ error_message?: string;
44
+
45
+ expires_at?: string;
46
+
47
+ metadata?: { [key: string]: unknown };
48
+
49
+ organization_id?: string;
50
+
51
+ partner_user_id?: string;
52
+
53
+ presence_address?: string;
54
+
55
+ request_id?: string;
56
+
57
+ scope?: string;
58
+
59
+ sdk_type?: 'signal' | 'presence';
60
+
61
+ /**
62
+ * Signed JWT verification receipt (present when status=completed)
63
+ */
64
+ signed_token?: string;
65
+
66
+ user_email?: string;
67
+
68
+ /**
69
+ * Legacy alias for signed_token
70
+ */
71
+ verification_token?: string;
72
+
73
+ verified_at?: string;
25
74
  }
26
75
 
27
76
  export interface VerificationLookupUserByEmailResponse {
28
- data: unknown;
77
+ data: VerificationLookupUserByEmailResponse.Data;
78
+ }
79
+
80
+ export namespace VerificationLookupUserByEmailResponse {
81
+ export interface Data {
82
+ /**
83
+ * Whether a user with this email exists in Clerk
84
+ */
85
+ found: boolean;
86
+
87
+ /**
88
+ * Whether the user has registered passkeys
89
+ */
90
+ has_passkey: boolean;
91
+
92
+ /**
93
+ * Whether the user account is active (not banned/deleted)
94
+ */
95
+ is_active: boolean;
96
+
97
+ /**
98
+ * Clerk user ID (only present if found)
99
+ */
100
+ clerk_user_id?: string;
101
+ }
102
+ }
103
+
104
+ export interface VerificationGetStatusParams {
105
+ /**
106
+ * The verification request ID from create-verification-link
107
+ */
108
+ request_id: string;
109
+ }
110
+
111
+ export interface VerificationLookupUserByEmailParams {
112
+ /**
113
+ * The user's email address
114
+ */
115
+ email: string;
29
116
  }
30
117
 
31
118
  export declare namespace Verification {
32
119
  export {
33
120
  type VerificationGetStatusResponse as VerificationGetStatusResponse,
34
121
  type VerificationLookupUserByEmailResponse as VerificationLookupUserByEmailResponse,
122
+ type VerificationGetStatusParams as VerificationGetStatusParams,
123
+ type VerificationLookupUserByEmailParams as VerificationLookupUserByEmailParams,
35
124
  };
36
125
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.2.3'; // x-release-please-version
1
+ export const VERSION = '1.3.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.2.3";
1
+ export declare const VERSION = "1.3.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.2.3";
1
+ export declare const VERSION = "1.3.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.2.3'; // x-release-please-version
4
+ exports.VERSION = '1.3.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.2.3'; // x-release-please-version
1
+ export const VERSION = '1.3.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map