Access
Access benefit schema and validated entitlement constructor; constructing a value does not grant access.
Declaration
Section titled “Declaration”const Access: Schema.Union<readonly [Schema.Struct<{ entitlements: Schema.$Array<Schema.brand<Schema.String, "EntitlementKey">>; type: Schema.tag<"entitlements">; duration: Schema.Union<readonly [Schema.Literals<readonly ...>, Schema.Struct<{ type: ...; months: ...; anchor: ...; calendar: ...; }>]>;}>]> & { discriminants: readonly ["entitlements"]; cases: { entitlements: Schema.Struct<{ entitlements: Schema.$Array<Schema.brand<Schema.String, "EntitlementKey">>; type: Schema.tag<"entitlements">; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>; }>; }; isAnyOf: <Keys>(keys) => (value) => value is Extract<{ entitlements: readonly ((...) & (...))[]; type: "entitlements"; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }, { type: Keys }>; guards: { entitlements: (u) => u is { entitlements: readonly (string & any)[]; type: "entitlements"; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }; }; match: { <Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never; <Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never; };} & { entitlements: (input) => Effect.Effect<typeof AccessBenefit.Type, Schema.SchemaError>;};Type Declaration
Section titled “Type Declaration”discriminants
Section titled “discriminants”readonly discriminants: readonly ["entitlements"];readonly cases: { entitlements: Schema.Struct<{ entitlements: Schema.$Array<Schema.brand<Schema.String, "EntitlementKey">>; type: Schema.tag<"entitlements">; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>; }>;};cases.entitlements
Section titled “cases.entitlements”entitlements: Schema.Struct<{ entitlements: Schema.$Array<Schema.brand<Schema.String, "EntitlementKey">>; type: Schema.tag<"entitlements">; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>;}>;isAnyOf
Section titled “isAnyOf”readonly isAnyOf: <Keys>(keys) => (value) => value is Extract<{ entitlements: readonly ((...) & (...))[]; type: "entitlements"; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }, { type: Keys }>;Type Parameters
Section titled “Type Parameters”Keys
Parameters
Section titled “Parameters”readonly Keys[]
Returns
Section titled “Returns”(value) => value is Extract<{ entitlements: readonly ((…) & (…))[]; type: “entitlements”; duration: “perpetual” | “purchased_period” | { type: “fixed”; months: number & any; anchor: “settlement”; calendar: “utc_clamped” } }, { type: Keys }>
guards
Section titled “guards”readonly guards: { entitlements: (u) => u is { entitlements: readonly (string & any)[]; type: "entitlements"; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } };};guards.entitlements
Section titled “guards.entitlements”entitlements: (u) => u is { entitlements: readonly (string & any)[]; type: "entitlements"; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } };Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”u is { entitlements: readonly (string & any)[]; type: “entitlements”; duration: “perpetual” | “purchased_period” | { type: “fixed”; months: number & any; anchor: “settlement”; calendar: “utc_clamped” } }
readonly match: {<Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never;<Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never;};Call Signature
Section titled “Call Signature”<Cases>(value, cases): Cases[keyof Cases] extends (value) => R ? any : never;Type Parameters
Section titled “Type Parameters”Cases extends {
[key: string]: (value) => any;
}
Parameters
Section titled “Parameters”entitlements
Section titled “entitlements”readonly string & any[]
"entitlements"
duration
Section titled “duration”| "perpetual"
| "purchased_period"
| {
type: "fixed";
months: number & any;
anchor: "settlement";
calendar: "utc_clamped";
}
Cases
Returns
Section titled “Returns”Cases[keyof Cases] extends (value) => R ? any : never
Call Signature
Section titled “Call Signature”<Cases>(cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never;Type Parameters
Section titled “Type Parameters”Cases extends {
[key: string]: (value) => any;
}
Parameters
Section titled “Parameters”Cases
Returns
Section titled “Returns”(value) => Cases[keyof Cases] extends (value) => R ? any : never
Type Declaration
Section titled “Type Declaration”entitlements
Section titled “entitlements”entitlements: (input) => Effect.Effect<typeof AccessBenefit.Type, Schema.SchemaError>;Parses an entitlement contribution without requiring its wire-format tag.
Parameters
Section titled “Parameters”Omit<typeof AccessBenefit.Encoded, "type">
Returns
Section titled “Returns”Effect.Effect<typeof AccessBenefit.Type, Schema.SchemaError>