@agentcash/router 1.7.0 → 1.7.1

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/index.d.cts CHANGED
@@ -438,6 +438,7 @@ type MppxMiddlewareResponse<T extends Transport.AnyTransport> = {
438
438
  withReceipt: Transport.WithReceipt<T>;
439
439
  };
440
440
  type MppxMiddleware<TOptions, T extends Transport.AnyTransport> = (options: TOptions) => (input: Request) => Promise<MppxMiddlewareResponse<T>>;
441
+
441
442
  interface RouterDeps {
442
443
  x402Server: X402Server | null;
443
444
  initPromise: Promise<void>;
@@ -492,37 +493,12 @@ type StreamArg<TBody, TQuery, HasAuth extends boolean, NeedsBody extends boolean
492
493
  } : {
493
494
  __missing: 'Select an auth mode: .paid({ dynamic: true, ... }) — streaming requires handler-driven dynamic pricing';
494
495
  };
496
+ interface RouteBuilderDefaults {
497
+ protocols?: ProtocolType[];
498
+ }
495
499
  declare class RouteBuilder<TBody = undefined, TQuery = undefined, TOutput = undefined, HasAuth extends boolean = false, NeedsBody extends boolean = false, HasBody extends boolean = false, IsDynamic extends boolean = false> {
496
- /** @internal */ readonly _key: string;
497
- /** @internal */ readonly _registry: RouteRegistry;
498
- /** @internal */ readonly _deps: OrchestrateDeps;
499
- /** @internal */ _authMode: AuthMode | null;
500
- /** @internal */ _pricing: PricingConfig | undefined;
501
- /** @internal */ _siwxEnabled: boolean;
502
- /** @internal */ _protocols: ProtocolType[];
503
- /** @internal */ _maxPrice: string | undefined;
504
- /** @internal */ _minPrice: string | undefined;
505
- /** @internal */ _dynamicPrice: boolean;
506
- /** @internal */ _tickCost: string | undefined;
507
- /** @internal */ _unitType: string | undefined;
508
- /** @internal */ _payTo: PayToConfig | undefined;
509
- /** @internal */ _bodySchema: ZodType | undefined;
510
- /** @internal */ _querySchema: ZodType | undefined;
511
- /** @internal */ _outputSchema: ZodType | undefined;
512
- /** @internal */ _inputExample: JsonObject | undefined;
513
- /** @internal */ _hasInputExample: boolean;
514
- /** @internal */ _outputExample: JsonValue | undefined;
515
- /** @internal */ _hasOutputExample: boolean;
516
- /** @internal */ _description: string | undefined;
517
- /** @internal */ _path: string | undefined;
518
- /** @internal */ _method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH';
519
- /** @internal */ _apiKeyResolver: ((key: string) => unknown | Promise<unknown>) | undefined;
520
- /** @internal */ _providerName: string | undefined;
521
- /** @internal */ _providerConfig: ProviderConfig | undefined;
522
- /** @internal */ _validateFn: ((body: TBody) => void | Promise<void>) | undefined;
523
- /** @internal */ _settlement: SettlementLifecycle<TBody> | undefined;
524
- /** @internal */ _mppInfo: MppProtocolInfo | undefined;
525
- constructor(key: string, registry: RouteRegistry, deps: OrchestrateDeps);
500
+ #private;
501
+ constructor(key: string, registry: RouteRegistry, deps: OrchestrateDeps, defaults?: RouteBuilderDefaults);
526
502
  private fork;
527
503
  /**
528
504
  * Charge a fixed price per request, denominated in USDC as a decimal string.
package/dist/index.d.ts CHANGED
@@ -438,6 +438,7 @@ type MppxMiddlewareResponse<T extends Transport.AnyTransport> = {
438
438
  withReceipt: Transport.WithReceipt<T>;
439
439
  };
440
440
  type MppxMiddleware<TOptions, T extends Transport.AnyTransport> = (options: TOptions) => (input: Request) => Promise<MppxMiddlewareResponse<T>>;
441
+
441
442
  interface RouterDeps {
442
443
  x402Server: X402Server | null;
443
444
  initPromise: Promise<void>;
@@ -492,37 +493,12 @@ type StreamArg<TBody, TQuery, HasAuth extends boolean, NeedsBody extends boolean
492
493
  } : {
493
494
  __missing: 'Select an auth mode: .paid({ dynamic: true, ... }) — streaming requires handler-driven dynamic pricing';
494
495
  };
496
+ interface RouteBuilderDefaults {
497
+ protocols?: ProtocolType[];
498
+ }
495
499
  declare class RouteBuilder<TBody = undefined, TQuery = undefined, TOutput = undefined, HasAuth extends boolean = false, NeedsBody extends boolean = false, HasBody extends boolean = false, IsDynamic extends boolean = false> {
496
- /** @internal */ readonly _key: string;
497
- /** @internal */ readonly _registry: RouteRegistry;
498
- /** @internal */ readonly _deps: OrchestrateDeps;
499
- /** @internal */ _authMode: AuthMode | null;
500
- /** @internal */ _pricing: PricingConfig | undefined;
501
- /** @internal */ _siwxEnabled: boolean;
502
- /** @internal */ _protocols: ProtocolType[];
503
- /** @internal */ _maxPrice: string | undefined;
504
- /** @internal */ _minPrice: string | undefined;
505
- /** @internal */ _dynamicPrice: boolean;
506
- /** @internal */ _tickCost: string | undefined;
507
- /** @internal */ _unitType: string | undefined;
508
- /** @internal */ _payTo: PayToConfig | undefined;
509
- /** @internal */ _bodySchema: ZodType | undefined;
510
- /** @internal */ _querySchema: ZodType | undefined;
511
- /** @internal */ _outputSchema: ZodType | undefined;
512
- /** @internal */ _inputExample: JsonObject | undefined;
513
- /** @internal */ _hasInputExample: boolean;
514
- /** @internal */ _outputExample: JsonValue | undefined;
515
- /** @internal */ _hasOutputExample: boolean;
516
- /** @internal */ _description: string | undefined;
517
- /** @internal */ _path: string | undefined;
518
- /** @internal */ _method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH';
519
- /** @internal */ _apiKeyResolver: ((key: string) => unknown | Promise<unknown>) | undefined;
520
- /** @internal */ _providerName: string | undefined;
521
- /** @internal */ _providerConfig: ProviderConfig | undefined;
522
- /** @internal */ _validateFn: ((body: TBody) => void | Promise<void>) | undefined;
523
- /** @internal */ _settlement: SettlementLifecycle<TBody> | undefined;
524
- /** @internal */ _mppInfo: MppProtocolInfo | undefined;
525
- constructor(key: string, registry: RouteRegistry, deps: OrchestrateDeps);
500
+ #private;
501
+ constructor(key: string, registry: RouteRegistry, deps: OrchestrateDeps, defaults?: RouteBuilderDefaults);
526
502
  private fork;
527
503
  /**
528
504
  * Charge a fixed price per request, denominated in USDC as a decimal string.