@agent-score/commerce 2.4.0 → 2.5.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.
- package/dist/challenge/index.d.mts +5 -1
- package/dist/challenge/index.d.ts +5 -1
- package/dist/challenge/index.js +11 -4
- package/dist/challenge/index.js.map +1 -1
- package/dist/challenge/index.mjs +11 -4
- package/dist/challenge/index.mjs.map +1 -1
- package/dist/{checkout-B-MIzYzW.d.ts → checkout-McfNpZJf.d.ts} +72 -1
- package/dist/{checkout-Bn7ZKIBD.d.mts → checkout-o17dIxHi.d.mts} +72 -1
- package/dist/core.d.mts +23 -1
- package/dist/core.d.ts +23 -1
- package/dist/core.js +25 -11
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +25 -11
- package/dist/core.mjs.map +1 -1
- package/dist/discovery/index.d.mts +17 -2
- package/dist/discovery/index.d.ts +17 -2
- package/dist/discovery/index.js +14 -4
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/index.mjs +14 -4
- package/dist/discovery/index.mjs.map +1 -1
- package/dist/gate-CWP10xPQ.d.mts +339 -0
- package/dist/gate-CWP10xPQ.d.ts +339 -0
- package/dist/identity/express.d.mts +26 -1
- package/dist/identity/express.d.ts +26 -1
- package/dist/identity/express.js +587 -13
- package/dist/identity/express.js.map +1 -1
- package/dist/identity/express.mjs +583 -12
- package/dist/identity/express.mjs.map +1 -1
- package/dist/identity/fastify.d.mts +12 -2
- package/dist/identity/fastify.d.ts +12 -2
- package/dist/identity/fastify.js +595 -13
- package/dist/identity/fastify.js.map +1 -1
- package/dist/identity/fastify.mjs +591 -12
- package/dist/identity/fastify.mjs.map +1 -1
- package/dist/identity/hono.d.mts +26 -1
- package/dist/identity/hono.d.ts +26 -1
- package/dist/identity/hono.js +576 -13
- package/dist/identity/hono.js.map +1 -1
- package/dist/identity/hono.mjs +572 -12
- package/dist/identity/hono.mjs.map +1 -1
- package/dist/identity/nextjs.d.mts +3 -0
- package/dist/identity/nextjs.d.ts +3 -0
- package/dist/identity/nextjs.js +581 -13
- package/dist/identity/nextjs.js.map +1 -1
- package/dist/identity/nextjs.mjs +577 -12
- package/dist/identity/nextjs.mjs.map +1 -1
- package/dist/identity/web.d.mts +24 -1
- package/dist/identity/web.d.ts +24 -1
- package/dist/identity/web.js +581 -13
- package/dist/identity/web.js.map +1 -1
- package/dist/identity/web.mjs +577 -12
- package/dist/identity/web.mjs.map +1 -1
- package/dist/index.d.mts +119 -3
- package/dist/index.d.ts +119 -3
- package/dist/index.js +893 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +873 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/identity/web.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { b as AipGateOptions, r as buildAipErrorBody, V as VerifiedAit } from '../gate-CWP10xPQ.mjs';
|
|
1
2
|
import { AgentScoreCoreOptions, AgentIdentity, DenialReason, CreateSessionOnMissing, AssessResult, SignerVerdict, FailOpenInfraReason, GateQuotaInfo } from '../core.mjs';
|
|
3
|
+
import 'jose';
|
|
2
4
|
import '../signer-3FAit11j.mjs';
|
|
3
5
|
|
|
4
6
|
interface AgentScoreGateOptions extends Omit<AgentScoreCoreOptions, 'createSessionOnMissing'> {
|
|
@@ -96,5 +98,26 @@ declare function createConditionalAgentScoreGate(options: AgentScoreGateOptions)
|
|
|
96
98
|
/** Wrapper variant matching `withAgentScoreGate(opts, handler)` that only
|
|
97
99
|
* invokes the gate when a payment credential is attached. */
|
|
98
100
|
declare function withConditionalAgentScoreGate<TCtx = unknown>(options: AgentScoreGateOptions, handler: Parameters<typeof withAgentScoreGate<TCtx>>[1]): (req: Request, ctx: TCtx) => Promise<Response>;
|
|
101
|
+
type AipGuardResult = {
|
|
102
|
+
allowed: true;
|
|
103
|
+
ait: VerifiedAit;
|
|
104
|
+
} | {
|
|
105
|
+
allowed: false;
|
|
106
|
+
response: Response;
|
|
107
|
+
};
|
|
108
|
+
interface AipGateWebOptions extends AipGateOptions {
|
|
109
|
+
/** Custom denial responder. Defaults to a 401/403 `application/problem+json` Response. */
|
|
110
|
+
onDenied?: (req: Request, body: ReturnType<typeof buildAipErrorBody>) => Response | Promise<Response>;
|
|
111
|
+
}
|
|
112
|
+
/** Create a Web Fetch AIP guard: returns `{ allowed, ait }` or `{ allowed: false, response }`. */
|
|
113
|
+
declare function createAipGate(options: AipGateWebOptions): (req: Request) => Promise<AipGuardResult>;
|
|
114
|
+
/** Wrap a Web Fetch handler with the AIP gate. Denied requests return the problem+json Response. */
|
|
115
|
+
declare function withAipGate<TCtx = unknown>(options: AipGateWebOptions, handler: (req: Request, gate: {
|
|
116
|
+
ait: VerifiedAit;
|
|
117
|
+
}, ctx?: TCtx) => Response | Promise<Response>): (req: Request, ctx?: TCtx) => Promise<Response>;
|
|
118
|
+
/** Conditional variant: only runs the AIP gate when an `Agent-Identity` header is present. */
|
|
119
|
+
declare function withConditionalAipGate<TCtx = unknown>(options: AipGateWebOptions, handler: (req: Request, gate: {
|
|
120
|
+
ait?: VerifiedAit;
|
|
121
|
+
}, ctx?: TCtx) => Response | Promise<Response>): (req: Request, ctx?: TCtx) => Promise<Response>;
|
|
99
122
|
|
|
100
|
-
export { type GuardResult, createAgentScoreGate, createConditionalAgentScoreGate, withAgentScoreGate, withConditionalAgentScoreGate };
|
|
123
|
+
export { type AipGateWebOptions, type AipGuardResult, type GuardResult, createAgentScoreGate, createAipGate, createConditionalAgentScoreGate, withAgentScoreGate, withAipGate, withConditionalAgentScoreGate, withConditionalAipGate };
|
package/dist/identity/web.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { b as AipGateOptions, r as buildAipErrorBody, V as VerifiedAit } from '../gate-CWP10xPQ.js';
|
|
1
2
|
import { AgentScoreCoreOptions, AgentIdentity, DenialReason, CreateSessionOnMissing, AssessResult, SignerVerdict, FailOpenInfraReason, GateQuotaInfo } from '../core.js';
|
|
3
|
+
import 'jose';
|
|
2
4
|
import '../signer-3FAit11j.js';
|
|
3
5
|
|
|
4
6
|
interface AgentScoreGateOptions extends Omit<AgentScoreCoreOptions, 'createSessionOnMissing'> {
|
|
@@ -96,5 +98,26 @@ declare function createConditionalAgentScoreGate(options: AgentScoreGateOptions)
|
|
|
96
98
|
/** Wrapper variant matching `withAgentScoreGate(opts, handler)` that only
|
|
97
99
|
* invokes the gate when a payment credential is attached. */
|
|
98
100
|
declare function withConditionalAgentScoreGate<TCtx = unknown>(options: AgentScoreGateOptions, handler: Parameters<typeof withAgentScoreGate<TCtx>>[1]): (req: Request, ctx: TCtx) => Promise<Response>;
|
|
101
|
+
type AipGuardResult = {
|
|
102
|
+
allowed: true;
|
|
103
|
+
ait: VerifiedAit;
|
|
104
|
+
} | {
|
|
105
|
+
allowed: false;
|
|
106
|
+
response: Response;
|
|
107
|
+
};
|
|
108
|
+
interface AipGateWebOptions extends AipGateOptions {
|
|
109
|
+
/** Custom denial responder. Defaults to a 401/403 `application/problem+json` Response. */
|
|
110
|
+
onDenied?: (req: Request, body: ReturnType<typeof buildAipErrorBody>) => Response | Promise<Response>;
|
|
111
|
+
}
|
|
112
|
+
/** Create a Web Fetch AIP guard: returns `{ allowed, ait }` or `{ allowed: false, response }`. */
|
|
113
|
+
declare function createAipGate(options: AipGateWebOptions): (req: Request) => Promise<AipGuardResult>;
|
|
114
|
+
/** Wrap a Web Fetch handler with the AIP gate. Denied requests return the problem+json Response. */
|
|
115
|
+
declare function withAipGate<TCtx = unknown>(options: AipGateWebOptions, handler: (req: Request, gate: {
|
|
116
|
+
ait: VerifiedAit;
|
|
117
|
+
}, ctx?: TCtx) => Response | Promise<Response>): (req: Request, ctx?: TCtx) => Promise<Response>;
|
|
118
|
+
/** Conditional variant: only runs the AIP gate when an `Agent-Identity` header is present. */
|
|
119
|
+
declare function withConditionalAipGate<TCtx = unknown>(options: AipGateWebOptions, handler: (req: Request, gate: {
|
|
120
|
+
ait?: VerifiedAit;
|
|
121
|
+
}, ctx?: TCtx) => Response | Promise<Response>): (req: Request, ctx?: TCtx) => Promise<Response>;
|
|
99
122
|
|
|
100
|
-
export { type GuardResult, createAgentScoreGate, createConditionalAgentScoreGate, withAgentScoreGate, withConditionalAgentScoreGate };
|
|
123
|
+
export { type AipGateWebOptions, type AipGuardResult, type GuardResult, createAgentScoreGate, createAipGate, createConditionalAgentScoreGate, withAgentScoreGate, withAipGate, withConditionalAgentScoreGate, withConditionalAipGate };
|