ignotum 0.0.13 → 0.0.14

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.
Files changed (39) hide show
  1. package/dist/cli/bin.mjs +369 -55
  2. package/dist/cli/bin.mjs.map +1 -1
  3. package/dist/runtime/client.d.ts +3 -3
  4. package/dist/runtime/client.js +24 -4
  5. package/dist/runtime/client.js.map +1 -1
  6. package/dist/runtime/descriptor-DCCz5AHd-_nhlnu8U.js +298 -0
  7. package/dist/runtime/descriptor-DCCz5AHd-_nhlnu8U.js.map +1 -0
  8. package/dist/runtime/id-E7JKqQ9r.d.ts +1 -0
  9. package/dist/runtime/index-DWU-7TIh.d.ts +185 -0
  10. package/dist/runtime/internal/host.d.ts +23 -5
  11. package/dist/runtime/internal/host.js +24 -4
  12. package/dist/runtime/internal/host.js.map +1 -1
  13. package/dist/runtime/internal/server.d.ts +1 -1
  14. package/dist/runtime/internal/server.js +1 -1
  15. package/dist/runtime/internal/types.d.ts +2 -1
  16. package/dist/runtime/internal/types.js +1 -1
  17. package/dist/runtime/{pagination-DnKg3dkI-r5ZUxBBx.d.ts → pagination-CpYCaRYD-C2Rpp4Cw.d.ts} +14 -4
  18. package/dist/runtime/pagination-E7JKqQ9r.d.ts +1 -0
  19. package/dist/runtime/{schema-1Zs03-iS.js → schema-DqogEydG.js} +38 -11
  20. package/dist/runtime/schema-DqogEydG.js.map +1 -0
  21. package/dist/runtime/server.d.ts +4 -3
  22. package/dist/runtime/server.js +1 -1
  23. package/dist/runtime/types-C1iDP2Yf-BnkfBOQf.d.ts +224 -0
  24. package/package.json +2 -2
  25. package/src/cli/agent-files.ts +4 -0
  26. package/src/cli/build/server.ts +35 -6
  27. package/src/cli/command.ts +25 -2
  28. package/src/cli/deploy.ts +34 -11
  29. package/src/client/sync.ts +1 -1
  30. package/src/dev-runtime/database.ts +77 -2
  31. package/src/dev-runtime/id.ts +19 -4
  32. package/src/dev-runtime/migrations.ts +9 -0
  33. package/src/internal/host.ts +1 -1
  34. package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js +0 -154
  35. package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js.map +0 -1
  36. package/dist/runtime/id-Dz0apuB3.d.ts +0 -1
  37. package/dist/runtime/index-D54flWtH.d.ts +0 -402
  38. package/dist/runtime/pagination-Dz0apuB3.d.ts +0 -1
  39. package/dist/runtime/schema-1Zs03-iS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","names":[],"sources":["../../../../contracts/dist/runtime/host.js","../../../../runtime/dist/guest.js"],"sourcesContent":["import { GeneratedId } from \"./id.js\";\nimport { User } from \"../id.js\";\nimport { PaginationCursor, PaginationPageSize } from \"./pagination.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/host.ts\nconst HostDocument = Schema.Struct({\n\tid: GeneratedId,\n\tcreatedAt: Schema.Int,\n\tupdatedAt: Schema.Int,\n\tfields: Schema.JsonObject\n});\nconst HostCollect = Schema.Struct({\n\ttype: Schema.Literal(\"Collect\"),\n\ttable: Schema.String\n});\nconst HostIndexComparison = Schema.Struct({\n\tfield: Schema.String,\n\tvalue: Schema.Json\n});\nconst HostIndexRange = Schema.Struct({\n\tequal: Schema.Array(HostIndexComparison),\n\tlower: Schema.optional(Schema.Struct({\n\t\t...HostIndexComparison.fields,\n\t\tinclusive: Schema.Boolean\n\t})),\n\tupper: Schema.optional(Schema.Struct({\n\t\t...HostIndexComparison.fields,\n\t\tinclusive: Schema.Boolean\n\t}))\n});\nconst HostQuery = Schema.Struct({\n\ttype: Schema.Literal(\"Query\"),\n\ttable: Schema.String,\n\tindex: Schema.optional(Schema.String),\n\trange: Schema.optional(HostIndexRange),\n\torder: Schema.Literals([\"Asc\", \"Desc\"]),\n\tlimit: Schema.optional(Schema.Natural)\n});\nconst HostPaginate = Schema.Struct({\n\ttype: Schema.Literal(\"Paginate\"),\n\ttable: Schema.String,\n\tindex: Schema.optional(Schema.String),\n\trange: Schema.optional(HostIndexRange),\n\torder: Schema.Literals([\"Asc\", \"Desc\"]),\n\tpagination: Schema.Struct({\n\t\tcursor: Schema.NullOr(PaginationCursor),\n\t\tpageSize: PaginationPageSize\n\t})\n});\nconst HostFind = Schema.Struct({\n\ttype: Schema.Literal(\"Find\"),\n\ttable: Schema.String,\n\tid: GeneratedId\n});\nconst HostInsert = Schema.Struct({\n\ttype: Schema.Literal(\"Insert\"),\n\ttable: Schema.String,\n\tfields: Schema.JsonObject\n});\nconst HostDelete = Schema.Struct({\n\ttype: Schema.Literal(\"Delete\"),\n\ttable: Schema.String,\n\tid: GeneratedId\n});\nconst HostPatch = Schema.Struct({\n\ttype: Schema.Literal(\"Patch\"),\n\ttable: Schema.String,\n\tid: GeneratedId,\n\tfields: Schema.JsonObject\n});\nconst HostReplace = Schema.Struct({\n\ttype: Schema.Literal(\"Replace\"),\n\ttable: Schema.String,\n\tid: GeneratedId,\n\tfields: Schema.JsonObject\n});\nconst DatabaseHostRequest = Schema.Union([\n\tHostCollect,\n\tHostQuery,\n\tHostPaginate,\n\tHostFind,\n\tHostInsert,\n\tHostDelete,\n\tHostPatch,\n\tHostReplace\n]);\nconst HostReadId = Schema.Struct({ type: Schema.Literal(\"ReadId\") });\nconst QuickJsHostRequest = Schema.Union([DatabaseHostRequest, HostReadId]);\nconst HostIdentity = Schema.Struct({\n\ttype: Schema.Literal(\"Identity\"),\n\tuser: Schema.NullOr(User)\n});\nconst HostDocuments = Schema.Struct({\n\ttype: Schema.Literal(\"Documents\"),\n\tdocuments: Schema.Array(HostDocument)\n});\nconst HostPage = Schema.Struct({\n\ttype: Schema.Literal(\"Page\"),\n\tdocuments: Schema.Array(HostDocument),\n\tnextCursor: Schema.NullOr(PaginationCursor)\n});\nconst HostFound = Schema.Struct({\n\ttype: Schema.Literal(\"Found\"),\n\tdocument: Schema.NullOr(HostDocument)\n});\nconst HostInserted = Schema.Struct({\n\ttype: Schema.Literal(\"Inserted\"),\n\tid: GeneratedId\n});\nconst HostCompleted = Schema.Struct({\n\ttype: Schema.Literal(\"Completed\"),\n\tfound: Schema.Boolean\n});\nconst QuickJsHostResponse = Schema.Union([\n\tHostIdentity,\n\tHostDocuments,\n\tHostPage,\n\tHostFound,\n\tHostInserted,\n\tHostCompleted\n]);\n//#endregion\nexport { DatabaseHostRequest, HostCollect, HostCompleted, HostDelete, HostDocument, HostDocuments, HostFind, HostFound, HostIdentity, HostIndexComparison, HostIndexRange, HostInsert, HostInserted, HostPage, HostPaginate, HostPatch, HostQuery, HostReadId, HostReplace, QuickJsHostRequest, QuickJsHostResponse };\n\n//# sourceMappingURL=host.js.map","import { HostCompleted, HostDocuments, HostFound, HostIdentity, HostInserted, HostPage, QuickJsHostRequest } from \"@ignotum/contracts/runtime/host\";\nimport { runtimeFileOccurrencesOf } from \"@ignotum/contracts/schema/file\";\nimport { GeneratedId } from \"@ignotum/contracts/runtime/id\";\nimport { Effect, Predicate, Schema } from \"effect\";\nimport { makeIdContext } from \"@ignotum/contracts/id\";\nimport { ErrorValueSchema, documentNotFound, resultFromEffect } from \"@ignotum/contracts/runtime/result\";\nimport { getFunctionEnvironment, getFunctionSchema } from \"@ignotum/contracts/runtime/schema\";\nimport { SchemaDefinitionTypeId, decodeDefinedEnvironment, emptyEnv } from \"@ignotum/contracts/schema\";\nimport { TransportObjectTypeSchema, datePathsOf, datePathsOfObject } from \"@ignotum/contracts/runtime/value\";\n//#region src/guest.ts\nconst decodeHostResponse = Schema.decodeEffect(Schema.fromJsonString(Schema.Union([\n\tHostDocuments,\n\tHostPage,\n\tHostFound,\n\tHostInserted,\n\tHostCompleted,\n\tHostIdentity\n])));\nconst encodeHostRequest = Schema.encodeSync(Schema.fromJsonString(QuickJsHostRequest));\nconst callHost = Effect.fn(\"Guest.callHost\")(function* (call, request) {\n\treturn yield* Effect.tryPromise(() => call(encodeHostRequest(request))).pipe(Effect.flatMap(decodeHostResponse), Effect.orDie);\n});\nconst tableFor = (schema, table) => {\n\tconst definition = schema[SchemaDefinitionTypeId][table];\n\tif (definition === void 0) throw new Error(`Unknown database table '${table}'.`);\n\treturn definition;\n};\nconst guestCodec = (schema) => schema;\nconst encodeFields = (schema, table, fields) => {\n\tconst definition = tableFor(schema, table);\n\treturn Schema.decodeUnknownSync(Schema.JsonObject)(Schema.encodeUnknownSync(Schema.toCodecJson(guestCodec(definition.schema)), { onExcessProperty: \"error\" })(fields));\n};\nconst encodePatchFields = (schema, table, fields) => {\n\tconst definition = tableFor(schema, table);\n\treturn Schema.decodeSync(Schema.JsonObject)(Object.fromEntries(Object.entries(fields).map(([name, value]) => {\n\t\tconst field = definition.fields[name];\n\t\tif (field === void 0) throw new Error(`Unknown field '${name}' on table '${table}'.`);\n\t\treturn [name, Schema.encodeUnknownSync(Schema.toCodecJson(guestCodec(field)))(value)];\n\t})));\n};\nconst documentCodec = (schema, table) => guestCodec(Schema.Struct({\n\t...tableFor(schema, table).fields,\n\tid: Schema.String,\n\tcreatedAt: Schema.DateFromMillis,\n\tupdatedAt: Schema.DateFromMillis\n}));\nconst decodeDocument = (schema, table, document) => Schema.decodeUnknownSync(TransportObjectTypeSchema)(Schema.decodeSync(Schema.toCodecJson(documentCodec(schema, table)))({\n\t...document.fields,\n\tid: document.id,\n\tcreatedAt: document.createdAt,\n\tupdatedAt: document.updatedAt\n}));\nconst expectResponse = (response, tag) => {\n\tif (response.type !== tag) throw new Error(`Unexpected host response '${response.type}'.`);\n\treturn response;\n};\nconst makeReader = (schema, call) => {\n\tconst findEffect = (table, id) => callHost(call, {\n\t\ttype: \"Find\",\n\t\ttable,\n\t\tid: GeneratedId.make(id)\n\t}).pipe(Effect.map((response) => expectResponse(response, \"Found\")), Effect.map(({ document }) => document === null ? void 0 : decodeDocument(schema, table, document)));\n\tconst query = (table, selectedIndex, selectedRange, order = \"Asc\") => {\n\t\tconst definition = tableFor(schema, table);\n\t\tconst encodeIndexValue = (field, value) => {\n\t\t\tconst codec = field === \"createdAt\" ? Schema.DateFromMillis : field === \"id\" ? GeneratedId : definition.fields[field];\n\t\t\tif (codec === void 0) throw new Error(`Unknown index field '${field}'.`);\n\t\t\treturn Schema.decodeUnknownSync(Schema.Json)(Schema.encodeUnknownSync(guestCodec(codec))(value));\n\t\t};\n\t\tconst execute = (limit) => {\n\t\t\tconst request = selectedIndex === void 0 ? {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\torder\n\t\t\t} : selectedRange === void 0 ? {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\torder\n\t\t\t} : {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\trange: selectedRange,\n\t\t\t\torder\n\t\t\t};\n\t\t\treturn callHost(call, limit === void 0 ? request : {\n\t\t\t\t...request,\n\t\t\t\tlimit\n\t\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Documents\")), Effect.map(({ documents }) => documents.map((document) => decodeDocument(schema, table, document))));\n\t\t};\n\t\tconst executePage = (pagination) => {\n\t\t\treturn callHost(call, selectedIndex === void 0 ? {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t} : selectedRange === void 0 ? {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t} : {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\trange: selectedRange,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Page\")), Effect.map(({ documents, nextCursor }) => ({\n\t\t\t\titems: documents.map((document) => decodeDocument(schema, table, document)),\n\t\t\t\tnextCursor\n\t\t\t})));\n\t\t};\n\t\tconst validateLimit = (count) => {\n\t\t\tif (!Number.isInteger(count) || count < 0 || count > 1e3) throw new Error(\"Query limits must be integers between 0 and 1000.\");\n\t\t\treturn count;\n\t\t};\n\t\treturn Object.freeze({\n\t\t\tindex: (name, buildRange) => {\n\t\t\t\tif (selectedIndex !== void 0) throw new Error(\"A query can select only one index.\");\n\t\t\t\tconst index = definition.indexes[name];\n\t\t\t\tif (index === void 0) throw new Error(`Unknown index '${name}' on table '${table}'.`);\n\t\t\t\tif (buildRange === void 0) return query(table, name, void 0, order);\n\t\t\t\tconst fields = [\n\t\t\t\t\t...index.fields,\n\t\t\t\t\t\"createdAt\",\n\t\t\t\t\t\"id\"\n\t\t\t\t];\n\t\t\t\tconst range = { equal: [] };\n\t\t\t\tlet position = 0;\n\t\t\t\tlet boundedField;\n\t\t\t\tconst expectField = (field) => {\n\t\t\t\t\tconst expected = fields[position];\n\t\t\t\t\tif (field !== expected) throw new Error(`Expected index field '${expected}', received '${field}'.`);\n\t\t\t\t};\n\t\t\t\tconst builder = {\n\t\t\t\t\teq: (field, value) => {\n\t\t\t\t\t\tif (boundedField !== void 0) throw new Error(\"Equality cannot follow an index bound.\");\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\trange.equal.push({\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value)\n\t\t\t\t\t\t});\n\t\t\t\t\t\tposition += 1;\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tgt: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.lower !== void 0) throw new Error(\"An index range has only one lower bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.lower = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tgte: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.lower !== void 0) throw new Error(\"An index range has only one lower bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.lower = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: true\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tlt: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.upper !== void 0) throw new Error(\"An index range has only one upper bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.upper = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tlte: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.upper !== void 0) throw new Error(\"An index range has only one upper bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.upper = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: true\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst built = buildRange(builder);\n\t\t\t\tif (!Predicate.isObject(built)) throw new Error(\"An index range callback must return its builder.\");\n\t\t\t\treturn query(table, name, range, order);\n\t\t\t},\n\t\t\torder: (direction) => query(table, selectedIndex, selectedRange, direction === \"asc\" ? \"Asc\" : \"Desc\"),\n\t\t\tcollect: () => resultFromEffect(execute()),\n\t\t\ttake: (count) => resultFromEffect(execute(validateLimit(count))),\n\t\t\tfirst: () => resultFromEffect(execute(1).pipe(Effect.map((documents) => documents[0]))),\n\t\t\tunique: () => resultFromEffect(execute(2).pipe(Effect.flatMap((documents) => documents.length > 1 ? Effect.die(/* @__PURE__ */ new Error(\"A unique database query matched more than one document.\")) : Effect.succeed(documents[0])))),\n\t\t\tpaginate: (options) => resultFromEffect(executePage(options))\n\t\t});\n\t};\n\treturn Object.freeze({\n\t\tfind: (table, id) => resultFromEffect(findEffect(table, id)),\n\t\tget: (table, id) => resultFromEffect(findEffect(table, id).pipe(Effect.flatMap((document) => document === void 0 ? Effect.fail(documentNotFound(table, id)) : Effect.succeed(document)))),\n\t\tquery: (table) => query(table)\n\t});\n};\nconst makeWriter = (schema, call) => {\n\tconst reader = makeReader(schema, call);\n\tconst complete = Effect.fn(\"Guest.completeWrite\")(function* (table, id, request) {\n\t\tif (expectResponse(yield* callHost(call, request), \"Completed\").found === false) return yield* Effect.fail(documentNotFound(table, id));\n\t});\n\tconst writer = {\n\t\t...reader,\n\t\tdelete: (table, id) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Delete\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id)\n\t\t})),\n\t\tinsert: (table, value) => resultFromEffect(callHost(call, {\n\t\t\ttype: \"Insert\",\n\t\t\ttable,\n\t\t\tfields: encodeFields(schema, table, value)\n\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Inserted\").id))),\n\t\tpatch: (table, id, value) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Patch\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id),\n\t\t\tfields: encodePatchFields(schema, table, value)\n\t\t})),\n\t\treplace: (table, id, value) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Replace\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id),\n\t\t\tfields: encodeFields(schema, table, value)\n\t\t}))\n\t};\n\treturn Object.freeze(writer);\n};\nconst encodeSuccess = Effect.fn(\"Guest.encodeSuccess\")(function* (definition, value) {\n\tif (definition.returns === void 0) {\n\t\tyield* Schema.encodeUnknownEffect(Schema.Undefined)(value);\n\t\treturn { type: \"Success\" };\n\t}\n\tconst encoded = yield* Schema.encodeUnknownEffect(Schema.toCodecJson(definition.returns))(value);\n\tconst files = runtimeFileOccurrencesOf(value);\n\tconst result = files.length === 0 ? {\n\t\ttype: \"Success\",\n\t\tvalue: encoded\n\t} : {\n\t\ttype: \"Success\",\n\t\tvalue: encoded,\n\t\tfiles\n\t};\n\tconst dates = datePathsOf(value);\n\treturn dates.length === 0 ? result : {\n\t\t...result,\n\t\tdates\n\t};\n});\nconst encodeFailure = Effect.fn(\"Guest.encodeFailure\")(function* (definition, error) {\n\tconst result = {\n\t\ttype: \"Failure\",\n\t\terror: yield* Schema.encodeUnknownEffect(Schema.toCodecJson(definition.errors ?? ErrorValueSchema))(error)\n\t};\n\tconst dates = datePathsOfObject(error);\n\treturn dates.length === 0 ? result : {\n\t\t...result,\n\t\tdates\n\t};\n});\nconst runGuest = Effect.fn(\"Guest.invoke\")(function* (definition, encodedArgs, call, rawEnvironment) {\n\tconst schema = getFunctionSchema(definition);\n\tif (schema === void 0) return yield* Effect.die(\"The function has no bound schema.\");\n\tconst environmentDefinition = getFunctionEnvironment(definition) ?? emptyEnv;\n\tconst environment = yield* decodeDefinedEnvironment(environmentDefinition, rawEnvironment).pipe(Effect.mapError(() => /* @__PURE__ */ new Error(\"The deployment environment is invalid.\")));\n\tconst decodedArgs = yield* Schema.decodeEffect(Schema.toCodecJson(guestCodec(Schema.Struct(definition.args ?? {}))))(encodedArgs).pipe(Effect.match({\n\t\tonFailure: () => ({ valid: false }),\n\t\tonSuccess: (value) => ({\n\t\t\tvalid: true,\n\t\t\tvalue\n\t\t})\n\t}));\n\tif (!decodedArgs.valid) return {\n\t\ttype: \"InvocationRejected\",\n\t\tcode: \"InvalidArguments\",\n\t\tmessage: \"The invocation arguments do not match the function definition.\"\n\t};\n\tconst args = yield* Schema.decodeUnknownEffect(Schema.ObjectKeyword)(decodedArgs.value);\n\tconst context = Object.freeze({\n\t\tdb: definition._tag === \"Query\" ? makeReader(schema, call) : makeWriter(schema, call),\n\t\tenv: environment,\n\t\tid: makeIdContext(callHost(call, { type: \"ReadId\" }).pipe(Effect.flatMap((response) => response.type === \"Identity\" ? Effect.succeed(response.user) : Effect.die(\"The ID response is invalid.\"))))\n\t});\n\treturn yield* Effect.gen(() => definition.handler(context, args)).pipe(Effect.matchEffect({\n\t\tonFailure: (error) => encodeFailure(definition, error),\n\t\tonSuccess: (value) => encodeSuccess(definition, value)\n\t}));\n});\nconst invoke = (definition, encodedArgs, call, rawEnvironment = {}) => Effect.runPromise(runGuest(definition, encodedArgs, call, rawEnvironment)).then((result) => Schema.encodeSync(Schema.fromJsonString(Schema.Json))(result));\n//#endregion\nexport { invoke };\n\n//# sourceMappingURL=guest.js.map"],"mappings":";;;;;AAKA,MAAM,eAAe,OAAO,OAAO;CAClC,IAAI;CACJ,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,QAAQ,OAAO;AAChB,CAAC;AACD,MAAM,cAAc,OAAO,OAAO;CACjC,MAAM,OAAO,QAAQ,SAAS;CAC9B,OAAO,OAAO;AACf,CAAC;AACD,MAAM,sBAAsB,OAAO,OAAO;CACzC,OAAO,OAAO;CACd,OAAO,OAAO;AACf,CAAC;AACD,MAAM,iBAAiB,OAAO,OAAO;CACpC,OAAO,OAAO,MAAM,mBAAmB;CACvC,OAAO,OAAO,SAAS,OAAO,OAAO;EACpC,GAAG,oBAAoB;EACvB,WAAW,OAAO;CACnB,CAAC,CAAC;CACF,OAAO,OAAO,SAAS,OAAO,OAAO;EACpC,GAAG,oBAAoB;EACvB,WAAW,OAAO;CACnB,CAAC,CAAC;AACH,CAAC;AACD,MAAM,YAAY,OAAO,OAAO;CAC/B,MAAM,OAAO,QAAQ,OAAO;CAC5B,OAAO,OAAO;CACd,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,OAAO,OAAO,SAAS,cAAc;CACrC,OAAO,OAAO,SAAS,CAAC,OAAO,MAAM,CAAC;CACtC,OAAO,OAAO,SAAS,OAAO,OAAO;AACtC,CAAC;AACD,MAAM,eAAe,OAAO,OAAO;CAClC,MAAM,OAAO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AO,WAAW,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,OAAO,MAAM;EACnJ,kBAAkB,EAAE,OAAO,MAAM;EACjC,YAAY,WAAW;GACtB,OAAO;GACP;EACD;CACD,CAAC,CAAC;CACF,IAAI,CAAC,YAAY,OAAO,OAAO;EAC9B,MAAM;EACN,MAAM;EACN,SAAS;CACV;CACA,MAAM,OAAO,OAAO,OAAO,oBAAoB,OAAO,aAAa,CAAC,CAAC,YAAY,KAAK;CACtF,MAAM,UAAU,OAAO,OAAO;EAC7B,IAAI,WAAW,SAAS,UAAU,WAAW,QAAQ,IAAI,IAAI,WAAW,QAAQ,IAAI;EACpF,KAAK;EACL,IAAI,cAAc,SAAS,MAAM,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO,SAAS,aAAa,SAAS,SAAS,aAAa,OAAO,QAAQ,SAAS,IAAI,IAAI,OAAO,IAAI,6BAA6B,CAAC,CAAC,CAAC;CAClM,CAAC;CACD,OAAO,OAAO,OAAO,UAAU,WAAW,QAAQ,SAAS,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,YAAY;EACzF,YAAY,UAAU,cAAc,YAAY,KAAK;EACrD,YAAY,UAAU,cAAc,YAAY,KAAK;CACtD,CAAC,CAAC;AACH,CAAC;AACD,MAAM,UAAU,YAAY,aAAa,MAAM,iBAAiB,CAAC,MAAM,OAAO,WAAW,SAAS,YAAY,aAAa,MAAM,cAAc,CAAC,CAAC,CAAC,MAAM,WAAW,OAAO,WAAW,OAAO,eAAe,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC"}
