@reclaimprotocol/client 0.1.15 → 0.1.17

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.17",
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,39 @@
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
+ "AdminSubscribeOrgPlan": {"method":"post","path":"/admin/orgs/{orgId}/billing/subscribe"},
14
21
  "AdminThemes": {"method":"get","path":"/admin/themes"},
15
22
  "AdminUsers": {"method":"get","path":"/admin/users"},
16
- "AttachLanding": {"method":"get","path":"/attach"},
17
- "AttachPage": {"method":"get","path":"/attach/{code}"},
23
+ "AdminVerificationClients": {"method":"get","path":"/admin/verification-clients"},
24
+ "AdminVoidOrgCredit": {"method":"post","path":"/admin/orgs/{orgId}/credits/{grantId}/void"},
25
+ "CancelBillingSubscription": {"method":"delete","path":"/orgs/{orgId}/billing/subscription"},
18
26
  "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"},
27
+ "ChangeOrgPlan": {"method":"post","path":"/orgs/{orgId}/billing/change-plan"},
28
+ "ConsentPage": {"method":"get","path":"/oauth/consent"},
29
+ "CreateBillingCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/checkout"},
30
+ "CreateBillingPortalSession": {"method":"post","path":"/orgs/{orgId}/billing/portal"},
22
31
  "CreateCallbackSubscription": {"method":"post","path":"/verifications/callback-subscriptions"},
32
+ "CreateCreditCheckoutSession": {"method":"post","path":"/orgs/{orgId}/billing/credits/checkout"},
33
+ "CreateManualTransaction": {"method":"post","path":"/admin/billing/transactions"},
23
34
  "CreateOrg": {"method":"post","path":"/orgs"},
24
35
  "CreateOrgCallbackSubscription": {"method":"post","path":"/orgs/{orgId}/callback-subscriptions"},
25
36
  "CreateProvider": {"method":"post","path":"/providers"},
26
37
  "CreateProviderVersion": {"method":"post","path":"/providers/{providerId}/versions"},
27
38
  "CreateTheme": {"method":"post","path":"/orgs/{orgId}/themes"},
39
+ "CreateVerificationClient": {"method":"post","path":"/admin/verification-clients"},
28
40
  "CreateVerificationSession": {"method":"post","path":"/verifications/sessions"},
29
41
  "DecideProviderVersionReview": {"method":"post","path":"/providers/{providerId}/versions/{version}/review-decision"},
30
42
  "DeleteCallbackSubscription": {"method":"delete","path":"/verifications/callback-subscriptions/{subscriptionId}"},
