@reclaimprotocol/client 0.1.43 → 0.1.44
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/lib/result.js +26 -0
- package/lib/routes.gen.d.ts +24 -0
- package/lib/routes.gen.js +7 -1
- package/lib/types/openapi.gen.d.ts +472 -31
- package/lib/types/openapi.gen.js +1 -1
- package/package.json +1 -1
- package/src/result.ts +32 -0
- package/src/routes.gen.ts +7 -1
- package/src/types/openapi.gen.ts +473 -32
package/lib/result.js
CHANGED
|
@@ -386,6 +386,15 @@ export async function verifyResultFull(jws, opts = {}) {
|
|
|
386
386
|
if (hasContentValidation(commonValidation)) {
|
|
387
387
|
await verifyRequestProofGroup(proofGroups, commonValidation);
|
|
388
388
|
}
|
|
389
|
+
else if (isProviderlessAiResult(payload, providerResults)) {
|
|
390
|
+
// AI sessions have no provider or recipe, so there is no content to
|
|
391
|
+
// match. Attestor trust, proof signatures, and session binding still
|
|
392
|
+
// apply through `commonValidation`.
|
|
393
|
+
await verifyRequestProofGroup(proofGroups, {
|
|
394
|
+
...commonValidation,
|
|
395
|
+
dangerouslyDisableContentValidation: true,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
389
398
|
else {
|
|
390
399
|
await verifyByResolvedRecipes(commonValidation, expectedSessionId);
|
|
391
400
|
}
|
|
@@ -528,6 +537,23 @@ function hasContentValidation(config) {
|
|
|
528
537
|
|| config.providerId
|
|
529
538
|
|| config.dangerouslyDisableContentValidation);
|
|
530
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* Whether a result comes from an AI session: the session declares no
|
|
542
|
+
* providers, and no `results` entry names a provider or version. Any other
|
|
543
|
+
* shape, including a mix of both kinds of entries, takes the recipe path.
|
|
544
|
+
*/
|
|
545
|
+
function isProviderlessAiResult(payload, entries) {
|
|
546
|
+
const session = payload.verification_session;
|
|
547
|
+
if (!session || typeof session !== 'object' || Array.isArray(session)) {
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
const { providers } = session;
|
|
551
|
+
return Array.isArray(providers)
|
|
552
|
+
&& providers.length === 0
|
|
553
|
+
&& entries.length > 0
|
|
554
|
+
&& entries.every((entry) => (entry.provider_id === undefined
|
|
555
|
+
&& entry.resolved_version === undefined));
|
|
556
|
+
}
|
|
531
557
|
function proofGroupKey(group) {
|
|
532
558
|
return `${group.providerId ?? ''}\u0000${group.providerVersion ?? ''}`;
|
|
533
559
|
}
|
package/lib/routes.gen.d.ts
CHANGED
|
@@ -35,10 +35,18 @@ export declare const ROUTES: {
|
|
|
35
35
|
readonly method: "get";
|
|
36
36
|
readonly path: "/admin/callback-dlq";
|
|
37
37
|
};
|
|
38
|
+
readonly AdminDisableOrgAiAppKey: {
|
|
39
|
+
readonly method: "post";
|
|
40
|
+
readonly path: "/admin/orgs/{orgId}/ai-app-key/disable";
|
|
41
|
+
};
|
|
38
42
|
readonly AdminFeatureFlags: {
|
|
39
43
|
readonly method: "get";
|
|
40
44
|
readonly path: "/admin/feature-flags";
|
|
41
45
|
};
|
|
46
|
+
readonly AdminGetOrgAiAppKey: {
|
|
47
|
+
readonly method: "get";
|
|
48
|
+
readonly path: "/admin/orgs/{orgId}/ai-app-key";
|
|
49
|
+
};
|
|
42
50
|
readonly AdminGrantOrgCredit: {
|
|
43
51
|
readonly method: "post";
|
|
44
52
|
readonly path: "/admin/orgs/{orgId}/credits";
|
|
@@ -59,6 +67,10 @@ export declare const ROUTES: {
|
|
|
59
67
|
readonly method: "get";
|
|
60
68
|
readonly path: "/admin/reviews";
|
|
61
69
|
};
|
|
70
|
+
readonly AdminRotateOrgAiAppKey: {
|
|
71
|
+
readonly method: "post";
|
|
72
|
+
readonly path: "/admin/orgs/{orgId}/ai-app-key/rotate";
|
|
73
|
+
};
|
|
62
74
|
readonly AdminSessions: {
|
|
63
75
|
readonly method: "get";
|
|
64
76
|
readonly path: "/admin/sessions";
|
|
@@ -503,6 +515,14 @@ export declare const ROUTES: {
|
|
|
503
515
|
readonly method: "post";
|
|
504
516
|
readonly path: "/providers/{providerId}/versions/{version}/publish";
|
|
505
517
|
};
|
|
518
|
+
readonly ReceiveAiVerificationCancel: {
|
|
519
|
+
readonly method: "post";
|
|
520
|
+
readonly path: "/verifications/ai-sessions/{sessionId}/cancel";
|
|
521
|
+
};
|
|
522
|
+
readonly ReceiveAiVerificationProofs: {
|
|
523
|
+
readonly method: "post";
|
|
524
|
+
readonly path: "/verifications/ai-sessions/{sessionId}/proofs";
|
|
525
|
+
};
|
|
506
526
|
readonly RefreshBillingPlans: {
|
|
507
527
|
readonly method: "post";
|
|
508
528
|
readonly path: "/admin/billing/plans/refresh";
|
|
@@ -623,6 +643,10 @@ export declare const ROUTES: {
|
|
|
623
643
|
readonly method: "get";
|
|
624
644
|
readonly path: "/site/{domain}/panel";
|
|
625
645
|
};
|
|
646
|
+
readonly StartAiVerificationSession: {
|
|
647
|
+
readonly method: "post";
|
|
648
|
+
readonly path: "/verifications/ai-sessions/{sessionId}/start";
|
|
649
|
+
};
|
|
626
650
|
readonly StartSocialLogin: {
|
|
627
651
|
readonly method: "get";
|
|
628
652
|
readonly path: "/login/social/{provider}";
|
package/lib/routes.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
|
|
2
|
-
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:
|
|
2
|
+
// from packages/app/openapi.yaml (spec v0.1.0, source sha256:cbe3daf2a1f3).
|
|
3
3
|
// The hash catches drift the version misses (a spec can change without a
|
|
4
4
|
// version bump) — do not remove it as "redundant" with the version.
|
|
5
5
|
// Run `npm run openapi:gen --workspace=packages/app` to regenerate. Do not edit by hand.
|
|
@@ -13,12 +13,15 @@ export const ROUTES = {
|
|
|
13
13
|
"AdminBillingPlans": { "method": "get", "path": "/admin/billing/plans" },
|
|
14
14
|
"AdminBillingTransactions": { "method": "get", "path": "/admin/billing/transactions" },
|
|
15
15
|
"AdminCallbackDlq": { "method": "get", "path": "/admin/callback-dlq" },
|
|
16
|
+
"AdminDisableOrgAiAppKey": { "method": "post", "path": "/admin/orgs/{orgId}/ai-app-key/disable" },
|
|
16
17
|
"AdminFeatureFlags": { "method": "get", "path": "/admin/feature-flags" },
|
|
18
|
+
"AdminGetOrgAiAppKey": { "method": "get", "path": "/admin/orgs/{orgId}/ai-app-key" },
|
|
17
19
|
"AdminGrantOrgCredit": { "method": "post", "path": "/admin/orgs/{orgId}/credits" },
|
|
18
20
|
"AdminHome": { "method": "get", "path": "/admin" },
|
|
19
21
|
"AdminOrgs": { "method": "get", "path": "/admin/orgs" },
|
|
20
22
|
"AdminProviders": { "method": "get", "path": "/admin/providers" },
|
|
21
23
|
"AdminReviews": { "method": "get", "path": "/admin/reviews" },
|
|
24
|
+
"AdminRotateOrgAiAppKey": { "method": "post", "path": "/admin/orgs/{orgId}/ai-app-key/rotate" },
|
|
22
25
|
"AdminSessions": { "method": "get", "path": "/admin/sessions" },
|
|
23
26
|
"AdminSetProviderFixWithAi": { "method": "put", "path": "/admin/providers/{providerId}/fix-with-ai" },
|
|
24
27
|
"AdminSetUserOrgLimit": { "method": "put", "path": "/users/{userId}/org-limit" },
|
|
@@ -130,6 +133,8 @@ export const ROUTES = {
|
|
|
130
133
|
"ProviderPreviewImage": { "method": "get", "path": "/providers/{providerId}/preview.png" },
|
|
131
134
|
"Providers": { "method": "get", "path": "/providers" },
|
|
132
135
|
"PublishProviderVersion": { "method": "post", "path": "/providers/{providerId}/versions/{version}/publish" },
|
|
136
|
+
"ReceiveAiVerificationCancel": { "method": "post", "path": "/verifications/ai-sessions/{sessionId}/cancel" },
|
|
137
|
+
"ReceiveAiVerificationProofs": { "method": "post", "path": "/verifications/ai-sessions/{sessionId}/proofs" },
|
|
133
138
|
"RefreshBillingPlans": { "method": "post", "path": "/admin/billing/plans/refresh" },
|
|
134
139
|
"RefundTransaction": { "method": "post", "path": "/admin/billing/transactions/{txId}/refund" },
|
|
135
140
|
"ReleaseCallbackListener": { "method": "post", "path": "/verifications/callback-listener/release" },
|
|
@@ -160,6 +165,7 @@ export const ROUTES = {
|
|
|
160
165
|
"Sitemap": { "method": "get", "path": "/sitemap.xml" },
|
|
161
166
|
"SitePage": { "method": "get", "path": "/site/{domain}" },
|
|
162
167
|
"SitePanel": { "method": "get", "path": "/site/{domain}/panel" },
|
|
168
|
+
"StartAiVerificationSession": { "method": "post", "path": "/verifications/ai-sessions/{sessionId}/start" },
|
|
163
169
|
"StartSocialLogin": { "method": "get", "path": "/login/social/{provider}" },
|
|
164
170
|
"StripeWebhook": { "method": "post", "path": "/billing/stripe/webhook" },
|
|
165
171
|
"SubmitConsent": { "method": "post", "path": "/oauth/consent" },
|