@reclaimprotocol/client 0.1.15 → 0.1.18

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/client",
3
3
  "title": "Reclaim Client",
4
- "version": "0.1.15",
4
+ "version": "0.1.18",
5
5
  "description": "Typed SDK/HTTP client SDK for the Reclaim Protocol — the programmatic way to use Reclaim Protocol to verify **data points** about your users (a follower count, an account balance, an order). Can be directly integrated by apps to request verification for their users using Reclaim Protocol and verify the results.",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -28,7 +28,7 @@
28
28
  "LICENSE"
29
29
  ],
30
30
  "engines": {
31
- "node": ">=20"
31
+ "node": ">=22.0.0"
32
32
  },
33
33
  "repository": {
34
34
  "url": "https://github.com/reclaimprotocol/builder",
@@ -39,7 +39,7 @@
39
39
  "build": "tsc",
40
40
  "prepublishOnly": "npm run build",
41
41
  "dev": "tsc --watch",
42
- "test": "node --test tests/*.test.ts",
42
+ "test": "node --test-timeout=120000 --test tests/*.test.ts",
43
43
  "check": "tsc -p tsconfig.test.json"
44
44
  },
45
45
  "keywords": [
package/src/consts.ts CHANGED
@@ -1,5 +1,5 @@
1
- // TODO: Update to production url
2
- export const DEFAULT_BASE_URL = 'http://localhost:4001'
1
+ export const DEFAULT_BASE_URL =
2
+ process.env.RECLAIM_BASE_URL || 'https://build.reclaimprotocol.org'
3
3
 
4
4
  export const USER_AGENT = '@reclaimprotocol/client'
5
5
 
package/src/errors.ts CHANGED
@@ -7,7 +7,7 @@ export type ProblemError = Boom<ProblemDetails>
7
7
 
8
8
  // Reads an `application/problem+json` response and throws a Boom-style
9
9
  // error. Falls back to status-only mapping when the body isn't a problem doc.
10
- export async function throwProblemError(res: Response): Promise<void> {
10
+ export async function throwProblemError(res: Response) {
11
11
  const contentType = res.headers.get('Content-Type') || ''
12
12
  let problem: ProblemDetails
13
13
  if(contentType.includes(PROBLEM_CONTENT_TYPE)) {
package/src/routes.gen.ts CHANGED
@@ -4,27 +4,41 @@
4
4
  // to regenerate. Do not edit by hand.
5
5
 
6
6
  export const ROUTES = {
7
+ "AcceptOrgInvite": {"method":"post","path":"/orgs/{orgId}/invite"},
7
8
  "AddOrgMember": {"method":"post","path":"/orgs/{orgId}/members"},
9
+ "AddStaffMember": {"method":"post","path":"/admin/staff"},
10
+ "AddVerificationClientKey": {"method":"post","path":"/admin/verification-clients/{clientId}/keys"},
11
+ "AdminBillingPlans": {"method":"get","path":"/admin/billing/plans"},
12
+ "AdminBillingTransactions": {"method":"get","path":"/admin/billing/transactions"},
8
13
  "AdminCallbackDlq": {"method":"get","path":"/admin/callback-dlq"},
14
+ "AdminGrantOrgCredit": {"method":"post","path":"/admin/orgs/{orgId}/credits"},
9
15
  "AdminHome": {"method":"get","path":"/admin"},
10
16
  "AdminOrgs": {"method":"get","path":"/admin/orgs"},
11
17
  "AdminProviders": {"method":"get","path":"/admin/providers"},
12
18
  "AdminReviews": {"method":"get","path":"/admin/reviews"},
13
19
  "AdminSessions": {"method":"get","path":"/admin/sessions"},
20
+ "AdminSetUserOrgLimit": {"method":"put","path":"/users/{userId}/org-limit"},
21
+ "AdminSubscribeOrgPlan": {"method":"post","path":"/admin/orgs/{orgId}/billing/subscribe"},
14
22
  "AdminThemes": {"method":"get","path":"/admin/themes"},
15
23
  "AdminUsers": {"method":"get","path":"/admin/users"},
16
- "AttachLanding": {"method":"get","path":"/attach"},
17
- "AttachPage": {"method":"get","path":"/attach/{code}"},
24
+ "AdminVerificationClients": {"method":"get","path":"/admin/verification-clients"},
25
+ "AdminVoidOrgCredit": {"method":"post","path":"/admin/orgs/{orgId}/credits/{grantId}/void"},
26
+ "CancelBillingSubscription": {"method":"delete","path":"/orgs/{orgId}/billing/subscription"},
18
27
  "CancelPublicListingRequest": {"method":"post","path":"/providers/{providerId}/versions/{version}/cancel-review"},
19
- "ComponentsDemo": {"method":"get","path":"/components_demo"},
20
- "ConfirmAttachSession": {"method":"post","path":"/credentials/attach/sessions/{code}/confirm"},
21
- "CreateAttachSession": {"method":"post","path":"/credentials/attach/sessions"},
28
+ "ChangeOrgPlan": {"method":"post","path":"/orgs/{orgId}/billing/change-plan"},
29
+ "ConsentPage": {"method":"get","path":"/oauth/consent"},
30
+ "ConvertOrgToRegular": {"method":"post","path":"/orgs/{orgId}/convert"},
31
+ "CreateBillingCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/checkout"},
32
+ "CreateBillingPortalSession": {"method":"post","path":"/orgs/{orgId}/billing/portal"},
22
33
  "CreateCallbackSubscription": {"method":"post","path":"/verifications/callback-subscriptions"},
34
+ "CreateCreditCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/credits/checkout"},
35
+ "CreateManualTransaction": {"method":"post","path":"/admin/billing/transactions"},
23
36
  "CreateOrg": {"method":"post","path":"/orgs"},
24
37
  "CreateOrgCallbackSubscription": {"method":"post","path":"/orgs/{orgId}/callback-subscriptions"},
25
38
  "CreateProvider": {"method":"post","path":"/providers"},
26
39
  "CreateProviderVersion": {"method":"post","path":"/providers/{providerId}/versions"},
27
40
  "CreateTheme": {"method":"post","path":"/orgs/{orgId}/themes"},
41
+ "CreateVerificationClient": {"method":"post","path":"/admin/verification-clients"},
28
42
  "CreateVerificationSession": {"method":"post","path":"/verifications/sessions"},
29
43
  "DecideProviderVersionReview": {"method":"post","path":"/providers/{providerId}/versions/{version}/review-decision"},
30
44
  "DeleteCallbackSubscription": {"method":"delete","path":"/verifications/callback-subscriptions/{subscriptionId}"},
@@ -43,14 +57,14 @@ export const ROUTES = {
43
57
  "DisposeVerificationSession": {"method":"post","path":"/v/{sessionId}/dispose"},
44
58
  "Docs": {"method":"get","path":"/docs"},
45
59
  "ExplorePreviewImage": {"method":"get","path":"/og/explore.png"},
46
- "GetAttachSession": {"method":"get","path":"/credentials/attach/sessions/{code}"},
47
60
  "GetImage": {"method":"get","path":"/images/{imageId}"},
48
61
  "GetMe": {"method":"get","path":"/me"},
49
62
  "GetOrg": {"method":"get","path":"/orgs/{orgId}"},
50
63
  "GetOrgBilling": {"method":"get","path":"/orgs/{orgId}/billing"},
64
+ "GetOrgCredits": {"method":"get","path":"/orgs/{orgId}/billing/credits"},
51
65
  "GetOrgKeypair": {"method":"get","path":"/orgs/{orgId}/keypair"},
52
66
  "GetOrgSession": {"method":"get","path":"/orgs/{orgId}/sessions/{sessionId}"},
53
- "GetOrgToken": {"method":"get","path":"/orgs/{orgId}/token"},
67
+ "GetOrgUsage": {"method":"get","path":"/orgs/{orgId}/billing/usage"},
54
68
  "GetProvider": {"method":"get","path":"/providers/{providerId}"},
55
69
  "GetProviderBySlug": {"method":"get","path":"/providers/{providerId}/{slug}"},
56
70
  "GetProviderVersion": {"method":"get","path":"/providers/{providerId}/versions/{version}"},
@@ -61,34 +75,50 @@ export const ROUTES = {
61
75
  "GetVerificationSession": {"method":"get","path":"/verifications/sessions/{sessionId}"},
62
76
  "Index": {"method":"get","path":"/"},
63
77
  "IssueOrgToken": {"method":"post","path":"/orgs/{orgId}/token"},
78
+ "IssueVerificationClientToken": {"method":"post","path":"/admin/verification-clients/{clientId}/tokens"},
64
79
  "JwksJson": {"method":"get","path":"/.well-known/jwks.json"},
80
+ "ListBillingPlans": {"method":"get","path":"/billing/plans"},
65
81
  "ListCallbackDlq": {"method":"get","path":"/verifications/callback-dlq"},
66
82
  "ListCallbackSubscriptions": {"method":"get","path":"/verifications/callback-subscriptions"},
67
83
  "ListOrgCallbackSubscriptions": {"method":"get","path":"/orgs/{orgId}/callback-subscriptions"},
68
84
  "ListOrgs": {"method":"get","path":"/orgs"},
85
+ "ListOrgTokens": {"method":"get","path":"/orgs/{orgId}/token"},
86
+ "ListOrgTransactions": {"method":"get","path":"/orgs/{orgId}/billing/transactions"},
69
87
  "ListOrgVerificationSessions": {"method":"get","path":"/orgs/{orgId}/sessions"},
70
88
  "ListProviderVersions": {"method":"get","path":"/providers/{providerId}/versions"},
71
89
  "ListSessionCallbackKeys": {"method":"get","path":"/verifications/sessions/{sessionId}/callback-keys"},
90
+ "ListStaffMembers": {"method":"get","path":"/admin/staff"},
72
91
  "ListThemes": {"method":"get","path":"/orgs/{orgId}/themes"},
73
92
  "ListVerificationDeliveries": {"method":"get","path":"/verifications/sessions/{sessionId}/deliveries"},
74
93
  "ListVerificationEvents": {"method":"get","path":"/verifications/sessions/{sessionId}/events"},
75
- "Login": {"method":"post","path":"/auth/login"},
76
94
  "LoginPage": {"method":"get","path":"/login"},
77
95
  "Logout": {"method":"post","path":"/logout"},
78
96
  "MakePrivate": {"method":"post","path":"/providers/{providerId}/make-private"},
79
97
  "OpenApiSpec": {"method":"get","path":"/openapi.yaml"},
98
+ "OrgInvitePage": {"method":"get","path":"/orgs/{orgId}/invite"},
80
99
  "ProviderPreviewImage": {"method":"get","path":"/providers/{providerId}/preview.png"},
81
100
  "Providers": {"method":"get","path":"/providers"},
82
101
  "PublishProviderVersion": {"method":"post","path":"/providers/{providerId}/versions/{version}/publish"},
102
+ "RefreshBillingPlans": {"method":"post","path":"/admin/billing/plans/refresh"},
103
+ "RefundTransaction": {"method":"post","path":"/admin/billing/transactions/{txId}/refund"},
83
104
  "RemoveOrgMember": {"method":"delete","path":"/orgs/{orgId}/members/{memberId}"},
105
+ "RemoveStaffMember": {"method":"delete","path":"/admin/staff/{email}"},
84
106
  "ReportClaimant": {"method":"post","path":"/v/{sessionId}/claimant"},
85
107
  "ReportVerificationEvent": {"method":"post","path":"/verifications/sessions/{sessionId}/events"},
108
+ "RequestLoginOtp": {"method":"post","path":"/login/otp"},
86
109
  "RequestPublicListing": {"method":"post","path":"/providers/{providerId}/request-public"},
87
110
  "RetryCallbackDlq": {"method":"post","path":"/verifications/callback-dlq/{dlqId}/retry"},
88
111
  "RetryVerificationCallback": {"method":"post","path":"/verifications/sessions/{sessionId}/retry-callback"},
112
+ "RevokeOrgToken": {"method":"delete","path":"/orgs/{orgId}/token/{tokenId}"},
113
+ "RevokeVerificationClientKey": {"method":"delete","path":"/admin/verification-clients/{clientId}/keys/{keyId}"},
114
+ "RevokeVerificationClientToken": {"method":"delete","path":"/admin/verification-clients/{clientId}/tokens/{tokenId}"},
89
115
  "Robots": {"method":"get","path":"/robots.txt"},
90
116
  "SearchOrgMembers": {"method":"get","path":"/orgs/{orgId}/members"},
117
+ "SetDefaultBillingPlan": {"method":"post","path":"/admin/billing/plans/{planId}/default"},
118
+ "SetOrgCreditGrace": {"method":"post","path":"/admin/orgs/{orgId}/credits/grace"},
119
+ "SetOrgGrace": {"method":"post","path":"/admin/orgs/{orgId}/billing/grace"},
91
120
  "SetOrgKeypair": {"method":"put","path":"/orgs/{orgId}/keypair"},
121
+ "SetupBillingPlan": {"method":"post","path":"/admin/billing/plans/setup"},
92
122
  "SetupProviderCreate": {"method":"post","path":"/providers/setup"},
93
123
  "SiteAiProvider": {"method":"post","path":"/site/{domain}/ai-provider"},
94
124
  "SiteBuild": {"method":"get","path":"/site/{domain}/build"},
@@ -99,19 +129,24 @@ export const ROUTES = {
99
129
  "SitePage": {"method":"get","path":"/site/{domain}"},
100
130
  "SitePanel": {"method":"get","path":"/site/{domain}/panel"},
101
131
  "SiteTryAi": {"method":"post","path":"/site/{domain}/try-ai"},
132
+ "StartSocialLogin": {"method":"get","path":"/login/social/{provider}"},
133
+ "StripeWebhook": {"method":"post","path":"/billing/stripe/webhook"},
134
+ "SubmitConsent": {"method":"post","path":"/oauth/consent"},
102
135
  "SubmitProviderVersionForReview": {"method":"post","path":"/providers/{providerId}/versions/{version}/review"},
103
136
  "SubmitVerificationResult": {"method":"post","path":"/verifications/sessions/{sessionId}/result"},
104
137
  "TransferProvider": {"method":"post","path":"/providers/{providerId}/transfer"},
138
+ "UpdateBillingPlan": {"method":"put","path":"/admin/billing/plans/{planId}"},
105
139
  "UpdateOrg": {"method":"patch","path":"/orgs/{orgId}"},
106
- "UpdateOrgBilling": {"method":"put","path":"/orgs/{orgId}/billing"},
107
140
  "UpdateOrgIcon": {"method":"put","path":"/orgs/{orgId}/icon"},
108
141
  "UpdateOrgMember": {"method":"patch","path":"/orgs/{orgId}/members/{memberId}"},
109
142
  "UpdateProvider": {"method":"patch","path":"/providers/{providerId}"},
110
143
  "UpdateProviderVersion": {"method":"patch","path":"/providers/{providerId}/versions/{version}"},
111
144
  "UpdateTheme": {"method":"patch","path":"/orgs/{orgId}/themes/{themeId}"},
145
+ "UpdateVerificationClient": {"method":"put","path":"/admin/verification-clients/{clientId}"},
112
146
  "VerificationPage": {"method":"get","path":"/v/{sessionId}"},
113
147
  "VerificationSessionSse": {"method":"get","path":"/v/{sessionId}/sse"},
114
148
  "VerificationStatus": {"method":"get","path":"/v/{sessionId}/status"},
149
+ "VerifyLoginOtp": {"method":"post","path":"/login/otp/verify"},
115
150
  } as const
116
151
 
117
152
  export type RouteId = keyof typeof ROUTES