Skip to content

@codesoul-co/hypha-core / contracts/runtime-timer-schemas

Using this module

Use the Runtime timer schemas module for declaring and runtime-validating contracts. It exports 10 constants, 2 functions.

Import from the package entrypoint

ts
import {
  runtimeTimerContractDefinitions,
  runtimeTimerContractJsonSchemas,
  runtimeTimerSweepRequestDefinition,
  runtimeTimerSweepRequestExample,
  runtimeTimerSweepRequestJsonSchema,
  runtimeTimerSweepRequestSchema,
  runtimeTimerSweepResultDefinition,
  runtimeTimerSweepResultExample,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 10 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Runtime validation example

ts
import { runtimeTimerSweepRequestSchema } from '@codesoul-co/hypha-core';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = runtimeTimerSweepRequestSchema.parse(input);

Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.

Public exports

SymbolKindSignatureDescription
runtimeTimerContractDefinitionsconstantconst runtimeTimerContractDefinitions: readonly [SpecSchemaDefinition<RuntimeTimerSweepRequest>, SpecSchemaDefinition<RuntimeTimerSweepResult>]Runtime Timer Contract Definitions constant exported by the contracts/runtime-timer-schemas module.
runtimeTimerContractJsonSchemasconstantconst runtimeTimerContractJsonSchemas: Record<string, JsonSchema>Runtime Timer Contract JSON Schemas constant exported by the contracts/runtime-timer-schemas module.
runtimeTimerSweepRequestDefinitionconstantconst runtimeTimerSweepRequestDefinition: SpecSchemaDefinition<RuntimeTimerSweepRequest>Runtime Timer Sweep Request Definition constant exported by the contracts/runtime-timer-schemas module.
runtimeTimerSweepRequestExampleconstantconst runtimeTimerSweepRequestExample: RuntimeTimerSweepRequestValid example value for Runtime Timer Sweep Request.
runtimeTimerSweepRequestJsonSchemaconstantconst runtimeTimerSweepRequestJsonSchema: JsonSchemaJSON Schema for Runtime Timer Sweep Request.
runtimeTimerSweepRequestSchemaconstantconst runtimeTimerSweepRequestSchema: z.ZodObject<{ ownerId: z.ZodString; leaseTtlMs: z.ZodNumber; limit: z.ZodNumber; cursor: z.ZodOptional<z.ZodString>; firedAt: z.ZodString; }, "strict", z.ZodTypeAny, { limit: number; ownerId: string; leaseTtlMs: number; firedAt: string; cursor?: string | undefined; }, { limit: number; ownerId: string; leaseTtlMs: number; firedAt: string; cursor?: string | undefined; }>Runtime schema for Runtime Timer Sweep Request.
runtimeTimerSweepResultDefinitionconstantconst runtimeTimerSweepResultDefinition: SpecSchemaDefinition<RuntimeTimerSweepResult>Runtime Timer Sweep Result Definition constant exported by the contracts/runtime-timer-schemas module.
runtimeTimerSweepResultExampleconstantconst runtimeTimerSweepResultExample: RuntimeTimerSweepResultValid example value for Runtime Timer Sweep Result.
runtimeTimerSweepResultJsonSchemaconstantconst runtimeTimerSweepResultJsonSchema: JsonSchemaJSON Schema for Runtime Timer Sweep Result.
runtimeTimerSweepResultSchemaconstantconst runtimeTimerSweepResultSchema: z.ZodEffects<z.ZodObject<{ scanned: z.ZodNumber; fired: z.ZodNumber; notDue: z.ZodNumber; leaseUnavailable: z.ZodNumber; alreadyResolved: z.ZodNumber; results: z.ZodArray<z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; runId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; runId: string; tenantId?: string | undefined; }, {...Runtime schema for Runtime Timer Sweep Result.
validateRuntimeTimerSweepRequestfunctionvalidateRuntimeTimerSweepRequest(input: unknown): RuntimeTimerSweepRequestValidate Runtime Timer Sweep Request function with 1 public call signature; parameters and return types are listed below.
validateRuntimeTimerSweepResultfunctionvalidateRuntimeTimerSweepResult(input: unknown): RuntimeTimerSweepResultValidate Runtime Timer Sweep Result function with 1 public call signature; parameters and return types are listed below.

runtimeTimerContractDefinitions

Runtime Timer Contract Definitions constant exported by the contracts/runtime-timer-schemas module.

Declaration

text
export declare const runtimeTimerContractDefinitions: readonly [SpecSchemaDefinition<RuntimeTimerSweepRequest>, SpecSchemaDefinition<RuntimeTimerSweepResult>];

runtimeTimerContractJsonSchemas

Runtime Timer Contract JSON Schemas constant exported by the contracts/runtime-timer-schemas module.

Declaration

text
export declare const runtimeTimerContractJsonSchemas: Record<string, JsonSchema>;

runtimeTimerSweepRequestDefinition

Runtime Timer Sweep Request Definition constant exported by the contracts/runtime-timer-schemas module.

Declaration

text
export declare const runtimeTimerSweepRequestDefinition: SpecSchemaDefinition<RuntimeTimerSweepRequest>;

runtimeTimerSweepRequestExample

Valid example value for Runtime Timer Sweep Request.

Declaration

text
export declare const runtimeTimerSweepRequestExample: RuntimeTimerSweepRequest;

runtimeTimerSweepRequestJsonSchema

JSON Schema for Runtime Timer Sweep Request.

Declaration

text
export declare const runtimeTimerSweepRequestJsonSchema: JsonSchema;

runtimeTimerSweepRequestSchema

Runtime schema for Runtime Timer Sweep Request.

Declaration

text
export declare const runtimeTimerSweepRequestSchema: z.ZodObject<{ ownerId: z.ZodString; leaseTtlMs: z.ZodNumber; limit: z.ZodNumber; cursor: z.ZodOptional<z.ZodString>; firedAt: z.ZodString; }, "strict", z.ZodTypeAny, { limit: number; ownerId: string; leaseTtlMs: number; firedAt: string; cursor?: string | undefined; }, { limit: number; ownerId: string; leaseTtlMs: number; firedAt: string; cursor?: string | undefined; }>;

runtimeTimerSweepResultDefinition

Runtime Timer Sweep Result Definition constant exported by the contracts/runtime-timer-schemas module.

Declaration

text
export declare const runtimeTimerSweepResultDefinition: SpecSchemaDefinition<RuntimeTimerSweepResult>;

runtimeTimerSweepResultExample

Valid example value for Runtime Timer Sweep Result.

Declaration

text
export declare const runtimeTimerSweepResultExample: RuntimeTimerSweepResult;

runtimeTimerSweepResultJsonSchema

JSON Schema for Runtime Timer Sweep Result.

Declaration

text
export declare const runtimeTimerSweepResultJsonSchema: JsonSchema;

runtimeTimerSweepResultSchema

Runtime schema for Runtime Timer Sweep Result.

Declaration

text
export declare const runtimeTimerSweepResultSchema: z.ZodEffects<z.ZodObject<{ scanned: z.ZodNumber; fired: z.ZodNumber; notDue: z.ZodNumber; leaseUnavailable: z.ZodNumber; alreadyResolved: z.ZodNumber; results: z.ZodArray<z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; runId: z.ZodString; }, "strict", z.ZodTypeAny, { userId: string; runId: string; tenantId?: string | undefined; }, { userId: string; runId: string; tenantId?: string | undefined; }>; disposition: z.ZodEnum<["fired", "not_due", "lease_unavailable", "already_resolved"]>; eventIds: z.ZodArray<z.ZodString, "many">; }, "strict", z.ZodTypeAny, { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }, { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }>, "many">; nextCursor: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { fired: number; scanned: number; notDue: number; leaseUnavailable: number; alreadyResolved: number; results: { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }[]; nextCursor?: string | undefined; }, { fired: number; scanned: number; notDue: number; leaseUnavailable: number; alreadyResolved: number; results: { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }[]; nextCursor?: string | undefined; }>, { fired: number; scanned: number; notDue: number; leaseUnavailable: number; alreadyResolved: number; results: { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }[]; nextCursor?: string | undefined; }, { fired: number; scanned: number; notDue: number; leaseUnavailable: number; alreadyResolved: number; results: { scope: { userId: string; runId: string; tenantId?: string | undefined; }; disposition: "not_due" | "lease_unavailable" | "fired" | "already_resolved"; eventIds: string[]; }[]; nextCursor?: string | undefined; }>;

validateRuntimeTimerSweepRequest

Validate Runtime Timer Sweep Request function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeTimerSweepRequest(input: unknown): RuntimeTimerSweepRequest;

Call signature

text
validateRuntimeTimerSweepRequest(input: unknown): RuntimeTimerSweepRequest

Parameters

ParameterTypeRequiredDescription
inputunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: RuntimeTimerSweepRequest
  • Description: The return contract is defined by the type shown above.

validateRuntimeTimerSweepResult

Validate Runtime Timer Sweep Result function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeTimerSweepResult(input: unknown): RuntimeTimerSweepResult;

Call signature

text
validateRuntimeTimerSweepResult(input: unknown): RuntimeTimerSweepResult

Parameters

ParameterTypeRequiredDescription
inputunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: RuntimeTimerSweepResult
  • Description: The return contract is defined by the type shown above.