mppx 0.14.1 → 0.16.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/CHANGELOG.md +42 -0
- package/README.md +1 -1
- package/dist/Expires.js +1 -1
- package/dist/Store.d.ts +2 -2
- package/dist/Store.js +13 -3
- package/dist/cli/cli.js +137 -131
- package/dist/cli/plugins/index.js +11 -11
- package/dist/cli/validate/payment.d.ts +12 -0
- package/dist/cli/validate/payment.js +113 -14
- package/dist/client/Mppx.d.ts +13 -3
- package/dist/client/Mppx.js +47 -22
- package/dist/client/internal/Fetch.d.ts +11 -0
- package/dist/client/internal/Fetch.js +46 -8
- package/dist/client/internal/ProofRealm.d.ts +21 -0
- package/dist/client/internal/ProofRealm.js +55 -0
- package/dist/{attestation → extensions/identity}/Constants.d.ts +2 -2
- package/dist/{attestation → extensions/identity}/Constants.js +2 -2
- package/dist/extensions/identity/Types.d.ts +21 -0
- package/dist/extensions/identity/index.d.ts +7 -0
- package/dist/extensions/identity/index.js +6 -0
- package/dist/{attestation → extensions/identity}/internal/HttpMessageSignature.d.ts +3 -3
- package/dist/{attestation → extensions/identity}/internal/HttpMessageSignature.js +12 -10
- package/dist/extensions/identity/internal/SigningContext.d.ts +6 -0
- package/dist/{attestation → extensions/identity}/internal/SigningContext.js +3 -3
- package/dist/extensions/identity/internal/Verification.d.ts +9 -0
- package/dist/extensions/identity/internal/Verification.js +10 -0
- package/dist/{tap → extensions/identity/tap}/Constants.js +1 -1
- package/dist/extensions/identity/tap/client/index.d.ts +32 -0
- package/dist/{tap → extensions/identity/tap}/client/index.js +13 -9
- package/dist/extensions/identity/tap/server/index.d.ts +27 -0
- package/dist/{tap → extensions/identity/tap}/server/index.js +12 -4
- package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/Constants.js +1 -1
- package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/client/index.d.ts +6 -5
- package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/client/index.js +5 -5
- package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/server/index.d.ts +6 -5
- package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/server/index.js +6 -4
- package/dist/identity/Client.d.ts +34 -0
- package/dist/identity/Client.js +133 -0
- package/dist/identity/Server.d.ts +46 -0
- package/dist/identity/Server.js +145 -0
- package/dist/identity/Types.d.ts +90 -0
- package/dist/identity/Types.js +2 -0
- package/dist/{attestation → identity}/index.d.ts +2 -2
- package/dist/{attestation → identity}/index.js +1 -2
- package/dist/identity/internal/SigningContext.d.ts +6 -0
- package/dist/identity/internal/SigningContext.js +11 -0
- package/dist/integrations/x402/Evm.d.ts +2 -0
- package/dist/internal/version.d.ts +2 -2
- package/dist/internal/version.js +1 -1
- package/dist/mcp/client/McpClient.d.ts +5 -0
- package/dist/mcp/client/McpClient.js +2 -0
- package/dist/middlewares/express.js +18 -6
- package/dist/proxy/Proxy.js +10 -5
- package/dist/proxy/Service.d.ts +42 -4
- package/dist/proxy/Service.js +21 -5
- package/dist/server/Mppx.d.ts +32 -8
- package/dist/server/Mppx.js +144 -54
- package/dist/stripe/server/internal/html.gen.js +1 -1
- package/dist/tempo/Methods.d.ts +5 -0
- package/dist/tempo/Methods.js +1 -0
- package/dist/tempo/client/Subscription.d.ts +5 -0
- package/dist/tempo/internal/charge.js +2 -1
- package/dist/tempo/internal/fee-payer.d.ts +0 -2
- package/dist/tempo/internal/fee-payer.js +0 -4
- package/dist/tempo/server/Charge.js +4 -0
- package/dist/tempo/server/Methods.d.ts +26 -0
- package/dist/tempo/server/Subscription.d.ts +5 -0
- package/dist/tempo/server/Subscription.js +8 -5
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/client/Runtime.d.ts +2 -0
- package/dist/tempo/session/client/Session.js +1 -1
- package/dist/tempo/session/client/SessionManager.d.ts +6 -0
- package/dist/tempo/session/client/SessionManager.js +14 -7
- package/dist/tempo/session/client/Transports.d.ts +12 -3
- package/dist/tempo/session/client/Transports.js +37 -11
- package/dist/tempo/session/precompile/Chain.js +0 -3
- package/dist/tempo/session/server/Ws.d.ts +5 -2
- package/dist/tempo/session/server/Ws.js +11 -2
- package/dist/tempo/subscription/Store.d.ts +7 -1
- package/dist/tempo/subscription/Store.js +66 -13
- package/dist/tempo/subscription/Types.d.ts +2 -0
- package/package.json +15 -11
- package/dist/attestation/Client.d.ts +0 -17
- package/dist/attestation/Client.js +0 -28
- package/dist/attestation/Server.d.ts +0 -4
- package/dist/attestation/Server.js +0 -8
- package/dist/attestation/Types.d.ts +0 -76
- package/dist/attestation/internal/SigningContext.d.ts +0 -4
- package/dist/tap/client/index.d.ts +0 -26
- package/dist/tap/server/index.d.ts +0 -20
- /package/dist/{attestation → extensions/identity}/Types.js +0 -0
- /package/dist/{tap → extensions/identity/tap}/Constants.d.ts +0 -0
- /package/dist/{tap → extensions/identity/tap}/Types.d.ts +0 -0
- /package/dist/{tap → extensions/identity/tap}/Types.js +0 -0
- /package/dist/{tap → extensions/identity/tap}/index.d.ts +0 -0
- /package/dist/{tap → extensions/identity/tap}/index.js +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/Constants.d.ts +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/Types.d.ts +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/Types.js +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/index.d.ts +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/index.js +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/internal/JwkThumbprint.d.ts +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/internal/JwkThumbprint.js +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/internal/SignatureAgent.d.ts +0 -0
- /package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/internal/SignatureAgent.js +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Verifies every configured request-attestation protocol. */
|
|
2
|
-
export async function verify(request, verifiers) {
|
|
3
|
-
const outcomes = {};
|
|
4
|
-
for (const [name, verifier] of Object.entries(verifiers))
|
|
5
|
-
outcomes[name] = await verifier.verify(request);
|
|
6
|
-
return outcomes;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=Server.js.map
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { MaybePromise } from '../internal/types.js';
|
|
2
|
-
import type { Algorithms } from './Constants.js';
|
|
3
|
-
/** RFC 9421 algorithms implemented by the request-attestation signer and verifier. */
|
|
4
|
-
export type SignatureAlgorithm = (typeof Algorithms)[keyof typeof Algorithms];
|
|
5
|
-
/** Resolves a trusted public key for a parsed request signature. */
|
|
6
|
-
export type KeyResolver = (parameters: {
|
|
7
|
-
/** RFC 9421 algorithm declared by the signature. */
|
|
8
|
-
algorithm: SignatureAlgorithm;
|
|
9
|
-
/** Key identifier declared by the signature. */
|
|
10
|
-
keyId: string;
|
|
11
|
-
/** Request carrying the signature. */
|
|
12
|
-
request: Request;
|
|
13
|
-
}) => MaybePromise<CryptoKey | undefined>;
|
|
14
|
-
/**
|
|
15
|
-
* The complete outcome of attempting one protocol verifier.
|
|
16
|
-
*
|
|
17
|
-
* `absent` means the protocol did not appear on the request. `invalid` means
|
|
18
|
-
* it appeared but failed validation and must reject the request. `unverified`
|
|
19
|
-
* means key material or another required verification dependency was unavailable.
|
|
20
|
-
* `verified` carries protocol-specific data that is safe for callers to inspect.
|
|
21
|
-
*/
|
|
22
|
-
export type Verification<value = unknown> = {
|
|
23
|
-
status: 'absent';
|
|
24
|
-
} | {
|
|
25
|
-
status: 'invalid';
|
|
26
|
-
reason: string;
|
|
27
|
-
} | {
|
|
28
|
-
status: 'unverified';
|
|
29
|
-
reason: string;
|
|
30
|
-
} | {
|
|
31
|
-
status: 'verified';
|
|
32
|
-
value: value;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Verifies one request-attestation protocol carried by an HTTP request.
|
|
36
|
-
*
|
|
37
|
-
* Verifiers are registered in a {@link VerifierMap}; each map key names the
|
|
38
|
-
* result returned to the caller.
|
|
39
|
-
*/
|
|
40
|
-
export type Verifier<value = unknown> = {
|
|
41
|
-
/** Validates the request and returns a complete protocol verification outcome. */
|
|
42
|
-
verify: (request: Request) => MaybePromise<Verification<value>>;
|
|
43
|
-
};
|
|
44
|
-
/** Maps each recognized protocol name to its verifier. */
|
|
45
|
-
export type VerifierMap = Readonly<Record<string, Verifier>>;
|
|
46
|
-
/** Preserves each configured protocol's complete verification outcome. */
|
|
47
|
-
export type VerificationsFrom<verifiers extends VerifierMap> = {
|
|
48
|
-
readonly [protocol in keyof verifiers]: Awaited<ReturnType<verifiers[protocol]['verify']>>;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Values shared by every signer contributing to one HTTP request attempt.
|
|
52
|
-
*
|
|
53
|
-
* A caller may reuse this context across independent signature protocols so
|
|
54
|
-
* they describe the same attempt. A later network retry must use a new context.
|
|
55
|
-
*/
|
|
56
|
-
export type SigningContext = {
|
|
57
|
-
/** Unix timestamp, in seconds, at which the request attempt was created. */
|
|
58
|
-
readonly created: number;
|
|
59
|
-
/** Base64url-encoded random value identifying this request attempt. */
|
|
60
|
-
readonly nonce: string;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Signs each outbound HTTP request, including MPP payment retries.
|
|
64
|
-
*
|
|
65
|
-
* The protocol type preserves which adapter produced the signer for diagnostics
|
|
66
|
-
* and composition, without asserting that the signer alone authorizes payment.
|
|
67
|
-
*/
|
|
68
|
-
export type Signer<protocol extends string = string> = {
|
|
69
|
-
/** Protocol identifier used for diagnostics. */
|
|
70
|
-
protocol: protocol;
|
|
71
|
-
/** Returns a new request containing the protocol's signature material. */
|
|
72
|
-
sign: (request: Request, context?: SigningContext | undefined) => MaybePromise<Request>;
|
|
73
|
-
};
|
|
74
|
-
/** Maps application-defined names to request-attestation signers. */
|
|
75
|
-
export type SignerMap = Readonly<Record<string, Signer>>;
|
|
76
|
-
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as AttestationTypes from '../../attestation/Types.js';
|
|
2
|
-
import { Constants } from '../Constants.js';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a TAP request signer.
|
|
5
|
-
*
|
|
6
|
-
* The signer emits RFC 9421 HTTP message signatures with TAP's
|
|
7
|
-
* `agent-browser-auth` or `agent-payer-auth` tag. Pass it to
|
|
8
|
-
* `Attestation.Client.wrapFetch` so MPPX signs both the initial request and
|
|
9
|
-
* its automatic paid retry.
|
|
10
|
-
*/
|
|
11
|
-
export declare function signer(config: signer.Config): AttestationTypes.Signer<typeof Constants.protocol>;
|
|
12
|
-
export declare namespace signer {
|
|
13
|
-
type Config = {
|
|
14
|
-
/** TAP signature type for the request. */
|
|
15
|
-
intent: (typeof Constants.intents)[keyof typeof Constants.intents];
|
|
16
|
-
/** Ed25519 or RSA-PSS SHA-512 private key provisioned to the agent provider. */
|
|
17
|
-
key: CryptoKey;
|
|
18
|
-
/** Identifier the merchant uses to resolve the signing public key. */
|
|
19
|
-
keyId: string;
|
|
20
|
-
/** Signature lifetime in seconds. TAP permits at most eight minutes. @default 480 */
|
|
21
|
-
expiresIn?: number | undefined;
|
|
22
|
-
/** RFC 9421 dictionary label. @default 'tap' */
|
|
23
|
-
label?: string | undefined;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type * as Attestation from '../../attestation/Types.js';
|
|
2
|
-
import type * as Store from '../../Store.js';
|
|
3
|
-
import type * as Types from '../Types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a verifier for TAP agent-recognition signatures.
|
|
6
|
-
*
|
|
7
|
-
* TAP verifies trusted agent participation and request integrity. Consumer
|
|
8
|
-
* recognition and payment-container verification stay protocol-specific and
|
|
9
|
-
* are intentionally not inferred from this header-only verifier.
|
|
10
|
-
*/
|
|
11
|
-
export declare function verifier(config: verifier.Config): Attestation.Verifier<Types.VerifiedRequest>;
|
|
12
|
-
export declare namespace verifier {
|
|
13
|
-
type Config = {
|
|
14
|
-
/** Resolves a TAP-approved public key by its `keyid` and signature algorithm. */
|
|
15
|
-
keyResolver: Attestation.KeyResolver;
|
|
16
|
-
/** Atomically consumes each nonce in shared storage for multi-instance deployments. */
|
|
17
|
-
nonceStore: Store.AtomicStore;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{web-bot-auth → extensions/identity/web-bot-auth}/internal/SignatureAgent.d.ts
RENAMED
|
File without changes
|
|
File without changes
|