ignotum 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/cli/bin.mjs +6111 -4448
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/cli/emscripten-module-D5GzfUNv.mjs +533 -0
- package/dist/cli/emscripten-module-D5GzfUNv.mjs.map +1 -0
- package/dist/cli/ffi-7IElU4Co.mjs +148 -0
- package/dist/cli/ffi-7IElU4Co.mjs.map +1 -0
- package/dist/cli/managed-release-WHYLZwaS.mjs +10902 -0
- package/dist/cli/managed-release-WHYLZwaS.mjs.map +1 -0
- package/dist/cli/managed-release.d.mts +1 -0
- package/dist/cli/managed-release.mjs +14 -0
- package/dist/cli/managed-release.mjs.map +1 -0
- package/dist/cli/module-ES6BEMUI-D36I4NVn.mjs +1289 -0
- package/dist/cli/module-ES6BEMUI-D36I4NVn.mjs.map +1 -0
- package/dist/runtime/{api-Cv3hMbzo.d.ts → api-B4fwp5a2.d.ts} +4 -4
- package/dist/runtime/bootstrap-BISQSn_O.js +916 -0
- package/dist/runtime/bootstrap-BISQSn_O.js.map +1 -0
- package/dist/runtime/bootstrap-BTFScKAc.d.ts +545 -0
- package/dist/runtime/client.d.ts +50 -15
- package/dist/runtime/client.js +7 -1138
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js +269 -0
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js.map +1 -0
- package/dist/runtime/{id-Bt9XWRGL.js → id--1m0NuUL.js} +4 -4
- package/dist/runtime/id--1m0NuUL.js.map +1 -0
- package/dist/runtime/{id-BzFHf3Wo-DGPCjgrf.d.ts → id-7an3nxTu-DZJSM5xh.d.ts} +2 -2
- package/dist/runtime/id-CBOt2kDo.d.ts +1 -0
- package/dist/runtime/identity-QjtJRxBD.d.ts +2 -0
- package/dist/runtime/image-Djtjy4Z8.js +19 -0
- package/dist/runtime/image-Djtjy4Z8.js.map +1 -0
- package/dist/runtime/index-D4seNHlX.d.ts +184 -0
- package/dist/runtime/internal/api.d.ts +1 -1
- package/dist/runtime/internal/api.js +30 -1
- package/dist/runtime/internal/api.js.map +1 -0
- package/dist/runtime/internal/bootstrap.d.ts +2 -0
- package/dist/runtime/internal/bootstrap.js +2 -0
- package/dist/runtime/internal/client.d.ts +2 -0
- package/dist/runtime/internal/client.js +75 -0
- package/dist/runtime/internal/client.js.map +1 -0
- package/dist/runtime/internal/host.d.ts +25 -8
- package/dist/runtime/internal/host.js +27 -6
- package/dist/runtime/internal/host.js.map +1 -1
- package/dist/runtime/internal/routes.d.ts +2 -0
- package/dist/runtime/internal/routes.js +2 -0
- package/dist/runtime/internal/server.d.ts +1 -1
- package/dist/runtime/internal/server.js +1 -1
- package/dist/runtime/internal/types.d.ts +2 -1
- package/dist/runtime/internal/types.js +1 -1
- package/dist/runtime/pagination-CBOt2kDo.d.ts +1 -0
- package/dist/runtime/pagination-D3qd6s9N.js +33 -0
- package/dist/runtime/pagination-D3qd6s9N.js.map +1 -0
- package/dist/runtime/result-BkziOG1L.d.ts +1 -0
- package/dist/runtime/router-BSBI1oN1.js +2377 -0
- package/dist/runtime/router-BSBI1oN1.js.map +1 -0
- package/dist/runtime/routes-Ce8TVP-T.js +690 -0
- package/dist/runtime/routes-Ce8TVP-T.js.map +1 -0
- package/dist/runtime/{schema-1Zs03-iS.js → schema-D1wOqiNH.js} +40 -12
- package/dist/runtime/schema-D1wOqiNH.js.map +1 -0
- package/dist/runtime/server.d.ts +5 -5
- package/dist/runtime/server.js +2 -2
- package/dist/runtime/{sync-Bs8J3fIr.d.ts → sync-D-GK2sv9.d.ts} +3 -2
- package/dist/runtime/{api-CAgKDij7.js → sync-DzUwA8W9.js} +22 -41
- package/dist/runtime/sync-DzUwA8W9.js.map +1 -0
- package/dist/runtime/types-DeCCyqLU-BIm7rU-0.d.ts +341 -0
- package/package.json +29 -4
- package/src/cli/agent-files.ts +14 -8
- package/src/cli/build/managed-client.ts +411 -0
- package/src/cli/build/managed-server.ts +294 -0
- package/src/cli/build/managed.ts +67 -0
- package/src/cli/build/output.ts +47 -0
- package/src/cli/build/server.ts +51 -220
- package/src/cli/client-config.ts +1 -140
- package/src/cli/client-styles.ts +1 -0
- package/src/cli/codegen.ts +9 -4
- package/src/cli/command.ts +28 -5
- package/src/cli/control-client.ts +84 -101
- package/src/cli/deploy.ts +133 -177
- package/src/cli/dev.ts +506 -107
- package/src/cli/image-assets.ts +499 -0
- package/src/cli/managed-client-boundaries.ts +103 -0
- package/src/cli/managed-dev-platform.ts +118 -0
- package/src/cli/managed-exports.ts +219 -0
- package/src/cli/managed-release-bin.ts +13 -0
- package/src/cli/managed-release.ts +260 -0
- package/src/cli/module-boundaries.ts +11 -1
- package/src/cli/new-app.ts +111 -87
- package/src/cli/route-codegen.ts +311 -0
- package/src/cli/route-static.ts +710 -0
- package/src/client/bootstrap.ts +110 -0
- package/src/client/errors.ts +13 -7
- package/src/client/files.ts +64 -0
- package/src/client/id.ts +9 -5
- package/src/client/image.ts +28 -0
- package/src/client/index.ts +25 -2
- package/src/client/managed-client.ts +729 -0
- package/src/client/managed-upgrade.ts +283 -0
- package/src/client/recovery-journal.ts +195 -0
- package/src/client/route-boundaries.ts +184 -0
- package/src/client/router-history.ts +152 -0
- package/src/client/router-store.ts +644 -0
- package/src/client/router.ts +324 -0
- package/src/client/routes.ts +28 -0
- package/src/client/sync.ts +66 -592
- package/src/dev-runtime/database.ts +77 -2
- package/src/dev-runtime/functions.ts +3 -3
- package/src/dev-runtime/id.ts +19 -4
- package/src/dev-runtime/managed-functions.ts +255 -0
- package/src/dev-runtime/managed-sync.ts +263 -0
- package/src/dev-runtime/managed-websocket.ts +71 -0
- package/src/dev-runtime/migrations.ts +20 -0
- package/src/dev-runtime/sync.ts +236 -236
- package/src/image-assets.d.ts +36 -0
- package/src/internal/client.ts +186 -0
- package/src/internal/host.ts +1 -1
- package/src/internal/http-paths.ts +0 -3
- package/src/internal/routes.ts +45 -0
- package/dist/runtime/api-CAgKDij7.js.map +0 -1
- package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js +0 -154
- package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js.map +0 -1
- package/dist/runtime/id-Bt9XWRGL.js.map +0 -1
- package/dist/runtime/id-Dz0apuB3.d.ts +0 -1
- package/dist/runtime/index-D54flWtH.d.ts +0 -402
- package/dist/runtime/pagination-DnKg3dkI-r5ZUxBBx.d.ts +0 -112
- package/dist/runtime/pagination-Dz0apuB3.d.ts +0 -1
- package/dist/runtime/result-DKAA4gpS.d.ts +0 -1
- package/dist/runtime/schema-1Zs03-iS.js.map +0 -1
- package/src/cli/build/client.ts +0 -119
- package/src/cli/build/public.ts +0 -186
- package/src/cli/client-entry.ts +0 -152
- package/src/cli/client-plugin.ts +0 -136
- package/src/client/app.ts +0 -15
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
import { _ as fileFormats, c as Result$1, g as FileValue, i as ErrorValue, n as DocumentNotFoundValue, p as FileFormat, r as ErrorBrand, t as GeneratedId } from "./id-BzFHf3Wo-DGPCjgrf.js";
|
|
2
|
-
import { a as ValueDescriptor, c as IdContext, i as DescriptorField, n as PaginationPage, o as ValueDescriptorCarrier, r as DescribedValue, s as ValueFields, t as PaginationOptions } from "./pagination-DnKg3dkI-r5ZUxBBx.js";
|
|
3
|
-
import { Brand, Effect, Redacted, Schema, Struct } from "effect";
|
|
4
|
-
//#region ../contracts/dist/values-B4I-91OJ.d.ts
|
|
5
|
-
//#region src/schema/values.d.ts
|
|
6
|
-
declare const IdTargetsTypeId: unique symbol;
|
|
7
|
-
declare const UnresolvedReferencesTypeId: unique symbol;
|
|
8
|
-
interface IdTargets<TableName extends string> {
|
|
9
|
-
readonly [IdTargetsTypeId]: TableName;
|
|
10
|
-
}
|
|
11
|
-
interface UnresolvedReferences<TableName extends string> {
|
|
12
|
-
readonly [UnresolvedReferencesTypeId]: TableName;
|
|
13
|
-
}
|
|
14
|
-
type IdTargetsOf<Value> = Value extends IdTargets<infer TableName> ? TableName : never;
|
|
15
|
-
type UnresolvedReferencesOf<Value> = Value extends UnresolvedReferences<infer TableName> ? TableName : never;
|
|
16
|
-
type WithIdTargets<Value, TableName extends string> = [TableName] extends [never] ? Value : Value & IdTargets<TableName>;
|
|
17
|
-
type WithUnresolvedReferences<Value, TableName extends string> = [TableName] extends [never] ? Value : Value & UnresolvedReferences<TableName>;
|
|
18
|
-
type PreserveIdMetadata<Value, Source> = WithUnresolvedReferences<WithIdTargets<Value, IdTargetsOf<Source>>, UnresolvedReferencesOf<Source>>;
|
|
19
|
-
type PreserveValueMetadata<Value extends Schema.Constraint, Source> = Source extends ValueDescriptorCarrier ? DescribedValue<PreserveIdMetadata<Value, Source> & Schema.Constraint> : PreserveIdMetadata<Value, Source>;
|
|
20
|
-
type IdDefinition<TableName extends string> = DescribedValue<Schema.brand<typeof GeneratedId, `ignotum/id/${TableName}`> & IdTargets<TableName>>;
|
|
21
|
-
type ReferenceDefinition<TableName extends string> = IdDefinition<TableName> & UnresolvedReferences<TableName>;
|
|
22
|
-
type AddedFieldValidation<Fields, AddedFields> = Extract<keyof AddedFields, keyof Fields> extends never ? readonly [] : readonly [invalidFields: never];
|
|
23
|
-
type OverriddenFieldValidation<Fields, OverriddenFields> = Exclude<keyof OverriddenFields, keyof Fields> extends never ? readonly [] : readonly [invalidFields: never];
|
|
24
|
-
type PartialFields<Fields extends Schema.Struct.Fields> = { readonly [FieldName in keyof Fields]: Fields[FieldName] extends Schema.Constraint ? PreserveValueMetadata<Schema.optional<Fields[FieldName]>, Fields[FieldName]> : never; };
|
|
25
|
-
interface FixedObjectValidator<Fields extends Schema.Struct.Fields> extends Schema.Struct<Fields> {
|
|
26
|
-
readonly pick: <const Keys extends ReadonlyArray<keyof Fields>>(...keys: Keys) => ObjectDefinition<Pick<Fields, Keys[number]>>;
|
|
27
|
-
readonly omit: <const Keys extends ReadonlyArray<keyof Fields>>(...keys: Keys) => ObjectDefinition<Omit<Fields, Keys[number]>>;
|
|
28
|
-
readonly extend: <const AddedFields extends ValueFields>(fields: AddedFields, ...validation: AddedFieldValidation<Fields, AddedFields>) => ObjectDefinition<Struct.Assign<Fields, AddedFields>>;
|
|
29
|
-
readonly override: <const OverriddenFields extends Partial<Record<keyof Fields, DescribedValue>>>(fields: OverriddenFields, ...validation: OverriddenFieldValidation<Fields, OverriddenFields>) => ObjectDefinition<Struct.Assign<Fields, OverriddenFields>>;
|
|
30
|
-
readonly partial: () => ObjectDefinition<PartialFields<Fields>>;
|
|
31
|
-
}
|
|
32
|
-
type ObjectDefinition<Fields extends Schema.Struct.Fields> = DescribedValue<PreserveIdMetadata<FixedObjectValidator<Fields>, Fields[keyof Fields]>>;
|
|
33
|
-
type ResolvedFields<Fields extends Schema.Struct.Fields> = { readonly [FieldName in keyof Fields]: Omit<Fields[FieldName], typeof UnresolvedReferencesTypeId>; };
|
|
34
|
-
type LiteralValue = string | number | boolean;
|
|
35
|
-
interface IndexDefinition<Name extends string = string, FieldNames extends readonly string[] = readonly string[]> {
|
|
36
|
-
readonly name: Name;
|
|
37
|
-
readonly fields: FieldNames;
|
|
38
|
-
}
|
|
39
|
-
interface IndexDefinitions {
|
|
40
|
-
readonly [indexName: string]: IndexDefinition;
|
|
41
|
-
}
|
|
42
|
-
type IndexScalar = boolean | Date | number | string;
|
|
43
|
-
type IndexFieldName<Fields extends Schema.Struct.Fields> = { readonly [FieldName in keyof Fields & string]: Fields[FieldName]["Type"] extends IndexScalar ? FieldName : never; }[keyof Fields & string];
|
|
44
|
-
type IndexFieldTuple<Fields extends Schema.Struct.Fields> = readonly [IndexFieldName<Fields>, ...ReadonlyArray<IndexFieldName<Fields>>];
|
|
45
|
-
interface TableDefinition<Fields extends Schema.Struct.Fields, Indexes extends IndexDefinitions = {}> {
|
|
46
|
-
readonly _tag: "Table";
|
|
47
|
-
readonly descriptor: ValueDescriptor;
|
|
48
|
-
readonly fields: Fields;
|
|
49
|
-
readonly indexes: Indexes;
|
|
50
|
-
readonly schema: Schema.Struct<Fields>;
|
|
51
|
-
readonly index: <const Name extends string, const FieldNames extends IndexFieldTuple<Fields>>(name: Name extends keyof Indexes ? never : Name, fields: FieldNames) => TableDefinition<Fields, Indexes & Record<Name, IndexDefinition<Name, FieldNames>>>;
|
|
52
|
-
}
|
|
53
|
-
interface TableDefinitions {
|
|
54
|
-
readonly [tableName: string]: TableDefinition<Schema.Struct.Fields, IndexDefinitions>;
|
|
55
|
-
}
|
|
56
|
-
type TableNameOf$2<Definition extends TableDefinitions> = keyof Definition & string;
|
|
57
|
-
type ReservedFieldName = "createdAt" | "id" | "updatedAt";
|
|
58
|
-
type ReservedErrorTagName = "InternalServerError";
|
|
59
|
-
declare const ReservedFieldTypeId: unique symbol;
|
|
60
|
-
interface ReservedField<FieldName extends string> {
|
|
61
|
-
readonly [ReservedFieldTypeId]: `The field name '${FieldName}' is reserved by Ignotum`;
|
|
62
|
-
}
|
|
63
|
-
declare const ReservedErrorTagTypeId: unique symbol;
|
|
64
|
-
interface ReservedErrorTag<Tag extends string> {
|
|
65
|
-
readonly [ReservedErrorTagTypeId]: `The error tag '${Tag}' is reserved by Ignotum`;
|
|
66
|
-
}
|
|
67
|
-
type ErrorTagValidation<Tag extends string> = Tag extends ReservedErrorTagName ? ReservedErrorTag<Tag> : unknown;
|
|
68
|
-
type ReservedFieldValidation<Fields extends Schema.Struct.Fields> = { readonly [FieldName in Extract<keyof Fields, ReservedFieldName>]: ReservedField<FieldName>; };
|
|
69
|
-
type ReservedErrorFieldValidation<Fields extends Schema.Struct.Fields> = { readonly [FieldName in Extract<keyof Fields, "_tag">]: ReservedField<FieldName>; };
|
|
70
|
-
type ErrorDefinition<Tag extends string, Fields extends Schema.Struct.Fields> = DescribedValue<PreserveIdMetadata<Schema.brand<Schema.TaggedStruct<Tag, Fields>, typeof ErrorBrand> & ((fields: Schema.Struct.MakeIn<Fields>) => Schema.brand<Schema.TaggedStruct<Tag, Fields>, typeof ErrorBrand>["Type"]), Fields[keyof Fields]>>;
|
|
71
|
-
declare const table: <const Fields extends ValueFields>(fields: Fields & ReservedFieldValidation<NoInfer<Fields>>) => TableDefinition<Fields>;
|
|
72
|
-
declare const string: () => DescribedValue<Schema.String>;
|
|
73
|
-
declare const number: () => DescribedValue<Schema.Finite>;
|
|
74
|
-
declare const integer: () => DescribedValue<Schema.Int>;
|
|
75
|
-
declare const boolean: () => DescribedValue<Schema.Boolean>;
|
|
76
|
-
declare const date: () => DescribedValue<Schema.DateFromMillis>;
|
|
77
|
-
interface FileOptions<Formats extends readonly FileFormat[]> {
|
|
78
|
-
readonly formats?: Formats;
|
|
79
|
-
readonly maxBytes?: number;
|
|
80
|
-
}
|
|
81
|
-
declare const file: <const Formats extends readonly FileFormat[] = typeof fileFormats>(options?: FileOptions<Formats>) => DescribedValue<Schema.decodeTo<Schema.declare<FileValue<"avif" | "gif" | "jpeg" | "png" | "webp">, FileValue<"avif" | "gif" | "jpeg" | "png" | "webp">>, Schema.Struct<{
|
|
82
|
-
readonly $ignotum: Schema.Literal<"file">;
|
|
83
|
-
readonly id: Schema.brand<Schema.String, "ignotum/file/FileId"> & {
|
|
84
|
-
readonly idPrefix: "file";
|
|
85
|
-
};
|
|
86
|
-
readonly format: Schema.Literals<readonly ["jpeg", "png", "webp", "avif", "gif"]>;
|
|
87
|
-
readonly name: Schema.String;
|
|
88
|
-
readonly size: Schema.Int;
|
|
89
|
-
}>, never, never>> & Schema.Schema<FileValue<Formats[number]>>;
|
|
90
|
-
declare const never: () => DescribedValue<Schema.Never>;
|
|
91
|
-
declare const nullValue: () => DescribedValue<Schema.Null>;
|
|
92
|
-
declare const literal: <const Value extends LiteralValue>(value: Value) => DescribedValue<Schema.Literal<Value>>;
|
|
93
|
-
declare const literals: <const Members extends readonly [LiteralValue, LiteralValue, ...ReadonlyArray<LiteralValue>]>(...members: Members) => DescribedValue<Schema.Literals<Members>>;
|
|
94
|
-
declare const userId: () => DescribedValue<Schema.brand<Schema.String, "ignotum/id/UserId">>;
|
|
95
|
-
declare const id: <const TableName extends string>(tableName: TableName) => ReferenceDefinition<TableName>;
|
|
96
|
-
declare const array: <Value extends DescribedValue>(value: Value) => PreserveValueMetadata<Schema.$Array<Value>, Value>;
|
|
97
|
-
declare const object: <const Fields extends ValueFields>(fields: Fields) => ObjectDefinition<Fields>;
|
|
98
|
-
declare const optional: <Value extends DescribedValue>(value: Value) => PreserveValueMetadata<Schema.optional<Value>, Value>;
|
|
99
|
-
declare const nullable: <Value extends DescribedValue>(value: Value) => PreserveValueMetadata<Schema.NullOr<Value>, Value>;
|
|
100
|
-
declare const record: <Value extends DescribedValue>(value: Value) => PreserveValueMetadata<Schema.$Record<Schema.String, Value>, Value>;
|
|
101
|
-
declare const union: <const Members extends ReadonlyArray<DescribedValue>>(...members: Members) => PreserveValueMetadata<Schema.Union<Members>, Members[number]>;
|
|
102
|
-
type Secret<Value> = Redacted.Redacted<Value>;
|
|
103
|
-
declare const Secret: {
|
|
104
|
-
readonly isSecret: (u: unknown) => u is Redacted.Redacted<unknown>;
|
|
105
|
-
readonly value: <T>(self: Redacted.Redacted<T>) => T;
|
|
106
|
-
};
|
|
107
|
-
type SecretDefinition<Value extends DescribedValue> = DescribedValue<Schema.RedactedFromValue<Value>>;
|
|
108
|
-
declare function secret(): SecretDefinition<ReturnType<typeof string>>;
|
|
109
|
-
declare function secret<Value extends DescribedValue>(value: Value): SecretDefinition<Value>;
|
|
110
|
-
declare const pagination: () => ObjectDefinition<{
|
|
111
|
-
readonly cursor: DescribedValue<Schema.NullOr<DescribedValue<Schema.brand<Schema.String, "ignotum/runtime/PaginationCursor">>> & Schema.Constraint>;
|
|
112
|
-
readonly pageSize: DescribedValue<Schema.brand<Schema.Int, "ignotum/runtime/PaginationPageSize">>;
|
|
113
|
-
}>;
|
|
114
|
-
declare const page: <Value extends DescribedValue>(value: Value) => ObjectDefinition<{
|
|
115
|
-
readonly items: PreserveValueMetadata<Schema.$Array<Value>, Value>;
|
|
116
|
-
readonly nextCursor: DescribedValue<Schema.NullOr<DescribedValue<Schema.brand<Schema.String, "ignotum/runtime/PaginationCursor">>> & Schema.Constraint>;
|
|
117
|
-
}> & Schema.Schema<PaginationPage<Value["Type"]>>;
|
|
118
|
-
declare const error: <const Tag extends string, const Fields extends ValueFields>(tag: Tag & ErrorTagValidation<Tag>, fields: Fields & ReservedErrorFieldValidation<NoInfer<Fields>>) => ErrorDefinition<Tag, Fields>;
|
|
119
|
-
declare const values: {
|
|
120
|
-
userId: typeof userId;
|
|
121
|
-
array: typeof array;
|
|
122
|
-
boolean: typeof boolean;
|
|
123
|
-
date: typeof date;
|
|
124
|
-
file: typeof file;
|
|
125
|
-
error: typeof error;
|
|
126
|
-
id: typeof id;
|
|
127
|
-
integer: typeof integer;
|
|
128
|
-
literal: typeof literal;
|
|
129
|
-
literals: typeof literals;
|
|
130
|
-
never: typeof never;
|
|
131
|
-
null: typeof nullValue;
|
|
132
|
-
nullable: typeof nullable;
|
|
133
|
-
number: typeof number;
|
|
134
|
-
object: typeof object;
|
|
135
|
-
optional: typeof optional;
|
|
136
|
-
record: typeof record;
|
|
137
|
-
string: typeof string;
|
|
138
|
-
union: typeof union;
|
|
139
|
-
};
|
|
140
|
-
declare const environmentValues: {
|
|
141
|
-
array: typeof array;
|
|
142
|
-
boolean: typeof boolean;
|
|
143
|
-
date: typeof date;
|
|
144
|
-
integer: typeof integer;
|
|
145
|
-
literal: typeof literal;
|
|
146
|
-
literals: typeof literals;
|
|
147
|
-
never: typeof never;
|
|
148
|
-
null: typeof nullValue;
|
|
149
|
-
nullable: typeof nullable;
|
|
150
|
-
number: typeof number;
|
|
151
|
-
object: typeof object;
|
|
152
|
-
optional: typeof optional;
|
|
153
|
-
record: typeof record;
|
|
154
|
-
secret: typeof secret;
|
|
155
|
-
string: typeof string;
|
|
156
|
-
union: typeof union;
|
|
157
|
-
};
|
|
158
|
-
type EnvironmentValues = typeof environmentValues;
|
|
159
|
-
type DocumentDefinition<Definition extends TableDefinitions, TableName extends TableNameOf$2<Definition>> = ObjectDefinition<Struct.Assign<ResolvedFields<Definition[TableName]["fields"]>, {
|
|
160
|
-
readonly id: IdDefinition<TableName>;
|
|
161
|
-
readonly createdAt: typeof Schema.DateFromMillis;
|
|
162
|
-
readonly updatedAt: typeof Schema.DateFromMillis;
|
|
163
|
-
}>>;
|
|
164
|
-
type BoundValues<Definition extends TableDefinitions> = Omit<typeof values, "id"> & {
|
|
165
|
-
readonly doc: <const TableName extends TableNameOf$2<Definition>>(tableName: TableName) => DocumentDefinition<Definition, TableName>;
|
|
166
|
-
readonly id: <const TableName extends TableNameOf$2<Definition>>(tableName: TableName) => IdDefinition<TableName>;
|
|
167
|
-
readonly page: typeof page;
|
|
168
|
-
readonly pagination: () => ReturnType<typeof pagination> & Schema.Schema<PaginationOptions>;
|
|
169
|
-
};
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region ../contracts/dist/types-D4UfDuy-.d.ts
|
|
172
|
-
//#region src/schema/environment.d.ts
|
|
173
|
-
declare const EnvironmentDefinitionTypeId: unique symbol;
|
|
174
|
-
declare const EnvironmentDecoderTypeId: unique symbol;
|
|
175
|
-
type EnvironmentFields = {
|
|
176
|
-
readonly [fieldName: PropertyKey]: DescribedValue<Schema.ConstraintDecoder<unknown, never>>;
|
|
177
|
-
};
|
|
178
|
-
interface DefinedEnv<Fields extends EnvironmentFields = EnvironmentFields> {
|
|
179
|
-
readonly _tag: "Environment";
|
|
180
|
-
readonly fields: Fields;
|
|
181
|
-
readonly descriptors: ReadonlyArray<DescriptorField>;
|
|
182
|
-
readonly schema: Schema.Struct<Fields>;
|
|
183
|
-
readonly [EnvironmentDefinitionTypeId]: Fields;
|
|
184
|
-
readonly [EnvironmentDecoderTypeId]: (raw: Readonly<Record<string, string>>) => Effect.Effect<Readonly<EnvironmentType<DefinedEnv<Fields>>>, EnvironmentValueInvalid>;
|
|
185
|
-
}
|
|
186
|
-
interface EnvironmentAuthoring {
|
|
187
|
-
readonly values: EnvironmentValues;
|
|
188
|
-
}
|
|
189
|
-
type EnvironmentType<Environment extends DefinedEnv> = Schema.Struct.Type<Environment[typeof EnvironmentDefinitionTypeId]>;
|
|
190
|
-
declare const EnvironmentValueInvalid_base: Schema.Class<EnvironmentValueInvalid, Schema.TaggedStruct<"EnvironmentValueInvalid", {
|
|
191
|
-
readonly key: Schema.optional<Schema.String>;
|
|
192
|
-
readonly message: Schema.String;
|
|
193
|
-
}>, import("effect/Cause").YieldableError>;
|
|
194
|
-
declare class EnvironmentValueInvalid extends EnvironmentValueInvalid_base {}
|
|
195
|
-
declare const defineEnv: <const Fields extends EnvironmentFields>(define: (authoring: EnvironmentAuthoring) => Fields) => DefinedEnv<Fields>;
|
|
196
|
-
declare const emptyEnv: DefinedEnv<{}>;
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region src/schema/types.d.ts
|
|
199
|
-
/** A document identifier branded with the table it belongs to. */
|
|
200
|
-
type Id<TableName extends string> = GeneratedId & Brand.Brand<`ignotum/id/${TableName}`>;
|
|
201
|
-
declare const SchemaDefinitionTypeId: unique symbol;
|
|
202
|
-
interface SchemaDefinitionContract<Definition> {
|
|
203
|
-
readonly [SchemaDefinitionTypeId]: Definition;
|
|
204
|
-
}
|
|
205
|
-
type SchemaDefinitionOf<SchemaDefinition> = SchemaDefinition extends SchemaDefinitionContract<infer Definition> ? Definition : never;
|
|
206
|
-
interface TableDefinitionLike {
|
|
207
|
-
readonly fields: Schema.Struct.Fields;
|
|
208
|
-
}
|
|
209
|
-
interface TablesLike {
|
|
210
|
-
readonly [tableName: string]: TableDefinitionLike;
|
|
211
|
-
}
|
|
212
|
-
type TableNameOf$1<Definition extends TablesLike> = keyof Definition & string;
|
|
213
|
-
interface SystemFields<TableName extends string> {
|
|
214
|
-
readonly id: Id<TableName>;
|
|
215
|
-
readonly createdAt: Date;
|
|
216
|
-
readonly updatedAt: Date;
|
|
217
|
-
}
|
|
218
|
-
type DocumentFields<TableName extends string, Table extends TableDefinitionLike> = SystemFields<TableName> & Schema.Struct.Type<Table["fields"]>;
|
|
219
|
-
/** The complete document returned for a table, including Ignotum system fields. */
|
|
220
|
-
type Document<Definition extends TablesLike, TableName extends TableNameOf$1<Definition>> = { readonly [FieldName in keyof DocumentFields<TableName, Definition[TableName]>]: DocumentFields<TableName, Definition[TableName]>[FieldName]; };
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region ../contracts/dist/schema/index.d.ts
|
|
223
|
-
//#region src/schema/definition.d.ts
|
|
224
|
-
type AnyTableDefinition = TableDefinition<Schema.Struct.Fields, IndexDefinitions>;
|
|
225
|
-
interface Tables {
|
|
226
|
-
readonly [tableName: string]: AnyTableDefinition;
|
|
227
|
-
}
|
|
228
|
-
type FieldsOf<Table extends AnyTableDefinition> = Table["fields"];
|
|
229
|
-
type IdTargetsOfFields<Fields extends Schema.Struct.Fields> = { readonly [FieldName in keyof Fields]: IdTargetsOf<Fields[FieldName]>; }[keyof Fields];
|
|
230
|
-
declare const UnknownTableReferenceTypeId: unique symbol;
|
|
231
|
-
interface UnknownTableReference<TableName extends string> {
|
|
232
|
-
readonly [UnknownTableReferenceTypeId]: `Unknown table reference: ${TableName}`;
|
|
233
|
-
}
|
|
234
|
-
type DefinitionReferenceValidation<Definitions extends Tables> = { readonly [TableName in keyof Definitions]: Exclude<IdTargetsOfFields<FieldsOf<Definitions[TableName]>>, keyof Definitions & string> extends (infer UnknownTarget extends string) ? [UnknownTarget] extends [never] ? unknown : UnknownTableReference<UnknownTarget> : never; };
|
|
235
|
-
type TableNameOf<SchemaDefinition extends Tables> = keyof SchemaDefinition & string;
|
|
236
|
-
interface DefinedSchema<SchemaDefinition extends Tables> extends SchemaDefinitionContract<SchemaDefinition> {
|
|
237
|
-
readonly _tag: "Schema";
|
|
238
|
-
}
|
|
239
|
-
interface SchemaAuthoring {
|
|
240
|
-
readonly table: typeof table;
|
|
241
|
-
readonly values: typeof values;
|
|
242
|
-
}
|
|
243
|
-
declare const defineSchema: <const Definitions extends Tables>(define: (authoring: SchemaAuthoring) => Definitions & DefinitionReferenceValidation<NoInfer<Definitions>>) => DefinedSchema<Definitions>;
|
|
244
|
-
//#endregion
|
|
245
|
-
//#region src/schema/server.d.ts
|
|
246
|
-
type TransportSchema = Schema.ConstraintCodec<unknown, unknown, never, never>;
|
|
247
|
-
interface ErrorSchema extends Schema.ConstraintCodec<ErrorValue, unknown, never, never> {
|
|
248
|
-
readonly Type: ErrorValue;
|
|
249
|
-
}
|
|
250
|
-
interface ResolvedFunctionValue {
|
|
251
|
-
readonly [UnresolvedReferencesTypeId]?: never;
|
|
252
|
-
}
|
|
253
|
-
type ContainsFile<Value> = Value extends FileValue ? true : Value extends Date ? false : Value extends ReadonlyArray<infer Item> ? true extends ContainsFile<Item> ? true : false : Value extends object ? true extends { [Key in keyof Value]-?: ContainsFile<Value[Key]>; }[keyof Value] ? true : false : false;
|
|
254
|
-
declare const InvalidFilePositionTypeId: unique symbol;
|
|
255
|
-
type FileFree<Value, Position extends string> = true extends ContainsFile<Value> ? {
|
|
256
|
-
readonly [InvalidFilePositionTypeId]: `Files cannot appear in ${Position}`;
|
|
257
|
-
} : unknown;
|
|
258
|
-
type ResolvedFunctionFields<Fields extends Schema.Struct.Fields> = { readonly [FieldName in keyof Fields]: Fields[FieldName] & ResolvedFunctionValue & TransportSchema; };
|
|
259
|
-
interface ForbiddenSystemFields {
|
|
260
|
-
readonly id?: never;
|
|
261
|
-
readonly createdAt?: never;
|
|
262
|
-
readonly updatedAt?: never;
|
|
263
|
-
}
|
|
264
|
-
type InsertOf<Table extends Tables[string]> = Schema.Struct.MakeIn<FieldsOf<Table>> & ForbiddenSystemFields;
|
|
265
|
-
type PatchOf<Table extends Tables[string]> = Partial<Schema.Struct.MakeIn<FieldsOf<Table>>> & ForbiddenSystemFields;
|
|
266
|
-
type FunctionArgs = Schema.Struct.Fields | undefined;
|
|
267
|
-
type FunctionReturns = TransportSchema | undefined;
|
|
268
|
-
type ArgsOf<Args extends FunctionArgs> = Args extends Schema.Struct.Fields ? keyof Args extends never ? void : Schema.Struct.Type<Args> : void;
|
|
269
|
-
type ReturnOf<Returns extends FunctionReturns> = Returns extends TransportSchema ? Returns["Type"] : void;
|
|
270
|
-
type DocumentNotFound<TableName extends string = string> = DocumentNotFoundValue<TableName, Id<TableName>>;
|
|
271
|
-
declare const IndexRangeTypeId: unique symbol;
|
|
272
|
-
interface IndexRangeExpression {
|
|
273
|
-
readonly [IndexRangeTypeId]: true;
|
|
274
|
-
}
|
|
275
|
-
type IndexFields<Definition extends Tables, Name extends TableNameOf<Definition>, IndexName extends keyof Definition[Name]["indexes"]> = Definition[Name]["indexes"][IndexName]["fields"] extends (infer Fields extends readonly string[]) ? readonly [...Fields, "createdAt", "id"] : never;
|
|
276
|
-
type IndexFieldValue<Definition extends Tables, Name extends TableNameOf<Definition>, FieldName extends string> = FieldName extends "createdAt" ? Date : FieldName extends "id" ? Id<Name> : FieldName extends keyof FieldsOf<Definition[Name]> ? FieldsOf<Definition[Name]>[FieldName]["Type"] : never;
|
|
277
|
-
interface IndexLowerBound<Definition extends Tables, Name extends TableNameOf<Definition>, FieldName extends string> extends IndexRangeExpression {
|
|
278
|
-
lt(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexRangeExpression;
|
|
279
|
-
lte(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexRangeExpression;
|
|
280
|
-
}
|
|
281
|
-
interface IndexUpperBound<Definition extends Tables, Name extends TableNameOf<Definition>, FieldName extends string> extends IndexRangeExpression {
|
|
282
|
-
gt(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexRangeExpression;
|
|
283
|
-
gte(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexRangeExpression;
|
|
284
|
-
}
|
|
285
|
-
interface IndexRangeBuilder<Definition extends Tables, Name extends TableNameOf<Definition>, Fields extends readonly string[]> extends IndexRangeExpression {
|
|
286
|
-
eq<FieldName extends Fields[0]>(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexRangeBuilder<Definition, Name, Fields extends readonly [string, ...infer Rest extends string[]] ? Rest : []>;
|
|
287
|
-
gt<FieldName extends Fields[0]>(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexLowerBound<Definition, Name, FieldName>;
|
|
288
|
-
gte<FieldName extends Fields[0]>(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexLowerBound<Definition, Name, FieldName>;
|
|
289
|
-
lt<FieldName extends Fields[0]>(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexUpperBound<Definition, Name, FieldName>;
|
|
290
|
-
lte<FieldName extends Fields[0]>(field: FieldName, value: IndexFieldValue<Definition, Name, FieldName>): IndexUpperBound<Definition, Name, FieldName>;
|
|
291
|
-
}
|
|
292
|
-
interface OrderedDatabaseQuery<Definition extends Tables, Name extends TableNameOf<Definition>> {
|
|
293
|
-
collect(): Result$1<ReadonlyArray<Document<Definition, Name>>, never>;
|
|
294
|
-
take(count: number): Result$1<ReadonlyArray<Document<Definition, Name>>, never>;
|
|
295
|
-
first(): Result$1<Document<Definition, Name> | undefined, never>;
|
|
296
|
-
unique(): Result$1<Document<Definition, Name> | undefined, never>;
|
|
297
|
-
paginate(options: PaginationOptions): Result$1<PaginationPage<Document<Definition, Name>>, never>;
|
|
298
|
-
}
|
|
299
|
-
interface SelectableDatabaseQuery<Definition extends Tables, Name extends TableNameOf<Definition>> extends OrderedDatabaseQuery<Definition, Name> {
|
|
300
|
-
order(direction: "asc" | "desc"): OrderedDatabaseQuery<Definition, Name>;
|
|
301
|
-
}
|
|
302
|
-
interface DatabaseQuery<Definition extends Tables, Name extends TableNameOf<Definition>> extends SelectableDatabaseQuery<Definition, Name> {
|
|
303
|
-
index<const IndexName extends keyof Definition[Name]["indexes"] & string>(name: IndexName, range?: (builder: IndexRangeBuilder<Definition, Name, IndexFields<Definition, Name, IndexName>>) => IndexRangeExpression): SelectableDatabaseQuery<Definition, Name>;
|
|
304
|
-
}
|
|
305
|
-
interface DatabaseReader<Definition extends Tables> {
|
|
306
|
-
query<const Name extends TableNameOf<Definition>>(name: Name): DatabaseQuery<Definition, Name>;
|
|
307
|
-
find<const Name extends TableNameOf<Definition>>(name: Name, id: Id<NoInfer<Name>>): Result$1<Document<Definition, Name> | undefined, never>;
|
|
308
|
-
get<const Name extends TableNameOf<Definition>>(name: Name, id: Id<NoInfer<Name>>): Result$1<Document<Definition, Name>, DocumentNotFound<Name>>;
|
|
309
|
-
}
|
|
310
|
-
interface DatabaseWriter<Definition extends Tables> extends DatabaseReader<Definition> {
|
|
311
|
-
delete<const Name extends TableNameOf<Definition>>(name: Name, id: Id<NoInfer<Name>>): Result$1<void, DocumentNotFound<Name>>;
|
|
312
|
-
insert<const Name extends TableNameOf<Definition>>(name: Name, value: InsertOf<Definition[NoInfer<Name>]>): Result$1<Id<Name>, never>;
|
|
313
|
-
patch<const Name extends TableNameOf<Definition>>(name: Name, id: Id<NoInfer<Name>>, value: PatchOf<Definition[NoInfer<Name>]>): Result$1<void, DocumentNotFound<Name>>;
|
|
314
|
-
replace<const Name extends TableNameOf<Definition>>(name: Name, id: Id<NoInfer<Name>>, value: InsertOf<Definition[NoInfer<Name>]>): Result$1<void, DocumentNotFound<Name>>;
|
|
315
|
-
}
|
|
316
|
-
interface QueryContext<Definition extends Tables, Environment extends DefinedEnv = typeof emptyEnv> {
|
|
317
|
-
readonly db: DatabaseReader<Definition>;
|
|
318
|
-
readonly env: EnvironmentType<Environment>;
|
|
319
|
-
readonly id: IdContext;
|
|
320
|
-
}
|
|
321
|
-
interface MutationContext<Definition extends Tables, Environment extends DefinedEnv = typeof emptyEnv> {
|
|
322
|
-
readonly db: DatabaseWriter<Definition>;
|
|
323
|
-
readonly env: EnvironmentType<Environment>;
|
|
324
|
-
readonly id: IdContext;
|
|
325
|
-
}
|
|
326
|
-
type FunctionKind = "Mutation" | "Query";
|
|
327
|
-
type HandlerContext<Kind extends FunctionKind, Definition extends Tables, Environment extends DefinedEnv> = Kind extends "Query" ? QueryContext<Definition, Environment> : MutationContext<Definition, Environment>;
|
|
328
|
-
type Handler<Kind extends FunctionKind, Definition extends Tables, Environment extends DefinedEnv, Args extends FunctionArgs, Success, Failure extends ErrorValue> = (ctx: HandlerContext<Kind, Definition, Environment>, args: ArgsOf<Args>) => Generator<Effect.Effect<unknown, Failure, never>, Success, never>;
|
|
329
|
-
type HandlerFailure<HandlerType> = HandlerType extends ((...arguments_: infer _Arguments) => Generator<infer Yielded, unknown, never>) ? Yielded extends Effect.Effect<unknown, infer Failure extends ErrorValue, never> ? Failure : never : never;
|
|
330
|
-
type FunctionDefinition<Kind extends FunctionKind, Definition extends Tables, Environment extends DefinedEnv, Args extends FunctionArgs, Returns extends FunctionReturns, Errors extends ErrorSchema | undefined, Failure extends ErrorValue> = {
|
|
331
|
-
readonly _tag: Kind;
|
|
332
|
-
readonly handler: Handler<Kind, Definition, Environment, Args, ReturnOf<Returns>, Failure>;
|
|
333
|
-
} & (Args extends Schema.Struct.Fields ? {
|
|
334
|
-
readonly args: Args;
|
|
335
|
-
} : {
|
|
336
|
-
readonly args?: never;
|
|
337
|
-
}) & (Returns extends TransportSchema ? {
|
|
338
|
-
readonly returns: Returns;
|
|
339
|
-
} : {
|
|
340
|
-
readonly returns?: never;
|
|
341
|
-
}) & (Errors extends ErrorSchema ? {
|
|
342
|
-
readonly errors: Errors;
|
|
343
|
-
} : {
|
|
344
|
-
readonly errors?: never;
|
|
345
|
-
});
|
|
346
|
-
interface FunctionInput<Kind extends FunctionKind, Definition extends Tables, Environment extends DefinedEnv, Args extends FunctionArgs, Success, Failure extends ErrorValue> {
|
|
347
|
-
readonly handler: Handler<Kind, Definition, Environment, Args, Success, Failure>;
|
|
348
|
-
}
|
|
349
|
-
type WithArgs<Kind extends FunctionKind, Args extends Schema.Struct.Fields> = {
|
|
350
|
-
readonly args: Args & ResolvedFunctionFields<NoInfer<Args>> & (Kind extends "Query" ? FileFree<Schema.Struct.Type<Args>, "query arguments"> : unknown);
|
|
351
|
-
};
|
|
352
|
-
interface WithoutArgs {
|
|
353
|
-
readonly args?: never;
|
|
354
|
-
}
|
|
355
|
-
type WithReturns<Kind extends FunctionKind, Returns extends TransportSchema> = {
|
|
356
|
-
readonly returns: Returns & ResolvedFunctionValue & (Kind extends "Mutation" ? FileFree<Returns["Type"], "mutation returns"> : unknown);
|
|
357
|
-
};
|
|
358
|
-
interface WithoutReturns {
|
|
359
|
-
readonly returns?: never;
|
|
360
|
-
}
|
|
361
|
-
interface DefineFunction<Kind extends FunctionKind, Definition extends Tables, Environment extends DefinedEnv> {
|
|
362
|
-
<const Args extends Schema.Struct.Fields, Returns extends TransportSchema, Errors extends ErrorSchema>(definition: FunctionInput<Kind, Definition, Environment, Args, Returns["Type"], Errors["Type"]> & WithArgs<Kind, Args> & WithReturns<Kind, Returns> & {
|
|
363
|
-
readonly errors: Errors & ResolvedFunctionValue & FileFree<Errors["Type"], "errors">;
|
|
364
|
-
}): FunctionDefinition<Kind, Definition, Environment, Args, Returns, Errors, Errors["Type"]>;
|
|
365
|
-
<Returns extends TransportSchema, Errors extends ErrorSchema>(definition: FunctionInput<Kind, Definition, Environment, undefined, Returns["Type"], Errors["Type"]> & WithoutArgs & WithReturns<Kind, Returns> & {
|
|
366
|
-
readonly errors: Errors & ResolvedFunctionValue & FileFree<Errors["Type"], "errors">;
|
|
367
|
-
}): FunctionDefinition<Kind, Definition, Environment, undefined, Returns, Errors, Errors["Type"]>;
|
|
368
|
-
<const Args extends Schema.Struct.Fields, Errors extends ErrorSchema>(definition: FunctionInput<Kind, Definition, Environment, Args, void, Errors["Type"]> & WithArgs<Kind, Args> & WithoutReturns & {
|
|
369
|
-
readonly errors: Errors & ResolvedFunctionValue & FileFree<Errors["Type"], "errors">;
|
|
370
|
-
}): FunctionDefinition<Kind, Definition, Environment, Args, undefined, Errors, Errors["Type"]>;
|
|
371
|
-
<Errors extends ErrorSchema>(definition: FunctionInput<Kind, Definition, Environment, undefined, void, Errors["Type"]> & WithoutArgs & WithoutReturns & {
|
|
372
|
-
readonly errors: Errors & ResolvedFunctionValue & FileFree<Errors["Type"], "errors">;
|
|
373
|
-
}): FunctionDefinition<Kind, Definition, Environment, undefined, undefined, Errors, Errors["Type"]>;
|
|
374
|
-
<const Args extends Schema.Struct.Fields, Returns extends TransportSchema, HandlerType extends Handler<Kind, Definition, Environment, Args, Returns["Type"], ErrorValue> = Handler<Kind, Definition, Environment, Args, Returns["Type"], never>>(definition: WithArgs<Kind, Args> & WithReturns<Kind, Returns> & {
|
|
375
|
-
readonly errors?: never;
|
|
376
|
-
readonly handler: HandlerType;
|
|
377
|
-
}): FunctionDefinition<Kind, Definition, Environment, Args, Returns, undefined, HandlerFailure<HandlerType>>;
|
|
378
|
-
<Returns extends TransportSchema, HandlerType extends Handler<Kind, Definition, Environment, undefined, Returns["Type"], ErrorValue> = Handler<Kind, Definition, Environment, undefined, Returns["Type"], never>>(definition: WithoutArgs & WithReturns<Kind, Returns> & {
|
|
379
|
-
readonly errors?: never;
|
|
380
|
-
readonly handler: HandlerType;
|
|
381
|
-
}): FunctionDefinition<Kind, Definition, Environment, undefined, Returns, undefined, HandlerFailure<HandlerType>>;
|
|
382
|
-
<const Args extends Schema.Struct.Fields, HandlerType extends Handler<Kind, Definition, Environment, Args, void, ErrorValue> = Handler<Kind, Definition, Environment, Args, void, never>>(definition: WithArgs<Kind, Args> & WithoutReturns & {
|
|
383
|
-
readonly errors?: never;
|
|
384
|
-
readonly handler: HandlerType;
|
|
385
|
-
}): FunctionDefinition<Kind, Definition, Environment, Args, undefined, undefined, HandlerFailure<HandlerType>>;
|
|
386
|
-
<HandlerType extends Handler<Kind, Definition, Environment, undefined, void, ErrorValue> = Handler<Kind, Definition, Environment, undefined, void, never>>(definition: WithoutArgs & WithoutReturns & {
|
|
387
|
-
readonly errors?: never;
|
|
388
|
-
readonly handler: HandlerType;
|
|
389
|
-
}): FunctionDefinition<Kind, Definition, Environment, undefined, undefined, undefined, HandlerFailure<HandlerType>>;
|
|
390
|
-
}
|
|
391
|
-
interface FunctionBuilders<Definition extends Tables, Environment extends DefinedEnv = typeof emptyEnv> {
|
|
392
|
-
readonly query: DefineFunction<"Query", Definition, Environment>;
|
|
393
|
-
readonly mutation: DefineFunction<"Mutation", Definition, Environment>;
|
|
394
|
-
}
|
|
395
|
-
interface SchemaBindings<Definition extends Tables, Environment extends DefinedEnv = typeof emptyEnv> extends FunctionBuilders<Definition, Environment> {
|
|
396
|
-
readonly values: BoundValues<Definition>;
|
|
397
|
-
}
|
|
398
|
-
declare function bindSchema<const Definition extends Tables>(schema: DefinedSchema<Definition>): SchemaBindings<Definition, typeof emptyEnv>;
|
|
399
|
-
declare function bindSchema<const Definition extends Tables, const Environment extends DefinedEnv>(schema: DefinedSchema<Definition>, environment: Environment): SchemaBindings<Definition, Environment>;
|
|
400
|
-
//#endregion
|
|
401
|
-
export { DefinedEnv as a, Id as c, defineEnv as d, Secret as f, defineSchema as i, SchemaDefinitionOf as l, SchemaAuthoring as n, Document as o, bindSchema as r, EnvironmentAuthoring as s, DefinedSchema as t, SchemaDefinitionTypeId as u };
|
|
402
|
-
//# sourceMappingURL=index-D54flWtH.d.ts.map
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { c as Result$1 } from "./id-BzFHf3Wo-DGPCjgrf.js";
|
|
2
|
-
import { Effect, Schema } from "effect";
|
|
3
|
-
//#region ../contracts/dist/id-W_I1iiJQ.d.ts
|
|
4
|
-
declare const UserId: Schema.brand<Schema.String, "ignotum/id/UserId">;
|
|
5
|
-
type UserId = typeof UserId.Type;
|
|
6
|
-
declare const User: Schema.Struct<{
|
|
7
|
-
readonly id: Schema.brand<Schema.String, "ignotum/id/UserId">;
|
|
8
|
-
readonly name: Schema.optional<Schema.String>;
|
|
9
|
-
readonly email: Schema.optional<Schema.String>;
|
|
10
|
-
readonly image: Schema.optional<Schema.String>;
|
|
11
|
-
}>;
|
|
12
|
-
type User = typeof User.Type;
|
|
13
|
-
declare const ProfileField: Schema.Literals<readonly ["name", "email", "image"]>;
|
|
14
|
-
type ProfileField = typeof ProfileField.Type;
|
|
15
|
-
declare const IdRequired: Schema.brand<Schema.Struct<{
|
|
16
|
-
readonly _tag: Schema.tag<"IdRequired">;
|
|
17
|
-
}>, "ignotum/error">;
|
|
18
|
-
type IdRequired = typeof IdRequired.Type;
|
|
19
|
-
interface IdContext {
|
|
20
|
-
readonly current: () => Result$1<User | null, never>;
|
|
21
|
-
readonly require: () => Result$1<User, IdRequired>;
|
|
22
|
-
}
|
|
23
|
-
declare const SessionOutcome: Schema.Literals<readonly ["SignedIn", "ProfileUpdated", "Cancelled"]>;
|
|
24
|
-
type SessionOutcome = typeof SessionOutcome.Type;
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region ../contracts/dist/descriptor-BM7e5QAn.d.ts
|
|
27
|
-
//#region src/schema/descriptor.d.ts
|
|
28
|
-
interface DescriptorField {
|
|
29
|
-
readonly name: string;
|
|
30
|
-
readonly value: ValueDescriptor;
|
|
31
|
-
}
|
|
32
|
-
type ValueDescriptor = {
|
|
33
|
-
readonly type: "array";
|
|
34
|
-
readonly value: ValueDescriptor;
|
|
35
|
-
} | {
|
|
36
|
-
readonly type: "boolean";
|
|
37
|
-
} | {
|
|
38
|
-
readonly type: "date";
|
|
39
|
-
} | {
|
|
40
|
-
readonly type: "file";
|
|
41
|
-
readonly formats: ReadonlyArray<"jpeg" | "png" | "webp" | "avif" | "gif">;
|
|
42
|
-
readonly maxBytes: number;
|
|
43
|
-
} | {
|
|
44
|
-
readonly type: "error";
|
|
45
|
-
readonly tag: string;
|
|
46
|
-
readonly fields: ReadonlyArray<DescriptorField>;
|
|
47
|
-
} | {
|
|
48
|
-
readonly type: "id";
|
|
49
|
-
readonly table: string;
|
|
50
|
-
} | {
|
|
51
|
-
readonly type: "userId";
|
|
52
|
-
} | {
|
|
53
|
-
readonly type: "integer";
|
|
54
|
-
} | {
|
|
55
|
-
readonly type: "literal";
|
|
56
|
-
readonly value: string | number | boolean;
|
|
57
|
-
} | {
|
|
58
|
-
readonly type: "literals";
|
|
59
|
-
readonly values: ReadonlyArray<string | number | boolean>;
|
|
60
|
-
} | {
|
|
61
|
-
readonly type: "never";
|
|
62
|
-
} | {
|
|
63
|
-
readonly type: "null";
|
|
64
|
-
} | {
|
|
65
|
-
readonly type: "nullable";
|
|
66
|
-
readonly value: ValueDescriptor;
|
|
67
|
-
} | {
|
|
68
|
-
readonly type: "number";
|
|
69
|
-
} | {
|
|
70
|
-
readonly type: "object";
|
|
71
|
-
readonly fields: ReadonlyArray<DescriptorField>;
|
|
72
|
-
} | {
|
|
73
|
-
readonly type: "optional";
|
|
74
|
-
readonly value: ValueDescriptor;
|
|
75
|
-
} | {
|
|
76
|
-
readonly type: "record";
|
|
77
|
-
readonly value: ValueDescriptor;
|
|
78
|
-
} | {
|
|
79
|
-
readonly type: "secret";
|
|
80
|
-
readonly value: ValueDescriptor;
|
|
81
|
-
} | {
|
|
82
|
-
readonly type: "string";
|
|
83
|
-
} | {
|
|
84
|
-
readonly type: "union";
|
|
85
|
-
readonly members: ReadonlyArray<ValueDescriptor>;
|
|
86
|
-
};
|
|
87
|
-
declare const ValueDescriptor: Schema.Codec<ValueDescriptor>;
|
|
88
|
-
declare const ValueDescriptorTypeId: unique symbol;
|
|
89
|
-
interface ValueDescriptorCarrier {
|
|
90
|
-
readonly [ValueDescriptorTypeId]: ValueDescriptor;
|
|
91
|
-
}
|
|
92
|
-
type DescribedValue<Value extends Schema.Constraint = Schema.Constraint> = Value & ValueDescriptorCarrier;
|
|
93
|
-
type ValueFields = {
|
|
94
|
-
readonly [fieldName: PropertyKey]: DescribedValue;
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region ../contracts/dist/pagination-DnKg3dkI.d.ts
|
|
98
|
-
//#region src/runtime/pagination.d.ts
|
|
99
|
-
declare const PaginationCursor: Schema.brand<Schema.String, "ignotum/runtime/PaginationCursor">;
|
|
100
|
-
type PaginationCursor = typeof PaginationCursor.Type;
|
|
101
|
-
declare const PaginationOptions: Schema.Struct<{
|
|
102
|
-
readonly cursor: Schema.NullOr<Schema.brand<Schema.String, "ignotum/runtime/PaginationCursor">>;
|
|
103
|
-
readonly pageSize: Schema.brand<Schema.Int, "ignotum/runtime/PaginationPageSize">;
|
|
104
|
-
}>;
|
|
105
|
-
type PaginationOptions = typeof PaginationOptions.Type;
|
|
106
|
-
interface PaginationPage<Item> {
|
|
107
|
-
readonly items: ReadonlyArray<Item>;
|
|
108
|
-
readonly nextCursor: PaginationCursor | null;
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
export { ValueDescriptor as a, IdContext as c, User as d, UserId as f, DescriptorField as i, ProfileField as l, PaginationPage as n, ValueDescriptorCarrier as o, DescribedValue as r, ValueFields as s, PaginationOptions as t, SessionOutcome as u };
|
|
112
|
-
//# sourceMappingURL=pagination-DnKg3dkI-r5ZUxBBx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./pagination-DnKg3dkI-r5ZUxBBx.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./id-BzFHf3Wo-DGPCjgrf.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-1Zs03-iS.js","names":["utf8ByteLength","Result$1"],"sources":["../../../contracts/dist/schema/values.js","../../../contracts/dist/runtime/schema.js","../../../contracts/dist/schema/index.js"],"sourcesContent":["import { GeneratedId } from \"../runtime/id.js\";\nimport { FileFormat, constrainedFileValue, fileFormats, fileLimits } from \"./file.js\";\nimport { ErrorBrand } from \"../runtime/result.js\";\nimport { UserId } from \"../id.js\";\nimport { c as getValueDescriptor, r as attachValueDescriptor, s as descriptorFields } from \"../descriptor-Cyo9FP9n.js\";\nimport { PaginationCursor, PaginationPageSize } from \"../runtime/pagination.js\";\nimport { Redacted, Schema, Struct } from \"effect\";\n//#region src/schema/values.ts\nconst LiteralValueSchema = Schema.Union([\n\tSchema.String,\n\tSchema.Finite,\n\tSchema.Boolean\n]);\nconst schemaIndexLimits = {\n\tfieldsPerIndex: 8,\n\tindexesPerSchema: 128,\n\tindexesPerTable: 16,\n\tkeyBytes: 4096,\n\tnameBytes: 64\n};\nconst utf8ByteLength = (value) => {\n\tlet bytes = 0;\n\tfor (const character of value) {\n\t\tconst point = character.codePointAt(0) ?? 0;\n\t\tbytes += point <= 127 ? 1 : point <= 2047 ? 2 : point <= 65535 ? 3 : 4;\n\t}\n\treturn bytes;\n};\nconst table = (fields) => {\n\tconst tableFields = fields;\n\tconst make = (indexes) => {\n\t\tconst index = (name, fieldNames) => {\n\t\t\tif (utf8ByteLength(name) > schemaIndexLimits.nameBytes) throw new Error(`Index names cannot exceed ${schemaIndexLimits.nameBytes} UTF-8 bytes.`);\n\t\t\tif (name.length === 0) throw new Error(\"Index names cannot be empty.\");\n\t\t\tif (name.startsWith(\"$\")) throw new Error(\"Index names beginning with '$' are reserved.\");\n\t\t\tif (Object.hasOwn(indexes, name)) throw new Error(`Duplicate index name '${name}'.`);\n\t\t\tif (fieldNames.length > schemaIndexLimits.fieldsPerIndex) throw new Error(`Indexes cannot contain more than ${schemaIndexLimits.fieldsPerIndex} fields.`);\n\t\t\tif (new Set(fieldNames).size !== fieldNames.length) throw new Error(`Index '${name}' contains duplicate fields.`);\n\t\t\tfor (const fieldName of fieldNames) {\n\t\t\t\tif (!Object.hasOwn(tableFields, fieldName)) throw new Error(`Index '${name}' references unknown field '${fieldName}'.`);\n\t\t\t\tconst descriptor = getValueDescriptor(tableFields[fieldName]);\n\t\t\t\tif (!(descriptor?.type === \"boolean\" || descriptor?.type === \"date\" || descriptor?.type === \"id\" || descriptor?.type === \"integer\" || descriptor?.type === \"number\" || descriptor?.type === \"string\" || descriptor?.type === \"literal\" || descriptor?.type === \"literals\")) throw new Error(`Index '${name}' field '${fieldName}' is not indexable.`);\n\t\t\t\tif (descriptor.type === \"literals\" && !(descriptor.values.every(Schema.is(Schema.Boolean)) || descriptor.values.every(Schema.is(Schema.Finite)) || descriptor.values.every(Schema.is(Schema.String)))) throw new Error(`Index '${name}' field '${fieldName}' mixes value types.`);\n\t\t\t}\n\t\t\tconst duplicate = Object.values(indexes).find((candidate) => candidate.fields.length === fieldNames.length && candidate.fields.every((fieldName, position) => fieldName === fieldNames[position]));\n\t\t\tif (duplicate !== void 0) throw new Error(`Index '${name}' duplicates index '${duplicate.name}'.`);\n\t\t\tif (Object.keys(indexes).length >= schemaIndexLimits.indexesPerTable) throw new Error(`Tables cannot declare more than ${schemaIndexLimits.indexesPerTable} indexes.`);\n\t\t\treturn make({\n\t\t\t\t...indexes,\n\t\t\t\t[name]: {\n\t\t\t\t\tname,\n\t\t\t\t\tfields: fieldNames\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\treturn {\n\t\t\t_tag: \"Table\",\n\t\t\tdescriptor: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tfields: descriptorFields(tableFields)\n\t\t\t},\n\t\t\tfields: tableFields,\n\t\t\tindex,\n\t\t\tindexes,\n\t\t\tschema: Schema.Struct(tableFields)\n\t\t};\n\t};\n\treturn make({});\n};\nconst fresh = (value) => value.pipe(Schema.annotate({}));\nconst string = () => attachValueDescriptor(fresh(Schema.String), { type: \"string\" });\nconst number = () => attachValueDescriptor(fresh(Schema.Finite), { type: \"number\" });\nconst integer = () => attachValueDescriptor(fresh(Schema.Int), { type: \"integer\" });\nconst boolean = () => attachValueDescriptor(fresh(Schema.Boolean), { type: \"boolean\" });\nconst date = () => attachValueDescriptor(fresh(Schema.DateFromMillis), { type: \"date\" });\nconst file = (options = {}) => {\n\tconst formats = options.formats ?? fileFormats;\n\tif (formats.length === 0) throw new Error(\"File format lists cannot be empty.\");\n\tSchema.decodeUnknownSync(Schema.Array(FileFormat))(formats);\n\tif (new Set(formats).size !== formats.length) throw new Error(\"File format lists cannot contain duplicates.\");\n\tconst maxBytes = options.maxBytes ?? fileLimits.fileBytes;\n\tif (!Number.isSafeInteger(maxBytes) || maxBytes <= 0 || maxBytes > fileLimits.fileBytes) throw new Error(`File sizes must be between 1 and ${fileLimits.fileBytes} bytes.`);\n\treturn attachValueDescriptor(constrainedFileValue(formats, maxBytes), {\n\t\ttype: \"file\",\n\t\tformats: [...formats],\n\t\tmaxBytes\n\t});\n};\nconst never = () => attachValueDescriptor(fresh(Schema.Never), { type: \"never\" });\nconst nullValue = () => attachValueDescriptor(fresh(Schema.Null), { type: \"null\" });\nconst literal = (value) => {\n\tSchema.decodeSync(LiteralValueSchema)(value);\n\treturn attachValueDescriptor(Schema.Literal(value), {\n\t\ttype: \"literal\",\n\t\tvalue\n\t});\n};\nconst literals = (...members) => {\n\tSchema.decodeSync(Schema.Array(LiteralValueSchema))(members);\n\treturn attachValueDescriptor(Schema.Literals(members), {\n\t\ttype: \"literals\",\n\t\tvalues: members\n\t});\n};\nconst makeIdSchema = (tableName) => {\n\tconst identifier = `ignotum/id/${tableName}`;\n\treturn attachValueDescriptor(GeneratedId.pipe(Schema.brand(identifier), Schema.annotate({ \"ignotum/table\": tableName })), {\n\t\ttype: \"id\",\n\t\ttable: tableName\n\t});\n};\nconst userId = () => attachValueDescriptor(fresh(UserId), { type: \"userId\" });\nconst id = (tableName) => makeIdSchema(tableName);\nconst requireDescriptor = (value) => {\n\tconst descriptor = getValueDescriptor(value);\n\tif (descriptor === void 0) throw new Error(\"Ignotum value combinators require a values validator.\");\n\treturn descriptor;\n};\nconst array = (value) => {\n\treturn attachValueDescriptor(Schema.Array(value), {\n\t\ttype: \"array\",\n\t\tvalue: requireDescriptor(value)\n\t});\n};\nconst assertFieldsExist = (fields, keys, operation) => {\n\tfor (const key of keys) if (!Object.hasOwn(fields, key)) throw new Error(`Cannot ${operation} unknown field '${String(key)}'.`);\n};\nconst fixedObject = (fields) => {\n\tconst pick = (...keys) => {\n\t\tassertFieldsExist(fields, keys, \"pick\");\n\t\treturn fixedObject(Struct.pick(fields, keys));\n\t};\n\tconst omit = (...keys) => {\n\t\tassertFieldsExist(fields, keys, \"omit\");\n\t\treturn fixedObject(Struct.omit(fields, keys));\n\t};\n\tconst extend = (addedFields, ..._validation) => {\n\t\tfor (const key of Reflect.ownKeys(addedFields)) if (Object.hasOwn(fields, key)) throw new Error(`Cannot extend existing field '${String(key)}'.`);\n\t\treturn fixedObject(Struct.assign(fields, addedFields));\n\t};\n\tconst override = (overriddenFields, ..._validation) => {\n\t\tassertFieldsExist(fields, Reflect.ownKeys(overriddenFields), \"override\");\n\t\treturn fixedObject(Struct.assign(fields, overriddenFields));\n\t};\n\tconst partial = () => {\n\t\tconst partialFields = Struct.map(fields, Schema.optional);\n\t\tfor (const name of Reflect.ownKeys(fields)) {\n\t\t\tconst field = fields[name];\n\t\t\tconst partialField = partialFields[name];\n\t\t\tif (field === void 0 || partialField === void 0) continue;\n\t\t\tattachValueDescriptor(partialField, {\n\t\t\t\ttype: \"optional\",\n\t\t\t\tvalue: requireDescriptor(field)\n\t\t\t});\n\t\t}\n\t\treturn fixedObject(partialFields);\n\t};\n\tconst schema = attachValueDescriptor(Schema.Struct(fields), {\n\t\ttype: \"object\",\n\t\tfields: descriptorFields(fields)\n\t});\n\treturn Object.assign(schema, {\n\t\textend,\n\t\tomit,\n\t\toverride,\n\t\tpartial,\n\t\tpick\n\t});\n};\nconst object = (fields) => fixedObject(fields);\nconst optional = (value) => {\n\treturn attachValueDescriptor(Schema.optional(value), {\n\t\ttype: \"optional\",\n\t\tvalue: requireDescriptor(value)\n\t});\n};\nconst nullable = (value) => {\n\treturn attachValueDescriptor(Schema.NullOr(value), {\n\t\ttype: \"nullable\",\n\t\tvalue: requireDescriptor(value)\n\t});\n};\nconst record = (value) => {\n\treturn attachValueDescriptor(Schema.Record(Schema.String, value), {\n\t\ttype: \"record\",\n\t\tvalue: requireDescriptor(value)\n\t});\n};\nconst union = (...members) => {\n\treturn attachValueDescriptor(Schema.Union(members), {\n\t\ttype: \"union\",\n\t\tmembers: members.map(requireDescriptor)\n\t});\n};\nconst Secret = {\n\tisSecret: Redacted.isRedacted,\n\tvalue: Redacted.value\n};\nfunction secret(value = string()) {\n\treturn attachValueDescriptor(Schema.RedactedFromValue(value, { disallowEncode: true }), {\n\t\ttype: \"secret\",\n\t\tvalue: requireDescriptor(value)\n\t});\n}\nconst paginationCursor = () => attachValueDescriptor(fresh(PaginationCursor), { type: \"string\" });\nconst pagination = () => fixedObject({\n\tcursor: nullable(paginationCursor()),\n\tpageSize: attachValueDescriptor(fresh(PaginationPageSize), { type: \"integer\" })\n});\nconst page = (value) => {\n\treturn fixedObject({\n\t\titems: array(value),\n\t\tnextCursor: nullable(paginationCursor())\n\t});\n};\nconst error = (tag, fields) => {\n\tif (tag === \"InternalServerError\") throw new Error(\"The error tag 'InternalServerError' is reserved by Ignotum.\");\n\tconst errorFields = { ...fields };\n\tReflect.deleteProperty(errorFields, \"_tag\");\n\tconst schema = Schema.TaggedStruct(tag, errorFields).pipe(Schema.brand(ErrorBrand));\n\tconst make = (input) => schema.make(input);\n\tconst definition = Object.assign(make, schema);\n\tObject.setPrototypeOf(definition, Object.getPrototypeOf(schema));\n\tattachValueDescriptor(definition, {\n\t\ttype: \"error\",\n\t\ttag,\n\t\tfields: descriptorFields(errorFields)\n\t});\n\treturn definition;\n};\nconst values = {\n\tuserId,\n\tarray,\n\tboolean,\n\tdate,\n\tfile,\n\terror,\n\tid,\n\tinteger,\n\tliteral,\n\tliterals,\n\tnever,\n\tnull: nullValue,\n\tnullable,\n\tnumber,\n\tobject,\n\toptional,\n\trecord,\n\tstring,\n\tunion\n};\nconst environmentValues = {\n\tarray,\n\tboolean,\n\tdate,\n\tinteger,\n\tliteral,\n\tliterals,\n\tnever,\n\tnull: nullValue,\n\tnullable,\n\tnumber,\n\tobject,\n\toptional,\n\trecord,\n\tsecret,\n\tstring,\n\tunion\n};\nconst bindValues = (definition) => {\n\tconst boundId = (tableName) => makeIdSchema(tableName);\n\tconst doc = (tableName) => {\n\t\tconst tableDefinition = definition[tableName];\n\t\tif (tableDefinition === void 0) throw new Error(`Unknown table '${tableName}'.`);\n\t\tconst tableFields = tableDefinition.fields;\n\t\tconst systemFields = {\n\t\t\tid: boundId(tableName),\n\t\t\tcreatedAt: date(),\n\t\t\tupdatedAt: date()\n\t\t};\n\t\treturn fixedObject(Struct.assign(tableFields, systemFields));\n\t};\n\tconst boundPagination = () => {\n\t\treturn pagination();\n\t};\n\treturn {\n\t\t...values,\n\t\tdoc,\n\t\tid: boundId,\n\t\tpage,\n\t\tpagination: boundPagination\n\t};\n};\n//#endregion\nexport { Secret, bindValues, environmentValues, schemaIndexLimits, table, values };\n\n//# sourceMappingURL=values.js.map","//#region src/runtime/schema.ts\nconst FunctionSchemaTypeId = Symbol.for(\"ignotum/runtime/schema/FunctionSchema\");\nconst FunctionEnvironmentTypeId = Symbol.for(\"ignotum/runtime/schema/FunctionEnvironment\");\nconst attachFunctionSchema = (schema) => (definition) => {\n\tObject.defineProperty(definition, FunctionSchemaTypeId, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: schema,\n\t\twritable: false\n\t});\n\treturn definition;\n};\nconst getFunctionSchema = (value) => value[FunctionSchemaTypeId];\nconst attachFunctionEnvironment = (environment) => (definition) => {\n\tObject.defineProperty(definition, FunctionEnvironmentTypeId, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: environment,\n\t\twritable: false\n\t});\n\treturn definition;\n};\nconst getFunctionEnvironment = (value) => value[FunctionEnvironmentTypeId];\n//#endregion\nexport { FunctionEnvironmentTypeId, FunctionSchemaTypeId, attachFunctionEnvironment, attachFunctionSchema, getFunctionEnvironment, getFunctionSchema };\n\n//# sourceMappingURL=schema.js.map","import { FileFormat, FileId, FileValue, FileValueTypeId, fileFormats, fileLimits, fileMimeTypes, isFileValue } from \"./file.js\";\nimport { Result } from \"../runtime/result.js\";\nimport { a as descriptorContainsFile, c as getValueDescriptor, i as descriptorAllowedInEnvironment, n as ValueDescriptorTypeId, o as descriptorContainsSecret, s as descriptorFields, t as ValueDescriptor } from \"../descriptor-Cyo9FP9n.js\";\nimport { Secret, bindValues, environmentValues, schemaIndexLimits, table, values } from \"./values.js\";\nimport { attachFunctionEnvironment, attachFunctionSchema } from \"../runtime/schema.js\";\nimport { Effect, Predicate, Result as Result$1, Schema } from \"effect\";\n//#region src/schema/types.ts\nconst SchemaDefinitionTypeId = Symbol.for(\"ignotum/schema/SchemaDefinition\");\n//#endregion\n//#region src/schema/definition.ts\nconst defineSchema = (define) => {\n\tconst definitions = define({\n\t\ttable,\n\t\tvalues\n\t});\n\tif (Object.values(definitions).reduce((count, definition) => count + Object.keys(definition.indexes).length, 0) > schemaIndexLimits.indexesPerSchema) throw new Error(`Schemas cannot declare more than ${schemaIndexLimits.indexesPerSchema} indexes.`);\n\treturn {\n\t\t_tag: \"Schema\",\n\t\t[SchemaDefinitionTypeId]: definitions\n\t};\n};\nconst isDefinedSchema = (value) => value._tag === \"Schema\" && Predicate.isObject(value[SchemaDefinitionTypeId]);\n//#endregion\n//#region src/schema/environment.ts\nconst EnvironmentDefinitionTypeId = Symbol.for(\"ignotum/schema/EnvironmentDefinition\");\nconst EnvironmentDecoderTypeId = Symbol.for(\"ignotum/schema/EnvironmentDecoder\");\nconst environmentLimits = {\n\tbytes: 65536,\n\tvariables: 128\n};\nvar EnvironmentValueInvalid = class extends Schema.TaggedError()(\"EnvironmentValueInvalid\", {\n\tkey: Schema.optional(Schema.String),\n\tmessage: Schema.String\n}) {};\nconst environmentName = /^[A-Z_][A-Z0-9_]*$/;\nconst defineEnv = (define) => {\n\tconst fields = define({ values: environmentValues });\n\tif (Reflect.ownKeys(fields).length > environmentLimits.variables) throw new Error(`Environments cannot declare more than ${environmentLimits.variables} variables.`);\n\tfor (const name of Reflect.ownKeys(fields)) {\n\t\tif (!Predicate.isString(name)) throw new Error(\"Environment variable names must be strings.\");\n\t\tif (!environmentName.test(name)) throw new Error(`Environment variable '${name}' must match ${environmentName.source}.`);\n\t\tif (name.startsWith(\"IGNOTUM_\")) throw new Error(`Environment variable '${name}' uses the reserved IGNOTUM_ prefix.`);\n\t}\n\tconst descriptors = descriptorFields(fields);\n\tfor (const field of descriptors) if (!descriptorAllowedInEnvironment(field.value)) throw new Error(`Environment variable '${field.name}' uses an unsupported validator.`);\n\tconst environment = {\n\t\t_tag: \"Environment\",\n\t\tfields,\n\t\tdescriptors,\n\t\tschema: Schema.Struct(fields),\n\t\t[EnvironmentDefinitionTypeId]: fields\n\t};\n\tObject.defineProperty(environment, EnvironmentDecoderTypeId, {\n\t\tenumerable: false,\n\t\tvalue: (raw) => decodeEnvironment(environment, raw)\n\t});\n\treturn Object.freeze(environment);\n};\nconst emptyEnv = defineEnv(() => ({}));\nconst isDefinedEnv = (value) => value._tag === \"Environment\" && Predicate.isObject(value[EnvironmentDefinitionTypeId]);\nconst utf8ByteLength = (value) => {\n\tlet bytes = 0;\n\tfor (const character of value) {\n\t\tconst point = character.codePointAt(0) ?? 0;\n\t\tbytes += point <= 127 ? 1 : point <= 2047 ? 2 : point <= 65535 ? 3 : 4;\n\t}\n\treturn bytes;\n};\nconst invalidValue = (key) => EnvironmentValueInvalid.make({\n\tkey,\n\tmessage: `Environment variable '${key}' does not match its declaration.`\n});\nconst decodeEnvironment = Effect.fn(\"Environment.decode\")(function* (environment, raw) {\n\tconst declared = new Set(Object.keys(environment.fields));\n\tconst supplied = Object.keys(raw);\n\tif (supplied.length > environmentLimits.variables) return yield* EnvironmentValueInvalid.make({ message: `Environments cannot contain more than ${environmentLimits.variables} variables.` });\n\tconst rawJson = JSON.stringify(raw);\n\tif (utf8ByteLength(rawJson) > environmentLimits.bytes) return yield* EnvironmentValueInvalid.make({ message: `Environments cannot exceed ${environmentLimits.bytes} UTF-8 bytes.` });\n\tfor (const key of supplied) if (!declared.has(key)) return yield* EnvironmentValueInvalid.make({\n\t\tkey,\n\t\tmessage: `Environment variable '${key}' is not declared in server/env.ts.`\n\t});\n\tconst decoded = {};\n\tfor (const [key, field] of Object.entries(environment.fields)) {\n\t\tconst input = Object.hasOwn(raw, key) ? raw[key] : void 0;\n\t\tconst direct = yield* Effect.result(Schema.decodeUnknownEffect(field)(input));\n\t\tif (Result$1.isSuccess(direct)) {\n\t\t\tif (direct.success !== void 0) Reflect.set(decoded, key, direct.success);\n\t\t\tcontinue;\n\t\t}\n\t\tif (input === void 0) return yield* invalidValue(key);\n\t\tconst parsed = yield* Effect.result(Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(input));\n\t\tif (Result$1.isFailure(parsed)) return yield* invalidValue(key);\n\t\tconst fromJson = yield* Effect.result(Schema.decodeUnknownEffect(field)(parsed.success));\n\t\tif (Result$1.isFailure(fromJson)) return yield* invalidValue(key);\n\t\tif (fromJson.success !== void 0) Reflect.set(decoded, key, fromJson.success);\n\t}\n\treturn Object.freeze(decoded);\n});\nconst decodeDefinedEnvironment = (environment, raw) => environment[EnvironmentDecoderTypeId](raw);\n//#endregion\n//#region src/schema/server.ts\nconst makeFunctionBuilder = (schema, environment, kind) => {\n\tconst define = (definition) => attachFunctionEnvironment(environment)(attachFunctionSchema(schema)({\n\t\t_tag: kind,\n\t\t...definition\n\t}));\n\treturn define;\n};\nconst makeFunctionBuilders = (schema, environment) => ({\n\tmutation: makeFunctionBuilder(schema, environment, \"Mutation\"),\n\tquery: makeFunctionBuilder(schema, environment, \"Query\")\n});\nfunction bindSchema(schema, environment = emptyEnv) {\n\treturn {\n\t\tvalues: bindValues(schema[SchemaDefinitionTypeId]),\n\t\t...makeFunctionBuilders(schema, environment)\n\t};\n}\n//#endregion\nexport { EnvironmentDefinitionTypeId, EnvironmentValueInvalid, FileFormat, FileId, FileValue, FileValueTypeId, Result, SchemaDefinitionTypeId, Secret, ValueDescriptor, ValueDescriptorTypeId, bindSchema, bindValues, decodeDefinedEnvironment, decodeEnvironment, defineEnv, defineSchema, descriptorAllowedInEnvironment, descriptorContainsFile, descriptorContainsSecret, descriptorFields, emptyEnv, environmentLimits, environmentValues, fileFormats, fileLimits, fileMimeTypes, getValueDescriptor, isDefinedEnv, isDefinedSchema, isFileValue, schema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