1
+ {"version":3,"file":"host.js","names":[],"sources":["../../../../contracts/dist/runtime/host.js","../../../../runtime/dist/guest.js"],"sourcesContent":["import { GeneratedId } from \"./id.js\";\nimport { User } from \"../id.js\";\nimport { PaginationCursor, PaginationPageSize } from \"./pagination.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/host.ts\nconst HostDocument = Schema.Struct({\n\tid: GeneratedId,\n\tcreatedAt: Schema.Int,\n\tupdatedAt: Schema.Int,\n\tfields: Schema.JsonObject\n});\nconst HostCollect = Schema.Struct({\n\ttype: Schema.Literal(\"Collect\"),\n\ttable: Schema.String\n});\nconst HostIndexComparison = Schema.Struct({\n\tfield: Schema.String,\n\tvalue: Schema.Json\n});\nconst HostIndexRange = Schema.Struct({\n\tequal: Schema.Array(HostIndexComparison),\n\tlower: Schema.optional(Schema.Struct({\n\t\t...HostIndexComparison.fields,\n\t\tinclusive: Schema.Boolean\n\t})),\n\tupper: Schema.optional(Schema.Struct({\n\t\t...HostIndexComparison.fields,\n\t\tinclusive: Schema.Boolean\n\t}))\n});\nconst HostQuery = Schema.Struct({\n\ttype: Schema.Literal(\"Query\"),\n\ttable: Schema.String,\n\tindex: Schema.optional(Schema.String),\n\trange: Schema.optional(HostIndexRange),\n\torder: Schema.Literals([\"Asc\", \"Desc\"]),\n\tlimit: Schema.optional(Schema.Natural)\n});\nconst HostPaginate = Schema.Struct({\n\ttype: Schema.Literal(\"Paginate\"),\n\ttable: Schema.String,\n\tindex: Schema.optional(Schema.String),\n\trange: Schema.optional(HostIndexRange),\n\torder: Schema.Literals([\"Asc\", \"Desc\"]),\n\tpagination: Schema.Struct({\n\t\tcursor: Schema.NullOr(PaginationCursor),\n\t\tpageSize: PaginationPageSize\n\t})\n});\nconst HostFind = Schema.Struct({\n\ttype: Schema.Literal(\"Find\"),\n\ttable: Schema.String,\n\tid: GeneratedId\n});\nconst HostInsert = Schema.Struct({\n\ttype: Schema.Literal(\"Insert\"),\n\ttable: Schema.String,\n\tfields: Schema.JsonObject\n});\nconst HostDelete = Schema.Struct({\n\ttype: Schema.Literal(\"Delete\"),\n\ttable: Schema.String,\n\tid: GeneratedId\n});\nconst HostPatch = Schema.Struct({\n\ttype: Schema.Literal(\"Patch\"),\n\ttable: Schema.String,\n\tid: GeneratedId,\n\tfields: Schema.JsonObject\n});\nconst HostReplace = Schema.Struct({\n\ttype: Schema.Literal(\"Replace\"),\n\ttable: Schema.String,\n\tid: GeneratedId,\n\tfields: Schema.JsonObject\n});\nconst DatabaseHostRequest = Schema.Union([\n\tHostCollect,\n\tHostQuery,\n\tHostPaginate,\n\tHostFind,\n\tHostInsert,\n\tHostDelete,\n\tHostPatch,\n\tHostReplace\n]);\nconst HostReadId = Schema.Struct({ type: Schema.Literal(\"ReadId\") });\nconst QuickJsHostRequest = Schema.Union([DatabaseHostRequest, HostReadId]);\nconst HostIdentity = Schema.Struct({\n\ttype: Schema.Literal(\"Identity\"),\n\tuser: Schema.NullOr(User)\n});\nconst HostDocuments = Schema.Struct({\n\ttype: Schema.Literal(\"Documents\"),\n\tdocuments: Schema.Array(HostDocument)\n});\nconst HostPage = Schema.Struct({\n\ttype: Schema.Literal(\"Page\"),\n\tdocuments: Schema.Array(HostDocument),\n\tnextCursor: Schema.NullOr(PaginationCursor)\n});\nconst HostFound = Schema.Struct({\n\ttype: Schema.Literal(\"Found\"),\n\tdocument: Schema.NullOr(HostDocument)\n});\nconst HostInserted = Schema.Struct({\n\ttype: Schema.Literal(\"Inserted\"),\n\tid: GeneratedId\n});\nconst HostCompleted = Schema.Struct({\n\ttype: Schema.Literal(\"Completed\"),\n\tfound: Schema.Boolean\n});\nconst QuickJsHostResponse = Schema.Union([\n\tHostIdentity,\n\tHostDocuments,\n\tHostPage,\n\tHostFound,\n\tHostInserted,\n\tHostCompleted\n]);\n//#endregion\nexport { DatabaseHostRequest, HostCollect, HostCompleted, HostDelete, HostDocument, HostDocuments, HostFind, HostFound, HostIdentity, HostIndexComparison, HostIndexRange, HostInsert, HostInserted, HostPage, HostPaginate, HostPatch, HostQuery, HostReadId, HostReplace, QuickJsHostRequest, QuickJsHostResponse };\n\n//# sourceMappingURL=host.js.map","import { HostCompleted, HostDocuments, HostFound, HostIdentity, HostInserted, HostPage, QuickJsHostRequest } from \"@ignotum/contracts/runtime/host\";\nimport { runtimeFileOccurrencesOf } from \"@ignotum/contracts/schema/file\";\nimport { Effect, Predicate, Schema } from \"effect\";\nimport { GeneratedId } from \"@ignotum/contracts/runtime/id\";\nimport { makeIdContext } from \"@ignotum/contracts/id\";\nimport { ErrorValueSchema, documentNotFound, resultFromEffect } from \"@ignotum/contracts/runtime/result\";\nimport { getFunctionEnvironment, getFunctionSchema } from \"@ignotum/contracts/runtime/schema\";\nimport { SchemaDefinitionTypeId, applyValueDefaults, decodeDefinedEnvironment, emptyEnv, evolveStoredFields } from \"@ignotum/contracts/schema\";\nimport { TransportObjectTypeSchema, datePathsOf, datePathsOfObject } from \"@ignotum/contracts/runtime/value\";\n//#region src/guest.ts\nconst decodeHostResponse = Schema.decodeEffect(Schema.fromJsonString(Schema.Union([\n\tHostDocuments,\n\tHostPage,\n\tHostFound,\n\tHostInserted,\n\tHostCompleted,\n\tHostIdentity\n])));\nconst encodeHostRequest = Schema.encodeSync(Schema.fromJsonString(QuickJsHostRequest));\nconst callHost = Effect.fn(\"Guest.callHost\")(function* (call, request) {\n\treturn yield* Effect.tryPromise(() => call(encodeHostRequest(request))).pipe(Effect.flatMap(decodeHostResponse), Effect.orDie);\n});\nconst tableFor = (schema, table) => {\n\tconst definition = schema[SchemaDefinitionTypeId][table];\n\tif (definition === void 0) throw new Error(`Unknown database table '${table}'.`);\n\treturn definition;\n};\nconst guestCodec = (schema) => schema;\nconst encodeFields = (schema, table, fields) => {\n\tconst definition = tableFor(schema, table);\n\treturn Schema.decodeUnknownSync(Schema.JsonObject)(Schema.encodeUnknownSync(Schema.toCodecJson(guestCodec(definition.schema)), { onExcessProperty: \"error\" })(applyValueDefaults(definition.schema, fields)));\n};\nconst encodePatchFields = (schema, table, fields) => {\n\tconst definition = tableFor(schema, table);\n\treturn Schema.decodeSync(Schema.JsonObject)(Object.fromEntries(Object.entries(fields).map(([name, value]) => {\n\t\tconst field = definition.fields[name];\n\t\tif (field === void 0) throw new Error(`Unknown field '${name}' on table '${table}'.`);\n\t\treturn [name, Schema.encodeUnknownSync(Schema.toCodecJson(guestCodec(field)))(value)];\n\t})));\n};\nconst documentCodec = (schema, table) => guestCodec(Schema.Struct({\n\t...tableFor(schema, table).fields,\n\tid: Schema.String,\n\tcreatedAt: Schema.DateFromMillis,\n\tupdatedAt: Schema.DateFromMillis\n}));\nconst decodeDocument = (schema, table, document) => Schema.decodeUnknownSync(TransportObjectTypeSchema)(Schema.decodeSync(Schema.toCodecJson(documentCodec(schema, table)))({\n\t...document.fields,\n\tid: document.id,\n\tcreatedAt: document.createdAt,\n\tupdatedAt: document.updatedAt\n}));\nconst expectResponse = (response, tag) => {\n\tif (response.type !== tag) throw new Error(`Unexpected host response '${response.type}'.`);\n\treturn response;\n};\nconst makeReader = (schema, call) => {\n\tconst findEffect = (table, id) => callHost(call, {\n\t\ttype: \"Find\",\n\t\ttable,\n\t\tid: GeneratedId.make(id)\n\t}).pipe(Effect.map((response) => expectResponse(response, \"Found\")), Effect.map(({ document }) => document === null ? void 0 : decodeDocument(schema, table, document)));\n\tconst query = (table, selectedIndex, selectedRange, order = \"Asc\") => {\n\t\tconst definition = tableFor(schema, table);\n\t\tconst encodeIndexValue = (field, value) => {\n\t\t\tconst codec = field === \"createdAt\" ? Schema.DateFromMillis : field === \"id\" ? GeneratedId : definition.fields[field];\n\t\t\tif (codec === void 0) throw new Error(`Unknown index field '${field}'.`);\n\t\t\treturn Schema.decodeUnknownSync(Schema.Json)(Schema.encodeUnknownSync(guestCodec(codec))(value));\n\t\t};\n\t\tconst execute = (limit) => {\n\t\t\tconst request = selectedIndex === void 0 ? {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\torder\n\t\t\t} : selectedRange === void 0 ? {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\torder\n\t\t\t} : {\n\t\t\t\ttype: \"Query\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\trange: selectedRange,\n\t\t\t\torder\n\t\t\t};\n\t\t\treturn callHost(call, limit === void 0 ? request : {\n\t\t\t\t...request,\n\t\t\t\tlimit\n\t\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Documents\")), Effect.map(({ documents }) => documents.map((document) => decodeDocument(schema, table, document))));\n\t\t};\n\t\tconst executePage = (pagination) => {\n\t\t\treturn callHost(call, selectedIndex === void 0 ? {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t} : selectedRange === void 0 ? {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t} : {\n\t\t\t\ttype: \"Paginate\",\n\t\t\t\ttable,\n\t\t\t\tindex: selectedIndex,\n\t\t\t\trange: selectedRange,\n\t\t\t\torder,\n\t\t\t\tpagination\n\t\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Page\")), Effect.map(({ documents, nextCursor }) => ({\n\t\t\t\titems: documents.map((document) => decodeDocument(schema, table, document)),\n\t\t\t\tnextCursor\n\t\t\t})));\n\t\t};\n\t\tconst validateLimit = (count) => {\n\t\t\tif (!Number.isInteger(count) || count < 0 || count > 1e3) throw new Error(\"Query limits must be integers between 0 and 1000.\");\n\t\t\treturn count;\n\t\t};\n\t\treturn Object.freeze({\n\t\t\tindex: (name, buildRange) => {\n\t\t\t\tif (selectedIndex !== void 0) throw new Error(\"A query can select only one index.\");\n\t\t\t\tconst index = definition.indexes[name];\n\t\t\t\tif (index === void 0) throw new Error(`Unknown index '${name}' on table '${table}'.`);\n\t\t\t\tif (buildRange === void 0) return query(table, name, void 0, order);\n\t\t\t\tconst fields = [\n\t\t\t\t\t...index.fields,\n\t\t\t\t\t\"createdAt\",\n\t\t\t\t\t\"id\"\n\t\t\t\t];\n\t\t\t\tconst range = { equal: [] };\n\t\t\t\tlet position = 0;\n\t\t\t\tlet boundedField;\n\t\t\t\tconst expectField = (field) => {\n\t\t\t\t\tconst expected = fields[position];\n\t\t\t\t\tif (field !== expected) throw new Error(`Expected index field '${expected}', received '${field}'.`);\n\t\t\t\t};\n\t\t\t\tconst builder = {\n\t\t\t\t\teq: (field, value) => {\n\t\t\t\t\t\tif (boundedField !== void 0) throw new Error(\"Equality cannot follow an index bound.\");\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\trange.equal.push({\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value)\n\t\t\t\t\t\t});\n\t\t\t\t\t\tposition += 1;\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tgt: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.lower !== void 0) throw new Error(\"An index range has only one lower bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.lower = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tgte: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.lower !== void 0) throw new Error(\"An index range has only one lower bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.lower = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: true\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tlt: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.upper !== void 0) throw new Error(\"An index range has only one upper bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.upper = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t},\n\t\t\t\t\tlte: (field, value) => {\n\t\t\t\t\t\texpectField(field);\n\t\t\t\t\t\tif (range.upper !== void 0) throw new Error(\"An index range has only one upper bound.\");\n\t\t\t\t\t\tboundedField = field;\n\t\t\t\t\t\trange.upper = {\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tvalue: encodeIndexValue(field, value),\n\t\t\t\t\t\t\tinclusive: true\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn builder;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst built = buildRange(builder);\n\t\t\t\tif (!Predicate.isObject(built)) throw new Error(\"An index range callback must return its builder.\");\n\t\t\t\treturn query(table, name, range, order);\n\t\t\t},\n\t\t\torder: (direction) => query(table, selectedIndex, selectedRange, direction === \"asc\" ? \"Asc\" : \"Desc\"),\n\t\t\tcollect: () => resultFromEffect(execute()),\n\t\t\ttake: (count) => resultFromEffect(execute(validateLimit(count))),\n\t\t\tfirst: () => resultFromEffect(execute(1).pipe(Effect.map((documents) => documents[0]))),\n\t\t\tunique: () => resultFromEffect(execute(2).pipe(Effect.flatMap((documents) => documents.length > 1 ? Effect.die(/* @__PURE__ */ new Error(\"A unique database query matched more than one document.\")) : Effect.succeed(documents[0])))),\n\t\t\tpaginate: (options) => resultFromEffect(executePage(options))\n\t\t});\n\t};\n\treturn Object.freeze({\n\t\tfind: (table, id) => resultFromEffect(findEffect(table, id)),\n\t\tget: (table, id) => resultFromEffect(findEffect(table, id).pipe(Effect.flatMap((document) => document === void 0 ? Effect.fail(documentNotFound(table, id)) : Effect.succeed(document)))),\n\t\tquery: (table) => query(table)\n\t});\n};\nconst makeWriter = (schema, call) => {\n\tconst reader = makeReader(schema, call);\n\tconst complete = Effect.fn(\"Guest.completeWrite\")(function* (table, id, request) {\n\t\tif (expectResponse(yield* callHost(call, request), \"Completed\").found === false) return yield* Effect.fail(documentNotFound(table, id));\n\t});\n\tconst writer = {\n\t\t...reader,\n\t\tdelete: (table, id) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Delete\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id)\n\t\t})),\n\t\tinsert: (table, value) => resultFromEffect(callHost(call, {\n\t\t\ttype: \"Insert\",\n\t\t\ttable,\n\t\t\tfields: encodeFields(schema, table, value)\n\t\t}).pipe(Effect.map((response) => expectResponse(response, \"Inserted\").id))),\n\t\tpatch: (table, id, value) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Patch\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id),\n\t\t\tfields: encodePatchFields(schema, table, value)\n\t\t})),\n\t\treplace: (table, id, value) => resultFromEffect(complete(table, id, {\n\t\t\ttype: \"Replace\",\n\t\t\ttable,\n\t\t\tid: GeneratedId.make(id),\n\t\t\tfields: encodeFields(schema, table, value)\n\t\t}))\n\t};\n\treturn Object.freeze(writer);\n};\nconst encodeSuccess = Effect.fn(\"Guest.encodeSuccess\")(function* (definition, value) {\n\tif (definition.returns === void 0) {\n\t\tyield* Schema.encodeUnknownEffect(Schema.Undefined)(value);\n\t\treturn { type: \"Success\" };\n\t}\n\tconst encoded = yield* Schema.encodeUnknownEffect(Schema.toCodecJson(definition.returns))(value);\n\tconst files = runtimeFileOccurrencesOf(value);\n\tconst result = files.length === 0 ? {\n\t\ttype: \"Success\",\n\t\tvalue: encoded\n\t} : {\n\t\ttype: \"Success\",\n\t\tvalue: encoded,\n\t\tfiles\n\t};\n\tconst dates = datePathsOf(value);\n\treturn dates.length === 0 ? result : {\n\t\t...result,\n\t\tdates\n\t};\n});\nconst encodeFailure = Effect.fn(\"Guest.encodeFailure\")(function* (definition, error) {\n\tconst result = {\n\t\ttype: \"Failure\",\n\t\terror: yield* Schema.encodeUnknownEffect(Schema.toCodecJson(definition.errors ?? ErrorValueSchema))(error)\n\t};\n\tconst dates = datePathsOfObject(error);\n\treturn dates.length === 0 ? result : {\n\t\t...result,\n\t\tdates\n\t};\n});\nconst runGuest = Effect.fn(\"Guest.invoke\")(function* (definition, encodedArgs, call, rawEnvironment) {\n\tconst schema = getFunctionSchema(definition);\n\tif (schema === void 0) return yield* Effect.die(\"The function has no bound schema.\");\n\tconst environmentDefinition = getFunctionEnvironment(definition) ?? emptyEnv;\n\tconst environment = yield* decodeDefinedEnvironment(environmentDefinition, rawEnvironment).pipe(Effect.mapError(() => /* @__PURE__ */ new Error(\"The deployment environment is invalid.\")));\n\tconst decodedArgs = yield* Schema.decodeEffect(Schema.toCodecJson(guestCodec(Schema.Struct(definition.args ?? {}))))(encodedArgs).pipe(Effect.match({\n\t\tonFailure: () => ({ valid: false }),\n\t\tonSuccess: (value) => ({\n\t\t\tvalid: true,\n\t\t\tvalue\n\t\t})\n\t}));\n\tif (!decodedArgs.valid) return {\n\t\ttype: \"InvocationRejected\",\n\t\tcode: \"InvalidArguments\",\n\t\tmessage: \"The invocation arguments do not match the function definition.\"\n\t};\n\tconst args = yield* Schema.decodeUnknownEffect(Schema.ObjectKeyword)(decodedArgs.value);\n\tconst context = Object.freeze({\n\t\tdb: definition._tag === \"Query\" ? makeReader(schema, call) : makeWriter(schema, call),\n\t\tenv: environment,\n\t\tid: makeIdContext(callHost(call, { type: \"ReadId\" }).pipe(Effect.flatMap((response) => response.type === \"Identity\" ? Effect.succeed(response.user) : Effect.die(\"The ID response is invalid.\"))))\n\t});\n\treturn yield* Effect.gen(() => definition.handler(context, args)).pipe(Effect.matchEffect({\n\t\tonFailure: (error) => encodeFailure(definition, error),\n\t\tonSuccess: (value) => encodeSuccess(definition, value)\n\t}));\n});\nconst invoke = (definition, encodedArgs, call, rawEnvironment = {}) => Effect.runPromise(runGuest(definition, encodedArgs, call, rawEnvironment)).then((result) => Schema.encodeSync(Schema.fromJsonString(Schema.Json))(result));\nconst EvolutionRequest = Schema.Struct({\n\ttable: Schema.String,\n\tfields: Schema.JsonObject\n});\n/** Entry point for the isolated schema bundle. It has no host capabilities. */\nconst evolve = (schema, encodedRequest) => {\n\tconst request = Schema.decodeSync(Schema.fromJsonString(EvolutionRequest))(encodedRequest);\n\tconst definition = tableFor(schema, request.table);\n\ttry {\n\t\treturn JSON.stringify({\n\t\t\ttype: \"Success\",\n\t\t\tvalue: { fields: evolveStoredFields(definition.schema, request.fields) }\n\t\t});\n\t} catch {\n\t\treturn JSON.stringify({\n\t\t\ttype: \"Success\",\n\t\t\tvalue: { error: `Stored fields in '${request.table}' do not match the new schema or its conversion rules.` }\n\t\t});\n\t}\n};\n//#endregion\nexport { evolve, invoke };\n\n//# sourceMappingURL=guest.js.map"],"mappings":";;;;;AAKA,MAAM,eAAe,OAAO,OAAO;CAClC,IAAI;CACJ,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,QAAQ,OAAO;AAChB,CAAC;AACD,MAAM,cAAc,OAAO,OAAO;CACjC,MAAM,OAAO,QAAQ,SAAS;CAC9B,OAAO,OAAO;AACf,CAAC;AACD,MAAM,sBAAsB,OAAO,OAAO;CACzC,OAAO,OAAO;CACd,OAAO,OAAO;AACf,CAAC;AACD,MAAM,iBAAiB,OAAO,OAAO;CACpC,OAAO,OAAO,MAAM,mBAAmB;CACvC,OAAO,OAAO,SAAS,OAAO,OAAO;EACpC,GAAG,oBAAoB;EACvB,WAAW,OAAO;CACnB,CAAC,CAAC;CACF,OAAO,OAAO,SAAS,OAAO,OAAO;EACpC,GAAG,oBAAoB;EACvB,WAAW,OAAO;CACnB,CAAC,CAAC;AACH,CAAC;AACD,MAAM,YAAY,OAAO,OAAO;CAC/B,MAAM,OAAO,QAAQ,OAAO;CAC5B,OAAO,OAAO;CACd,OAAO,OAAO,SAAS,OAAO,MAAM;CACpC,OAAO,OAAO,SAAS,cAAc;CACrC,OAAO,OAAO,SAAS,CAAC,OAAO,MAAM,CAAC;CACtC,OAAO,OAAO,SAAS,OAAO,OAAO;AACtC,CAAC;AACD,MAAM,eAAe,OAAO,OAAO;CAClC,MAAM,OAAO,QAAQ,UAAU;CAC/B,OAA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AAa,SAAS,QAAQ,QAAQ,KAAK;CACjD,IAAI;EACH,OAAO,KAAK,UAAU;GACrB,MAAM;GACN,OAAO,EAAE,QAAQ,mBAAmB,WAAW,QAAQ,QAAQ,MAAM,EAAE;EACxE,CAAC;CACF,QAAQ;EACP,OAAO,KAAK,UAAU;GACrB,MAAM;GACN,OAAO,EAAE,OAAO,qBAAqB,QAAQ,MAAM,wDAAwD;EAC5G,CAAC;CACF;AACD"}
@@ -1,4 +1,4 @@
1
- import { r as bindSchema$1 } from "../index-D54flWtH.js";
1
+ import { r as bindSchema$1 } from "../index-DWU-7TIh.js";
2
2
  //#region src/internal/server.d.ts
