@proof-holdings/sdk 0.0.0-stage → 1.2.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 (253) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +21 -0
  3. package/README.md +239 -2
  4. package/dist/cjs/client.d.ts +48 -0
  5. package/dist/cjs/client.d.ts.map +1 -0
  6. package/dist/cjs/client.js +73 -0
  7. package/dist/cjs/client.js.map +1 -0
  8. package/dist/cjs/credentials.d.ts +46 -0
  9. package/dist/cjs/credentials.d.ts.map +1 -0
  10. package/dist/cjs/credentials.js +137 -0
  11. package/dist/cjs/credentials.js.map +1 -0
  12. package/dist/cjs/crypto/hitl-crypto.d.ts +95 -0
  13. package/dist/cjs/crypto/hitl-crypto.d.ts.map +1 -0
  14. package/dist/cjs/crypto/hitl-crypto.js +338 -0
  15. package/dist/cjs/crypto/hitl-crypto.js.map +1 -0
  16. package/dist/cjs/errors.d.ts +52 -0
  17. package/dist/cjs/errors.d.ts.map +1 -0
  18. package/dist/cjs/errors.js +121 -0
  19. package/dist/cjs/errors.js.map +1 -0
  20. package/dist/cjs/http.d.ts +62 -0
  21. package/dist/cjs/http.d.ts.map +1 -0
  22. package/dist/cjs/http.js +192 -0
  23. package/dist/cjs/http.js.map +1 -0
  24. package/dist/cjs/index.d.ts +26 -0
  25. package/dist/cjs/index.d.ts.map +1 -0
  26. package/dist/cjs/index.js +79 -0
  27. package/dist/cjs/index.js.map +1 -0
  28. package/dist/cjs/jwks/key-set-cache.d.ts +105 -0
  29. package/dist/cjs/jwks/key-set-cache.d.ts.map +1 -0
  30. package/dist/cjs/jwks/key-set-cache.js +277 -0
  31. package/dist/cjs/jwks/key-set-cache.js.map +1 -0
  32. package/dist/cjs/jwks/keyset.d.ts +139 -0
  33. package/dist/cjs/jwks/keyset.d.ts.map +1 -0
  34. package/dist/cjs/jwks/keyset.js +503 -0
  35. package/dist/cjs/jwks/keyset.js.map +1 -0
  36. package/dist/cjs/jwks/support.d.ts +9 -0
  37. package/dist/cjs/jwks/support.d.ts.map +1 -0
  38. package/dist/cjs/jwks/support.js +12 -0
  39. package/dist/cjs/jwks/support.js.map +1 -0
  40. package/dist/cjs/polling.d.ts +10 -0
  41. package/dist/cjs/polling.d.ts.map +1 -0
  42. package/dist/cjs/polling.js +74 -0
  43. package/dist/cjs/polling.js.map +1 -0
  44. package/dist/cjs/resources/auth-sessions.d.ts +41 -0
  45. package/dist/cjs/resources/auth-sessions.d.ts.map +1 -0
  46. package/dist/cjs/resources/auth-sessions.js +34 -0
  47. package/dist/cjs/resources/auth-sessions.js.map +1 -0
  48. package/dist/cjs/resources/authorizations.d.ts +23 -0
  49. package/dist/cjs/resources/authorizations.d.ts.map +1 -0
  50. package/dist/cjs/resources/authorizations.js +29 -0
  51. package/dist/cjs/resources/authorizations.js.map +1 -0
  52. package/dist/cjs/resources/circles.d.ts +38 -0
  53. package/dist/cjs/resources/circles.d.ts.map +1 -0
  54. package/dist/cjs/resources/circles.js +67 -0
  55. package/dist/cjs/resources/circles.js.map +1 -0
  56. package/dist/cjs/resources/confirmations.d.ts +111 -0
  57. package/dist/cjs/resources/confirmations.d.ts.map +1 -0
  58. package/dist/cjs/resources/confirmations.js +86 -0
  59. package/dist/cjs/resources/confirmations.js.map +1 -0
  60. package/dist/cjs/resources/delegations.d.ts +36 -0
  61. package/dist/cjs/resources/delegations.d.ts.map +1 -0
  62. package/dist/cjs/resources/delegations.js +47 -0
  63. package/dist/cjs/resources/delegations.js.map +1 -0
  64. package/dist/cjs/resources/hitl-chat-id.d.ts +42 -0
  65. package/dist/cjs/resources/hitl-chat-id.d.ts.map +1 -0
  66. package/dist/cjs/resources/hitl-chat-id.js +37 -0
  67. package/dist/cjs/resources/hitl-chat-id.js.map +1 -0
  68. package/dist/cjs/resources/hitl-keys.d.ts +13 -0
  69. package/dist/cjs/resources/hitl-keys.d.ts.map +1 -0
  70. package/dist/cjs/resources/hitl-keys.js +22 -0
  71. package/dist/cjs/resources/hitl-keys.js.map +1 -0
  72. package/dist/cjs/resources/hitl.d.ts +39 -0
  73. package/dist/cjs/resources/hitl.d.ts.map +1 -0
  74. package/dist/cjs/resources/hitl.js +58 -0
  75. package/dist/cjs/resources/hitl.js.map +1 -0
  76. package/dist/cjs/resources/me.d.ts +102 -0
  77. package/dist/cjs/resources/me.d.ts.map +1 -0
  78. package/dist/cjs/resources/me.js +85 -0
  79. package/dist/cjs/resources/me.js.map +1 -0
  80. package/dist/cjs/resources/profiles.d.ts +47 -0
  81. package/dist/cjs/resources/profiles.d.ts.map +1 -0
  82. package/dist/cjs/resources/profiles.js +70 -0
  83. package/dist/cjs/resources/profiles.js.map +1 -0
  84. package/dist/cjs/resources/proof-me.d.ts +48 -0
  85. package/dist/cjs/resources/proof-me.d.ts.map +1 -0
  86. package/dist/cjs/resources/proof-me.js +24 -0
  87. package/dist/cjs/resources/proof-me.js.map +1 -0
  88. package/dist/cjs/resources/proofs.d.ts +81 -0
  89. package/dist/cjs/resources/proofs.d.ts.map +1 -0
  90. package/dist/cjs/resources/proofs.js +437 -0
  91. package/dist/cjs/resources/proofs.js.map +1 -0
  92. package/dist/cjs/resources/public-profiles.d.ts +36 -0
  93. package/dist/cjs/resources/public-profiles.d.ts.map +1 -0
  94. package/dist/cjs/resources/public-profiles.js +49 -0
  95. package/dist/cjs/resources/public-profiles.js.map +1 -0
  96. package/dist/cjs/resources/sessions.d.ts +15 -0
  97. package/dist/cjs/resources/sessions.d.ts.map +1 -0
  98. package/dist/cjs/resources/sessions.js +26 -0
  99. package/dist/cjs/resources/sessions.js.map +1 -0
  100. package/dist/cjs/resources/templates.d.ts +25 -0
  101. package/dist/cjs/resources/templates.d.ts.map +1 -0
  102. package/dist/cjs/resources/templates.js +46 -0
  103. package/dist/cjs/resources/templates.js.map +1 -0
  104. package/dist/cjs/resources/verification-requests.d.ts +56 -0
  105. package/dist/cjs/resources/verification-requests.d.ts.map +1 -0
  106. package/dist/cjs/resources/verification-requests.js +61 -0
  107. package/dist/cjs/resources/verification-requests.js.map +1 -0
  108. package/dist/cjs/resources/verifications.d.ts +60 -0
  109. package/dist/cjs/resources/verifications.d.ts.map +1 -0
  110. package/dist/cjs/resources/verifications.js +91 -0
  111. package/dist/cjs/resources/verifications.js.map +1 -0
  112. package/dist/cjs/resources/webhook-deliveries.d.ts +15 -0
  113. package/dist/cjs/resources/webhook-deliveries.d.ts.map +1 -0
  114. package/dist/cjs/resources/webhook-deliveries.js +26 -0
  115. package/dist/cjs/resources/webhook-deliveries.js.map +1 -0
  116. package/dist/cjs/streaming.d.ts +87 -0
  117. package/dist/cjs/streaming.d.ts.map +1 -0
  118. package/dist/cjs/streaming.js +289 -0
  119. package/dist/cjs/streaming.js.map +1 -0
  120. package/dist/cjs/types.d.ts +1483 -0
  121. package/dist/cjs/types.d.ts.map +1 -0
  122. package/dist/cjs/types.js +6 -0
  123. package/dist/cjs/types.js.map +1 -0
  124. package/dist/cjs/version.d.ts +2 -0
  125. package/dist/cjs/version.d.ts.map +1 -0
  126. package/dist/cjs/version.js +5 -0
  127. package/dist/cjs/version.js.map +1 -0
  128. package/dist/esm/client.d.ts +48 -0
  129. package/dist/esm/client.d.ts.map +1 -0
  130. package/dist/esm/client.js +69 -0
  131. package/dist/esm/client.js.map +1 -0
  132. package/dist/esm/credentials.d.ts +46 -0
  133. package/dist/esm/credentials.d.ts.map +1 -0
  134. package/dist/esm/credentials.js +127 -0
  135. package/dist/esm/credentials.js.map +1 -0
  136. package/dist/esm/crypto/hitl-crypto.d.ts +95 -0
  137. package/dist/esm/crypto/hitl-crypto.d.ts.map +1 -0
  138. package/dist/esm/crypto/hitl-crypto.js +321 -0
  139. package/dist/esm/crypto/hitl-crypto.js.map +1 -0
  140. package/dist/esm/errors.d.ts +52 -0
  141. package/dist/esm/errors.d.ts.map +1 -0
  142. package/dist/esm/errors.js +106 -0
  143. package/dist/esm/errors.js.map +1 -0
  144. package/dist/esm/http.d.ts +62 -0
  145. package/dist/esm/http.d.ts.map +1 -0
  146. package/dist/esm/http.js +187 -0
  147. package/dist/esm/http.js.map +1 -0
  148. package/dist/esm/index.d.ts +26 -0
  149. package/dist/esm/index.d.ts.map +1 -0
  150. package/dist/esm/index.js +33 -0
  151. package/dist/esm/index.js.map +1 -0
  152. package/dist/esm/jwks/key-set-cache.d.ts +105 -0
  153. package/dist/esm/jwks/key-set-cache.d.ts.map +1 -0
  154. package/dist/esm/jwks/key-set-cache.js +268 -0
  155. package/dist/esm/jwks/key-set-cache.js.map +1 -0
  156. package/dist/esm/jwks/keyset.d.ts +139 -0
  157. package/dist/esm/jwks/keyset.d.ts.map +1 -0
  158. package/dist/esm/jwks/keyset.js +489 -0
  159. package/dist/esm/jwks/keyset.js.map +1 -0
  160. package/dist/esm/jwks/support.d.ts +9 -0
  161. package/dist/esm/jwks/support.d.ts.map +1 -0
  162. package/dist/esm/jwks/support.js +9 -0
  163. package/dist/esm/jwks/support.js.map +1 -0
  164. package/dist/esm/package.json +1 -0
  165. package/dist/esm/polling.d.ts +10 -0
  166. package/dist/esm/polling.d.ts.map +1 -0
  167. package/dist/esm/polling.js +71 -0
  168. package/dist/esm/polling.js.map +1 -0
  169. package/dist/esm/resources/auth-sessions.d.ts +41 -0
  170. package/dist/esm/resources/auth-sessions.d.ts.map +1 -0
  171. package/dist/esm/resources/auth-sessions.js +30 -0
  172. package/dist/esm/resources/auth-sessions.js.map +1 -0
  173. package/dist/esm/resources/authorizations.d.ts +23 -0
  174. package/dist/esm/resources/authorizations.d.ts.map +1 -0
  175. package/dist/esm/resources/authorizations.js +25 -0
  176. package/dist/esm/resources/authorizations.js.map +1 -0
  177. package/dist/esm/resources/circles.d.ts +38 -0
  178. package/dist/esm/resources/circles.d.ts.map +1 -0
  179. package/dist/esm/resources/circles.js +63 -0
  180. package/dist/esm/resources/circles.js.map +1 -0
  181. package/dist/esm/resources/confirmations.d.ts +111 -0
  182. package/dist/esm/resources/confirmations.d.ts.map +1 -0
  183. package/dist/esm/resources/confirmations.js +82 -0
  184. package/dist/esm/resources/confirmations.js.map +1 -0
  185. package/dist/esm/resources/delegations.d.ts +36 -0
  186. package/dist/esm/resources/delegations.d.ts.map +1 -0
  187. package/dist/esm/resources/delegations.js +43 -0
  188. package/dist/esm/resources/delegations.js.map +1 -0
  189. package/dist/esm/resources/hitl-chat-id.d.ts +42 -0
  190. package/dist/esm/resources/hitl-chat-id.d.ts.map +1 -0
  191. package/dist/esm/resources/hitl-chat-id.js +33 -0
  192. package/dist/esm/resources/hitl-chat-id.js.map +1 -0
  193. package/dist/esm/resources/hitl-keys.d.ts +13 -0
  194. package/dist/esm/resources/hitl-keys.d.ts.map +1 -0
  195. package/dist/esm/resources/hitl-keys.js +18 -0
  196. package/dist/esm/resources/hitl-keys.js.map +1 -0
  197. package/dist/esm/resources/hitl.d.ts +39 -0
  198. package/dist/esm/resources/hitl.d.ts.map +1 -0
  199. package/dist/esm/resources/hitl.js +54 -0
  200. package/dist/esm/resources/hitl.js.map +1 -0
  201. package/dist/esm/resources/me.d.ts +102 -0
  202. package/dist/esm/resources/me.d.ts.map +1 -0
  203. package/dist/esm/resources/me.js +81 -0
  204. package/dist/esm/resources/me.js.map +1 -0
  205. package/dist/esm/resources/profiles.d.ts +47 -0
  206. package/dist/esm/resources/profiles.d.ts.map +1 -0
  207. package/dist/esm/resources/profiles.js +66 -0
  208. package/dist/esm/resources/profiles.js.map +1 -0
  209. package/dist/esm/resources/proof-me.d.ts +48 -0
  210. package/dist/esm/resources/proof-me.d.ts.map +1 -0
  211. package/dist/esm/resources/proof-me.js +20 -0
  212. package/dist/esm/resources/proof-me.js.map +1 -0
  213. package/dist/esm/resources/proofs.d.ts +81 -0
  214. package/dist/esm/resources/proofs.d.ts.map +1 -0
  215. package/dist/esm/resources/proofs.js +433 -0
  216. package/dist/esm/resources/proofs.js.map +1 -0
  217. package/dist/esm/resources/public-profiles.d.ts +36 -0
  218. package/dist/esm/resources/public-profiles.d.ts.map +1 -0
  219. package/dist/esm/resources/public-profiles.js +45 -0
  220. package/dist/esm/resources/public-profiles.js.map +1 -0
  221. package/dist/esm/resources/sessions.d.ts +15 -0
  222. package/dist/esm/resources/sessions.d.ts.map +1 -0
  223. package/dist/esm/resources/sessions.js +22 -0
  224. package/dist/esm/resources/sessions.js.map +1 -0
  225. package/dist/esm/resources/templates.d.ts +25 -0
  226. package/dist/esm/resources/templates.d.ts.map +1 -0
  227. package/dist/esm/resources/templates.js +42 -0
  228. package/dist/esm/resources/templates.js.map +1 -0
  229. package/dist/esm/resources/verification-requests.d.ts +56 -0
  230. package/dist/esm/resources/verification-requests.d.ts.map +1 -0
  231. package/dist/esm/resources/verification-requests.js +57 -0
  232. package/dist/esm/resources/verification-requests.js.map +1 -0
  233. package/dist/esm/resources/verifications.d.ts +60 -0
  234. package/dist/esm/resources/verifications.d.ts.map +1 -0
  235. package/dist/esm/resources/verifications.js +87 -0
  236. package/dist/esm/resources/verifications.js.map +1 -0
  237. package/dist/esm/resources/webhook-deliveries.d.ts +15 -0
  238. package/dist/esm/resources/webhook-deliveries.d.ts.map +1 -0
  239. package/dist/esm/resources/webhook-deliveries.js +22 -0
  240. package/dist/esm/resources/webhook-deliveries.js.map +1 -0
  241. package/dist/esm/streaming.d.ts +87 -0
  242. package/dist/esm/streaming.d.ts.map +1 -0
  243. package/dist/esm/streaming.js +286 -0
  244. package/dist/esm/streaming.js.map +1 -0
  245. package/dist/esm/types.d.ts +1483 -0
  246. package/dist/esm/types.d.ts.map +1 -0
  247. package/dist/esm/types.js +5 -0
  248. package/dist/esm/types.js.map +1 -0
  249. package/dist/esm/version.d.ts +2 -0
  250. package/dist/esm/version.d.ts.map +1 -0
  251. package/dist/esm/version.js +2 -0
  252. package/dist/esm/version.js.map +1 -0
  253. package/package.json +64 -4
