@reclaimprotocol/client 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -74,7 +74,7 @@ await reclaim.keypair.set(orgId, {
74
74
 
75
75
  ```ts
76
76
  const session = await reclaim.sessions.create({
77
- providerId: 'prov_…',
77
+ providers: [{ providerId: 'prov_…' }], // one or more, proved in order → one combined result
78
78
  context: { userId: 'abc' },
79
79
  })
80
80
  console.log('open this:', session.verificationUrl) // hand to the end-user
@@ -87,8 +87,9 @@ curl -X POST "$BUILDER_URL/verifications/sessions" \
87
87
  -H "Authorization: Bearer $RECLAIM_ORG_SECRET" \
88
88
  -H 'Content-Type: application/json' \
89
89
  -d '{
90
- "providerId": "prov_…",
91
- "context": { "userId": "abc" }
90
+ "providers": [{ "providerId": "prov_…" }],
91
+ "context": { "userId": "abc" },
92
+ "verificationClientUrl": "https://your.app/v/{sessionId}"
92
93
  }'
93
94
  # → 201 { "id": "…", "verificationUrl": "…", "status": "pending", "mode": "…", … }
94
95
  ```
@@ -140,7 +141,8 @@ Returns a `Reclaim` with four namespaces (`sessions`, `callbacks`, `keypair`, `r
140
141
  ### `reclaim.sessions`
141
142
 
142
143
  ```ts
143
- reclaim.sessions.create({ providerId, version?, context, verificationClientUrl? })
144
+ reclaim.sessions.create({ providers, context, verificationClientUrl? })
145
+ // providers: { providerId, version? }[] — proved in order, one combined result; all required.
144
146
  // → VerificationSession (has `id`, `verificationUrl`, `status`, `mode`, …)
145
147
  // verificationClientUrl defaults to the Builder's own /v/{sessionId} page.
146
148
  reclaim.sessions.get(sessionId) // → VerificationSession
@@ -248,7 +250,7 @@ const client = new ReclaimClient({ baseUrl, token, fetch, headers })
248
250
  const { data, response } = await client.call('GetVerificationSession', { params: { sessionId } })
249
251
  ```
250
252
 
251
- Errors are thrown as `ProblemError` (RFC 9457). `throwProblemError`, `DEFAULT_BASE_URL`, `USER_AGENT`, encoding helpers (`b64url`, `hexToBytes`, …), and the generated `components` / `operations` types are also exported.
253
+ Errors are thrown as `ProblemError` (RFC 9457). `throwProblemError`, `DEFAULT_BASE_URL`, `USER_AGENT`, and encoding helpers (`b64url`, `base64urlToBytes`, `bytesToHex`, `hexToBytes`) are also exported. The `call` method is fully typed against the generated OpenAPI operations.
252
254
 
253
255
  ## Security notes
254
256
 
@@ -127,6 +127,10 @@ export declare const ROUTES: {
127
127
  readonly method: "delete";
128
128
  readonly path: "/orgs/{orgId}/themes/{themeId}";
129
129
  };
130
+ readonly DiscoverDataPoints: {
131
+ readonly method: "get";
132
+ readonly path: "/discover/data-points";
133
+ };
130
134
  readonly DiscoverResolve: {
131
135
  readonly method: "get";
132
136
  readonly path: "/discover/resolve";
@@ -339,10 +343,22 @@ export declare const ROUTES: {
339
343
  readonly method: "post";
340
344
  readonly path: "/providers/setup";
341
345
  };
346
+ readonly SiteAiProvider: {
347
+ readonly method: "post";
348
+ readonly path: "/site/{domain}/ai-provider";
349
+ };
342
350
  readonly SiteBuild: {
343
351
  readonly method: "get";
344
352
  readonly path: "/site/{domain}/build";
345
353
  };
354
+ readonly SiteBuildAlternative: {
355
+ readonly method: "get";
356
+ readonly path: "/site/{domain}/alternative";
357
+ };
358
+ readonly SiteBuildRepair: {
359
+ readonly method: "get";
360
+ readonly path: "/site/{domain}/repair";
361
+ };
346
362
  readonly SiteBuildTry: {
347
363
  readonly method: "post";
348
364
  readonly path: "/site/{domain}/try";
@@ -359,6 +375,10 @@ export declare const ROUTES: {
359
375
  readonly method: "get";
360
376
  readonly path: "/site/{domain}/panel";
361
377
  };
378
+ readonly SiteTryAi: {
379
+ readonly method: "post";
380
+ readonly path: "/site/{domain}/try-ai";
381
+ };
362
382
  readonly SubmitProviderVersionForReview: {
363
383
  readonly method: "post";
364
384
  readonly path: "/providers/{providerId}/versions/{version}/review";
package/lib/routes.gen.js CHANGED
@@ -35,6 +35,7 @@ export const ROUTES = {
35
35
  "DeleteProvider": { "method": "delete", "path": "/providers/{providerId}" },
36
36
  "DeleteProviderVersion": { "method": "delete", "path": "/providers/{providerId}/versions/{version}" },
37
37
  "DeleteTheme": { "method": "delete", "path": "/orgs/{orgId}/themes/{themeId}" },
38
+ "DiscoverDataPoints": { "method": "get", "path": "/discover/data-points" },
38
39
  "DiscoverResolve": { "method": "get", "path": "/discover/resolve" },
39
40
  "DiscoverTeachAgent": { "method": "get", "path": "/discover/teach" },
40
41
  "DiscoverWebsites": { "method": "get", "path": "/discover/websites" },
@@ -88,11 +89,15 @@ export const ROUTES = {
88
89
  "SearchOrgMembers": { "method": "get", "path": "/orgs/{orgId}/members" },
89
90
  "SetOrgKeypair": { "method": "put", "path": "/orgs/{orgId}/keypair" },
90
91
  "SetupProviderCreate": { "method": "post", "path": "/providers/setup" },
92
+ "SiteAiProvider": { "method": "post", "path": "/site/{domain}/ai-provider" },
91
93
  "SiteBuild": { "method": "get", "path": "/site/{domain}/build" },
94
+ "SiteBuildAlternative": { "method": "get", "path": "/site/{domain}/alternative" },
95
+ "SiteBuildRepair": { "method": "get", "path": "/site/{domain}/repair" },
92
96
  "SiteBuildTry": { "method": "post", "path": "/site/{domain}/try" },
93
97
  "Sitemap": { "method": "get", "path": "/sitemap.xml" },
94
98
  "SitePage": { "method": "get", "path": "/site/{domain}" },
95
99
  "SitePanel": { "method": "get", "path": "/site/{domain}/panel" },
100
+ "SiteTryAi": { "method": "post", "path": "/site/{domain}/try-ai" },
96
101
  "SubmitProviderVersionForReview": { "method": "post", "path": "/providers/{providerId}/versions/{version}/review" },
97
102
  "SubmitVerificationResult": { "method": "post", "path": "/verifications/sessions/{sessionId}/result" },
98
103
  "TransferProvider": { "method": "post", "path": "/providers/{providerId}/transfer" },