@farthershore/business exports
Every public export and declaration from @farthershore/business.
Every public export and declaration from @farthershore/business.
Import from @farthershore/business. This reference is extracted from the published declaration surface for version 3.2.0. Read the collection's guides for workflows, prerequisites and failure handling.
This package executable compiles locally; it does not apply or release a business. See build output for generated artifacts and diagnostics.
Usage: farthershore-manifest-build [--entry business] [--out business-build.json] [--diagnostics-out manifest-diagnostics.json]
--entry defaults to the business/ folder (all modules imported; exactly one default fs.business() export is compiled).
Pass a folder to discover it, or a single file to load only that file.
Public export AuthoredMoneyAmount.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L230.
export type AuthoredMoneyAmount = Readonly<MoneyAmount__51964157493a & CommerceBrand__7b1b990b7c90<"money_amount">>;
Public export backend.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L66.
export declare function backend(id: string, options?: FunctionalBackendOptions): BackendRef;
Public export BackendDefinitionJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L304.
export type BackendDefinitionJson = {
name?: string;
slug?: string;
transport?: {
mode?: BackendTransportModeJson;
runner?: BackendRunnerJson;
};
/**
* Gateway->backend request signing. Emitted for every declared backend; the
* builder helper defaults omission to `{ required: true }` (HARD default).
*/
verification?: {
required?: boolean;
};
/** Meter allow-list. Omitted = all business meters allowed. */
meters?: string[];
/** Marks the default backend when a business declares more than one. */
default?: boolean;
};
Public export BackendRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L42.
export type BackendRef = DeclarationRef__2a230f417174<"backend">;
Public export BackendRunnerJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L303.
export type BackendRunnerJson = "embedded" | "sidecar";
Public export BackendTransportModeJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L302.
export type BackendTransportModeJson = "direct" | "tunnel";
Public export BoundRateRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L63.
export type BoundRateRef = Readonly<{
kind: "bound_catalog_rate";
rate?: ExactRate;
tiers?: ExactCatalogTiers;
quote?: ExactQuoteBounds__e9cf817917c1;
measure: MeasureRef;
item?: ModelRef;
where: readonly DimensionValueRef[];
} & CommerceBrand__7b1b990b7c90<"bound_catalog_rate">>;
Public export business.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L21.
declare const business: BusinessFunction__7e4f3d5c2657;
Public export BusinessSpecJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L395.
export type BusinessSpecJson = {
business: BusinessBlockJson__a04690090fc8;
gateway?: {
authHeader?: string;
upstreamAuth?: {
type: "none" | "static_bearer";
token?: string;
};
};
metering?: {
meters?: MeterDefinitionJson[];
billOn4xx?: boolean;
};
/** BYO-Backend V1 — first-class backend declarations keyed by backend id.
* Emitted only when at least one backend is declared (so single-backend /
* no-backend products keep their pre-BYOB irHash). */
backend?: Record<string, BackendDefinitionJson>;
resources?: CountedResourceJson__90d0b7f16d08[];
/** Repo-owned custom permission subjects. Emitted (sorted by subject) only
* when at least one permission-carrying group is declared, so businesses
* without permission groups keep their pre-cutover irHash. */
permissions?: PermissionSubjectJson__d124b4a2259d[];
policies?: BusinessPoliciesJson__0d51efe66230;
customer_context?: BusinessCustomerContextJson__e5b9539124a5;
plans?: PlanSpecJson[];
/** Advanced/internal platform-schema blocks (usage, billing,
* environments, lifecycle, ephemeral, …) are validated by the platform
* schema but are not authorable through the functional SDK. */
[key: string]: unknown;
};
Public export CacheProfile.
Declaration source: packages/business/dist/types/ir-types.d.ts#L3.
export type CacheProfile = "long" | "short" | "blocking";
Public export canonicalIrJson.
Declaration source: packages/business/dist/types/validate.d.ts#L68.
export declare function canonicalIrJson(ir: unknown): string;
Public export CatalogSelectorRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L52.
export type CatalogSelectorRef = ModelRef | DimensionValueRef;
One authored tier bracket: `upTo` is the inclusive cumulative upper bound; `null` = open-ended final tier.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L12.
export type CatalogTierInput = Readonly<{
upTo: number | null;
rate: UnboundRateRef;
}>;
Public export commerceSnapshotOf.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L22.
export declare function commerceSnapshotOf(businessValue: CompiledBusiness__671c1daa22b7): CommerceAuthoringSnapshot__60159f2d0d70 | null;
Public export dimension.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L4.
export declare function dimension(key: string, options?: Readonly<{
values?: readonly string[];
}>): DimensionRef;
Public export DimensionConditionRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L31.
export type DimensionConditionRef = Readonly<{
kind: "dimension_condition";
dimension: DimensionRef;
value: string;
} & CommerceBrand__7b1b990b7c90<"dimension_condition">>;
Public export DimensionRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L36.
export type DimensionRef = Readonly<{
kind: "dimension";
key: string;
value(value: string): DimensionValueRef;
is(value: string): DimensionConditionRef;
} & CommerceBrand__7b1b990b7c90<"dimension">>;
Public export DimensionValueRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L26.
export type DimensionValueRef = Readonly<{
kind: "dimension_value";
dimension: DimensionRef;
value: string;
} & CommerceBrand__7b1b990b7c90<"dimension_value">>;
Public export disclosure.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L59.
declare const disclosure: Readonly<{
opaque: DisclosureRef;
transparent: DisclosureRef;
}>;
Public export DisclosureRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L118.
export type DisclosureRef = Readonly<{
kind: "disclosure";
disclosure: "opaque" | "transparent";
} & CommerceBrand__7b1b990b7c90<"disclosure">>;
Public export display.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L54.
declare const display: Readonly<{
multiplier(options: Readonly<{
factor: number;
}>): MultiplierDisplayRef;
}>;
Public export ExactCatalogTiers.
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L5.
export type ExactCatalogTiers = Readonly<{
strategy: "graduated" | "volume_retroactive";
tiers: readonly Readonly<{
upTo: string | null;
rate: ExactRate;
}>[];
}>;
Public export ExactRate.
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L1.
export type ExactRate = Readonly<{
num: string;
den: string;
}>;
Public export exhaustion.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L67.
declare const exhaustion: Readonly<{
block: ExhaustionRef;
overage(binding: PricingBindingRef): ExhaustionRef;
}>;
Public export ExhaustionRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L122.
export type ExhaustionRef = Readonly<{
kind: "exhaustion";
behavior: "block" | "overage";
} & CommerceBrand__7b1b990b7c90<"exhaustion">>;
The zero recurring price. Only meaningful on a `plan.kind.free` plan,
where it is optional (a free plan needs no price control at all); every
other kind states its price with `money.usd(...)`.
Declaration source: packages/business/dist/types/value-model/money.d.ts#L31.
export declare function free(): AuthoredPrice__fa4522a263d6;
Public export frontendIntegration.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L67.
export declare function frontendIntegration(id: string, options: FrontendIntegrationOptions): FrontendIntegrationRef;
Public export FrontendIntegrationInjectionJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L159.
export type FrontendIntegrationInjectionJson = {
secretRef: string;
location: "header";
name: string;
template: "{value}" | "Bearer {value}";
} | {
secretRef: string;
location: "query";
name: string;
};
Public export FrontendIntegrationOperationJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L152.
export type FrontendIntegrationOperationJson = {
method: FrontendIntegrationMethodJson__404791a522ea;
path: string;
headers: string[];
query: string[];
body: FrontendIntegrationBodyJson__412664c4c97a;
};
Public export FrontendIntegrationOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L43.
export type FrontendIntegrationOptions = Omit<FrontendIntegrationSpecJson, "id" | "request" | "response"> & {
request: {
operations: ReadonlyArray<Omit<FrontendIntegrationSpecJson["request"]["operations"][number], "headers" | "query" | "body"> & {
headers?: readonly string[];
query?: readonly string[];
body: FrontendIntegrationBodyOptions__69124a73fbef;
}>;
};
response: Omit<FrontendIntegrationSpecJson["response"], "contentTypes" | "jsonPointers" | "responseHeaders"> & {
contentTypes: readonly string[];
jsonPointers: readonly string[];
responseHeaders?: readonly string[];
};
/** Integration calls are always platform-only and cannot carry customer economics. */
costs?: never;
reports?: never;
usagePolicy?: never;
creates?: never;
deletes?: never;
};
Public export FrontendIntegrationRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L43.
export type FrontendIntegrationRef = DeclarationRef__2a230f417174<"frontend_integration">;
Secret-value-free mirror of contracts' FrontendIntegrationSpec.
Declaration source: packages/business/dist/types/ir-types.d.ts#L170.
export type FrontendIntegrationSpecJson = {
id: string;
upstream: string;
request: {
operations: FrontendIntegrationOperationJson[];
};
injection: FrontendIntegrationInjectionJson;
response: {
kind: "json";
contentTypes: string[];
maxBytes: number;
jsonPointers: string[];
responseHeaders: string[];
};
};
Public export FunctionalBackendOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L12.
export type FunctionalBackendOptions = Omit<BackendOptions__63ffee6039bc, "meters"> & {
meters?: MeterRef[];
};
Public export FunctionalBusinessOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L8.
export type FunctionalBusinessOptions = BusinessOptions__bbd5a4a3592b;
Public export FunctionalGroupOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L89.
export type FunctionalGroupOptions = {
permission?: FunctionalGroupPermissionOptions;
};
Repo-owned raw permission vocabulary — the `permission` option of
`fs.group`. This declaration never creates a role, chooses a default role,
or assigns a user. Each subscribing organization composes these permissions
into its own CUSTOM roles at runtime.
Declaring it makes the group id a custom permission subject: member routes
are gated at the gateway by `<id>:read|write`, and `verbs` are the EXTRA
grant-by-exact-name domain verbs the builder's own backend checks
(`read`/`write` are implied and may not be re-declared). Collisions with
the managed / platform permission vocabularies are rejected by the
platform compiler's validate pass.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L84.
export type FunctionalGroupPermissionOptions = {
verbs?: readonly string[];
escalatory?: readonly string[];
description?: string;
};
Public export FunctionalMeterOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L15.
export type FunctionalMeterOptions = Omit<MeterOptions__b9495f4ba34f, "pairsWith" | "estimate"> & {
pairsWith?: MeterRef;
};
Public export FunctionalMeterRoutesOptions.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L28.
export type FunctionalMeterRoutesOptions = Pick<FunctionalRouteOptions, "reports" | "costs" | "onStatusCodes" | "postStreamBilling">;
Public export FunctionalRequestMeterOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L18.
export type FunctionalRequestMeterOptions = Omit<RequestMeterOptions__7ec5d6047951, "estimate">;
Public export FunctionalResourceOptions.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L9.
export type FunctionalResourceOptions = ResourceOptions__04a2cc1fd6ee & {
cap?: ResourceOptions__04a2cc1fd6ee["scope"];
};
Public export FunctionalRouteLimitAuthoring.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L26.
export type FunctionalRouteLimitAuthoring = Extract<RouteLimitAuthoring__ae39586db789, string> | FunctionalRouteLimitInput;
Public export FunctionalRouteLimitInput.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L23.
export type FunctionalRouteLimitInput = Omit<RouteLimitInput__250d9325480a, "dimension"> & {
dimension?: MeterRef;
};
Public export FunctionalRouteOptions.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L7.
export type FunctionalRouteOptions = Omit<RouteOptions__8ba341feca83, "action" | "backend" | "reports" | "costs" | "rateLimit" | "quota" | "limits" | "surfaces"> & {
action?: string;
/** Repo-owned custom permissions — require ONE of the route's permission
* group's declared verbs at the gateway for this operation, instead of the
* method-derived read/write default. Only valid on a route that is a
* member of a permission-carrying group declaring the verb. */
permission?: string;
backend?: BackendRef;
reports?: MeterRef | readonly MeterRef[];
costs?: MeterCost | readonly MeterCost[];
rateLimit?: FunctionalRouteLimitAuthoring;
quota?: FunctionalRouteLimitAuthoring;
creates?: ResourceRef;
deletes?: ResourceRef;
surfaces?: RouteOptions__8ba341feca83["surfaces"];
};
Public export FundingBucketRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L114.
export type FundingBucketRef = Readonly<{
kind: "funding_bucket";
bucketKind: FundingBucketKind__eced6b195b95;
} & CommerceBrand__7b1b990b7c90<"funding_bucket">>;
Public export group.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L92.
export declare function group(id: string, members: readonly (RouteRef | GroupRef)[], options?: FunctionalGroupOptions): GroupRef;
Public export GroupRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L36.
export type GroupRef = DeclarationRef__2a230f417174<"group">;
Public export hashIr.
Declaration source: packages/business/dist/types/validate.d.ts#L67.
export declare function hashIr(ir: unknown): string;
Public export HttpMethod.
Declaration source: packages/business/dist/types/ir-types.d.ts#L1.
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
Public export included.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L46.
export declare function included(amount: AuthoredMoneyAmount, options?: Readonly<{
display?: MultiplierDisplayRef;
}>): FundingBucketRef;
Public export LimitStrategy.
Declaration source: packages/business/dist/types/limit-strategy.d.ts#L1.
export type LimitStrategy = "fixed_window" | "sliding_window" | "token_bucket";
Thrown on builder misuse (duplicate keys, unknown refs) at call time.
Declaration source: packages/business/dist/types/errors.d.ts#L19.
export declare class ManifestBuilderError extends Error {
readonly code: string;
constructor(message: string, code?: string);
}
Platform compiler result: the validated envelope plus its canonical hash.
Declaration source: packages/business/dist/types/ir-types.d.ts#L434.
export type ManifestBuildResult = {
ir: ManifestIrDocument;
irHash: string;
};
Public export ManifestIrDocument.
Declaration source: packages/business/dist/types/ir-types.d.ts#L425.
export type ManifestIrDocument = {
irVersion: 1;
sdkVersion: string;
business: BusinessSpecJson;
routes: RouteLayerJson[];
frontendIntegrations: FrontendIntegrationSpecJson[];
commerce: CommerceAuthoringSnapshot__60159f2d0d70;
};
One validation problem, in the platform's diagnostic envelope shape.
Declaration source: packages/business/dist/types/errors.d.ts#L2.
export type ManifestIssue = {
code: string;
path: string;
message: string;
/** Builder source that owns the invalid business definition, when known. */
source?: string;
};
Public export ManifestResourceGraphSnapshot.
Declaration source: packages/business/dist/types/resource-graph.d.ts#L11.
export type ManifestResourceGraphSnapshot = {
readonly nodes: readonly Omit<ManifestResourceNode__c5816bda01cb, "value">[];
};
Public export ManifestResourceKind.
Declaration source: packages/business/dist/types/resource-graph.d.ts#L1.
export type ManifestResourceKind = "business" | "meter" | "counted_resource" | "surface" | "route_layer" | "action" | "plan" | "backend" | "frontend_integration" | "permission_subject";
Public export ManifestResourceUrn.
Declaration source: packages/business/dist/types/resource-graph.d.ts#L2.
export type ManifestResourceUrn = `urn:farthershore:business:${ManifestResourceKind}:${string}`;
Thrown by the platform manifest compiler when the assembled manifest fails
schema validation. Plain-data `issues` so the error survives serialization
across the runner callback boundary.
Declaration source: packages/business/dist/types/errors.d.ts#L14.
export declare class ManifestValidationError extends Error {
readonly issues: ManifestIssue[];
constructor(issues: ManifestIssue[]);
}
Public export measure.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L3.
export declare function measure(key: string): MeasureRef;
Public export MeasureMaximumRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L21.
export type MeasureMaximumRef = Readonly<{
kind: "measure_maximum";
measure: MeasureRef;
maximum: number;
} & CommerceBrand__7b1b990b7c90<"measure_maximum">>;
Public export MeasureRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L16.
export type MeasureRef = Readonly<{
kind: "measure";
key: string;
atMost(maximum: number): MeasureMaximumRef;
} & CommerceBrand__7b1b990b7c90<"measure">>;
Public export meter.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L8.
declare const meter: MeterFunction__02c80dd4d01e;
Public export MeterCost.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L16.
export type MeterCost = {
readonly kind: "meter_cost";
readonly meter: MeterRef;
readonly value: number;
};
Public export MeterDefinitionJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L4.
export type MeterDefinitionJson = {
key: string;
display: string;
unit?: string;
routeDefault?: number;
enforcementType?: "exact_pre_request" | "estimated_then_settled" | "postpaid" | "strict_concurrency";
aggregation?: "SUM" | "COUNT" | "MAX" | "UNIQUE_COUNT" | "LATEST";
window?: "minute" | "hour" | "day" | "month" | "billing_period";
valueProperty?: string;
uniqueProperty?: string;
groupBy?: string[];
eventCode?: string;
/** Token category this meter measures, when it is a token meter. T5 covers
* the full token-accounting vocabulary: the input/output/total axes, the
* cache axes (`cached_read_input` / `cache_creation_input`), `context`, the
* output-budget axes (`max_output` / `estimated_output` / `actual_output`),
* and `streaming_output`. Mirrors `TOKEN_CATEGORIES` in contracts. */
tokenCategory?: "input" | "output" | "total" | "cached_read_input" | "cache_creation_input" | "context" | "max_output" | "estimated_output" | "actual_output" | "streaming_output";
/** How the gateway RESERVES units for this meter on an estimate-then-settle
* path: `reserve_max` (conservative worst-case) / `estimate` (heuristic) /
* `count_actual` (no reserve). T5 — authored per token category to its
* use-case: hard quota → `reserve_max` (optionally capped by
* `reserveCeiling`); soft billing → `estimate`; spend → `reserve_max`. */
reserveStrategy?: "reserve_max" | "estimate" | "count_actual";
/** T5 — optional configured reservation CEILING (meter's native unit) for a
* conservative `reserve_max` strategy that must not hold the full theoretical
* worst case. Positive integer. Omit ⇒ unbounded worst-case reserve. */
reserveCeiling?: number;
/** Key of a meter this one is paired with (e.g. an `input` token meter pairs
* with its `output` meter) so settlement / observability correlate the pair. */
pairsWith?: string;
};
Public export MeterLimit.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L11.
export type MeterLimit = {
readonly kind: "meter_limit";
readonly meter: MeterRef;
readonly value: PlanLimitJson;
};
`meter()` options. Every meter is structural (aggregation / window /
enforcement / unit — what routes report and limits ration). Declaring
`measures` (and optionally `dimensions`) additionally makes it a PRICEABLE
measurement meter that `pricing()` catalogs rate and
`meterRoutes(key, route, { reports })` binds.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L87.
export type MeterOptions = FunctionalMeterOptions & Readonly<{
measures?: readonly MeasureRef[];
dimensions?: readonly DimensionRef[];
}>;
Public export MeterRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L26.
export type MeterRef = DeclarationRef__2a230f417174<"meter"> & {
fixed(value: number): MeterCost;
perSecond(value: number, options?: TemporalLimitOptions): MeterLimit;
perMinute(value: number, options?: TemporalLimitOptions): MeterLimit;
perHour(value: number, options?: TemporalLimitOptions): MeterLimit;
perDay(value: number, options?: TemporalLimitOptions): MeterLimit;
perWeek(value: number, options?: TemporalLimitOptions): MeterLimit;
perMonth(value: number, options?: TemporalLimitOptions): MeterLimit;
};
`meterRoutes(key, routeRef, options)` — a concrete route's commerce
metering binding.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L163.
export type MeterRouteBindingOptions = Readonly<{
/** Priceable meters (declared with `measures`) this route reports. */
reports: readonly MeterRef[];
maxOutputUnits?: MeasureMaximumRef;
/** FAR-909 — finite route_cap admission bounds for measures the client cannot declare. */
caps?: readonly MeasureMaximumRef[];
/**
* FAR-911 (H5) — the request-side clamp binding for `maxOutputUnits`: names
* the compiled admission knob `max_output_units` and the ONE gateway
* parser/mutator that reads and rewrites the request body's output-unit
* limit (`json_body_max_output_units_v1`: the JSON body's canonical
* output-unit field — for LLM chat/stream routes the `max_tokens` /
* `max_output_tokens` protocol aliases — parsed as a non-negative integer,
* clamped DOWN to the declared bound, and rewritten before upstream
* signing; a missing knob is set to the bound). Builders never name a raw
* JSON path: the route adapter owns protocol aliases. Compile-time only on
* this branch — the gateway consumer is FAR-905
* (`far905-requires-clamp-consumer.pending-gate.test.ts`); until it lands,
* a client that exceeds a declared bound is TERMINAL-QUARANTINED at
* ingestion (`ADMISSION_BOUND_BREACHED`, fail-closed, unbilled), never
* over-debited.
*/
maxOutputUnitsAdapter?: Readonly<{
knob: "max_output_units";
parser: "json_body_max_output_units_v1";
mutator: "json_body_max_output_units_v1";
}>;
/**
* FAR-911 (H3) — chunked top-up instead of a declared `maxOutputUnits`:
* `bound` is the cumulative per-operation ceiling (`out.atMost(65536)`),
* `chunkUnits` the initial reservation; the cumulative ceiling is funded
* before the first response byte. Exclusive with `maxOutputUnits`.
*/
chunkPolicy?: Readonly<{
bound: MeasureMaximumRef;
chunkUnits: number;
}>;
/**
* FAR-911 (H3) — post-stream measurement timing. `settlementMax` declares
* the finite per-measure settlement maxima prepaid/x402 plans require.
*/
postStream?: Readonly<{
settlementMax?: readonly MeasureMaximumRef[];
}>;
}>;
THE meterRoutes verb — always `(key, target, options)` with an
author-supplied stable key. A concrete `route()` ref target is a COMMERCE
METERING BINDING (`reports` name priceable meters; admission bounds via
`maxOutputUnits` / `caps` / `chunkPolicy` / `postStream`). A wildcard path,
group ref, or array target is a STRUCTURAL OVERLAY on the matched routes
(`reports` / `costs` / `onStatusCodes` / `postStreamBilling`) — the
route-layer overlay under `key`.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L20.
declare const meterRoutes: MeterRoutesFunction__799abcbb8f6e;
Structural overlay targets: a wildcard path, a group ref, or an array of
paths / route refs / group refs. A single `route()` ref is a commerce
metering binding instead (see {@link MeterRouteBindingOptions}).
Declaration source: packages/business/dist/types/commerce/types.d.ts#L224.
export type MeterRoutesOverlayTarget = Exclude<MeterRoutesTarget, RouteRef>;
Public export MeterRoutesTarget.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L27.
export type MeterRoutesTarget = string | RouteRef | GroupRef | readonly (string | RouteRef | GroupRef)[];
Public export ModelRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L42.
export type ModelRef = Readonly<{
kind: "model";
provider: ProviderRef;
key: string;
} & CommerceBrand__7b1b990b7c90<"model">>;
Public export modifier.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L43.
declare const modifier: Readonly<{
multiplier(numerator: number, denominator: number): ModifierBuilder__ae4a0e208869;
}>;
Public export ModifierRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L72.
export type ModifierRef = Readonly<{
kind: "pricing_modifier";
multiplier: ExactRate;
when: DimensionConditionRef;
} & CommerceBrand__7b1b990b7c90<"pricing_modifier">>;
Public export money.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L23.
declare const money: MoneyFunction__dc62d2738f6d;
Public export MultiplierDisplayRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L110.
export type MultiplierDisplayRef = Readonly<{
kind: "multiplier_display";
factor: number;
} & CommerceBrand__7b1b990b7c90<"multiplier_display">>;
Public export MutationClass.
Declaration source: packages/business/dist/types/ir-types.d.ts#L2.
export type MutationClass = "runtime" | "contractual";
Validate and presence-preservingly copy the temporal limit fields. A
resolved quota-length window rejects `token_bucket` up front (mirrors Core
`requireQuotaWindowStrategy`), including custom windows. `cell` carries the
surrounding limit's `capacity` + the dimension's `aggregation` so the
coherence rules Core enforces at publish also fail the local build.
Declaration source: packages/business/dist/types/limit-strategy.d.ts#L31.
export declare function normalizeTemporalLimitOptions(options: TemporalLimitOptions, context: string, windowSeconds?: number, cell?: {
capacity?: number;
aggregation?: string;
}): TemporalLimitOptions;
Public export plan.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L10.
declare const plan: PlanFunction__9b23957fc098;
A3 — per-request capacity ceiling authored on a plan. Mirrors the contracts
`planCapacitySchema` (ceilings + enforce/track + failMode + T9
`tokenCountSource` + T12 `scope`) WITHOUT the compiler-owned `kind` /
`provenance` discriminators. The core compiler turns it into a
`{ kind: "capacity", …, provenance: "plan" }` ConstraintSpec. At least one
ceiling must be present.
Declaration source: packages/business/dist/types/ir-types.d.ts#L52.
export type PlanCapacityJson = {
maxInputTokens?: number;
maxOutputTokens?: number;
maxContextTokens?: number;
maxPayloadBytes?: number;
enforcement?: "enforce" | "track";
failMode?: "open" | "closed";
/** T9 — confidence input: `declared` (exact) vs `estimated` (tokenizer). */
tokenCountSource?: "declared" | "estimated";
/** T12 — FORWARD-COMPAT scope hint. */
scope?: LimitScopeJson__215e4eb2041c;
};
The DECLARED plan kind (`plan.kind.*`). Carried on the Manifest IR plan
and on the commerce manifest; surfaces read it, nothing infers it.
Declaration source: packages/business/dist/types/ir-types.d.ts#L66.
export type PlanKindJson = "free" | "flat" | "usage" | "prepaid" | "hybrid" | "trial" | "custom";
Public export PlanKindRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L131.
export type PlanKindRef<Name extends PlanKindName__d0fd9bcc38b8 = PlanKindName__d0fd9bcc38b8> = Readonly<{
kind: "plan_kind";
name: Name;
} & CommerceBrand__7b1b990b7c90<`plan_kind:${Name}`>>;
Public export PlanLimitJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L75.
export type PlanLimitJson = {
dimension: string;
window: PlanLimitWindowJson__34c3ba9c4506;
capacity: number;
enforcement?: "enforce" | "track";
/** A3 — optional WARN threshold as a fraction of `capacity` in [0, 1]. The
* core compiler threads it onto the emitted rate_limit / quota constraint's
* `warnAt`. Advisory only; never denies. Optional + additive. */
warnAt?: number;
strategy?: "fixed_window" | "sliding_window" | "token_bucket";
bucketCapacity?: number;
refillRatePerSecond?: number;
/** T12 — optional FORWARD-COMPAT scope hint. The core compiler threads it onto
* the emitted rate_limit / quota constraint's `scope`. v1 enforcement is
* unchanged. Optional + additive. */
scope?: LimitScopeJson__215e4eb2041c;
reset_trigger?: "billing_period" | "subscription_start";
};
`plan()` options — the DECLARED `kind` (required), the five economics
controls, and the structural (entitlement) half: what the plan grants and
how it rations. Usage money is only ever `usagePricing` / `funding` /
`spendPolicy`; there is no per-meter rate on a plan.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L158.
export type PlanOptions = PlanEconomicsControls__792c3ab4d885 & Readonly<{
kind: PlanKindRef;
}> & Readonly<Pick<StructuralPlanOptions__f7824ff3bdd0, "name" | "description" | "details" | "grants" | "limits" | "capacity" | "maxMonthlySpendCents" | "minMonthlySpendCents" | "selfServeEnabled" | "archive">>;
Public export PlanRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L37.
export type PlanRef = DeclarationRef__2a230f417174<"plan">;
Public export PlanSpecJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L113.
export type PlanSpecJson = {
key: string;
/** The DECLARED plan kind. Required: a plan is free / flat / usage / …
* because the builder said so, never because of its shape. Usage money
* never lives on the plan; it is commerce-manifest owned. */
kind: PlanKindJson;
description?: string;
details?: string[];
recurring_fee_cents?: number;
billing_interval?: "month" | "year";
trial_days?: number;
max_monthly_spend_cents?: number;
min_monthly_spend_cents?: number;
limits?: PlanLimitJson[];
/** Additive v2 direct grants using stable route ids. */
routeGrants?: string[];
/** Named managed-frontend integrations this plan permits. */
frontendIntegrationGrants?: string[];
resource_limits?: Record<string, number>;
/** A3 — per-request capacity ceiling. Compiles to a `{ kind: "capacity" }`
* ConstraintSpec the gateway enforces (413 `request_too_large`). */
capacity?: PlanCapacityJson;
overageBehavior?: "block" | "allow_and_bill";
selfServeEnabled?: boolean;
archive?: PlanArchiveJson__452830f6517f;
/** Escape hatch: future fields ride through here. `variants` was removed and is rejected at validation. */
[key: string]: unknown;
};
Public export prepaid.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L49.
export declare function prepaid(amount: AuthoredMoneyAmount, options?: Readonly<{
topUp?: boolean;
}>): FundingBucketRef;
Public export pricing.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L9.
export declare function pricing(key: string, options: PricingOptions): PricingRef;
Public export PricingBindingRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L97.
export type PricingBindingRef = Readonly<{
kind: "pricing_binding";
binding: PricingBindingKind__ff438801f484;
pricing: PricingRef;
version?: number;
} & CommerceBrand__7b1b990b7c90<"pricing_binding">>;
Public export PricingOptions.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L92.
export type PricingOptions = Readonly<{
/** A meter declared with `measures` (priceable). */
meter: MeterRef;
catalog: readonly PricingCatalogAuthoringEntry__8ad295725f7a[];
}>;
Public export PricingRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L103.
export type PricingRef = Readonly<{
kind: "pricing";
key: string;
current(): PricingBindingRef;
withContractTerms(): PricingBindingRef;
fixedVersion(version: number): PricingBindingRef;
} & CommerceBrand__7b1b990b7c90<"pricing">>;
Public export promo.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L52.
export declare function promo(amount: AuthoredMoneyAmount): FundingBucketRef;
Public export provider.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L7.
export declare function provider(key: string): ProviderRef;
Public export ProviderRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L47.
export type ProviderRef = Readonly<{
kind: "provider";
key: string;
model(key: string): ModelRef;
} & CommerceBrand__7b1b990b7c90<"provider">>;
FAR-911 — admission-rail constants for `spendPolicy.rail`.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L64.
declare const rail: Readonly<{
x402: RailRef;
}>;
FAR-911 — admission rail constant (`rail.x402`): every op is funded before it runs.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L127.
export type RailRef = Readonly<{
kind: "admission_rail";
rail: "x402";
} & CommerceBrand__7b1b990b7c90<"admission_rail">>;
Public export rate.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L24.
declare const rate: Readonly<{
perUnit(amount: AuthoredMoneyAmount): UnboundRateRef;
perMillion(amount: AuthoredMoneyAmount): UnboundRateRef;
per(unitCount: number, amount: AuthoredMoneyAmount): UnboundRateRef;
rational(numerator: number, denominator: number, amount: AuthoredMoneyAmount): UnboundRateRef;
/** FAR-909 — graduated tiers: each unit rated by the tier its cumulative window position falls in. */
graduated(tiers: readonly CatalogTierInput[]): UnboundRateRef;
/** FAR-909 — volume (retroactive) tiers: every unit rated at the tier the window total selects at close. */
volume(tiers: readonly CatalogTierInput[]): UnboundRateRef;
/**
* FAR-911 / M5 — bounded backend quote: the backend proposes a per-unit
* rate per report; Core clamps it into `[min, max]` (SDK-created flat
* rates, USD per unit) and dispute-flags out-of-range proposals.
*/
backendQuoted(bounds: Readonly<{
min: UnboundRateRef;
max: UnboundRateRef;
}>): UnboundRateRef;
}>;
Public export referral.
Declaration source: packages/business/dist/types/commerce/authoring.d.ts#L53.
export declare function referral(amount: AuthoredMoneyAmount): FundingBucketRef;
Public export requests.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L64.
export declare function requests(options?: FunctionalRequestMeterOptions): MeterRef;
Public export resource.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L65.
export declare function resource(id: string, options?: FunctionalResourceOptions): ResourceRef;
The declaration graph behind a compiled business — every node's URN, kind,
key, `dependsOn` edges, and declaration order.
This is the SDK's internal representation, exposed for inspection: tooling and
agents can reason about what a business declares and how its pieces reference
each other without re-parsing the Manifest IR (where branded refs have already
collapsed to plain strings, and `group()` / `meterRoutes()` have been erased
entirely).
Node payloads are NOT included — `snapshot()` strips `value`, so this is
structure only. The Manifest IR remains the wire format and the only thing
Core consumes.
Returns `null` for a value that is not an authentic `fs.business()` result.
For a deferred (folder-discovered) program the graph is captured when the
manifest materializes, so call `compileBusinessToManifest` first if you need
it before anything else has forced materialization.
Declaration source: packages/business/dist/types/business.d.ts#L133.
export declare function resourceGraphOf(business: CompiledBusiness__671c1daa22b7): ManifestResourceGraphSnapshot | null;
Public export ResourceLimit.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L21.
export type ResourceLimit = {
readonly kind: "resource_limit";
readonly resource: ResourceRef;
readonly count: number;
};
Public export ResourceRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L38.
export type ResourceRef = DeclarationRef__2a230f417174<"resource"> & {
/** Maximum number of this persistent resource a subscription may own. */
max(count: number): ResourceLimit;
};
Public export route.
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L68.
export declare function route(path: string, operations: RouteOperations): RouteRef;
Public export RouteDefinitionJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L225.
export type RouteDefinitionJson = {
match: {
method: HttpMethod;
path: string;
};
metering?: {
defaults?: Record<string, number>;
reports?: string[];
onStatusCodes?: string | number[];
/** The authoritative billable units arrive through the attested
* post-stream reporter. The in-band gateway event remains reserve-only. */
postStreamBilling?: boolean;
};
/** Explicit billing semantics belong to the route, not the metering block;
* contracts reparses route layers strictly enough to strip unknown nested
* keys, which would silently turn authored free operations into inferred
* billable metered operations. */
usagePolicy?: RouteUsagePolicyJson__bd930ebf5713;
unmetered?: boolean;
inheritDefaultMeters?: boolean;
action?: string;
/** Repo-owned custom permissions — stamped by lowering when this route is a
* member of a permission-carrying `fs.group`. The gateway gates the route
* on `<permissionSubject>:read|write`; metering/grant identity (`action` /
* canonical method+path) is untouched. Never authored directly on a route. */
permissionSubject?: string;
/** Repo-owned custom permissions — gateway-required verb override for this
* operation (`<permissionSubject>:<permissionVerb>` instead of the
* method-derived read/write). Present only with `permissionSubject`. */
permissionVerb?: string;
/** BYO-Backend V1 — route→backend binding id. Omitted = the sole / default
* backend (single-backend businesses stay zero-config). */
backend?: string;
/** Canonical per-route auth/timeout/retry policy (FAR-680). Omitted when no
* policy intent was authored — keeps the IR (and irHash) byte-identical. */
policy?: RoutePolicyJson;
/** FAR-684 — canonical per-route rate/quota overrides, normalized from
* `rateLimit` / `quota` sugar. Omitted when the route authored none — keeps
* the IR (and irHash) byte-identical. */
limits?: RouteLimitJson__077809c9f639[];
};
Public export RouteLayerJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L340.
export type RouteLayerJson = {
description?: string;
mutation_class?: MutationClass;
cacheProfile?: CacheProfile;
routes: RouteDefinitionJson[];
runtime?: {
rollout_key?: string;
required_flags?: string[];
};
actions?: ActionSpecJson__e01b08e9d184[];
/** Layer-level default backend binding; exact routes may override it. */
backend?: string;
};
Public export RouteOperations.
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L30.
export type RouteOperations = Partial<Record<"get" | "post" | "put" | "patch" | "delete" | "head" | "options", RouteOperationOptions__902951868956>>;
Public export RoutePolicyJson.
Declaration source: packages/business/dist/types/ir-types.d.ts#L206.
export type RoutePolicyJson = {
authMode?: "public" | "required";
timeoutMs?: number;
idleTimeoutMs?: number;
retry?: RouteRetryPolicyJson;
/** Consumer-principal subject requirement the gateway enforces (403
* `member_subject_required` / `service_subject_required`). OMITTED when the
* route imposes no requirement ("any") — absence-vs-presence is the only
* irHash signal, so a route with no subject requirement stays byte-identical. */
subject?: "member" | "service";
/** CALLABILITY axis — allowlist of credential surfaces the gateway admits.
* OMITTED = all admitted (the implicit "hybrid" state). Emitted as a
* non-empty, deduped, canonically-sorted array so the irHash is stable. */
surfaces?: RouteSurface__b5c8a54b503c[];
/** VISIBILITY axis — true excludes the route from generated docs + grantable
* API-key scopes, and makes a callability deny return 404 (not 403). OMITTED
* when the route is visible, so a listed route stays byte-identical. */
hidden?: boolean;
};
Public export RouteRef.
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L35.
export type RouteRef = DeclarationRef__2a230f417174<"route">;
Retry conditions the canonical retry policy fires on (FAR-680).
Declaration source: packages/business/dist/types/ir-types.d.ts#L186.
export type RouteRetryOnJson = "network" | "5xx";
CANONICAL retry policy — the explicit IR shape SDK sugar normalizes into
and FAR-689 consumes. Never hand-authored; `retry: true` expands to it.
Declaration source: packages/business/dist/types/ir-types.d.ts#L189.
export type RouteRetryPolicyJson = {
maxAttempts: number;
retryOn: RouteRetryOnJson[];
backoff: {
base: number;
max: number;
jitter: number;
};
budgetRatio: number;
};
Public export scope.
Declaration source: packages/business/dist/types/value-model/constants.d.ts#L5.
declare const scope: Readonly<{
subscription: "subscription";
subject: "subject";
}>;
Public export SDK_VERSION.
Declaration source: packages/business/dist/types/version.d.ts#L1.
declare const SDK_VERSION: string;
Public export surfaces.
Declaration source: packages/business/dist/types/value-model/constants.d.ts#L1.
declare const surfaces: Readonly<{
ui: "ui";
api: "api";
}>;
Public export TemporalLimitOptions.
Declaration source: packages/business/dist/types/limit-strategy.d.ts#L2.
export type TemporalLimitOptions = {
/** Temporal accounting strategy. Omitted preserves fixed-window IR. */
strategy?: LimitStrategy;
/** Token-bucket burst capacity. Valid only with `token_bucket`. */
bucketCapacity?: number;
/** Token-bucket steady-state refill rate in units per second. */
refillRatePerSecond?: number;
};
Public export UnboundRateRef.
Declaration source: packages/business/dist/types/commerce/types.d.ts#L53.
export type UnboundRateRef = Readonly<{
kind: "catalog_rate";
/** Flat per-unit rate; absent when `tiers` is present. */
rate?: ExactRate;
/** Tiered pricing model (FAR-909); absent when `rate` is present. */
tiers?: ExactCatalogTiers;
/** Bounded backend-quoted rule (FAR-911); absent when `rate`/`tiers` is present. */
quote?: ExactQuoteBounds__e9cf817917c1;
for(measure: MeasureRef, ...selectors: readonly CatalogSelectorRef[]): BoundRateRef;
} & CommerceBrand__7b1b990b7c90<"catalog_rate">>;
Validate a candidate envelope against the platform schemas. On success
the returned `ir` is the JSON-normalized ORIGINAL candidate — NOT the
zod-parsed value. The platform treats the business spec as a raw document
because the YAML path never zod-transformed it before storing/compiling.
Validation proves the document is acceptable; the bytes stay the author's.
Declaration source: packages/business/dist/types/validate.d.ts#L18.
export declare function validateManifestIr(candidate: unknown): ValidationResult;
BUILD-completeness check (distinct from the structural `validateManifestIr`
above): emit an `error` issue for every plan missing a `limits[]` rule, using
the shared `isCompletePlanRateLimit` predicate so the LOCAL build matches the
PUBLISH gate exactly (`isCompletePlanRateLimit`, apps/core
`services/plan-rate-limit.ts`). A limitless plan thus fails at author/build
time instead of passing locally and only failing at push. The predicate is
the single source of truth in `@farthershore/contracts/plans`, so local ==
publish by construction.
It is run by the build entry (`farthershore build` → src/bin.ts) AFTER a
clean `compileBusinessToManifest`, NOT folded into the platform compiler's
structural validation: the compiler's direct callers (and the golden
IR-equivalence fixtures) compile minimal, intentionally-limitless products
to assert IR byte-identity, and must stay free of the completeness gate.
The hint names the plan + shows the minimal structured `limits` shape.
Declaration source: packages/business/dist/types/validate.d.ts#L37.
export declare function validatePlanRateLimitCompleteness(ir: ManifestIrDocument): ManifestIssue[];
Public export ValidationResult.
Declaration source: packages/business/dist/types/validate.d.ts#L3.
export type ValidationResult = {
ok: true;
ir: ManifestIrDocument;
irHash: string;
} | {
ok: false;
issues: ManifestIssue[];
};
These declarations explain types reachable from the public exports above. They are source evidence, not supported package imports. Suffixed names are documentation identifiers that preserve distinct lexical bindings. Standard-library and third-party types (for example Promise, React and Zod) remain external boundaries; their implementation declarations are not expanded here.
Declaration source: packages/business/dist/types/ir-types.d.ts#L323.
export type ActionSpecJson__e01b08e9d184 = {
id: string;
title?: string;
kind: "query" | "mutation";
actorType?: string;
subject?: {
type: string;
from: "header" | "path_param";
name: string;
};
inputSchemaRef?: string;
audit?: "none" | "metadata" | "full";
resource?: {
resource: string;
effect: "create" | "delete";
};
};
Declaration source: packages/business/dist/types/value-model/money.d.ts#L3.
declare const AUTHENTIC_PRICE__9ac77f4b80b2: unique symbol;
Declaration source: packages/business/dist/types/value-model/money.d.ts#L4.
export type AuthoredPrice__fa4522a263d6 = Readonly<PriceSpec__1288e85e83b9 & {
readonly [AUTHENTIC_PRICE__9ac77f4b80b2]: true;
}>;
Declaration source: packages/business/dist/types/backend.d.ts#L8.
export type BackendOptions__63ffee6039bc = {
/** Human-friendly label (defaults to the id). */
name?: string;
/** Stable slug (defaults to the id). */
slug?: string;
transport?: BackendTransportOptions__6fbea01c7324;
/**
* Per-request gateway->backend signature verification. The JWKS + signer
* keystone is proven, so this is the HARD default: OMITTING it compiles to
* `verification: { required: true }` — the gateway signs every request, the
* backend fails closed, and `ctx.principal` is guaranteed. Set
* `verification: { required: false }` to opt a backend out (escape hatch).
*/
verification?: {
required?: boolean;
};
/** Meter allow-list. Omitted = all business meters allowed. */
meters?: Array<KeyRef__d164043d89c3 | MeterRef__af57686b0ce1>;
/** Marks this as the default backend when a business declares more than one. */
default?: boolean;
};
Declaration source: packages/business/dist/types/business.d.ts#L110.
export type BackendRef__376a47b9b8d4 = {
readonly kind: "backend";
readonly key: string;
};
Declaration source: packages/business/dist/types/backend.d.ts#L4.
export type BackendTransportOptions__6fbea01c7324 = {
mode?: BackendTransportModeJson;
runner?: BackendRunnerJson;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L383.
export type BusinessBlockJson__a04690090fc8 = {
visibility?: "public" | "private";
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L363.
export type BusinessChangeApprovalRiskJson__e8db37f1738a = "safe" | "non_blocking" | "economic_risk" | "blocking";
Declaration source: packages/business/dist/types/ir-types.d.ts#L362.
export type BusinessCleanupPolicyModeJson__41a5ae49826e = "report" | "pull_request";
Declaration source: packages/business/dist/types/ir-types.d.ts#L375.
export type BusinessCustomerContextJson__e5b9539124a5 = {
context_tokens?: {
enabled?: boolean;
};
portal_auth?: {
strategy: CustomerPortalAuthStrategyJson__c8cec76b5a5a;
};
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L229.
export type BusinessFunction__7e4f3d5c2657 = (options?: FunctionalBusinessOptions) => CompiledBusiness__671c1daa22b7;
Declaration source: packages/business/dist/types/business.d.ts#L35.
export type BusinessOptions__bbd5a4a3592b = {
visibility?: "public" | "private";
/** API-key header the gateway reads (default x-api-key). */
authHeader?: string;
upstreamAuth?: {
type: "none" | "static_bearer";
token?: string;
};
billOn4xx?: boolean;
/** Business operator policies, e.g. zero-traffic cleanup report/PR mode. */
operatorPolicies?: BusinessPoliciesJson__0d51efe66230;
/** Customer-context controls emitted as business.customer_context. */
customerContext?: {
contextTokens?: BusinessCustomerContextJson__e5b9539124a5["context_tokens"];
customerAuth?: BusinessCustomerContextJson__e5b9539124a5["portal_auth"];
};
billing?: {
applyLimitUpgradesInstantly?: boolean;
/** D4 — how plan changes cascade to EXISTING subscribers. Absent =
* platform default: auto-advance (economic changes reach existing
* subscribers at each one's next renewal — `period_end`; price
* decreases apply immediately). `immediate` on price
* increases / entitlement reductions requires the matching
* `allowImmediate*` consent flag (schema-enforced). Shape mirrors
* `subscriberChangePolicySchema` in @farthershore/contracts. */
subscriberChangePolicy?: SubscriberChangePolicyOptions__b422925d18da;
};
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L364.
export type BusinessPoliciesJson__0d51efe66230 = {
cleanup?: {
enabled?: boolean;
mode?: BusinessCleanupPolicyModeJson__41a5ae49826e;
};
change_approval?: {
auto_merge_max_risk?: "none" | "safe" | "non_blocking";
require_human_for?: BusinessChangeApprovalRiskJson__e8db37f1738a[];
};
};
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L92.
export type CommerceAuthoringSnapshot__60159f2d0d70 = Readonly<{
schemaVersion: 1;
measures: readonly Readonly<{
key: string;
}>[];
dimensions: readonly Readonly<{
key: string;
values?: readonly string[];
}>[];
providers: readonly Readonly<{
key: string;
models: readonly string[];
}>[];
meters: readonly Readonly<{
key: string;
measures: readonly string[];
dimensions: readonly string[];
}>[];
pricingPolicies: readonly LoweredPricingPolicy__51372c7aeb1f[];
plans: readonly LoweredPlan__acc0ad17968f[];
meterRouteBindings: readonly Readonly<{
key: string;
/** Served route keys — ONE per declared operation of the bound `route()`
* (`servedRouteKey`: the gateway route id, e.g. `POST /v1/chat`),
* sorted. Never a bare path. */
routeKeys: readonly string[];
reports: readonly string[];
caps?: readonly Readonly<{
measurementKey: string;
maximum: number;
}>[];
maxOutputUnits?: Readonly<{
measurementKey: string;
maximum: number;
adapter?: Readonly<{
knob: "max_output_units";
parser: "json_body_max_output_units_v1";
mutator: "json_body_max_output_units_v1";
}>;
}>;
}>[];
}>;
Declaration source: packages/business/dist/types/commerce/types.d.ts#L8.
type CommerceBrand__7b1b990b7c90<Name extends string> = {
readonly [commerceBrand__afc79e100d58]: Name;
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L7.
declare const commerceBrand__afc79e100d58: unique symbol;
Declaration source: packages/business/dist/types/business.d.ts#L7.
export type CompiledBusiness__671c1daa22b7 = Readonly<{
readonly kind: "business";
}>;
Declaration source: packages/business/dist/types/ir-types.d.ts#L354.
export type CountedResourceCountSourceJson__7b01580d882e = "reported" | "action_inferred";
Declaration source: packages/business/dist/types/ir-types.d.ts#L355.
export type CountedResourceJson__90d0b7f16d08 = {
name: string;
display?: string;
scope?: CountedResourceScopeJson__5c4e2863f653;
subjectType?: string;
countSource?: CountedResourceCountSourceJson__7b01580d882e;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L353.
export type CountedResourceScopeJson__5c4e2863f653 = "subscription" | "subject";
Declaration source: packages/business/dist/types/value-model/money.d.ts#L2.
export type Currency__c07b80881979 = "usd";
Declaration source: packages/business/dist/types/ir-types.d.ts#L374.
export type CustomerPortalAuthStrategyJson__c8cec76b5a5a = "clerk" | "test-personas";
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L5.
export type DeclarationRef__2a230f417174<K extends RefKind__6d76109c9bb1 = RefKind__6d76109c9bb1> = {
readonly kind: K;
readonly id: string;
readonly generation: number;
readonly [refBrand__3cba6d1ed1ab]: true;
};
Declaration source: packages/business/dist/types/route-policy.d.ts#L4.
export type DurationInput__9fbd3d189b84 = string | number;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L13.
export type ExactQuoteBounds__e9cf817917c1 = Readonly<{
kind: "backend_quoted";
min: ExactRate;
max: ExactRate;
}>;
Declaration source: packages/business/dist/types/ir-types.d.ts#L142.
export type FrontendIntegrationBodyJson__412664c4c97a = {
kind: "none";
} | {
kind: "json";
maxBytes: number;
} | {
kind: "text";
maxBytes: number;
contentTypes: string[];
};
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L36.
type FrontendIntegrationBodyOptions__69124a73fbef = Extract<FrontendIntegrationSpecJson["request"]["operations"][number]["body"], {
kind: "none" | "json";
}> | (Omit<Extract<FrontendIntegrationSpecJson["request"]["operations"][number]["body"], {
kind: "text";
}>, "contentTypes"> & {
contentTypes: readonly string[];
});
Declaration source: packages/business/dist/types/ir-types.d.ts#L141.
export type FrontendIntegrationMethodJson__404791a522ea = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L19.
export type FundingBucketKind__eced6b195b95 = "included" | "prepaid" | "promo" | "referral";
Declaration source: packages/business/dist/types/refs.d.ts#L1.
export type KeyRef__d164043d89c3 = string | {
key: string;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L40.
export type LimitScopeJson__215e4eb2041c = {
endpoint?: string;
apiKey?: string;
workspace?: string;
region?: string;
};
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L21.
export type LoweredCatalogCondition__91bc16beb904 = Readonly<{
dimensionKey: string;
value: string;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L25.
export type LoweredCatalogItem__4eb2f217a7cb = Readonly<{
provider: string;
model: string;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L53.
export type LoweredFundingBucket__ee3504094266 = Readonly<{
kind: FundingBucketKind__eced6b195b95;
currency: "usd";
amountMinor: number;
topUp?: boolean;
display?: Readonly<{
kind: "multiplier";
factor: number;
baseMinor: number;
}>;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L64.
export type LoweredPlan__acc0ad17968f = Readonly<{
key: string;
kind: PlanKindName__d0fd9bcc38b8;
price?: Readonly<{
currency: "usd";
interval: "month" | "year";
recurringFeeMinor: number;
}>;
usagePricing?: Readonly<{
kind: PricingBindingKind__ff438801f484;
pricingPolicyKey: string;
version?: number;
}>;
funding?: Readonly<{
buckets: readonly LoweredFundingBucket__ee3504094266[];
}>;
lifecycle?: Readonly<{
trialDays: number;
}>;
spendPolicy?: Readonly<{
disclosure?: "opaque" | "transparent";
rail?: "x402";
onExhaustion: Readonly<{
behavior: "block" | "overage";
pricingPolicyKey?: string;
}>;
}>;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L29.
export type LoweredPricingCatalogEntry__1d1b855a7ba8 = Readonly<{
key: string;
item?: LoweredCatalogItem__4eb2f217a7cb;
measurementKey: string;
where?: readonly LoweredCatalogCondition__91bc16beb904[];
rate?: ExactRate;
tiers?: ExactCatalogTiers;
quote?: ExactQuoteBounds__e9cf817917c1;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L38.
export type LoweredPricingModifier__1c95de5a5c16 = Readonly<{
multiplier: ExactRate;
when: Readonly<{
dimensionKey: string;
operator: "eq";
value: string;
}>;
}>;
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L46.
export type LoweredPricingPolicy__51372c7aeb1f = Readonly<{
key: string;
meterKey: string;
currency: "usd";
catalog: readonly LoweredPricingCatalogEntry__1d1b855a7ba8[];
modifiers: readonly LoweredPricingModifier__1c95de5a5c16[];
}>;
Declaration source: packages/business/dist/types/resource-graph.d.ts#L3.
export type ManifestResourceNode__c5816bda01cb<T = unknown> = {
readonly urn: ManifestResourceUrn;
readonly kind: ManifestResourceKind;
readonly key: string;
readonly value: T;
readonly dependsOn: readonly ManifestResourceUrn[];
readonly declarationOrder: number;
};
Declaration source: packages/business/dist/types/route-metering.d.ts#L5.
export type MeterCost__c48c806cf197 = {
readonly kind: "meter_cost";
readonly meter: string;
readonly value: number;
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L220.
export type MeterFunction__02c80dd4d01e = (id: string, options?: MeterOptions) => MeterRef;
Declaration source: packages/business/dist/types/business.d.ts#L63.
export type MeterOptions__b9495f4ba34f = Omit<MeterDefinitionJson, "key" | "display"> & {
display?: string;
};
Declaration source: packages/business/dist/types/route-metering.d.ts#L10.
export type MeterRef__af57686b0ce1 = {
readonly kind: "meter";
readonly key: string;
/** Fixed gateway-known usage for route/business defaults. */
fixed(value: number): MeterCost__c48c806cf197;
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L225.
export type MeterRoutesFunction__799abcbb8f6e = {
(key: string, target: RouteRef, options: MeterRouteBindingOptions): void;
(key: string, target: MeterRoutesOverlayTarget | GroupRef, options: FunctionalMeterRoutesOptions): void;
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L77.
export type ModifierBuilder__ae4a0e208869 = Readonly<{
when(condition: DimensionConditionRef): ModifierRef;
} & CommerceBrand__7b1b990b7c90<"modifier_builder">>;
Declaration source: packages/business/dist/types/value-model/money.d.ts#L11.
export type MoneyAmount__51964157493a = Readonly<{
currency: Currency__c07b80881979;
minor: number;
monthly(): MoneyPrice__4792013e3b32;
yearly(): MoneyPrice__4792013e3b32;
}>;
Declaration source: packages/business/dist/types/commerce/types.d.ts#L231.
export type MoneyFunction__dc62d2738f6d = Readonly<{
usd(major: number): AuthoredMoneyAmount;
}>;
Declaration source: packages/business/dist/types/value-model/money.d.ts#L7.
export type MoneyPrice__4792013e3b32 = Readonly<AuthoredPrice__fa4522a263d6 & {
currency: Currency__c07b80881979;
interval: "month" | "year";
}>;
Declaration source: packages/business/dist/types/ir-types.d.ts#L389.
export type PermissionSubjectJson__d124b4a2259d = {
subject: string;
verbs: string[];
escalatory?: string[];
description?: string;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L108.
export type PlanArchiveJson__452830f6517f = {
at?: string;
transitionTo?: string;
strategy?: "auto" | "explicit" | "block";
};
Declaration source: packages/business/dist/types/commerce/types.d.ts#L135.
type PlanEconomicsControls__792c3ab4d885 = Readonly<{
/** `money.usd(n).monthly()` / `.yearly()`; `free()` only on `kind: free`. */
price?: MoneyPrice__4792013e3b32 | AuthoredPrice__fa4522a263d6;
usagePricing?: PricingBindingRef;
funding?: {
buckets: readonly FundingBucketRef[];
};
lifecycle?: {
trialDays: number;
};
spendPolicy?: {
disclosure?: DisclosureRef;
/** FAR-911 — `rail.x402`: compile under the prepaid admission matrix rows. */
rail?: RailRef;
onExhaustion: ExhaustionRef;
};
}>;
Declaration source: packages/business/dist/types/commerce/types.d.ts#L208.
export type PlanFunction__9b23957fc098 = {
(id: string, options: PlanOptions): PlanRef;
readonly kind: Readonly<{
free: PlanKindRef<"free">;
flat: PlanKindRef<"flat">;
usage: PlanKindRef<"usage">;
prepaid: PlanKindRef<"prepaid">;
hybrid: PlanKindRef<"hybrid">;
trial: PlanKindRef<"trial">;
custom: PlanKindRef<"custom">;
}>;
};
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L20.
export type PlanKindName__d0fd9bcc38b8 = "free" | "flat" | "usage" | "prepaid" | "hybrid" | "trial" | "custom";
Declaration source: packages/business/dist/types/ir-types.d.ts#L67.
export type PlanLimitWindowJson__34c3ba9c4506 = {
type: "named";
name: "second" | "minute" | "hour" | "day" | "week" | "month";
} | {
type: "custom";
seconds: number;
label?: string;
};
Declaration source: packages/business/dist/types/business.d.ts#L75.
export type PlanOptions__0e8a3d72b1c6 = {
/** The DECLARED plan kind (`plan.kind.*`); never inferred from shape. */
kind: PlanKindJson;
name: string;
description?: string;
details?: string[];
/** The normalized recurring price spec. Omit for a 0-fee plan. */
price?: PriceSpec__1288e85e83b9;
trialDays?: number;
maxMonthlySpendCents?: number;
minMonthlySpendCents?: number;
limits?: PlanLimitJson[];
/** Direct grants using stable route ids. */
routeGrants?: string[];
/** Named managed-frontend integrations this plan permits. */
frontendIntegrationGrants?: string[];
resourceLimits?: Record<string, number>;
/** A3 — per-request capacity ceiling (normalized PlanCapacityJson). */
capacity?: PlanCapacityJson;
overageBehavior?: "block" | "allow_and_bill";
selfServeEnabled?: boolean;
archive?: {
at?: string;
transitionTo?: string;
strategy?: "auto" | "explicit" | "block";
};
};
Declaration source: packages/business/dist/types/price.d.ts#L9.
export type PriceSpec__1288e85e83b9 = {
recurring_fee_cents: number;
billing_interval: "month" | "year";
};
Declaration source: packages/business/dist/types/commerce/lowered-types.d.ts#L18.
export type PricingBindingKind__ff438801f484 = "current" | "current_with_contract_terms" | "fixed_version";
Declaration source: packages/business/dist/types/commerce/types.d.ts#L91.
export type PricingCatalogAuthoringEntry__8ad295725f7a = UnboundRateRef | BoundRateRef | ModifierRef;
Declaration source: packages/business/dist/types/route-policy.d.ts#L7.
export type RawRetryPolicyInput__d96fd6958073 = RouteRetryPolicyJson;
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L4.
declare const refBrand__3cba6d1ed1ab: unique symbol;
Declaration source: packages/business/dist/types/value-model/refs.d.ts#L3.
export type RefKind__6d76109c9bb1 = "meter" | "route" | "group" | "plan" | "resource" | "backend" | "frontend_integration";
Declaration source: packages/business/dist/types/business.d.ts#L66.
export type RequestMeterOptions__7ec5d6047951 = Partial<MeterOptions__b9495f4ba34f>;
Declaration source: packages/business/dist/types/business.d.ts#L74.
export type ResourceOptions__04a2cc1fd6ee = Omit<CountedResourceJson__90d0b7f16d08, "name">;
Declaration source: packages/business/dist/types/ir-types.d.ts#L273.
export type RouteAuthoredUsagePolicyJson__622a0aa384fd = {
preset: RouteUsagePolicyPresetJson__0df8c3d02afc;
providerCostTracked?: RouteProviderCostTrackedJson__69509ac0044b;
chargeableOutcomes?: RouteChargeableOutcomesJson__ba3a3aead9e9;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L267.
export type RouteChargeableOutcomesJson__ba3a3aead9e9 = "success_only" | "success_and_partial" | "attempted" | "trusted_actual_usage_only";
Declaration source: packages/business/dist/types/route-metering.d.ts#L34.
export type RouteLimitAuthoring__ae39586db789 = string | RouteLimitInput__250d9325480a;
Declaration source: packages/business/dist/types/route-metering.d.ts#L22.
export type RouteLimitInput__250d9325480a = TemporalLimitOptions & {
/** Capacity in the dimension's native unit. */
limit: number;
/** Window the cap resets on. */
per: RouteLimitWindowName__a0705d660e11;
/** Metered dimension. Defaults to `requests` (native per-call count). */
dimension?: string;
/** Record without denying past capacity (default: false → enforce). */
track?: boolean;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L99.
export type RouteLimitJson__077809c9f639 = {
dimension: string;
window: PlanLimitWindowJson__34c3ba9c4506;
capacity: number;
enforcement?: "enforce" | "track";
strategy?: "fixed_window" | "sliding_window" | "token_bucket";
bucketCapacity?: number;
refillRatePerSecond?: number;
};
Declaration source: packages/business/dist/types/route-metering.d.ts#L19.
export type RouteLimitWindowName__a0705d660e11 = "second" | "minute" | "hour" | "day" | "week" | "month";
Declaration source: packages/business/dist/types/route-metering.d.ts#L52.
export type RouteMeteringOptions__00c1790b3d64 = {
/**
* Dynamic meter keys the upstream may report with @farthershore/backend.
*/
reports?: string | MeterRef__af57686b0ce1 | Array<string | MeterRef__af57686b0ce1>;
/** Fixed gateway-known route costs. */
costs?: MeterCost__c48c806cf197 | Array<MeterCost__c48c806cf197>;
/** Override the default successful-response range. */
onStatusCodes?: string | number[];
/** Usage-policy preset authoring. The core compiler expands this to compiled UsagePolicy. */
usagePolicy?: RouteAuthoredUsagePolicyJson__622a0aa384fd | RouteUsagePolicyJson__bd930ebf5713;
/** Declare that billable units normally arrive after the response stream.
* Fixed costs are admitted before the call; actual reports settle later. */
postStreamBilling?: boolean;
/** FAR-684 — short-window velocity cap for THIS route, e.g.
* `rateLimit: "10/min"`. Normalized to a route-scoped `rate_limit`
* ConstraintSpec the gateway enforces (429) only on this route. */
rateLimit?: RouteLimitAuthoring__ae39586db789;
/** FAR-684 — longer-period budget for THIS route, e.g. `quota: "10000/month"`.
* Normalized to a route-scoped `quota` ConstraintSpec the gateway enforces
* (402) only on this route. */
quota?: RouteLimitAuthoring__ae39586db789;
/** FAR-684 — ADVANCED escape hatch: canonical route-scoped limits used
* verbatim (the codegen round-trip path). Wins over `rateLimit`/`quota`. */
limits?: RouteLimitJson__077809c9f639[];
};
Declaration source: packages/business/dist/types/value-model/registry.d.ts#L29.
export type RouteOperationOptions__902951868956 = FunctionalRouteOptions;
Declaration source: packages/business/dist/types/business.d.ts#L67.
export type RouteOptions__8ba341feca83 = RouteMeteringOptions__00c1790b3d64 & RoutePolicyOptions__ed332c838a9c & {
action?: string;
/** BYO-Backend V1 — bind this route to a declared backend. Omitted = the
* business's sole / default backend (single-backend products stay
* zero-config). */
backend?: string | BackendRef__376a47b9b8d4;
};
Declaration source: packages/business/dist/types/route-policy.d.ts#L12.
export type RoutePolicyOptions__ed332c838a9c = {
/** Sugar for `policy.authMode: "public"`. Omitted/`false` = required. */
public?: boolean;
/** Overall request timeout: `"30s"` | `30_000` (ms) → `policy.timeoutMs`. */
timeout?: DurationInput__9fbd3d189b84;
/** Idle/TTFB timeout: `"5s"` | `5_000` (ms) → `policy.idleTimeoutMs`. */
idleTimeout?: DurationInput__9fbd3d189b84;
/**
* `true` → the platform-canonical safe retry default; a full object → the
* advanced escape hatch (used verbatim); `false`/omitted → no retry.
*/
retry?: boolean | RawRetryPolicyInput__d96fd6958073;
/**
* Consumer-principal subject requirement (D4). `requireMember` forces a
* MEMBER subject (a session or a personal key) → `policy.subject: "member"`;
* `requireService` forces a SERVICE subject (an org-owned service-account
* key) → `policy.subject: "service"`. Omit both = no requirement ("any").
* Mutually exclusive, and incompatible with `public` (a public route carries
* no credential, so it can't require a subject).
*/
requireMember?: true;
requireService?: true;
/**
* CALLABILITY — the allowlist of credential surfaces the gateway admits, e.g.
* `surfaces: ["api"]` (key-only) or `["ui"]` (portal-only).
* Omitted = all admitted ("hybrid" — the common case). Authored order is
* irrelevant (deduped + canonically sorted at compile). Refused on a `public`
* route (no credential to classify). A route NOT admitting `api` is
* automatically absent from the generated API reference and un-grantable to
* API keys — a key can't call it, so listing it would mislead.
*/
surfaces?: RouteSurface__b5c8a54b503c[];
/**
* VISIBILITY — `true` also 404s a wrong-surface caller (instead of an
* informative 403) and force-hides an OTHERWISE-api-callable route from docs +
* scopes (a private beta). Redundant on a non-api route (already hidden by its
* surfaces). Allowed on a `public` route (visibility isn't a credential
* concern). Omitted = visible.
*/
hidden?: boolean;
/**
* ADVANCED escape hatch — the raw canonical policy object, merged UNDER the
* sugar fields above (sugar wins on conflict). Prefer the one-liner intent
* forms; reach for this only when you need a knob the sugar doesn't expose.
*/
policy?: RoutePolicyJson;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L268.
export type RouteProviderCostTrackedJson__69509ac0044b = boolean | {
providerCostTracked?: boolean;
provider?: string;
model?: string;
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L205.
export type RouteSurface__b5c8a54b503c = "ui" | "api" | "agent" | "webhook" | "cli";
Declaration source: packages/business/dist/types/ir-types.d.ts#L278.
export type RouteTrafficClassJson__0fcb4c4bf86d = "customer_operation" | "control_plane" | "admin_internal" | "background_job" | "webhook" | "healthcheck" | "unclassified";
Declaration source: packages/business/dist/types/ir-types.d.ts#L281.
export type RouteUsagePolicyJson__bd930ebf5713 = {
trafficClass: RouteTrafficClassJson__0fcb4c4bf86d;
policySource: RouteUsagePolicySourceJson__956c2e9dd016;
limitParticipation: {
profile: RouteUsagePolicyLimitProfileJson__5436ffa8006e;
pools?: string[];
scopes?: Array<Record<string, unknown>>;
metrics?: string[];
};
customerBillingPolicy: {
customerBillable: boolean;
meterKey?: string;
chargeableOutcomes: RouteChargeableOutcomesJson__ba3a3aead9e9;
invoiceBehavior?: string;
};
providerCostPolicy: {
providerCostTracked: boolean;
declaredProviderHint?: string;
declaredModelHint?: string;
};
};
Declaration source: packages/business/dist/types/ir-types.d.ts#L280.
export type RouteUsagePolicyLimitProfileJson__5436ffa8006e = "customer_usage" | "business_capacity" | "control_plane" | "admin_internal" | "platform_abuse_only" | "healthcheck" | "none";
Declaration source: packages/business/dist/types/ir-types.d.ts#L266.
export type RouteUsagePolicyPresetJson__0df8c3d02afc = "billable_operation" | "free_operation" | "control_plane" | "admin_internal" | "webhook" | "background_job" | "healthcheck";
Declaration source: packages/business/dist/types/ir-types.d.ts#L279.
export type RouteUsagePolicySourceJson__956c2e9dd016 = "declared" | "inherited" | "defaulted" | "inferred";
Declaration source: packages/business/dist/types/value-model/declarations.d.ts#L26.
export type StructuralPlanOptions__f7824ff3bdd0 = Pick<PlanOptions__0e8a3d72b1c6, "description" | "details" | "trialDays" | "maxMonthlySpendCents" | "minMonthlySpendCents" | "capacity" | "overageBehavior" | "selfServeEnabled"> & {
kind: PlanKindJson;
name?: string;
price?: AuthoredPrice__fa4522a263d6;
grants?: readonly (RouteRef | GroupRef | FrontendIntegrationRef)[];
limits?: readonly (MeterLimit | ResourceLimit)[];
archive?: Omit<PlanArchiveJson__452830f6517f, "transitionTo"> & {
transitionTo?: PlanRef;
};
};
Declaration source: packages/business/dist/types/business.d.ts#L15.
export type SubscriberChangeActionOption__99f1a181d6ed = "immediate" | "period_end";
Declaration source: packages/business/dist/types/business.d.ts#L19.
export type SubscriberChangePolicyOptions__b422925d18da = {
default?: SubscriberChangeActionOption__99f1a181d6ed;
when?: {
price_increase?: SubscriberChangeActionOption__99f1a181d6ed;
price_decrease?: SubscriberChangeActionOption__99f1a181d6ed;
route_grant_added?: SubscriberChangeActionOption__99f1a181d6ed;
route_grant_removed?: SubscriberChangeActionOption__99f1a181d6ed;
limit_increased?: SubscriberChangeActionOption__99f1a181d6ed;
limit_reduced?: SubscriberChangeActionOption__99f1a181d6ed;
credit_increased?: SubscriberChangeActionOption__99f1a181d6ed;
credit_reduced?: SubscriberChangeActionOption__99f1a181d6ed;
rating_changed?: SubscriberChangeActionOption__99f1a181d6ed;
};
allowImmediatePriceIncrease?: boolean;
allowImmediateEntitlementReduction?: boolean;
};