Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>One scheduled run window on the wire — the wire form of the engine's ProcessScheduleEntry.
The engine models id / stopAt as Option and the times as Date; the toolkit standard is
DateTime.Utc and optionalKey, so the runtime maps between them. startAt is when the run
instance triggers; stopAt (absent = open-ended) is when it stops.
export const const processScheduleEntry: Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>
readonly startAt: Schema.DateTimeUtc
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>
}>
const processScheduleEntry: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: { readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | unde…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined; }, readonly []>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; rea…;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Sc…;
check: (checks_0: Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }>, ...checks: Array<Check<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?…;
rebuild: (ast: Objects) => Schema.Struct<{ readonly id: Schema.optionalKey<Schema.String>; readonly startAt: Schema.DateTimeUtc; readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc> }>;
make: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?…;
makeOption: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Option.Option<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; re…;
makeEffect: (input: { readonly startAt: DateTime.Utc; readonly id?: string | undefined; readonly stopAt?: DateTime.Utc | undefined }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly startAt: DateTime.Utc; readonly id?: string | undefined; re…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
One scheduled run window on the wire — the wire form of the engine's
ProcessScheduleEntry
.
The engine models id / stopAt as Option and the times as Date; the toolkit standard is
DateTime.Utc and optionalKey, so the runtime maps between them. startAt is when the run
instance triggers; stopAt (absent = open-ended) is when it stops.
processScheduleEntry = import SchemaSchema.function Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>(fields: {
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}): Schema.Struct<{
readonly id: Schema.optionalKey<Schema.String>;
readonly startAt: Schema.DateTimeUtc;
readonly stopAt: Schema.optionalKey<Schema.DateTimeUtc>;
}>
Defines a struct schema from a map of field schemas.
Details
Each field value is a schema. Use
optionalKey
or
optional
to
mark fields as optional, and
mutableKey
to mark them as mutable.
The resulting schema's Type is a readonly object type with the fields'
decoded types. The Encoded form mirrors the field schemas' encoded types.
Example (Defining a basic struct)
import { Schema } from "effect"
const Person = Schema.Struct({
name: Schema.String,
age: Schema.Number,
email: Schema.optionalKey(Schema.String)
})
// { readonly name: string; readonly age: number; readonly email?: string }
type Person = typeof Person.Type
const alice = Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 })
console.log(alice)
// { name: 'Alice', age: 30 }
Struct({
id: Schema.optionalKey<Schema.String>(property) id: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.optionalKey<Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.optionalKey<Schema.String>;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.optionalKey<Schema.String>;
rebuild: (ast: String) => Schema.optionalKey<Schema.String>;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
id: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.String>(self: Schema.String) => Schema.optionalKey<Schema.String>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String),
startAt: Schema.DateTimeUtc(property) startAt: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
startAt: import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc,
stopAt: Schema.optionalKey<Schema.DateTimeUtc>(property) stopAt: {
Type: S["Type"];
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
schema: S;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.optionalKey<Schema.DateTimeUtc>;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.optionalKey<Schema.DateTimeUtc>;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.optionalKey<Schema.DateTimeUtc>;
rebuild: (ast: Declaration) => Schema.optionalKey<Schema.DateTimeUtc>;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
stopAt: import SchemaSchema.const optionalKey: optionalKeyLambda
<Schema.DateTimeUtc>(self: Schema.DateTimeUtc) => Schema.optionalKey<Schema.DateTimeUtc>
Type-level representation returned by
optionalKey
.
Creates an exact optional key schema for struct fields. Unlike optional,
this creates exact optional properties (not | undefined) that can be
completely omitted from the object.
Example (Creating a struct with optional key)
import { Schema } from "effect"
const schema = Schema.Struct({
name: Schema.String,
age: Schema.optionalKey(Schema.Number)
})
// Type: { readonly name: string; readonly age?: number }
type Person = typeof schema["Type"]
optionalKey(import SchemaSchema.const DateTimeUtc: Schema.DateTimeUtcconst DateTimeUtc: {
Rebuild: DateTimeUtc;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<DateTime.Utc, readonly []>) => Schema.DateTimeUtc;
annotateKey: (annotations: Schema.Annotations.Key<DateTime.Utc>) => Schema.DateTimeUtc;
check: (checks_0: Check<DateTime.Utc>, ...checks: Array<Check<DateTime.Utc>>) => Schema.DateTimeUtc;
rebuild: (ast: Declaration) => Schema.DateTimeUtc;
make: (input: DateTime.Utc, options?: Schema.MakeOptions) => DateTime.Utc;
makeOption: (input: DateTime.Utc, options?: Schema.MakeOptions) => Option.Option<DateTime.Utc>;
makeEffect: (input: DateTime.Utc, options?: Schema.MakeOptions) => Effect.Effect<DateTime.Utc, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
DateTimeUtc
.
Schema for DateTime.Utc values.
When to use
Use to validate existing DateTime.Utc schema values and use the default JSON
codec that represents them as UTC ISO strings.
Details
The default JSON codec decodes UTC ISO strings into DateTime.Utc values and
encodes DateTime.Utc values as UTC ISO strings.
DateTimeUtc),
});