@@ -0,0 +1,1483 @@
1
+ export type VerificationType = 'phone' | 'email' | 'domain' | 'social' | 'wallet' | 'account' | 'telegram_bot';
2
+ export type VerificationChannel = 'whatsapp' | 'telegram' | 'sms' | 'email' | 'dns' | 'http' | 'auto' | 'github' | 'google' | 'facebook' | 'x' | 'linkedin' | 'instagram' | 'youtube' | 'tiktok' | 'ethereum' | 'solana' | 'bitcoin' | 'coinbase' | 'kraken' | 'telegram_bot_token';
3
+ export type VerificationStatus = 'pending' | 'verified' | 'failed' | 'expired' | 'revoked' | 'cancelled';
4
+ export type SessionChannel = 'whatsapp' | 'telegram' | 'sms';
5
+ export type VerificationRequestStatus = 'pending' | 'partial' | 'completed' | 'expired' | 'cancelled';
6
+ export type ActionType = 'verification' | '2fa' | 'login' | 'custom' | 'confirmation' | 'authorization';
7
+ export interface ApiError {
8
+ code: string;
9
+ message: string;
10
+ details?: unknown;
11
+ request_id?: string;
12
+ /** Seconds to wait before retrying (rate limit and lockout errors) */
13
+ retryAfter?: number;
14
+ /** Number of remaining attempts before lockout (auth endpoints only) */
15
+ remaining_attempts?: number;
16
+ }
17
+ export interface Pagination {
18
+ page: number;
19
+ limit: number;
20
+ total: number;
21
+ total_pages: number;
22
+ /** @deprecated Use total_pages. */
23
+ pages: number;
24
+ }
25
+ export interface PaginatedList<T> {
26
+ data: T[];
27
+ pagination: Pagination;
28
+ }
29
+ export interface ChallengeInstructions {
30
+ /**
31
+ * ABSENT for the pairs whose code we deliver out-of-band — `type: 'email'`, and `type: 'domain'`
32
+ * with `channel: 'email'`. There the code (and the magic link) go to the mailbox and never to the
33
+ * caller: the delivery is what the proof rests on, so holding the code would prove nothing.
34
+ * Present for every other pair, which has to relay it (phone) or publish it (domain dns/http/auto).
35
+ */
36
+ code?: string;
37
+ expires_at: string;
38
+ instruction?: string;
39
+ send_to?: string;
40
+ send_to_formatted?: string;
41
+ deep_link?: string;
42
+ message?: string;
43
+ record_type?: string;
44
+ record_name?: string;
45
+ record_value?: string;
46
+ file_path?: string;
47
+ file_content?: string;
48
+ file_url?: string;
49
+ method?: string;
50
+ magic_link?: string;
51
+ email_sent?: boolean;
52
+ email_to?: string;
53
+ }
54
+ export interface ProofToken {
55
+ token: string;
56
+ expires_at: string;
57
+ /** Present for SMS proofs: `standard`, or `degraded` once a later spoof check finds risk. */
58
+ confidence?: 'high' | 'standard' | 'degraded';
59
+ }
60
+ export interface Verification {
61
+ id: string;
62
+ type: VerificationType;
63
+ channel: VerificationChannel;
64
+ status: VerificationStatus;
65
+ /** Absent for an identifier-free phone verification, whose number is learned only on completion. */
66
+ identifier?: string;
67
+ attempts?: number;
68
+ max_attempts?: number;
69
+ challenge?: ChallengeInstructions;
70
+ proof?: ProofToken;
71
+ verified_at?: string;
72
+ verified_data?: Record<string, unknown>;
73
+ created_at: string;
74
+ }
75
+ export interface CreateVerificationParams {
76
+ type: VerificationType;
77
+ channel: VerificationChannel;
78
+ identifier: string;
79
+ external_user_id?: string;
80
+ callback_url?: string;
81
+ client_metadata?: Record<string, unknown>;
82
+ dns_provider?: Record<string, string>;
83
+ email_prefix?: string;
84
+ bot_token?: string;
85
+ }
86
+ export interface ListVerificationsParams {
87
+ status?: VerificationStatus;
88
+ type?: VerificationType;
89
+ channel?: VerificationChannel;
90
+ limit?: number;
91
+ page?: number;
92
+ }
93
+ export type MultiChannelPhoneChannel = 'whatsapp' | 'telegram' | 'sms';
94
+ export interface CreateMultiChannelVerificationParams {
95
+ type: 'phone';
96
+ identifier: string;
97
+ channels: MultiChannelPhoneChannel[];
98
+ external_user_id?: string;
99
+ client_metadata?: Record<string, unknown>;
100
+ proof_expiry_days?: number;
101
+ }
102
+ export interface MultiChannelChannelBlock {
103
+ channel: MultiChannelPhoneChannel;
104
+ verification_id: string;
105
+ status: VerificationStatus;
106
+ deep_link?: string;
107
+ qr_code?: string;
108
+ qr_text?: string;
109
+ message?: string;
110
+ instructions?: string;
111
+ phone_number?: string;
112
+ sms_message?: string;
113
+ sms_dids?: Record<string, unknown>;
114
+ suggested_region?: 'americas' | 'europe' | 'israel';
115
+ }
116
+ export interface MultiChannelVerificationResponse {
117
+ group_id: string;
118
+ type: 'phone';
119
+ identifier: string;
120
+ status: VerificationStatus;
121
+ expires_at: string;
122
+ external_user_id?: string;
123
+ client_metadata?: Record<string, unknown>;
124
+ channels: MultiChannelChannelBlock[];
125
+ created_at: string;
126
+ }
127
+ export interface MultiChannelGroupStatusResponse {
128
+ group_id: string;
129
+ status: 'pending' | 'verified' | 'expired';
130
+ winning_channel: MultiChannelPhoneChannel | null;
131
+ channels: Array<{
132
+ channel: MultiChannelPhoneChannel;
133
+ verification_id: string;
134
+ status: VerificationStatus;
135
+ }>;
136
+ proof?: ProofToken;
137
+ }
138
+ export interface RequestedAsset {
139
+ type: VerificationType;
140
+ identifier?: string | null;
141
+ channel?: VerificationChannel | null;
142
+ allowed_channels?: VerificationChannel[];
143
+ required?: boolean;
144
+ }
145
+ export interface VerificationRequestAsset extends RequestedAsset {
146
+ status?: string;
147
+ verification_id?: string;
148
+ proof_token?: string;
149
+ verified_at?: string;
150
+ verified_identifier?: string;
151
+ verified_channel?: VerificationChannel;
152
+ }
153
+ /**
154
+ * Additive machine-readable effective state on a verification request. Re-derives
155
+ * expiry from `expires_at` (never trusts the stored status); present only on
156
+ * authenticated owner/requester responses.
157
+ */
158
+ export interface ComputedState {
159
+ status: VerificationRequestStatus;
160
+ is_expiring_soon: boolean;
161
+ next_action: {
162
+ code: string;
163
+ role: 'requester' | 'recipient';
164
+ label: string;
165
+ };
166
+ }
167
+ export interface VerificationRequest {
168
+ id: string;
169
+ reference_id?: string;
170
+ status: VerificationRequestStatus;
171
+ /** Additive effective-state envelope (authenticated owner/requester only). */
172
+ computed_state?: ComputedState;
173
+ action_type: ActionType;
174
+ action_context?: Record<string, unknown> | null;
175
+ assets: VerificationRequestAsset[];
176
+ partial_ok?: boolean;
177
+ validity_requirement?: string | null;
178
+ verification_url: string;
179
+ redirect_url?: string | null;
180
+ callback_url?: string | null;
181
+ expires_at: string;
182
+ completed_at?: string;
183
+ created_at: string;
184
+ }
185
+ /** A verification request as `list()` returns it: a summary — `retrieve()` it for its assets. */
186
+ export interface VerificationRequestListItem {
187
+ id: string;
188
+ reference_id?: string;
189
+ status: VerificationRequestStatus;
190
+ computed_state: ComputedState;
191
+ action_type: ActionType;
192
+ asset_count: number;
193
+ progress: {
194
+ completed: number;
195
+ completed_required: number;
196
+ required: number;
197
+ total: number;
198
+ };
199
+ expires_at: string;
200
+ completed_at?: string;
201
+ created_at: string;
202
+ }
203
+ export interface CancelVerificationRequestResponse {
204
+ id: string;
205
+ status: 'cancelled';
206
+ message: string;
207
+ }
208
+ export interface CreateVerificationRequestParams {
209
+ assets: RequestedAsset[];
210
+ reference_id?: string;
211
+ action_type?: ActionType;
212
+ action_context?: Record<string, unknown>;
213
+ partial_ok?: boolean;
214
+ validity_requirement?: string;
215
+ redirect_url?: string;
216
+ callback_url?: string;
217
+ /** Expiry in seconds (default: 604800 = 7 days, max: 2592000 = 30 days) */
218
+ expires_in?: number;
219
+ public_profile_id?: string;
220
+ }
221
+ export interface ListVerificationRequestsParams {
222
+ /**
223
+ * Status filter. `active` is a synthetic, query-only alias for live (not-yet-expired)
224
+ * pending or partial requests; the persisted statuses are time-aware on the server.
225
+ */
226
+ status?: VerificationRequestStatus | 'active';
227
+ reference_id?: string;
228
+ limit?: number;
229
+ page?: number;
230
+ }
231
+ export interface ResendResponse {
232
+ success: boolean;
233
+ message: string;
234
+ expires_at: string;
235
+ }
236
+ export interface TestVerifyResponse {
237
+ id: string;
238
+ type: VerificationType;
239
+ channel: VerificationChannel;
240
+ status: VerificationStatus;
241
+ identifier: string;
242
+ verified_at?: string;
243
+ proof_token?: string;
244
+ proof_expires_at?: string;
245
+ test_mode: boolean;
246
+ }
247
+ export interface StartDomainVerificationParams {
248
+ domain: string;
249
+ customer_id?: string;
250
+ verification_method?: 'manual_dns' | 'http_file';
251
+ }
252
+ export interface DomainVerification {
253
+ id: string;
254
+ domain: string;
255
+ status: string;
256
+ verification_method?: string;
257
+ dns_record?: {
258
+ type: string;
259
+ name: string;
260
+ value: string;
261
+ };
262
+ http_file?: {
263
+ path: string;
264
+ content: string;
265
+ };
266
+ provider?: {
267
+ detected: string;
268
+ name: string;
269
+ };
270
+ verified_at?: string;
271
+ }
272
+ export interface DomainCheckResponse {
273
+ id: string;
274
+ domain: string;
275
+ status: string;
276
+ verified?: boolean;
277
+ verified_at?: string;
278
+ check_count?: number;
279
+ }
280
+ export interface VerifiedUserVerification {
281
+ id: string;
282
+ type: VerificationType;
283
+ channel: VerificationChannel;
284
+ identifier: string;
285
+ status?: VerificationStatus;
286
+ verified_at?: string;
287
+ has_proof?: boolean;
288
+ proof_expires_at?: string;
289
+ created_at?: string;
290
+ }
291
+ export interface VerifiedUser {
292
+ external_user_id: string;
293
+ verification_count: number;
294
+ types_verified: VerificationType[];
295
+ verifications: VerifiedUserVerification[];
296
+ first_verified_at?: string;
297
+ last_verified_at?: string;
298
+ }
299
+ export interface ListVerifiedUsersParams {
300
+ page?: number;
301
+ limit?: number;
302
+ }
303
+ export interface ProofStatus {
304
+ proof_id: string;
305
+ /** A live proof reads `active`; `suspended` is the reversible pause (schema 1.3+ servers). */
306
+ status: string;
307
+ is_valid: boolean;
308
+ is_revoked: boolean;
309
+ revoked_at?: string;
310
+ revoked_reason?: string;
311
+ /** When the current suspension began; null/absent unless status is `suspended`. */
312
+ suspended_at?: string | null;
313
+ expires_at?: string;
314
+ is_expired: boolean;
315
+ verified_at?: string;
316
+ }
317
+ export interface ProofValidation {
318
+ valid: boolean;
319
+ reason?: string;
320
+ message?: string;
321
+ /** Stable public handle of the proof (`ph_ctl_…`), when it is registered. */
322
+ proof_id?: string;
323
+ verification?: {
324
+ id: string;
325
+ /** What the proof proves: an asset (a verification type), or a `confirmation` / `authorization` decision. */
326
+ type: VerificationType | 'confirmation' | 'authorization';
327
+ /** `browser` for a confirmation approved on the approval page. */
328
+ channel: VerificationChannel | 'browser';
329
+ /** SHA-256 of the verified identifier — compare with your own hash of the value you expect. */
330
+ identifier_hash: string;
331
+ verified_at: string;
332
+ expires_at: string;
333
+ /** Present on `confirmation` and `authorization` proofs only. */
334
+ decision?: 'approve' | 'deny';
335
+ };
336
+ revoked_at?: string;
337
+ revoked_reason?: string;
338
+ /** When the suspension began — present only with reason `suspended`. */
339
+ suspended_at?: string;
340
+ }
341
+ /** Collection a revoked proof was issued from — a proof does not have to come from a verification. */
342
+ export type RevokedProofType = 'verification' | 'verification_request' | 'confirmation' | 'authorization' | 'user_asset';
343
+ export interface RevokedProof {
344
+ /**
345
+ * The `sub` claim carried by the proof token — match it against `payload.sub` offline.
346
+ * Null when that `sub` is shared with a still-live proof; match on `public_proof_id` instead.
347
+ */
348
+ proof_id: string | null;
349
+ /** Stable public handle of the same proof, or null for a proof issued before the registry. */
350
+ public_proof_id: string | null;
351
+ proof_type: RevokedProofType;
352
+ revoked_at: string | null;
353
+ reason?: string | null;
354
+ }
355
+ export interface RevocationList {
356
+ revoked: RevokedProof[];
357
+ issued_at: string;
358
+ count: number;
359
+ /**
360
+ * True when the list was truncated at the server cap and may be incomplete — re-baseline and
361
+ * prefer the Token Status List at `status_list_uri`, which never truncates. Absent on servers
362
+ * older than schema 1.3.
363
+ */
364
+ has_more?: boolean;
365
+ /** The Token Status List endpoint (IETF draft-ietf-oauth-status-list). */
366
+ status_list_uri?: string;
367
+ signature: string | null;
368
+ kid: string | null;
369
+ }
370
+ export interface RevokeResponse {
371
+ success: boolean;
372
+ /** Public proof handle — present when the proof was addressed by `ph_ctl_*`/`ph_dlg_*`. */
373
+ proof_id?: string;
374
+ /** Which record carries the proof (`verification`, `user_asset`, `delegation`, …). Handle path only. */
375
+ proof_type?: string;
376
+ /** Present only when the revoked proof belongs to a verification. */
377
+ verification_id?: string;
378
+ revoked_at: string;
379
+ reason: string;
380
+ }
381
+ /** One of our SMS numbers, for one region: an `sms` session's code is texted to it. */
382
+ export interface SessionSmsNumber {
383
+ did: string;
384
+ label: string;
385
+ flag: string;
386
+ /** Opens the messaging app on this number with the message pre-filled. */
387
+ qr_code?: string;
388
+ qr_text?: string;
389
+ }
390
+ export interface Session {
391
+ id: string;
392
+ channel: SessionChannel;
393
+ status: VerificationStatus;
394
+ deep_link?: string;
395
+ qr_code?: string;
396
+ qr_text?: string;
397
+ instructions?: string;
398
+ /** `sms` only: the short code the person texts. */
399
+ sms_code?: string;
400
+ /** `sms` only: the message to send, as pre-filled in the links. */
401
+ sms_message?: string;
402
+ /** `sms` only: every number the code can be texted to, one per configured region. */
403
+ sms_dids?: {
404
+ americas: SessionSmsNumber;
405
+ europe?: SessionSmsNumber;
406
+ israel?: SessionSmsNumber;
407
+ };
408
+ phone_number?: string;
409
+ verified_at?: string;
410
+ verification_id?: string;
411
+ proof?: ProofToken;
412
+ expires_at: string;
413
+ created_at?: string;
414
+ }
415
+ export interface CreateSessionParams {
416
+ channel: SessionChannel;
417
+ /**
418
+ * The sub-account (project) this session is for: its branding and templates are used. Omitted:
419
+ * the API key's sub-account, else your primary.
420
+ */
421
+ profile_id?: string;
422
+ client_metadata?: Record<string, unknown>;
423
+ context?: {
424
+ /**
425
+ * @deprecated Ignored by the server: the bot copy names the session's sub-account
426
+ * (`profile_id`, else the API key's, else the primary).
427
+ */
428
+ business_name?: string;
429
+ /** Picks the bot's wording: log in, 2FA, account recovery, or plain verification (the default). */
430
+ action?: 'login' | '2fa' | 'verification' | 'recovery';
431
+ };
432
+ }
433
+ /**
434
+ * Webhook event types the platform delivers. Mirrors the backend OpenAPI
435
+ * `WebhookEventType` enum (`src/openapi/schemas.ts`).
436
+ */
437
+ export type WebhookEventType = 'verification_request.completed' | 'verification_request.partial' | 'verification_request.expired' | 'verification.completed' | 'confirmation.approved' | 'confirmation.denied' | 'authorization.approved' | 'authorization.denied' | 'proof.revoked' | 'proof.suspended' | 'proof.unsuspended' | 'account.deletion_scheduled' | 'account.deletion_cancelled';
438
+ export interface WebhookDelivery {
439
+ id: string;
440
+ url: string;
441
+ event_type: WebhookEventType;
442
+ status: 'pending' | 'delivered' | 'failed';
443
+ attempts: number;
444
+ max_attempts: number;
445
+ response_status: number | null;
446
+ error_message: string | null;
447
+ last_attempt_at: string | null;
448
+ next_retry_at: string | null;
449
+ delivered_at: string | null;
450
+ verification_request_id: string | null;
451
+ payload?: unknown;
452
+ response_body?: string | null;
453
+ created_at: string;
454
+ updated_at?: string;
455
+ }
456
+ export interface WebhookRetryResponse {
457
+ success: boolean;
458
+ message: string;
459
+ delivery_id: string;
460
+ next_retry_at: string;
461
+ }
462
+ export interface WebhookDeliveryList {
463
+ data: WebhookDelivery[];
464
+ /** @deprecated Use data. */
465
+ deliveries: WebhookDelivery[];
466
+ pagination: WebhookPagination;
467
+ }
468
+ export interface WebhookPagination {
469
+ page: number;
470
+ limit: number;
471
+ total: number;
472
+ total_pages: number;
473
+ }
474
+ export interface WebhookDeliveryStats {
475
+ total: number;
476
+ by_status: {
477
+ pending: number;
478
+ delivered: number;
479
+ failed: number;
480
+ };
481
+ delivery_rate: string;
482
+ recent_failures_24h: number;
483
+ }
484
+ /** Query params accepting an environment override (`production` | `test`). */
485
+ export interface MeEnvironmentParams {
486
+ /** Scope metrics to test or production data (default: production). */
487
+ environment?: 'production' | 'test';
488
+ }
489
+ /**
490
+ * One-call account snapshot (`GET /me/summary`) — the same data the dashboard
491
+ * home renders. Nested objects are intentionally loose; see the API reference
492
+ * for the full `quota` / `request_health` / `top_channels` shapes.
493
+ */
494
+ export interface PlatformSummary {
495
+ as_of: string;
496
+ cache_age_seconds: number;
497
+ quota: Record<string, unknown>;
498
+ request_health: Record<string, unknown>;
499
+ top_channels: Array<Record<string, unknown>>;
500
+ channels_with_zero_completions: string[];
501
+ /** Present only when the caller has the `hitl:read` scope. */
502
+ hitl_channels?: Record<string, unknown>;
503
+ active_api_keys: number;
504
+ next_action: Record<string, unknown> | null;
505
+ }
506
+ /** One of the six search buckets (`GET /me/search` `?type=`). */
507
+ export type MeSearchBucket = 'verification_requests' | 'verifications' | 'hitl' | 'confirmations' | 'authorizations' | 'api_keys';
508
+ export interface MeSearchParams {
509
+ /** Prefix-anchored, case-sensitive query (min 3 chars). */
510
+ q: string;
511
+ /** Narrow the search to a single bucket. */
512
+ type?: MeSearchBucket;
513
+ environment?: 'production' | 'test';
514
+ /** Max results per bucket (default 10, max 25). */
515
+ limit?: number;
516
+ }
517
+ /** Global account search results (`GET /me/search`). */
518
+ export interface MeSearchResults {
519
+ data: {
520
+ verification_requests: Array<Record<string, unknown>>;
521
+ verifications: Array<Record<string, unknown>>;
522
+ hitl: Array<Record<string, unknown>>;
523
+ confirmations: Array<Record<string, unknown>>;
524
+ authorizations: Array<Record<string, unknown>>;
525
+ api_keys: Array<Record<string, unknown>>;
526
+ };
527
+ /** Sum of all bucket lengths. */
528
+ total: number;
529
+ }
530
+ /** Redacted API-key metadata — never includes the key hash or full secret. */
531
+ export interface ApiKeyMetadata {
532
+ id: string;
533
+ name: string;
534
+ key_prefix: string;
535
+ environment: string;
536
+ scopes: string[];
537
+ /** Sub-account (PublicProfile) the key is bound to; null for unbound keys. */
538
+ profile_id: string | null;
539
+ last_used_at: string | null;
540
+ revoked_at: string | null;
541
+ /**
542
+ * Ids of the keys this key replaced, newest first (it was regenerated through
543
+ * `POST /me/api-keys/:id/regenerate` or renewed by an MCP sign-in refresh). Their requests and
544
+ * usage count as this key's.
545
+ */
546
+ replaced_key_ids?: string[];
547
+ created_at: string;
548
+ }
549
+ /** Per-API-key usage counts plus attribution context (`GET /me/api-keys/:id/usage`). */
550
+ export interface ApiKeyUsage {
551
+ api_key: ApiKeyMetadata;
552
+ verifications: {
553
+ total: number;
554
+ by_type: Record<string, number>;
555
+ by_channel: Record<string, number>;
556
+ by_status: Record<string, number>;
557
+ };
558
+ verification_requests: {
559
+ total: number;
560
+ by_status: Record<string, number>;
561
+ };
562
+ confirmations: {
563
+ total: number;
564
+ by_status: Record<string, number>;
565
+ };
566
+ authorizations: {
567
+ total: number;
568
+ by_status: Record<string, number>;
569
+ };
570
+ /** Earliest UTC-day-floored attributed timestamp, or null if none. */
571
+ attribution_cutoff_at: string | null;
572
+ /** Fraction of in-scope verifications attributed to any key, or null. */
573
+ attributed_fraction: number | null;
574
+ }
575
+ export interface ListWebhookDeliveriesParams {
576
+ status?: string;
577
+ event_type?: string;
578
+ verification_request_id?: string;
579
+ limit?: number;
580
+ page?: number;
581
+ }
582
+ /**
583
+ * Why an offline verification answered `valid: false`. The names are the issuer's own — the same
584
+ * values `POST /api/v1/proofs/validate` returns in its `reason` field — so a caller branching on
585
+ * them does not need two vocabularies for the online and the offline path.
586
+ *
587
+ * `status_unavailable` means the revocation status could NOT be read (unreachable list, a list
588
+ * that failed its own checks, a slot the list does not cover). It is not a claim that the proof
589
+ * is withdrawn; it is the refusal to guess.
590
+ */
591
+ export type OfflineFailureReason = 'invalid' | 'expired' | 'revoked' | 'suspended' | 'status_unavailable'
592
+ /** The issuer revoked the key that signed this token; `pull_hint` says where to fetch a re-issued one. */
593
+ | 'key_revoked'
594
+ /** The key set could not be refreshed and the cached copy is older than `maxJwksAgeMs`; see `cache_age_seconds`. */
595
+ | 'jwks_stale'
596
+ /** The signing key belongs to another token family (a proof key signing a delegation, say). */
597
+ | 'wrong_key_purpose'
598
+ /** The token's `iat` lies outside its signing key's validity window. */
599
+ | 'outside_key_window'
600
+ /** The token's `exp` lies beyond `iat` plus its signing key's maximum token lifetime. */
601
+ | 'token_lifetime_exceeded'
602
+ /** No key the issuer publishes matches this token's `kid`, even after a refetch. */
603
+ | 'unknown_key';
604
+ /** Where a token signed by a revoked key can be fetched again, re-signed. */
605
+ export interface OfflinePullHint {
606
+ /** The configured issuer's origin. */
607
+ issuer_origin: string;
608
+ /** The token's handle: `proof_id` for a proof, `sub` for a delegation. */
609
+ handle: string | null;
610
+ }
611
+ export interface OfflineVerificationResult {
612
+ valid: boolean;
613
+ payload?: {
614
+ iss: string;
615
+ sub: string;
616
+ iat: number;
617
+ exp: number;
618
+ type: string;
619
+ channel: string;
620
+ identifier_hash: string;
621
+ verified_at: string;
622
+ user_id: string;
623
+ decision?: 'approve' | 'deny';
624
+ };
625
+ error?: string;
626
+ reason?: OfflineFailureReason;
627
+ /** With `reason: 'key_revoked'`. */
628
+ pull_hint?: OfflinePullHint;
629
+ /** With `reason: 'jwks_stale'`: the age of the cached key set, or null when it is unknown. */
630
+ cache_age_seconds?: number | null;
631
+ /**
632
+ * Whether the proof's revocation status was actually established during this call. False when
633
+ * the token carries no status-list slot, when the check was turned off, and whenever the
634
+ * verification failed before the list could be consulted — so a caller can never mistake "not
635
+ * checked" for "checked and clear".
636
+ */
637
+ revocation_checked: boolean;
638
+ }
639
+ /** Options for {@link Proofs.verifyOffline}. */
640
+ export interface OfflineVerificationOptions {
641
+ /**
642
+ * Check the issuer's status list for a revoked or suspended proof. Default TRUE: the method
643
+ * already fetches the public key set over the network, and the status list is the same kind of
644
+ * public, cacheable artifact — it reveals nothing about which proof is being checked.
645
+ *
646
+ * Set it to false only when the signature alone is the question (an air-gapped check against a
647
+ * warm key cache, say); the result then reports `revocation_checked: false`.
648
+ */
649
+ checkRevocation?: boolean;
650
+ }
651
+ export interface ProofOptions {
652
+ /** Omit it to resolve the key: PROOF_API_KEY, then ~/.proof-holdings/credentials for this base URL. */
653
+ apiKey?: string;
654
+ /** Explicit, else a non-empty PROOF_BASE_URL, else `https://api.proof.holdings`. */
655
+ baseUrl?: string;
656
+ timeout?: number;
657
+ maxRetries?: number;
658
+ fetch?: typeof globalThis.fetch;
659
+ /**
660
+ * How old the cached issuer key set may grow, while it cannot be refreshed, before offline
661
+ * verification answers `jwks_stale` instead of trusting it. Whole milliseconds, default 24 hours,
662
+ * at most 25 days — the constructor throws otherwise.
663
+ */
664
+ maxJwksAgeMs?: number;
665
+ }
666
+ export interface WaitOptions {
667
+ /** Initial poll interval in milliseconds (default: 2000) */
668
+ interval?: number;
669
+ /** Timeout in milliseconds (default: 600000 = 10 minutes) */
670
+ timeout?: number;
671
+ /** Backoff multiplier applied after each poll (default: 1.5) */
672
+ backoff?: number;
673
+ /** Maximum poll interval in milliseconds (default: 30000) */
674
+ maxInterval?: number;
675
+ /** Maximum random jitter added to each poll in milliseconds (default: 500) */
676
+ jitter?: number;
677
+ /** AbortSignal for cancellation */
678
+ signal?: AbortSignal;
679
+ }
680
+ /** Options for `confirmations.waitForResolution` and `confirmations.createAndWait`. */
681
+ export interface ConfirmAndWaitOptions extends WaitOptions {
682
+ /** Per-request proof expiry override in days, passed to confirmation create (7, 30, 90, or 365) */
683
+ proofExpiryDays?: number;
684
+ /**
685
+ * Throw `ConfirmationDeniedError` when the confirmation is denied.
686
+ * Default: `false` for `waitForResolution` (returns the denied confirmation),
687
+ * `true` for `createAndWait` (gate semantics — denial surfaces as an error).
688
+ */
689
+ throwOnDenial?: boolean;
690
+ }
691
+ /** Response from `GET /api/v1/hitl/:id/keys`. */
692
+ export interface HitlKeysResponse {
693
+ public_key: string;
694
+ encrypted_private_key: string;
695
+ kdf_salt: string;
696
+ kid: string;
697
+ }
698
+ /** Body accepted by `PUT /api/v1/hitl/:id/keys`. */
699
+ export interface HitlKeysPutParams {
700
+ public_key: string;
701
+ encrypted_private_key: string;
702
+ kdf_salt: string;
703
+ }
704
+ /** Response from `PUT /api/v1/hitl/:id/keys`. */
705
+ export interface HitlKeysPutResponse {
706
+ kid: string;
707
+ message: string;
708
+ }
709
+ /** Response from `DELETE /api/v1/hitl/:id/keys`. */
710
+ export interface HitlKeysDeleteResponse {
711
+ message: string;
712
+ }
713
+ /** An enrolled approver's public key, for multi-recipient (v2) envelope wrapping. */
714
+ export interface HitlApproverKey {
715
+ authorization_id: string;
716
+ recipient: string;
717
+ channel: string;
718
+ public_key: string;
719
+ kid: string;
720
+ }
721
+ export interface HitlApproverKeysResponse {
722
+ approver_keys: HitlApproverKey[];
723
+ }
724
+ export type HitlStatus = 'pending' | 'active' | 'archived';
725
+ /** A messaging channel configured for HITL approvals. */
726
+ export type HitlChannel = {
727
+ type: 'telegram';
728
+ config: {
729
+ chat_id: string;
730
+ };
731
+ } | {
732
+ type: 'whatsapp';
733
+ config: {
734
+ phone_number?: string;
735
+ bsuid?: string;
736
+ };
737
+ };
738
+ /** HITL configuration with messaging channels and timeout. */
739
+ export interface HitlConfig {
740
+ id: string;
741
+ /** Owner user ID (useful for SDK encryption AAD) */
742
+ user_id: string | null;
743
+ name?: string | null;
744
+ profile_id?: string | null;
745
+ /** Backing Circle for a circle-backed Approvals config (null for channel-list configs) */
746
+ circle_id?: string | null;
747
+ channels: HitlChannel[];
748
+ timeout_seconds: number;
749
+ status: HitlStatus;
750
+ /** Encryption keypair metadata (null if not configured) */
751
+ keypair: {
752
+ kid: string;
753
+ has_encrypted_private_key: boolean;
754
+ } | null;
755
+ environment: 'production' | 'test';
756
+ created_at: string;
757
+ updated_at: string;
758
+ }
759
+ export interface CreateHitlParams {
760
+ /** Name for this HITL configuration */
761
+ name: string;
762
+ /** At least one messaging channel for approvals */
763
+ channels: HitlChannel[];
764
+ /** Default timeout in seconds for confirmations (60–86400, server default 3600) */
765
+ timeout_seconds?: number;
766
+ /** Optional public profile for branded messages (caller must own it) */
767
+ profile_id?: string;
768
+ }
769
+ export interface UpdateHitlParams {
770
+ name?: string | null;
771
+ channels?: HitlChannel[];
772
+ timeout_seconds?: number;
773
+ }
774
+ export interface HitlListParams {
775
+ page?: number;
776
+ limit?: number;
777
+ status?: HitlStatus;
778
+ environment?: 'production' | 'test';
779
+ [key: string]: string | number | boolean | undefined;
780
+ }
781
+ export interface HitlListResponse {
782
+ data: HitlConfig[];
783
+ pagination: {
784
+ page: number;
785
+ limit: number;
786
+ total: number;
787
+ total_pages: number;
788
+ };
789
+ /**
790
+ * The plan's cap on active configs (`null` when unlimited) and the account's active count across
791
+ * every environment and profile — what creating a config is checked against, whatever the list
792
+ * itself is filtered to.
793
+ */
794
+ limits: {
795
+ max_active_configs: number | null;
796
+ active_configs: number;
797
+ };
798
+ }
799
+ /** One per-channel result from authorization consent dispatch. */
800
+ export interface HitlAuthorizationResult {
801
+ channel: string;
802
+ /** Channel recipient (chat_id, phone number, or BSUID) */
803
+ recipient: string;
804
+ authorization_id: string;
805
+ status: string;
806
+ }
807
+ /** Response from `POST /api/v1/hitl/:id/authorize`. */
808
+ export interface HitlAuthorizationResponse {
809
+ hitl_id: string;
810
+ authorizations: HitlAuthorizationResult[];
811
+ message: string;
812
+ }
813
+ /** Response from `POST /api/v1/hitl/:id/finalize` (pending → active). */
814
+ export interface HitlFinalizeResponse extends HitlConfig {
815
+ /** Authorization consent dispatch results (present when consent messages were sent) */
816
+ authorizations?: HitlAuthorizationResult[];
817
+ }
818
+ /** Response from `POST /api/v1/hitl/chat-id-discovery`. */
819
+ export interface ChatIdDiscoveryCreateResponse {
820
+ token: string;
821
+ deep_link: string;
822
+ /** QR code data URL for the deep link */
823
+ qr_code: string;
824
+ /** UTF-8 text representation of the QR code for terminal/agent display */
825
+ qr_text: string;
826
+ expires_in: number;
827
+ }
828
+ /** Response from `POST /api/v1/confirmations/:id/approval-link`. */
829
+ export interface ApprovalLinkResponse {
830
+ approval_url: string;
831
+ }
832
+ /** One proof entry from `GET /api/v1/verification-requests/:id/proofs`. */
833
+ export interface VerificationRequestProof {
834
+ type: VerificationType;
835
+ identifier?: string;
836
+ channel?: VerificationChannel;
837
+ proof_token: string;
838
+ verified_at?: string;
839
+ }
840
+ export interface VerificationRequestProofsResponse {
841
+ proofs: VerificationRequestProof[];
842
+ }
843
+ export type CircleStatus = 'active' | 'archived';
844
+ export type CircleMemberStatus = 'pending' | 'active';
845
+ export type CircleMemberChannelType = 'telegram' | 'whatsapp';
846
+ export type CircleMemberChannelStatus = 'declared' | 'verified';
847
+ /**
848
+ * A Circle member — channel presence booleans and a masked enrollment phone only, never an
849
+ * identifier (SEC-PM-006).
850
+ */
851
+ export interface CircleMember {
852
+ id: string;
853
+ name: string;
854
+ status: CircleMemberStatus;
855
+ has_telegram: boolean;
856
+ has_whatsapp: boolean;
857
+ mesh_opted_in: boolean;
858
+ mesh_opt_out: boolean;
859
+ /** Masked phone the contact proved at enrollment (`+9••••••4171`); null until they enroll. */
860
+ enrolled_phone_hint: string | null;
861
+ enrolled_at: string | null;
862
+ last_verified_at: string | null;
863
+ }
864
+ /** A Circle — a named group of trusted contacts. */
865
+ export interface Circle {
866
+ id: string;
867
+ user_id: string | null;
868
+ name: string | null;
869
+ /** How this Circle's members know its owner; null when unset */
870
+ owner_name: string | null;
871
+ profile_id: string | null;
872
+ environment: 'production' | 'test';
873
+ proof_me_enabled: boolean;
874
+ status: CircleStatus;
875
+ member_count: number;
876
+ members: CircleMember[];
877
+ created_at: string;
878
+ updated_at: string;
879
+ }
880
+ export interface CircleListResponse {
881
+ data: Circle[];
882
+ pagination: {
883
+ page: number;
884
+ limit: number;
885
+ total: number;
886
+ total_pages: number;
887
+ };
888
+ }
889
+ /** A member to create inline with a Circle (name + optional declared channels). */
890
+ export interface CircleMemberInput {
891
+ name: string;
892
+ /** Optional pre-declared Telegram chat id (usually captured at enrollment instead) */
893
+ telegram_chat_id?: string;
894
+ /** Optional pre-declared WhatsApp phone in E.164 (leading +) */
895
+ whatsapp_phone?: string;
896
+ }
897
+ export interface CreateCircleParams {
898
+ name: string;
899
+ /** How this Circle's members know its owner ("Dad"); the bots name nobody while it is unset */
900
+ owner_name?: string | null;
901
+ /** Optional public profile to bind for branded messages (create-only; caller must own it) */
902
+ profile_id?: string;
903
+ /** Opt this Circle into Proof-Me drills */
904
+ proof_me_enabled?: boolean;
905
+ members?: CircleMemberInput[];
906
+ }
907
+ export interface UpdateCircleParams {
908
+ name?: string;
909
+ /** How this Circle's members know its owner; null or an empty string clears it */
910
+ owner_name?: string | null;
911
+ }
912
+ export interface CircleListParams {
913
+ page?: number;
914
+ limit?: number;
915
+ status?: CircleStatus;
916
+ environment?: 'production' | 'test';
917
+ profile_id?: string;
918
+ [key: string]: string | number | boolean | undefined;
919
+ }
920
+ export interface CircleMemberListResponse {
921
+ members: CircleMember[];
922
+ }
923
+ export interface CreateCircleMemberParams {
924
+ name: string;
925
+ /** Optional pre-declared WhatsApp phone in E.164 (leading +); Telegram is captured at enrollment */
926
+ whatsapp_phone?: string;
927
+ }
928
+ /** Response from `POST /api/v1/circles/:id/members/invite` (a single-use member enrollment link). */
929
+ export interface CircleMemberInviteResponse {
930
+ token: string;
931
+ member_id: string;
932
+ telegram_deep_link: string;
933
+ whatsapp_deep_link: string;
934
+ /** QR code data URL for the primary deep link */
935
+ qr_code: string;
936
+ /** UTF-8 text representation of the QR code */
937
+ qr_text: string;
938
+ expires_in: number;
939
+ suggested_share_text: string;
940
+ }
941
+ /** Response from `POST /api/v1/circles/:id/members/:memberId/drill`. */
942
+ export interface CircleMemberDrillResponse {
943
+ id: string;
944
+ status: 'pending';
945
+ confirm_channel?: string;
946
+ single_channel_warning?: boolean;
947
+ }
948
+ export interface AddCircleMemberChannelParams {
949
+ channel: CircleMemberChannelType;
950
+ /** The Telegram chat id (≤50) or E.164 WhatsApp phone (leading +) — validated per channel */
951
+ identifier: string;
952
+ }
953
+ /** A member channel — metadata only, never the identifier (SEC-PM-006). */
954
+ export interface CircleMemberChannel {
955
+ id: string;
956
+ channel: CircleMemberChannelType;
957
+ status: CircleMemberChannelStatus;
958
+ verified_at: string | null;
959
+ created_at: string;
960
+ }
961
+ export interface CircleMemberChannelListResponse {
962
+ channels: CircleMemberChannel[];
963
+ }
964
+ export type DelegateIdentifierType = 'url' | 'purl';
965
+ export type DelegationStatus = 'active' | 'revoked';
966
+ export type DelegationEffectiveStatus = 'active' | 'revoked' | 'expired' | 'suspended';
967
+ export type RevokeDelegationReason = 'user_request' | 'fraud' | 'key_compromise' | 'other';
968
+ /** A typed artifact identifier — an https URL or a package URL (purl). */
969
+ export interface DelegateIdentifier {
970
+ type: DelegateIdentifierType;
971
+ value: string;
972
+ }
973
+ /**
974
+ * A delegation attests that whoever controls the `principal` domain authorized the
975
+ * `delegate` artifact for the listed scopes — nothing more. It says nothing about
976
+ * the artifact or the business behind it.
977
+ *
978
+ * NO method returns this shape. Every delegation response also carries the derived
979
+ * `effective_status`/`is_valid`, so what you receive is `DelegationListItem` (list, revoke)
980
+ * or `DelegationDetail` (create, retrieve). Exported as a back-compat type only.
981
+ */
982
+ export interface Delegation {
983
+ id: string;
984
+ /** Public handle (`ph_dlg_<32 hex>`) — accepted by the public proof status lookup */
985
+ delegation_id: string | null;
986
+ /** The control-proven domain (derived server-side from the control proof, never client input) */
987
+ principal: string;
988
+ delegate: DelegateIdentifier;
989
+ scope: string[];
990
+ /** Public handle (`ph_ctl_<32 hex>`) of the domain control proof this delegation chains down to */
991
+ control_proof: string;
992
+ status: DelegationStatus;
993
+ revoked_at: string | null;
994
+ revoked_reason: string | null;
995
+ environment: 'production' | 'test';
996
+ issued_at: string;
997
+ expires_at: string;
998
+ created_at: string;
999
+ }
1000
+ /**
1001
+ * The delegation plus the publishable signed token.
1002
+ *
1003
+ * NO method returns this shape either — it was the create-201 body until the derived pair
1004
+ * landed on the writes; `create` and `retrieve` now answer `DelegationDetail`. Exported as a
1005
+ * back-compat type only.
1006
+ */
1007
+ export interface DelegationWithToken extends Delegation {
1008
+ token: string | null;
1009
+ }
1010
+ /**
1011
+ * The LIST shape — the stored record plus the status DERIVED at read time.
1012
+ *
1013
+ * Render `effective_status`, not `status`: `status` is only whether the owner revoked the
1014
+ * delegation themselves, so a delegation still reads `active` there once its domain control
1015
+ * proof was revoked, suspended or expired — and once its OWN lifetime ran out — while every
1016
+ * verifier already rejects it. `effective_status` covers both clocks: a delegation is never
1017
+ * valid for longer than `min(its own expires_at, the control proof's)`.
1018
+ */
1019
+ export interface DelegationListItem extends Delegation {
1020
+ effective_status: DelegationEffectiveStatus;
1021
+ is_valid: boolean;
1022
+ }
1023
+ /** The retrieve shape — stored token plus the same derived status the list carries. */
1024
+ export interface DelegationDetail extends DelegationWithToken {
1025
+ effective_status: DelegationEffectiveStatus;
1026
+ is_valid: boolean;
1027
+ }
1028
+ export interface CreateDelegationParams {
1029
+ /** Public handle (`ph_ctl_<32 hex>`) of YOUR active domain control proof */
1030
+ control_proof: string;
1031
+ delegate: DelegateIdentifier;
1032
+ /** 1–32 capability scopes (pattern tokens, ≤64 chars each) */
1033
+ scope: string[];
1034
+ /** Lifetime in seconds — rejected (400), never truncated, when it exceeds the control proof's remainder */
1035
+ expires_in?: number;
1036
+ }
1037
+ export interface DelegationListParams {
1038
+ page?: number;
1039
+ limit?: number;
1040
+ /**
1041
+ * Filters the delegation's OWN stored record, not the derived `effective_status` — that
1042
+ * cascade spans two collections and cannot be filtered server-side without breaking
1043
+ * pagination. `status: 'active'` therefore still returns a delegation whose control proof
1044
+ * died, and one that simply ran out; read `effective_status` on each item.
1045
+ */
1046
+ status?: DelegationStatus;
1047
+ [key: string]: string | number | boolean | undefined;
1048
+ }
1049
+ export interface DelegationListResponse {
1050
+ data: DelegationListItem[];
1051
+ pagination: {
1052
+ page: number;
1053
+ limit: number;
1054
+ total: number;
1055
+ };
1056
+ }
1057
+ export interface RevokeDelegationParams {
1058
+ reason?: RevokeDelegationReason;
1059
+ }
1060
+ export type AuthorizationStatus = 'pending' | 'active' | 'revoked' | 'denied' | 'expired';
1061
+ export type AuthorizationChannel = 'telegram' | 'whatsapp' | 'sms' | 'email';
1062
+ export type AuthorizationScope = 'confirmations' | string;
1063
+ /** Audit-trail entry on an authorization (informational). */
1064
+ export interface AuthorizationAuditEntry {
1065
+ event: string;
1066
+ timestamp: string;
1067
+ details?: Record<string, unknown>;
1068
+ }
1069
+ /** Authorization resource — consent record for sending confirmations. */
1070
+ export interface Authorization {
1071
+ id: string;
1072
+ /** HITL configuration the consent belongs to — `confirmations` scope only. */
1073
+ hitl_id?: string;
1074
+ /** Circle the consent belongs to — `identity_challenge` scope only. */
1075
+ circle_id?: string;
1076
+ recipient: string;
1077
+ status: AuthorizationStatus;
1078
+ phone?: string | null;
1079
+ channel: AuthorizationChannel;
1080
+ scope: AuthorizationScope;
1081
+ business_name?: string;
1082
+ /** Owner-assigned human label for this approver (F22); null when unset. Surfaces lead with it, falling back to the masked recipient. */
1083
+ label?: string | null;
1084
+ /** The approver's own messenger name ("First Last @username"), captured when they approved over Telegram; null when none was captured. Chosen by the approver, not verified. */
1085
+ recipient_display_name: string | null;
1086
+ /** Whether the approver has enrolled an encryption key — a confirmation can be sealed to them only once this is true. */
1087
+ enrolled: boolean;
1088
+ verification_id?: string;
1089
+ proof_token?: string;
1090
+ authorized_at?: string;
1091
+ expires_at: string;
1092
+ revoked_at?: string;
1093
+ revocation_reason?: string;
1094
+ confirmations_sent: number;
1095
+ last_used_at?: string;
1096
+ created_at: string;
1097
+ updated_at: string;
1098
+ }
1099
+ /** Body accepted by `PATCH /api/v1/authorizations/:id` — owner-editable metadata (F22). */
1100
+ export interface UpdateAuthorizationBody {
1101
+ /** Owner-assigned human label ("Sarah — CFO"). null or an empty string clears it. */
1102
+ label: string | null;
1103
+ }
1104
+ /** Body accepted by `POST /api/v1/authorizations`. */
1105
+ export interface CreateAuthorizationParams {
1106
+ hitl_id: string;
1107
+ recipient: string;
1108
+ phone?: string;
1109
+ channel?: AuthorizationChannel;
1110
+ scope?: AuthorizationScope;
1111
+ /**
1112
+ * @deprecated Ignored by the server: the consent message names the approval setup's sub-account.
1113
+ */
1114
+ business_name?: string;
1115
+ business_profile_id?: string;
1116
+ /** Seconds from now until the authorization expires. */
1117
+ expires_in?: number;
1118
+ }
1119
+ /** Response from `POST /api/v1/authorizations`. Includes the authorization URL. */
1120
+ export interface CreateAuthorizationResponse {
1121
+ id: string;
1122
+ hitl_id: string;
1123
+ recipient: string;
1124
+ status: AuthorizationStatus;
1125
+ phone?: string | null;
1126
+ channel: AuthorizationChannel;
1127
+ scope: AuthorizationScope;
1128
+ business_name?: string;
1129
+ authorization_url: string;
1130
+ expires_at: string;
1131
+ created_at: string;
1132
+ }
1133
+ /** Query params for `GET /api/v1/authorizations`. */
1134
+ export interface AuthorizationListParams {
1135
+ status?: AuthorizationStatus;
1136
+ phone?: string;
1137
+ channel?: AuthorizationChannel;
1138
+ page?: number;
1139
+ limit?: number;
1140
+ }
1141
+ /** Paginated response from `GET /api/v1/authorizations`. */
1142
+ export interface AuthorizationListResponse {
1143
+ data: Authorization[];
1144
+ pagination: {
1145
+ page: number;
1146
+ limit: number;
1147
+ total: number;
1148
+ total_pages: number;
1149
+ };
1150
+ }
1151
+ /** Query params for `GET /api/v1/authorizations/export`. */
1152
+ export interface AuthorizationExportParams {
1153
+ format?: 'json' | 'csv';
1154
+ from?: string;
1155
+ to?: string;
1156
+ status?: AuthorizationStatus;
1157
+ }
1158
+ /**
1159
+ * Response from `GET /api/v1/authorizations/export?format=json`. CSV
1160
+ * exports (`format=csv`) are served as `text/csv` and come back through the
1161
+ * http layer's non-JSON envelope instead — `Authorizations.export` has an
1162
+ * overload returning `BinaryResponse` for that case.
1163
+ */
1164
+ export interface AuthorizationExportResponse {
1165
+ data: Authorization[];
1166
+ total: number;
1167
+ }
1168
+ export type TemplateChannel = 'telegram' | 'whatsapp' | 'sms' | 'email';
1169
+ export type TemplateMessageType = 'verification_request' | 'verification_success' | 'verification_expired' | 'login_request' | 'login_success' | '2fa_request' | '2fa_success' | 'account_deletion_request' | 'account_deletion_success' | 'confirmation_request' | 'confirmation_approved' | 'confirmation_denied';
1170
+ /** Editable template content fields. */
1171
+ export interface TemplateContent {
1172
+ subject?: string;
1173
+ body: string;
1174
+ button_text?: string;
1175
+ button_url_template?: string;
1176
+ }
1177
+ /**
1178
+ * Which project (sub-account) a templates call acts on. Templates exist per project only.
1179
+ *
1180
+ * Omitted: a project-bound API key uses its own project, any other caller the primary project. A
1181
+ * project-bound key naming a different project is refused (403 `profile_mismatch`).
1182
+ */
1183
+ export interface TemplateProjectOptions {
1184
+ /** The project's id, sent as the `profile_id` query parameter. */
1185
+ profileId?: string;
1186
+ }
1187
+ /** A message template (custom or default). */
1188
+ export interface Template extends TemplateContent {
1189
+ /** Present on custom templates only */
1190
+ id?: string;
1191
+ /** The project the custom template belongs to. Present on custom templates only */
1192
+ profile_id?: string | null;
1193
+ channel: TemplateChannel;
1194
+ message_type: TemplateMessageType;
1195
+ is_active?: boolean;
1196
+ version?: number;
1197
+ updated_at?: string;
1198
+ }
1199
+ /** A variable available for substitution in template bodies. */
1200
+ export interface TemplateVariable {
1201
+ name: string;
1202
+ description: string;
1203
+ }
1204
+ /** Response from `GET /api/v1/templates`. */
1205
+ export interface TemplateListResponse {
1206
+ /** The project whose templates are listed */
1207
+ profile_id: string | null;
1208
+ custom_templates: Template[];
1209
+ available_channels: TemplateChannel[];
1210
+ available_message_types: TemplateMessageType[];
1211
+ available_variables: TemplateVariable[];
1212
+ }
1213
+ /** Response from `GET /api/v1/templates/defaults`. */
1214
+ export interface TemplateDefaultsResponse {
1215
+ defaults: Record<string, Partial<Record<TemplateChannel, TemplateContent>>>;
1216
+ }
1217
+ /** Response from `GET /api/v1/templates/:channel/:messageType`. */
1218
+ export interface TemplateGetResponse {
1219
+ is_custom: boolean;
1220
+ /** `project`: the project's own template; `default`: the platform default it falls back to */
1221
+ scope: 'project' | 'default';
1222
+ /** The project the template was resolved for */
1223
+ profile_id: string | null;
1224
+ template: Template;
1225
+ }
1226
+ /** Response from `PUT /api/v1/templates/:channel/:messageType`. */
1227
+ export interface TemplateUpsertResponse {
1228
+ success: boolean;
1229
+ template: Template;
1230
+ }
1231
+ /** Response from `DELETE /api/v1/templates/:channel/:messageType`. */
1232
+ export interface TemplateDeleteResponse {
1233
+ success: boolean;
1234
+ message: string;
1235
+ }
1236
+ /** A template rendered with variables substituted. */
1237
+ export interface RenderedTemplate {
1238
+ subject?: string;
1239
+ body: string;
1240
+ button_text?: string;
1241
+ button_url?: string;
1242
+ }
1243
+ /** Body accepted by `POST /api/v1/templates/preview`. */
1244
+ export interface TemplatePreviewParams extends TemplateContent {
1245
+ channel: TemplateChannel;
1246
+ message_type: TemplateMessageType;
1247
+ }
1248
+ /** Response from `POST /api/v1/templates/preview`. */
1249
+ export interface TemplatePreviewResponse {
1250
+ preview: RenderedTemplate;
1251
+ validation_errors: string[];
1252
+ is_valid: boolean;
1253
+ }
1254
+ /** Body accepted by `POST /api/v1/templates/render`. */
1255
+ export interface TemplateRenderParams {
1256
+ channel: TemplateChannel;
1257
+ message_type: TemplateMessageType;
1258
+ variables?: {
1259
+ code?: string;
1260
+ expires_in?: string;
1261
+ user_identifier?: string;
1262
+ callback_url?: string;
1263
+ };
1264
+ }
1265
+ /** Response from `POST /api/v1/templates/render`. */
1266
+ export interface TemplateRenderResponse {
1267
+ rendered: RenderedTemplate;
1268
+ }
1269
+ export interface ProfileTheme {
1270
+ primary_color?: string;
1271
+ background_type?: 'solid' | 'gradient';
1272
+ background_color?: string;
1273
+ gradient_start?: string;
1274
+ gradient_end?: string;
1275
+ font_style?: 'default' | 'modern' | 'classic';
1276
+ }
1277
+ export interface CustomLink {
1278
+ title: string;
1279
+ url: string;
1280
+ icon?: string;
1281
+ is_visible?: boolean;
1282
+ display_order?: number;
1283
+ }
1284
+ /** A public profile owned by the authenticated user. */
1285
+ export interface Profile {
1286
+ id: string;
1287
+ profile_id: string;
1288
+ username?: string;
1289
+ is_primary?: boolean;
1290
+ display_name?: string;
1291
+ bio?: string;
1292
+ avatar_url?: string | null;
1293
+ verification_level?: string;
1294
+ is_business?: boolean;
1295
+ business_name?: string;
1296
+ public_proofs?: unknown[];
1297
+ custom_links?: CustomLink[];
1298
+ theme?: ProfileTheme;
1299
+ is_public: boolean;
1300
+ show_verification_dates?: boolean;
1301
+ show_proof_channels?: boolean;
1302
+ /** The owner's switch for the public Delegations section (default true). */
1303
+ show_delegations?: boolean;
1304
+ /** Theme of this project's emails; null when unset (read as `dark`). Returned to the owner. */
1305
+ email_theme?: 'dark' | 'light' | null;
1306
+ /** Support address shown in this project's messages as `{{support_email}}`. Returned to the owner. */
1307
+ support_email?: string | null;
1308
+ view_count?: number;
1309
+ created_at: string;
1310
+ updated_at: string;
1311
+ }
1312
+ /** Body accepted by `POST /api/v1/me/profiles`. */
1313
+ export interface CreateProfileParams {
1314
+ display_name?: string;
1315
+ bio?: string;
1316
+ avatar_url?: string;
1317
+ business_name?: string;
1318
+ is_business?: boolean;
1319
+ is_public?: boolean;
1320
+ is_primary?: boolean;
1321
+ theme?: ProfileTheme;
1322
+ /** Theme of the HTML emails sent for this project. Unset reads as `dark`. */
1323
+ email_theme?: 'dark' | 'light';
1324
+ /** Support address shown in this project's messages as `{{support_email}}`. */
1325
+ support_email?: string;
1326
+ }
1327
+ /** Body accepted by `PATCH /api/v1/me/profiles/:profileId`. */
1328
+ export interface UpdateProfileParams {
1329
+ display_name?: string;
1330
+ bio?: string;
1331
+ avatar_url?: string | null;
1332
+ business_name?: string;
1333
+ is_business?: boolean;
1334
+ is_public?: boolean;
1335
+ is_primary?: boolean;
1336
+ show_verification_dates?: boolean;
1337
+ show_proof_channels?: boolean;
1338
+ /** Whether the public profile lists the published, in-force delegations for the domains it shows. */
1339
+ show_delegations?: boolean;
1340
+ theme?: ProfileTheme;
1341
+ custom_links?: CustomLink[];
1342
+ /** Theme of the HTML emails sent for this project. Unset reads as `dark`. */
1343
+ email_theme?: 'dark' | 'light';
1344
+ /** Support address shown in this project's messages as `{{support_email}}`; `null` clears it. */
1345
+ support_email?: string | null;
1346
+ }
1347
+ /** Response from `GET /api/v1/me/profiles`. */
1348
+ export interface ProfileListResponse {
1349
+ profiles: Profile[];
1350
+ count: number;
1351
+ /** -1 = unlimited under the current plan */
1352
+ max_profiles: number;
1353
+ }
1354
+ /** Response from `DELETE /api/v1/me/profiles/:profileId`. */
1355
+ export interface ProfileDeleteResponse {
1356
+ success: boolean;
1357
+ message: string;
1358
+ }
1359
+ /** A per-profile message template (custom or default). */
1360
+ export interface ProfileTemplate {
1361
+ channel: TemplateChannel;
1362
+ message_type: TemplateMessageType;
1363
+ subject?: string;
1364
+ body: string;
1365
+ button_text?: string;
1366
+ button_url_template?: string;
1367
+ is_custom: boolean;
1368
+ is_active: boolean;
1369
+ }
1370
+ /** Response from `GET /api/v1/me/profiles/:profileId/templates`. */
1371
+ export interface ProfileTemplateListResponse {
1372
+ profile_id: string;
1373
+ templates: ProfileTemplate[];
1374
+ }
1375
+ /** Body accepted by `PUT /api/v1/me/profiles/:profileId/templates/:channel/:type`. */
1376
+ export interface ProfileTemplateUpdateParams {
1377
+ subject?: string;
1378
+ body: string;
1379
+ button_text?: string;
1380
+ button_url_template?: string;
1381
+ is_active?: boolean;
1382
+ }
1383
+ /** Body accepted by `POST /api/v1/me/profiles/:profileId/templates/preview`. */
1384
+ export interface ProfileTemplatePreviewParams extends TemplateContent {
1385
+ channel: TemplateChannel;
1386
+ message_type: TemplateMessageType;
1387
+ }
1388
+ /** Response from `POST /api/v1/me/profiles/:profileId/templates/preview`. */
1389
+ export interface ProfileTemplatePreviewResponse {
1390
+ preview: RenderedTemplate;
1391
+ variables_used: string[];
1392
+ }
1393
+ /** A proof entry on a public profile (channel is never exposed publicly). */
1394
+ export interface PublicProfileProof {
1395
+ type: string;
1396
+ display_value?: string;
1397
+ label?: string;
1398
+ verified_at?: string;
1399
+ }
1400
+ /** A visible custom link on a public profile. */
1401
+ export interface PublicProfileLink {
1402
+ title: string;
1403
+ url: string;
1404
+ icon?: string;
1405
+ }
1406
+ /** Public view of a profile from `GET /api/v1/profiles/p/:profileId` or `/u/:username`. */
1407
+ export interface PublicProfileView {
1408
+ profile_id: string;
1409
+ username?: string;
1410
+ display_name?: string;
1411
+ bio?: string;
1412
+ avatar_url?: string;
1413
+ verification_level?: string;
1414
+ is_business?: boolean;
1415
+ business_name?: string;
1416
+ proofs: PublicProfileProof[];
1417
+ links: PublicProfileLink[];
1418
+ theme?: ProfileTheme;
1419
+ /**
1420
+ * The published, in-force delegations for the domains this profile shows in full. Empty when the
1421
+ * owner turned the section off; null when they could not be read — never an empty list standing
1422
+ * in for an unknown.
1423
+ */
1424
+ delegations?: PublicProfileDelegation[] | null;
1425
+ }
1426
+ /** One entry of a public profile's Delegations section. */
1427
+ export interface PublicProfileDelegation {
1428
+ /** The canonical artifact identity, e.g. `pkg:npm/@proof-holdings/mcp-server`. */
1429
+ delegate: string;
1430
+ delegate_type: 'url' | 'purl';
1431
+ /** The domain, shown on this profile, that authorized the artifact. */
1432
+ principal: string;
1433
+ scope: string[];
1434
+ issued_at: string;
1435
+ expires_at: string;
1436
+ /** The artifact's page on proof.holdings; null for a class with no page. */
1437
+ artifact_path: string | null;
1438
+ }
1439
+ /**
1440
+ * Response from `GET /api/v1/profiles/badge/:username` — everything needed to embed the
1441
+ * verification badge.
1442
+ *
1443
+ * `state` is the field to branch on, not the HTTP status: an unknown username, a profile that is
1444
+ * not public, and a published profile with no live proof ALL answer 200 with
1445
+ * `no_public_record` and are deliberately indistinguishable from one another.
1446
+ *
1447
+ * `badge_urls` are extensionless by design — the badge is served live, and a `.svg` URL would be
1448
+ * cached as an immutable static image.
1449
+ */
1450
+ export interface ProfileBadge {
1451
+ username: string;
1452
+ /** What the badge asserts about: a verified domain, else a name, else the handle. */
1453
+ subject: string;
1454
+ verified_count: number;
1455
+ state: 'published' | 'no_public_record';
1456
+ checked_at: string;
1457
+ profile_url: string;
1458
+ badge_urls: {
1459
+ default: string;
1460
+ paper: string;
1461
+ compact: string;
1462
+ };
1463
+ snippets: {
1464
+ markdown: string;
1465
+ html: string;
1466
+ };
1467
+ }
1468
+ /** Response from `GET /api/v1/profiles/check-username/:username`. */
1469
+ export interface UsernameAvailabilityResponse {
1470
+ available: boolean;
1471
+ reason?: string;
1472
+ }
1473
+ /**
1474
+ * Binary response envelope produced by the http layer for non-JSON 2xx
1475
+ * responses (e.g. avatar images, CSV exports).
1476
+ */
1477
+ export interface BinaryResponse {
1478
+ data: Uint8Array;
1479
+ content_type: string;
1480
+ }
1481
+ /** Envelope returned by `GET /api/v1/profiles/p/:profileId/avatar`. */
1482
+ export type AvatarResponse = BinaryResponse;
1483
+ //# sourceMappingURL=types.d.ts.map