@farthershore/backend/runtime exports
Every public export and declaration from @farthershore/backend/runtime.
Every public export and declaration from @farthershore/backend/runtime.
Import from @farthershore/backend/runtime. This reference is extracted from the published declaration surface for version 0.21.2. Read the collection's guides for workflows, prerequisites and failure handling.
THE content-type half of the shared body-hash rule — a faithful copy of
`isStreamingExemptContentType` in `@farthershore/contracts/runtime`, pinned
behaviourally by `runtime-contract-parity.test.ts`.
Matching is on the content type's BASE (the part before any `;` parameters,
e.g. a multipart boundary), case-insensitively. An exempt content type signs
and verifies the STREAM sentinel REGARDLESS OF SIZE — the gateway signer
applies the identical rule, so a small multipart upload agrees on both sides.
Declaration source: packages/backend/dist/types/generated/runtime-contract.d.ts#L42.
export declare function isStreamingExemptContentType(contentType: string | null | undefined): boolean;
Public export RUNTIME_BODY_HASH_CONTRACT.
Declaration source: packages/backend/dist/types/generated/runtime-contract.d.ts#L22.
declare const RUNTIME_BODY_HASH_CONTRACT: {
readonly algorithm: "SHA-256";
readonly encoding: "hex-lower";
readonly source: "raw-request-bytes";
readonly emptyBodyHash: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
readonly maxBodyBytes: 10485760;
readonly streamingExemptToken: "STREAM";
readonly streamingExemptContentTypes: readonly ["text/event-stream", "application/octet-stream", "multipart/form-data"];
readonly overMaxStatus: 413;
};
Public export RUNTIME_ERROR_CODES.
Declaration source: packages/backend/dist/types/generated/runtime-contract.d.ts#L1.
declare const RUNTIME_ERROR_CODES: {
readonly missingSignature: "missing_signature";
readonly malformedSignature: "malformed_signature";
readonly unknownKeyId: "unknown_key_id";
readonly jwksUnavailable: "jwks_unavailable";
readonly badSignature: "bad_signature";
readonly bodyHashMismatch: "body_hash_mismatch";
readonly routeMismatch: "route_mismatch";
readonly clockSkew: "clock_skew";
readonly expiredSignature: "expired_signature";
readonly replayedNonce: "replayed_nonce";
readonly bodyTooLarge: "body_too_large";
readonly environmentMismatch: "environment_mismatch";
readonly missingToken: "missing_token";
readonly invalidToken: "invalid_token";
readonly contextUnverified: "context_unverified";
readonly memberSubjectRequired: "member_subject_required";
readonly serviceSubjectRequired: "service_subject_required";
readonly surfaceNotAllowed: "surface_not_allowed";
};
Public export RUNTIME_RESPONSE_METERING_CONTRACT.
Declaration source: packages/backend/dist/types/generated/runtime-contract.d.ts#L43.
declare const RUNTIME_RESPONSE_METERING_CONTRACT: {
readonly headers: {
readonly payload: "x-fs-metering";
readonly signature: "x-fs-metering-sig";
readonly token: "x-fs-metering-token";
};
readonly token: {
readonly environmentVariable: "FS_RUNTIME_TOKEN";
readonly presentation: "x-fs-metering-token";
readonly storage: "sha256-hash-only";
};
readonly signature: {
readonly algorithm: "HMAC-SHA256";
readonly encoding: "base64url";
readonly input: "payload-json";
readonly secret: "presented-runtime-token";
};
readonly payload: {
readonly method: "string";
readonly path: "string";
readonly rawDimsUnits: "Record<string, number>?";
readonly measureContext: "Record<string, unknown>?";
readonly creditUnitsConsumed: "Record<string, number>?";
readonly measurementsVersion: "1?";
readonly measurements: "Array<{ meter: string; values: Record<string, number>; dims?: Record<string, string> }>?";
readonly quote: "{ currency: string; amountNanos: string }?";
};
readonly errors: {
readonly missingToken: "missing_token";
readonly invalidMeterKey: "invalid_meter_key";
readonly invalidMeterValue: "invalid_meter_value";
readonly invalidQuote: "invalid_quote";
};
readonly httpAdapter: {
readonly input: "Request";
readonly output: "Response";
readonly networkCalls: false;
readonly preserves: readonly ["body", "headers", "status", "statusText"];
readonly gatewayStripsInternalHeaders: true;
};
};
Public export RuntimeErrorCode.
Declaration source: packages/backend/dist/types/generated/runtime-contract.d.ts#L21.
export type RuntimeErrorCode = (typeof RUNTIME_ERROR_CODES)[keyof typeof RUNTIME_ERROR_CODES];
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.