@@ -43,14 +55,14 @@ export const ROUTES = {
43
55
  "DisposeVerificationSession": {"method":"post","path":"/v/{sessionId}/dispose"},
44
56
  "Docs": {"method":"get","path":"/docs"},
45
57
  "ExplorePreviewImage": {"method":"get","path":"/og/explore.png"},
46
- "GetAttachSession": {"method":"get","path":"/credentials/attach/sessions/{code}"},
47
58
  "GetImage": {"method":"get","path":"/images/{imageId}"},
48
59
  "GetMe": {"method":"get","path":"/me"},
49
60
  "GetOrg": {"method":"get","path":"/orgs/{orgId}"},
50
61
  "GetOrgBilling": {"method":"get","path":"/orgs/{orgId}/billing"},
62
+ "GetOrgCredits": {"method":"get","path":"/orgs/{orgId}/billing/credits"},
51
63
  "GetOrgKeypair": {"method":"get","path":"/orgs/{orgId}/keypair"},
52
64
  "GetOrgSession": {"method":"get","path":"/orgs/{orgId}/sessions/{sessionId}"},
53
- "GetOrgToken": {"method":"get","path":"/orgs/{orgId}/token"},
65
+ "GetOrgUsage": {"method":"get","path":"/orgs/{orgId}/billing/usage"},
54
66
  "GetProvider": {"method":"get","path":"/providers/{providerId}"},
55
67
  "GetProviderBySlug": {"method":"get","path":"/providers/{providerId}/{slug}"},
56
68
  "GetProviderVersion": {"method":"get","path":"/providers/{providerId}/versions/{version}"},
@@ -61,34 +73,50 @@ export const ROUTES = {
61
73
  "GetVerificationSession": {"method":"get","path":"/verifications/sessions/{sessionId}"},
62
74
  "Index": {"method":"get","path":"/"},
63
75
  "IssueOrgToken": {"method":"post","path":"/orgs/{orgId}/token"},
76
+ "IssueVerificationClientToken": {"method":"post","path":"/admin/verification-clients/{clientId}/tokens"},
64
77
  "JwksJson": {"method":"get","path":"/.well-known/jwks.json"},
78
+ "ListBillingPlans": {"method":"get","path":"/billing/plans"},
65
79
  "ListCallbackDlq": {"method":"get","path":"/verifications/callback-dlq"},
66
80
  "ListCallbackSubscriptions": {"method":"get","path":"/verifications/callback-subscriptions"},
67
81
  "ListOrgCallbackSubscriptions": {"method":"get","path":"/orgs/{orgId}/callback-subscriptions"},
68
82
  "ListOrgs": {"method":"get","path":"/orgs"},
83
+ "ListOrgTokens": {"method":"get","path":"/orgs/{orgId}/token"},
84
+ "ListOrgTransactions": {"method":"get","path":"/orgs/{orgId}/billing/transactions"},
69
85
  "ListOrgVerificationSessions": {"method":"get","path":"/orgs/{orgId}/sessions"},
70
86
  "ListProviderVersions": {"method":"get","path":"/providers/{providerId}/versions"},
71
87
  "ListSessionCallbackKeys": {"method":"get","path":"/verifications/sessions/{sessionId}/callback-keys"},
88
+ "ListStaffMembers": {"method":"get","path":"/admin/staff"},
72
89
  "ListThemes": {"method":"get","path":"/orgs/{orgId}/themes"},
73
90
  "ListVerificationDeliveries": {"method":"get","path":"/verifications/sessions/{sessionId}/deliveries"},
74
91
  "ListVerificationEvents": {"method":"get","path":"/verifications/sessions/{sessionId}/events"},
75
- "Login": {"method":"post","path":"/auth/login"},
76
92
  "LoginPage": {"method":"get","path":"/login"},
77
93
  "Logout": {"method":"post","path":"/logout"},
78
94
  "MakePrivate": {"method":"post","path":"/providers/{providerId}/make-private"},
79
95
  "OpenApiSpec": {"method":"get","path":"/openapi.yaml"},
96
+ "OrgInvitePage": {"method":"get","path":"/orgs/{orgId}/invite"},
80
97
  "ProviderPreviewImage": {"method":"get","path":"/providers/{providerId}/preview.png"},
81
98
  "Providers": {"method":"get","path":"/providers"},
82
99
  "PublishProviderVersion": {"method":"post","path":"/providers/{providerId}/versions/{version}/publish"},
100
+ "RefreshBillingPlans": {"method":"post","path":"/admin/billing/plans/refresh"},
101
+ "RefundTransaction": {"method":"post","path":"/admin/billing/transactions/{txId}/refund"},
83
102
  "RemoveOrgMember": {"method":"delete","path":"/orgs/{orgId}/members/{memberId}"},
103
+ "RemoveStaffMember": {"method":"delete","path":"/admin/staff/{email}"},
84
104
  "ReportClaimant": {"method":"post","path":"/v/{sessionId}/claimant"},
85
105
  "ReportVerificationEvent": {"method":"post","path":"/verifications/sessions/{sessionId}/events"},
106
+ "RequestLoginOtp": {"method":"post","path":"/login/otp"},
86
107
  "RequestPublicListing": {"method":"post","path":"/providers/{providerId}/request-public"},
87
108
  "RetryCallbackDlq": {"method":"post","path":"/verifications/callback-dlq/{dlqId}/retry"},
88
109
  "RetryVerificationCallback": {"method":"post","path":"/verifications/sessions/{sessionId}/retry-callback"},
110
+ "RevokeOrgToken": {"method":"delete","path":"/orgs/{orgId}/token/{tokenId}"},
111
+ "RevokeVerificationClientKey": {"method":"delete","path":"/admin/verification-clients/{clientId}/keys/{keyId}"},
112
+ "RevokeVerificationClientToken": {"method":"delete","path":"/admin/verification-clients/{clientId}/tokens/{tokenId}"},
89
113
  "Robots": {"method":"get","path":"/robots.txt"},
90
114
  "SearchOrgMembers": {"method":"get","path":"/orgs/{orgId}/members"},
115
+ "SetDefaultBillingPlan": {"method":"post","path":"/admin/billing/plans/{planId}/default"},
116
+ "SetOrgCreditGrace": {"method":"post","path":"/admin/orgs/{orgId}/credits/grace"},
117
+ "SetOrgGrace": {"method":"post","path":"/admin/orgs/{orgId}/billing/grace"},
91
118
  "SetOrgKeypair": {"method":"put","path":"/orgs/{orgId}/keypair"},
119
+ "SetupBillingPlan": {"method":"post","path":"/admin/billing/plans/setup"},
92
120
  "SetupProviderCreate": {"method":"post","path":"/providers/setup"},
93
121
  "SiteAiProvider": {"method":"post","path":"/site/{domain}/ai-provider"},
94
122
  "SiteBuild": {"method":"get","path":"/site/{domain}/build"},
@@ -99,19 +127,24 @@ export const ROUTES = {
99
127
  "SitePage": {"method":"get","path":"/site/{domain}"},
100
128
  "SitePanel": {"method":"get","path":"/site/{domain}/panel"},
101
129
  "SiteTryAi": {"method":"post","path":"/site/{domain}/try-ai"},
130
+ "StartSocialLogin": {"method":"get","path":"/login/social/{provider}"},
131
+ "StripeWebhook": {"method":"post","path":"/billing/stripe/webhook"},
132
+ "SubmitConsent": {"method":"post","path":"/oauth/consent"},
102
133
  "SubmitProviderVersionForReview": {"method":"post","path":"/providers/{providerId}/versions/{version}/review"},
103
134
  "SubmitVerificationResult": {"method":"post","path":"/verifications/sessions/{sessionId}/result"},
104
135
  "TransferProvider": {"method":"post","path":"/providers/{providerId}/transfer"},
136
+ "UpdateBillingPlan": {"method":"put","path":"/admin/billing/plans/{planId}"},
105
137
  "UpdateOrg": {"method":"patch","path":"/orgs/{orgId}"},
106
- "UpdateOrgBilling": {"method":"put","path":"/orgs/{orgId}/billing"},
107
138
  "UpdateOrgIcon": {"method":"put","path":"/orgs/{orgId}/icon"},
108
139
  "UpdateOrgMember": {"method":"patch","path":"/orgs/{orgId}/members/{memberId}"},
109
140
  "UpdateProvider": {"method":"patch","path":"/providers/{providerId}"},
110
141
  "UpdateProviderVersion": {"method":"patch","path":"/providers/{providerId}/versions/{version}"},
111
142
  "UpdateTheme": {"method":"patch","path":"/orgs/{orgId}/themes/{themeId}"},
143
+ "UpdateVerificationClient": {"method":"put","path":"/admin/verification-clients/{clientId}"},
112
144
  "VerificationPage": {"method":"get","path":"/v/{sessionId}"},
113
145
  "VerificationSessionSse": {"method":"get","path":"/v/{sessionId}/sse"},
114
146
  "VerificationStatus": {"method":"get","path":"/v/{sessionId}/status"},
147
+ "VerifyLoginOtp": {"method":"post","path":"/login/otp/verify"},
115
148
  } as const
116
149
 
117
150
  export type RouteId = keyof typeof ROUTES