3
3
  declare const bindSchema: typeof bindSchema$1;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { n as bindSchema$1 } from "../schema-1Zs03-iS.js";
1
+ import { n as bindSchema$1 } from "../schema-DqogEydG.js";
2
2
  //#region src/internal/server.ts
3
3
  const bindSchema = bindSchema$1;
4
4
  //#endregion
@@ -1,2 +1,3 @@
1
- import { c as Id, l as SchemaDefinitionOf, o as Document, u as SchemaDefinitionTypeId } from "../index-D54flWtH.js";
1
+ import { a as Id, c as SchemaDefinitionTypeId, n as Document, s as SchemaDefinitionOf } from "../types-C1iDP2Yf-BnkfBOQf.js";
2
+ import "../index-DWU-7TIh.js";
2
3
  export { type Document, type Id, type SchemaDefinitionOf, SchemaDefinitionTypeId };
@@ -1,2 +1,2 @@
1
- import { t as SchemaDefinitionTypeId } from "../schema-1Zs03-iS.js";
1
+ import { t as SchemaDefinitionTypeId } from "../schema-DqogEydG.js";
2
2
  export { SchemaDefinitionTypeId };
@@ -23,7 +23,17 @@ interface IdContext {
23
23
  declare const SessionOutcome: Schema.Literals<readonly ["SignedIn", "ProfileUpdated", "Cancelled"]>;
24
24
  type SessionOutcome = typeof SessionOutcome.Type;
25
25
  //#endregion
26
- //#region ../contracts/dist/descriptor-BM7e5QAn.d.ts
26
+ //#region ../contracts/dist/descriptor-DAHJJO3I.d.ts
27
+ //#region src/schema/evolution.d.ts
28
+ type Defaulted<Value extends Schema.Constraint> = Omit<Value, "~type.constructor.default"> & {
29
+ readonly "~type.constructor.default": "with-default";
30
+ };
31
+ interface ValueEvolution<Value extends Schema.Constraint> {
32
+ default(value: Value["Type"]): DescribedValue<Defaulted<Value>>;
33
+ renameFrom(name: string): DescribedValue<Value>;
34
+ from<Previous extends DescribedValue>(previous: Previous, convert: (value: Previous["Type"]) => Value["Type"]): DescribedValue<Value>;
35
+ }
36
+ //#endregion
27
37
  //#region src/schema/descriptor.d.ts
28
38
  interface DescriptorField {
29
39
  readonly name: string;
@@ -89,12 +99,12 @@ declare const ValueDescriptorTypeId: unique symbol;
89
99
  interface ValueDescriptorCarrier {
90
100
  readonly [ValueDescriptorTypeId]: ValueDescriptor;
91
101
  }
92
- type DescribedValue<Value extends Schema.Constraint = Schema.Constraint> = Value & ValueDescriptorCarrier;
102
+ type DescribedValue<Value extends Schema.Constraint = Schema.Constraint> = Value & ValueDescriptorCarrier & ValueEvolution<Value>;
93
103
  type ValueFields = {
94
104
  readonly [fieldName: PropertyKey]: DescribedValue;
95
105
  };
96
106
  //#endregion
97
- //#region ../contracts/dist/pagination-DnKg3dkI.d.ts
107
+ //#region ../contracts/dist/pagination-CpYCaRYD.d.ts
98
108
  //#region src/runtime/pagination.d.ts
99
109
  declare const PaginationCursor: Schema.brand<Schema.String, "ignotum/runtime/PaginationCursor">;
100
110
  type PaginationCursor = typeof PaginationCursor.Type;
@@ -109,4 +119,4 @@ interface PaginationPage<Item> {
109
119
  }
110
120
  //#endregion
111
121
  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
122
+ //# sourceMappingURL=pagination-CpYCaRYD-C2Rpp4Cw.d.ts.map
@@ -0,0 +1 @@
1
+ import "./pagination-CpYCaRYD-C2Rpp4Cw.js";
@@ -1,5 +1,5 @@
1
1
  import { I as fileLimits, M as constrainedFileValue, N as fileFormats, O as FileFormat, W as GeneratedId, c as UserId, h as ErrorBrand } from "./id-Bt9XWRGL.js";
2
- import { a as getValueDescriptor, i as descriptorFields, n as attachValueDescriptor, o as PaginationCursor, r as descriptorAllowedInEnvironment, s as PaginationPageSize } from "./descriptor-Cyo9FP9n-C0SRVXNW.js";
2
+ import { a as descriptorFields, c as validateFieldRenames, d as PaginationPageSize, i as descriptorAllowedInEnvironment, l as withValueChildren, r as attachValueDescriptor, s as getValueDescriptor, u as PaginationCursor } from "./descriptor-DCCz5AHd-_nhlnu8U.js";
3
3
  import { Effect, Predicate, Redacted, Result, Schema, Struct } from "effect";
4
4
  //#region ../contracts/dist/schema/values.js
5
5
  const LiteralValueSchema = Schema.Union([
@@ -24,7 +24,14 @@ const utf8ByteLength$1 = (value) => {
24
24
  };
25
25
  const table = (fields) => {
26
26
  const tableFields = fields;
27
- const make = (indexes) => {
27
+ validateFieldRenames(tableFields);
28
+ const make = (indexes, schema = withValueChildren(attachValueDescriptor(Schema.Struct(tableFields), {
29
+ type: "object",
30
+ fields: descriptorFields(tableFields)
31
+ }), {
32
+ type: "object",
33
+ fields: tableFields
34
+ })) => {
28
35
  const index = (name, fieldNames) => {
29
36
  if (utf8ByteLength$1(name) > schemaIndexLimits.nameBytes) throw new Error(`Index names cannot exceed ${schemaIndexLimits.nameBytes} UTF-8 bytes.`);
30
37
  if (name.length === 0) throw new Error("Index names cannot be empty.");
@@ -47,7 +54,7 @@ const table = (fields) => {
47
54
  name,
48
55
  fields: fieldNames
49
56
  }
50
- });
57
+ }, schema);
51
58
  };
52
59
  return {
53
60
  _tag: "Table",
@@ -56,9 +63,10 @@ const table = (fields) => {
56
63
  fields: descriptorFields(tableFields)
57
64
  },
58
65
  fields: tableFields,
66
+ from: (previous, convert) => make(indexes, schema.from(previous, convert)),
59
67
  index,
60
68
  indexes,
61
- schema: Schema.Struct(tableFields)
69
+ schema
62
70
  };
63
71
  };
64
72
  return make({});
@@ -113,15 +121,19 @@ const requireDescriptor = (value) => {
113
121
  return descriptor;
114
122
  };
115
123
  const array = (value) => {
116
- return attachValueDescriptor(Schema.Array(value), {
124
+ return withValueChildren(attachValueDescriptor(Schema.Array(value), {
117
125
  type: "array",
118
126
  value: requireDescriptor(value)
127
+ }), {
128
+ type: "array",
129
+ value
119
130
  });
120
131
  };
121
132
  const assertFieldsExist = (fields, keys, operation) => {
122
133
  for (const key of keys) if (!Object.hasOwn(fields, key)) throw new Error(`Cannot ${operation} unknown field '${String(key)}'.`);
123
134
  };
124
135
  const fixedObject = (fields) => {
136
+ validateFieldRenames(fields);
125
137
  const pick = (...keys) => {
126
138
  assertFieldsExist(fields, keys, "pick");
127
139
  return fixedObject(Struct.pick(fields, keys));
@@ -151,9 +163,12 @@ const fixedObject = (fields) => {
151
163
  }
152
164
  return fixedObject(partialFields);
153
165
  };
154
- const schema = attachValueDescriptor(Schema.Struct(fields), {
166
+ const schema = withValueChildren(attachValueDescriptor(Schema.Struct(fields), {
155
167
  type: "object",
156
168
  fields: descriptorFields(fields)
169
+ }), {
170
+ type: "object",
171
+ fields
157
172
  });
158
173
  return Object.assign(schema, {
159
174
  extend,
@@ -165,27 +180,39 @@ const fixedObject = (fields) => {
165
180
  };
166
181
  const object = (fields) => fixedObject(fields);
167
182
  const optional = (value) => {
168
- return attachValueDescriptor(Schema.optional(value), {
183
+ return withValueChildren(attachValueDescriptor(Schema.optional(value), {
169
184
  type: "optional",
170
185
  value: requireDescriptor(value)
186
+ }), {
187
+ type: "optional",
188
+ value
171
189
  });
172
190
  };
173
191
  const nullable = (value) => {
174
- return attachValueDescriptor(Schema.NullOr(value), {
192
+ return withValueChildren(attachValueDescriptor(Schema.NullOr(value), {
175
193
  type: "nullable",
176
194
  value: requireDescriptor(value)
195
+ }), {
196
+ type: "nullable",
197
+ value
177
198
  });
178
199
  };
179
200
  const record = (value) => {
180
- return attachValueDescriptor(Schema.Record(Schema.String, value), {
201
+ return withValueChildren(attachValueDescriptor(Schema.Record(Schema.String, value), {
181
202
  type: "record",
182
203
  value: requireDescriptor(value)
204
+ }), {
205
+ type: "record",
206
+ value
183
207
  });
184
208
  };
185
209
  const union = (...members) => {
186
- return attachValueDescriptor(Schema.Union(members), {
210
+ return withValueChildren(attachValueDescriptor(Schema.Union(members), {
187
211
  type: "union",
188
212
  members: members.map(requireDescriptor)
213
+ }), {
214
+ type: "union",
215
+ members
189
216
  });
190
217
  };
191
218
  const Secret = {
@@ -420,4 +447,4 @@ function bindSchema(schema, environment = emptyEnv) {
420
447
  //#endregion
421
448
  export { defineSchema as a, getFunctionSchema as c, defineEnv as i, Secret as l, bindSchema as n, emptyEnv as o, decodeDefinedEnvironment as r, getFunctionEnvironment as s, SchemaDefinitionTypeId as t };
422
449
 
423
- //# sourceMappingURL=schema-1Zs03-iS.js.map
450
+ //# sourceMappingURL=schema-DqogEydG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-DqogEydG.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, f as validateFieldRenames, p as withValueChildren, r as attachValueDescriptor, s as descriptorFields } from \"../descriptor-DCCz5AHd.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\tvalidateFieldRenames(tableFields);\n\tconst make = (indexes, schema = withValueChildren(attachValueDescriptor(Schema.Struct(tableFields), {\n\t\ttype: \"object\",\n\t\tfields: descriptorFields(tableFields)\n\t}), {\n\t\ttype: \"object\",\n\t\tfields: tableFields\n\t})) => {\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}, schema);\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\tfrom: (previous, convert) => make(indexes, schema.from(previous, convert)),\n\t\t\tindex,\n\t\t\tindexes,\n\t\t\tschema\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 withValueChildren(attachValueDescriptor(Schema.Array(value), {\n\t\ttype: \"array\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"array\",\n\t\tvalue\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\tvalidateFieldRenames(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 = withValueChildren(attachValueDescriptor(Schema.Struct(fields), {\n\t\ttype: \"object\",\n\t\tfields: descriptorFields(fields)\n\t}), {\n\t\ttype: \"object\",\n\t\tfields\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 withValueChildren(attachValueDescriptor(Schema.optional(value), {\n\t\ttype: \"optional\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"optional\",\n\t\tvalue\n\t});\n};\nconst nullable = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.NullOr(value), {\n\t\ttype: \"nullable\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"nullable\",\n\t\tvalue\n\t});\n};\nconst record = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.Record(Schema.String, value), {\n\t\ttype: \"record\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"record\",\n\t\tvalue\n\t});\n};\nconst union = (...members) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.Union(members), {\n\t\ttype: \"union\",\n\t\tmembers: members.map(requireDescriptor)\n\t}), {\n\t\ttype: \"union\",\n\t\tmembers\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, d as evolveStoredValue, i as descriptorAllowedInEnvironment, l as applyValueDefaults, n as ValueDescriptorTypeId, o as descriptorContainsSecret, s as descriptorFields, t as ValueDescriptor, u as evolveStoredFields } from \"../descriptor-DCCz5AHd.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, applyValueDefaults, bindSchema, bindValues, decodeDefinedEnvironment, decodeEnvironment, defineEnv, defineSchema, descriptorAllowedInEnvironment, descriptorContainsFile, descriptorContainsSecret, descriptorFields, emptyEnv, environmentLimits, environmentValues, evolveStoredFields, evolveStoredValue, fileFormats, fileLimits, fileMimeTypes, getValueDescriptor, isDefinedEnv, isDefinedSchema, isFileValue, schemaIndexLimits, table, values };\n\n//# sourceMappingURL=index.js.map"],"mappings":";;;;AAQA,MAAM,qBAAqB,OAAO,MAAM;CACvC,OAAO;CACP,OAAO;CACP,OAAO;AACR,CAAC;AACD,MAAM,oBAAoB;CACzB,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,UAAU;CACV,WAAW;AACZ;AACA,MAAMA,oBAAkB,UAAU;CACjC,IAAI,QAAQ;CACZ,KAAK,MAAM,aAAa,OAAO;EAC9B,MAAM,QAAQ,UAAU,YAAY,CAAC,KAAK;EAC1C,SAAS,SAAS,MAAM,IAAI,SAAS,OAAO,IAAI,SAAS,QAAQ,IAAI;CACtE;CACA,OAAO;AACR;AACA,MAAM,SAAS,WAAW;CACzB,MAAM,cAAc;CACpB,qBAAqB,WAAW;CAChC,MAAM,QAAQ,SAAS,SAAS,kBAAkB,sBAAsB,OAAO,OAAO,WAAW,GAAG;EACnG,MAAM;EACN,QAAQ,iBAAiB,WAAW;CACrC,CAAC,GAAG;EACH,MAAM;EACN,QAAQ;CACT,CAAC,MAAM;EACN,MAAM,SAAS,MAAM,eAAe;GACnC,IAAIA,iBAAe,IAAI,IAAI,kBAAkB,WAAW,MAAM,IAAI,MAAM,6BAA6B,kBAAkB,UAAU,cA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,IAAIA,OAAS,UAAU,QAAQ,GAAG,OAAO,OAAO,aAAa,GAAG;EAChE,IAAI,SAAS,YAAY,KAAK,GAAG,QAAQ,IAAI,SAAS,KAAK,SAAS,OAAO;CAC5E;CACA,OAAO,OAAO,OAAO,OAAO;AAC7B,CAAC;AACD,MAAM,4BAA4B,aAAa,QAAQ,YAAY,yBAAyB,CAAC,GAAG;AAGhG,MAAM,uBAAuB,QAAQ,aAAa,SAAS;CAC1D,MAAM,UAAU,eAAe,0BAA0B,WAAW,CAAC,CAAC,qBAAqB,MAAM,CAAC,CAAC;EAClG,MAAM;EACN,GAAG;CACJ,CAAC,CAAC;CACF,OAAO;AACR;AACA,MAAM,wBAAwB,QAAQ,iBAAiB;CACtD,UAAU,oBAAoB,QAAQ,aAAa,UAAU;CAC7D,OAAO,oBAAoB,QAAQ,aAAa,OAAO;AACxD;AACA,SAAS,WAAW,QAAQ,cAAc,UAAU;CACnD,OAAO;EACN,QAAQ,WAAW,OAAO,uBAAuB;EACjD,GAAG,qBAAqB,QAAQ,WAAW;CAC5C;AACD"}
@@ -1,8 +1,9 @@
1
1
  import { c as Result$1, g as FileValue, h as FileMimeType, i as ErrorValue, m as FileMetadata, p as FileFormat } from "./id-BzFHf3Wo-DGPCjgrf.js";
2
2
  import "./result-DKAA4gpS.js";
3
- import { d as User, f as UserId } from "./pagination-DnKg3dkI-r5ZUxBBx.js";
4
- import "./id-Dz0apuB3.js";
5
- import { a as DefinedEnv, d as defineEnv$1, f as Secret$1, i as defineSchema$1, n as SchemaAuthoring, s as EnvironmentAuthoring, t as DefinedSchema } from "./index-D54flWtH.js";
3
+ import { d as User, f as UserId } from "./pagination-CpYCaRYD-C2Rpp4Cw.js";
4
+ import "./id-E7JKqQ9r.js";
5
+ import { l as defineEnv$1, m as Secret$1, r as EnvironmentAuthoring, t as DefinedEnv } from "./types-C1iDP2Yf-BnkfBOQf.js";
6
+ import { i as defineSchema$1, n as SchemaAuthoring, t as DefinedSchema } from "./index-DWU-7TIh.js";
6
7
  //#region src/server/index.d.ts
7
8
  declare const Result: typeof Result$1;
8
9
  type Result<Success, Failure extends ErrorValue> = Result$1<Success, Failure>;
@@ -1,5 +1,5 @@
1
1
  import { _ as Result$1 } from "./id-Bt9XWRGL.js";
2
- import { a as defineSchema$1, i as defineEnv$1, l as Secret$1 } from "./schema-1Zs03-iS.js";
2
+ import { a as defineSchema$1, i as defineEnv$1, l as Secret$1 } from "./schema-DqogEydG.js";
3
3
  //#region src/server/index.ts
4
4
  const Result = Result$1;
5
5
  const defineEnv = defineEnv$1;