ignotum 0.0.12 → 0.0.13
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/dist/cli/bin.mjs +825 -403
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/runtime/{api-DzcR7spt.js → api-CAgKDij7.js} +38 -2
- package/dist/runtime/api-CAgKDij7.js.map +1 -0
- package/dist/runtime/{api-5XSrIeqW.d.ts → api-Cv3hMbzo.d.ts} +4 -4
- package/dist/runtime/client.d.ts +39 -9
- package/dist/runtime/client.js +339 -60
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js +154 -0
- package/dist/runtime/descriptor-Cyo9FP9n-C0SRVXNW.js.map +1 -0
- package/dist/runtime/id-Bt9XWRGL.js +423 -0
- package/dist/runtime/id-Bt9XWRGL.js.map +1 -0
- package/dist/runtime/{id-Cs82tq9Q-CK-maMgN.d.ts → id-BzFHf3Wo-DGPCjgrf.d.ts} +2 -2
- package/dist/runtime/id-Dz0apuB3.d.ts +1 -0
- package/dist/runtime/{index-CrWg4Z0y.d.ts → index-D54flWtH.d.ts} +9 -5
- package/dist/runtime/internal/api.d.ts +1 -1
- package/dist/runtime/internal/api.js +1 -1
- package/dist/runtime/internal/host.d.ts +9 -6
- package/dist/runtime/internal/host.js +15 -6
- package/dist/runtime/internal/host.js.map +1 -1
- package/dist/runtime/internal/server.d.ts +1 -1
- package/dist/runtime/internal/server.js +1 -1
- package/dist/runtime/internal/types.d.ts +1 -1
- package/dist/runtime/internal/types.js +1 -1
- package/dist/runtime/{pagination-D-R9NR61-CpIoHFoI.d.ts → pagination-DnKg3dkI-r5ZUxBBx.d.ts} +31 -6
- package/dist/runtime/pagination-Dz0apuB3.d.ts +1 -0
- package/dist/runtime/result-DKAA4gpS.d.ts +1 -0
- package/dist/runtime/{schema-B9XxyRO8.js → schema-1Zs03-iS.js} +5 -3
- package/dist/runtime/schema-1Zs03-iS.js.map +1 -0
- package/dist/runtime/server.d.ts +6 -4
- package/dist/runtime/server.js +2 -2
- package/dist/runtime/server.js.map +1 -1
- package/dist/runtime/{sync-avN7NkcU.d.ts → sync-Bs8J3fIr.d.ts} +2 -2
- package/package.json +1 -1
- package/src/cli/agent-files.ts +6 -0
- package/src/client/hooks.ts +68 -0
- package/src/client/id.ts +259 -0
- package/src/client/index.ts +5 -2
- package/src/client/sync.ts +143 -10
- package/src/dev-runtime/functions.ts +111 -88
- package/src/dev-runtime/id.ts +175 -0
- package/src/dev-runtime/query-cache.ts +105 -0
- package/src/dev-runtime/sync.ts +149 -17
- package/src/server/index.ts +2 -0
- package/dist/runtime/api-DzcR7spt.js.map +0 -1
- package/dist/runtime/descriptor-XzDX2JDw-j3O6YHgW.js +0 -330
- package/dist/runtime/descriptor-XzDX2JDw-j3O6YHgW.js.map +0 -1
- package/dist/runtime/file-C1abuMgd.js +0 -173
- package/dist/runtime/file-C1abuMgd.js.map +0 -1
- package/dist/runtime/pagination-CX5IPbEi.d.ts +0 -1
- package/dist/runtime/result-DIjKM-p4.d.ts +0 -1
- package/dist/runtime/schema-B9XxyRO8.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as AppId, K as InvocationId, U as DeploymentId, Y as SubscriptionId, k as FileId, o as SessionState } from "./id-Bt9XWRGL.js";
|
|
2
2
|
import { Predicate, Schema } from "effect";
|
|
3
3
|
//#region ../contracts/dist/runtime/identity.js
|
|
4
4
|
const InvocationKey = Schema.String.pipe(Schema.brand("ignotum/hosted/InvocationKey"));
|
|
@@ -73,12 +73,19 @@ const WireFailure = Schema.Struct({
|
|
|
73
73
|
});
|
|
74
74
|
const WireResult = Schema.Union([WireSuccess, WireFailure]);
|
|
75
75
|
const SyncHandshake = Schema.Struct({
|
|
76
|
+
session: Schema.optional(SessionState),
|
|
77
|
+
serverTime: Schema.optional(Schema.Finite),
|
|
76
78
|
type: Schema.Literal("Handshake"),
|
|
77
79
|
appId: AppId,
|
|
78
80
|
deploymentId: DeploymentId,
|
|
79
81
|
generation: DeploymentGeneration
|
|
80
82
|
});
|
|
81
83
|
const Snapshot = Schema.Struct({
|
|
84
|
+
identity: Schema.optional(Schema.Struct({
|
|
85
|
+
sessionEpoch: Schema.String,
|
|
86
|
+
viewRevision: Schema.Natural,
|
|
87
|
+
dependsOnId: Schema.Boolean
|
|
88
|
+
})),
|
|
82
89
|
type: Schema.Literal("Snapshot"),
|
|
83
90
|
id: SubscriptionId,
|
|
84
91
|
result: WireResult,
|
|
@@ -89,6 +96,7 @@ const Snapshot = Schema.Struct({
|
|
|
89
96
|
})))
|
|
90
97
|
});
|
|
91
98
|
const Preparation = Schema.Struct({
|
|
99
|
+
sessionEpoch: Schema.optional(Schema.String),
|
|
92
100
|
type: Schema.Literal("Preparation"),
|
|
93
101
|
id: InvocationId,
|
|
94
102
|
kind: Schema.Literal("Mutation"),
|
|
@@ -98,17 +106,21 @@ const Preparation = Schema.Struct({
|
|
|
98
106
|
}))
|
|
99
107
|
});
|
|
100
108
|
const SyncResultSuccess = Schema.Struct({
|
|
109
|
+
sessionEpoch: Schema.optional(Schema.String),
|
|
101
110
|
type: Schema.Literal("Result"),
|
|
102
111
|
id: InvocationId,
|
|
103
112
|
result: WireSuccess,
|
|
104
113
|
committedRevision: AppStateRevision
|
|
105
114
|
});
|
|
106
115
|
const SyncResultFailure = Schema.Struct({
|
|
116
|
+
sessionEpoch: Schema.optional(Schema.String),
|
|
107
117
|
type: Schema.Literal("Result"),
|
|
108
118
|
id: InvocationId,
|
|
109
119
|
result: WireFailure
|
|
110
120
|
});
|
|
111
121
|
const ErrorCode = Schema.Literals([
|
|
122
|
+
"SessionChanged",
|
|
123
|
+
"SessionExpired",
|
|
112
124
|
"DuplicateOperationId",
|
|
113
125
|
"FunctionUnavailable",
|
|
114
126
|
"InvalidArguments",
|
|
@@ -119,6 +131,7 @@ const ErrorCode = Schema.Literals([
|
|
|
119
131
|
"WrongFunctionKind"
|
|
120
132
|
]);
|
|
121
133
|
const SyncError = Schema.Struct({
|
|
134
|
+
sessionEpoch: Schema.optional(Schema.String),
|
|
122
135
|
type: Schema.Literal("Error"),
|
|
123
136
|
operation: Schema.optional(Operation),
|
|
124
137
|
code: ErrorCode,
|
|
@@ -130,7 +143,30 @@ const Deployment = Schema.Struct({
|
|
|
130
143
|
generation: DeploymentGeneration
|
|
131
144
|
});
|
|
132
145
|
const DeploymentCloseCode = 4409;
|
|
146
|
+
const Session = Schema.Union([Schema.Struct({
|
|
147
|
+
type: Schema.Literal("Session"),
|
|
148
|
+
event: Schema.Literal("Updated"),
|
|
149
|
+
serverTime: Schema.Finite,
|
|
150
|
+
session: SessionState
|
|
151
|
+
}), Schema.Struct({
|
|
152
|
+
type: Schema.Literal("Session"),
|
|
153
|
+
event: Schema.Literals([
|
|
154
|
+
"SignedOut",
|
|
155
|
+
"Revoked",
|
|
156
|
+
"Expired",
|
|
157
|
+
"Unavailable",
|
|
158
|
+
"Replaced"
|
|
159
|
+
]),
|
|
160
|
+
sessionEpoch: Schema.String
|
|
161
|
+
})]);
|
|
162
|
+
const Invalidate = Schema.Struct({
|
|
163
|
+
type: Schema.Literal("Invalidate"),
|
|
164
|
+
sessionEpoch: Schema.String,
|
|
165
|
+
ids: Schema.Array(SubscriptionId)
|
|
166
|
+
});
|
|
133
167
|
const ServerMessage = Schema.Union([
|
|
168
|
+
Session,
|
|
169
|
+
Invalidate,
|
|
134
170
|
SyncHandshake,
|
|
135
171
|
Snapshot,
|
|
136
172
|
Preparation,
|
|
@@ -170,4 +206,4 @@ function createApi() {
|
|
|
170
206
|
//#endregion
|
|
171
207
|
export { ErrorCode as a, ServerMessageJson as c, WireSuccess as d, AppStateRevision as f, DeploymentCloseCode as i, WireFailure as l, InvocationKey as m, functionPathOf as n, FunctionAddress as o, DeploymentGeneration as p, ClientMessageJson as r, Operation as s, createApi as t, WireResult as u };
|
|
172
208
|
|
|
173
|
-
//# sourceMappingURL=api-
|
|
209
|
+
//# sourceMappingURL=api-CAgKDij7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-CAgKDij7.js","names":[],"sources":["../../../contracts/dist/runtime/identity.js","../../../contracts/dist/runtime/sync.js","../../src/internal/api.ts"],"sourcesContent":["import { AppId, AuthAccountId, AuthDeviceCodeId, AuthInternalId, AuthInvitationId, AuthMemberId, AuthSessionId, AuthVerificationId, ConnectionId, DeploymentId, DevDatabaseLockId, InvocationId, PlatformPrincipalId, RequestId, RuntimeRequestNonce, SubscriptionId, TableId, TeamId } from \"./id.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/identity.ts\nconst InvocationKey = Schema.String.pipe(Schema.brand(\"ignotum/hosted/InvocationKey\"));\nconst DeploymentGeneration = Schema.Natural.pipe(Schema.brand(\"ignotum/hosted/DeploymentGeneration\"));\nconst AppStateRevision = Schema.Natural.pipe(Schema.brand(\"ignotum/hosted/AppStateRevision\"));\n//#endregion\nexport { AppId, AppStateRevision, AuthAccountId, AuthDeviceCodeId, AuthInternalId, AuthInvitationId, AuthMemberId, AuthSessionId, AuthVerificationId, ConnectionId, DeploymentGeneration, DeploymentId, DevDatabaseLockId, InvocationId, InvocationKey, PlatformPrincipalId, RequestId, RuntimeRequestNonce, SubscriptionId, TableId, TeamId };\n\n//# sourceMappingURL=identity.js.map","import { AppId, DeploymentId, InvocationId, SubscriptionId } from \"./id.js\";\nimport { FileId } from \"../schema/file.js\";\nimport { TransportValueSchema, datePathsOf, datePathsOfObject, decodeTransportObject, decodeTransportValue, encodeTransportObject, encodeTransportValue } from \"./value.js\";\nimport { SessionState } from \"../id.js\";\nimport { AppStateRevision, DeploymentGeneration } from \"./identity.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/sync.ts\nconst FunctionNamePart = Schema.String.check(Schema.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]*$/));\nconst ApiFunctionAddressParts = Schema.TemplateLiteralParser([\n\t\"api.\",\n\tFunctionNamePart,\n\t\".\",\n\tFunctionNamePart\n]);\nconst FunctionAddress = Schema.TemplateLiteral([\n\t\"api.\",\n\tFunctionNamePart,\n\t\".\",\n\tFunctionNamePart\n]);\nconst apiFunctionParts = (address) => {\n\tconst [, moduleName, , functionName] = Schema.decodeSync(ApiFunctionAddressParts)(address);\n\treturn {\n\t\tfunctionName,\n\t\tmoduleName\n\t};\n};\nconst Subscribe = Schema.Struct({\n\ttype: Schema.Literal(\"Subscribe\"),\n\tid: SubscriptionId,\n\tfunction: FunctionAddress,\n\targs: Schema.Json\n});\nconst Unsubscribe = Schema.Struct({\n\ttype: Schema.Literal(\"Unsubscribe\"),\n\tid: SubscriptionId\n});\nconst Invoke = Schema.Struct({\n\ttype: Schema.Literal(\"Invoke\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tfunction: FunctionAddress,\n\targs: Schema.Json\n});\nconst Prepare = Schema.Struct({\n\ttype: Schema.Literal(\"Prepare\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tfunction: FunctionAddress,\n\targs: Schema.Json,\n\tfiles: Schema.Array(FileId)\n});\nconst ClientMessage = Schema.Union([\n\tSubscribe,\n\tUnsubscribe,\n\tPrepare,\n\tInvoke\n]);\nconst SubscriptionOperation = Schema.Struct({\n\ttype: Schema.Literal(\"Subscription\"),\n\tid: SubscriptionId\n});\nconst InvocationOperation = Schema.Struct({\n\ttype: Schema.Literal(\"Invocation\"),\n\tid: InvocationId\n});\nconst Operation = Schema.Union([SubscriptionOperation, InvocationOperation]);\nconst DatePath = Schema.Array(Schema.Union([Schema.String, Schema.Natural]));\nconst DatePaths = Schema.Array(DatePath);\nconst WireSuccess = Schema.Struct({\n\ttype: Schema.Literal(\"Success\"),\n\tvalue: Schema.optional(Schema.Json),\n\tdates: Schema.optional(DatePaths)\n});\nconst WireFailure = Schema.Struct({\n\ttype: Schema.Literal(\"Failure\"),\n\terror: Schema.Json,\n\tdates: Schema.optional(DatePaths)\n});\nconst WireResult = Schema.Union([WireSuccess, WireFailure]);\nconst SyncHandshake = Schema.Struct({\n\tsession: Schema.optional(SessionState),\n\tserverTime: Schema.optional(Schema.Finite),\n\ttype: Schema.Literal(\"Handshake\"),\n\tappId: AppId,\n\tdeploymentId: DeploymentId,\n\tgeneration: DeploymentGeneration\n});\nconst Snapshot = Schema.Struct({\n\tidentity: Schema.optional(Schema.Struct({\n\t\tsessionEpoch: Schema.String,\n\t\tviewRevision: Schema.Natural,\n\t\tdependsOnId: Schema.Boolean\n\t})),\n\ttype: Schema.Literal(\"Snapshot\"),\n\tid: SubscriptionId,\n\tresult: WireResult,\n\trevision: AppStateRevision,\n\tfiles: Schema.optional(Schema.Array(Schema.Struct({\n\t\tid: FileId,\n\t\turl: Schema.String\n\t})))\n});\nconst Preparation = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Preparation\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tuploads: Schema.Array(Schema.Struct({\n\t\tid: FileId,\n\t\turl: Schema.optional(Schema.String)\n\t}))\n});\nconst SyncResultSuccess = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Result\"),\n\tid: InvocationId,\n\tresult: WireSuccess,\n\tcommittedRevision: AppStateRevision\n});\nconst SyncResultFailure = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Result\"),\n\tid: InvocationId,\n\tresult: WireFailure\n});\nconst ErrorCode = Schema.Literals([\n\t\"SessionChanged\",\n\t\"SessionExpired\",\n\t\"DuplicateOperationId\",\n\t\"FunctionUnavailable\",\n\t\"InvalidArguments\",\n\t\"InvalidMessage\",\n\t\"InvocationIdConflict\",\n\t\"ResourceLimitExceeded\",\n\t\"UnknownFunction\",\n\t\"WrongFunctionKind\"\n]);\nconst SyncError = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Error\"),\n\toperation: Schema.optional(Operation),\n\tcode: ErrorCode,\n\tmessage: Schema.String\n});\nconst Deployment = Schema.Struct({\n\ttype: Schema.Literal(\"Deployment\"),\n\tdeploymentId: DeploymentId,\n\tgeneration: DeploymentGeneration\n});\nconst DeploymentCloseCode = 4409;\nconst Session = Schema.Union([Schema.Struct({\n\ttype: Schema.Literal(\"Session\"),\n\tevent: Schema.Literal(\"Updated\"),\n\tserverTime: Schema.Finite,\n\tsession: SessionState\n}), Schema.Struct({\n\ttype: Schema.Literal(\"Session\"),\n\tevent: Schema.Literals([\n\t\t\"SignedOut\",\n\t\t\"Revoked\",\n\t\t\"Expired\",\n\t\t\"Unavailable\",\n\t\t\"Replaced\"\n\t]),\n\tsessionEpoch: Schema.String\n})]);\nconst Invalidate = Schema.Struct({\n\ttype: Schema.Literal(\"Invalidate\"),\n\tsessionEpoch: Schema.String,\n\tids: Schema.Array(SubscriptionId)\n});\nconst ServerMessage = Schema.Union([\n\tSession,\n\tInvalidate,\n\tSyncHandshake,\n\tSnapshot,\n\tPreparation,\n\tSyncResultSuccess,\n\tSyncResultFailure,\n\tSyncError,\n\tDeployment\n]);\nconst ClientMessageJson = Schema.fromJsonString(ClientMessage);\nconst ServerMessageJson = Schema.fromJsonString(ServerMessage);\n//#endregion\nexport { ClientMessage, ClientMessageJson, DatePath, Deployment, DeploymentCloseCode, ErrorCode, FunctionAddress, FunctionNamePart, Invalidate, InvocationId, Operation, ServerMessage, ServerMessageJson, Session, SubscriptionId, SyncHandshake, TransportValueSchema, WireFailure, WireResult, WireSuccess, apiFunctionParts, datePathsOf, datePathsOfObject, decodeTransportObject, decodeTransportValue, encodeTransportObject, encodeTransportValue };\n\n//# sourceMappingURL=sync.js.map","import { Predicate } from \"effect\";\nimport type { Effect } from \"effect\";\n\nimport type { ErrorValue, InternalServerError } from \"@ignotum/contracts/runtime/result\";\nimport { FunctionAddress } from \"@ignotum/contracts/runtime/sync\";\nimport type { FileValue } from \"@ignotum/contracts/schema/file\";\n\nconst FunctionReferenceTypeId: unique symbol = Symbol.for(\"ignotum/internal/api/FunctionReference\");\ndeclare const FunctionReferenceTypesTypeId: unique symbol;\n\ntype FunctionKind = \"Mutation\" | \"Query\";\n\nexport type MutationInput<Value> = Value extends FileValue\n ? Value | File\n : Value extends Date\n ? Value\n : Value extends ReadonlyArray<infer Item>\n ? ReadonlyArray<MutationInput<Item>>\n : Value extends object\n ? { readonly [Key in keyof Value]: MutationInput<Value[Key]> }\n : Value;\n\nexport interface FunctionReference<\n Kind extends FunctionKind,\n Args,\n Success,\n Failure extends ErrorValue,\n> {\n readonly [FunctionReferenceTypeId]: FunctionAddress;\n readonly [FunctionReferenceTypesTypeId]?: {\n readonly kind: Kind;\n readonly args: Args;\n readonly value: Success;\n readonly error: Failure;\n };\n}\n\ntype ReferenceTypes<Reference> = Reference extends {\n readonly [FunctionReferenceTypesTypeId]?: infer Types;\n}\n ? Exclude<Types, undefined>\n : never;\n\nexport declare namespace FunctionReference {\n type Args<Reference> =\n ReferenceTypes<Reference> extends { readonly args: infer Args } ? Args : never;\n type Failure<Reference> =\n ReferenceTypes<Reference> extends {\n readonly error: infer Failure;\n }\n ? Failure\n : never;\n type Kind<Reference> =\n ReferenceTypes<Reference> extends { readonly kind: infer Kind } ? Kind : never;\n type Success<Reference> =\n ReferenceTypes<Reference> extends {\n readonly value: infer Success;\n }\n ? Success\n : never;\n}\n\ntype ReferenceOf<Definition> = Definition extends {\n readonly _tag: infer Kind extends FunctionKind;\n readonly handler: (\n ...arguments_: infer HandlerArguments\n ) => Generator<infer Yielded, infer Success, never>;\n}\n ? HandlerArguments extends readonly [infer _Context, ...infer Rest]\n ? FunctionReference<\n Kind,\n Rest extends readonly [infer Args, ...ReadonlyArray<unknown>]\n ? Kind extends \"Mutation\"\n ? MutationInput<Args>\n : Args\n : void,\n Success,\n | (Yielded extends Effect.Effect<unknown, infer Failure extends ErrorValue, never>\n ? Failure\n : never)\n | InternalServerError\n >\n : never\n : never;\n\ntype ApiModule<Module> = {\n readonly [FunctionName in keyof Module as FunctionName extends string\n ? ReferenceOf<Module[FunctionName]> extends never\n ? never\n : FunctionName\n : never]: ReferenceOf<Module[FunctionName]>;\n};\n\nexport type Api<Modules> = {\n readonly [ModuleName in keyof Modules]: ApiModule<Modules[ModuleName]>;\n};\n\nexport const functionPathOf = <\n Kind extends FunctionKind,\n Args,\n Success,\n Failure extends ErrorValue,\n>(\n reference: FunctionReference<Kind, Args, Success, Failure>,\n) => reference[FunctionReferenceTypeId];\n\nconst makeModuleReference = (moduleName: string) => {\n const references = new Map<string, object>();\n\n return new Proxy(\n {},\n {\n get: (_target, functionName) => {\n if (!Predicate.isString(functionName)) {\n return undefined;\n }\n\n const existing = references.get(functionName);\n if (existing !== undefined) {\n return existing;\n }\n\n const reference = {\n [FunctionReferenceTypeId]: FunctionAddress.make(`api.${moduleName}.${functionName}`),\n };\n references.set(functionName, reference);\n return reference;\n },\n },\n );\n};\n\nexport function createApi<Modules>(): Api<Modules>;\nexport function createApi() {\n const modules = new Map<string, object>();\n\n return new Proxy(\n {},\n {\n get: (_target, moduleName) => {\n if (!Predicate.isString(moduleName)) {\n return undefined;\n }\n\n const existing = modules.get(moduleName);\n if (existing !== undefined) {\n return existing;\n }\n\n const moduleReference = makeModuleReference(moduleName);\n modules.set(moduleName, moduleReference);\n return moduleReference;\n },\n },\n );\n}\n"],"mappings":";;;AAGA,MAAM,gBAAgB,OAAO,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACrF,MAAM,uBAAuB,OAAO,QAAQ,KAAK,OAAO,MAAM,qCAAqC,CAAC;AACpG,MAAM,mBAAmB,OAAO,QAAQ,KAAK,OAAO,MAAM,iCAAiC,CAAC;;;ACE5F,MAAM,mBAAmB,OAAO,OAAO,MAAM,OAAO,UAAU,4BAA4B,CAAC;AAC3D,OAAO,sBAAsB;CAC5D;CACA;CACA;CACA;AACD,CAAC;AACD,MAAM,kBAAkB,OAAO,gBAAgB;CAC9C;CACA;CACA;CACA;AACD,CA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T,EACF,CACF;AACF;AAGA,SAAgB,YAAY;CAC1B,MAAM,0BAAU,IAAI,IAAoB;CAExC,OAAO,IAAI,MACT,CAAC,GACD,EACE,MAAM,SAAS,eAAe;EAC5B,IAAI,CAAC,UAAU,SAAS,UAAU,GAChC;EAGF,MAAM,WAAW,QAAQ,IAAI,UAAU;EACvC,IAAI,aAAa,KAAA,GACf,OAAO;EAGT,MAAM,kBAAkB,oBAAoB,UAAU;EACtD,QAAQ,IAAI,YAAY,eAAe;EACvC,OAAO;CACT,EACF,CACF;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as InternalServerError, g as FileValue, i as ErrorValue } from "./id-
|
|
2
|
-
import "./result-
|
|
3
|
-
import { t as FunctionAddress } from "./sync-
|
|
1
|
+
import { a as InternalServerError, g as FileValue, i as ErrorValue } from "./id-BzFHf3Wo-DGPCjgrf.js";
|
|
2
|
+
import "./result-DKAA4gpS.js";
|
|
3
|
+
import { t as FunctionAddress } from "./sync-Bs8J3fIr.js";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
//#region src/internal/api.d.ts
|
|
6
6
|
declare const FunctionReferenceTypeId: unique symbol;
|
|
@@ -43,4 +43,4 @@ declare const functionPathOf: <Kind extends FunctionKind, Args, Success, Failure
|
|
|
43
43
|
declare function createApi<Modules>(): Api<Modules>;
|
|
44
44
|
//#endregion
|
|
45
45
|
export { functionPathOf as a, createApi as i, FunctionReference as n, MutationInput as r, Api as t };
|
|
46
|
-
//# sourceMappingURL=api-
|
|
46
|
+
//# sourceMappingURL=api-Cv3hMbzo.d.ts.map
|
package/dist/runtime/client.d.ts
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import { a as InternalServerError, g as FileValue, h as FileMimeType, i as ErrorValue, l as SettledResult, m as FileMetadata, o as Match, p as FileFormat, s as QueryResult$1 } from "./id-
|
|
2
|
-
import "./result-
|
|
3
|
-
import "./sync-
|
|
4
|
-
import { n as
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
1
|
+
import { a as InternalServerError, g as FileValue, h as FileMimeType, i as ErrorValue, l as SettledResult, m as FileMetadata, o as Match, p as FileFormat, s as QueryResult$1 } from "./id-BzFHf3Wo-DGPCjgrf.js";
|
|
2
|
+
import "./result-DKAA4gpS.js";
|
|
3
|
+
import "./sync-Bs8J3fIr.js";
|
|
4
|
+
import { d as User, f as UserId, l as ProfileField, n as PaginationPage, t as PaginationOptions, u as SessionOutcome } from "./pagination-DnKg3dkI-r5ZUxBBx.js";
|
|
5
|
+
import "./id-Dz0apuB3.js";
|
|
6
|
+
import { n as FunctionReference } from "./api-Cv3hMbzo.js";
|
|
7
|
+
import "./pagination-Dz0apuB3.js";
|
|
8
|
+
import { Context as Context$1, Effect, Layer, Schema } from "effect";
|
|
9
|
+
import { Dispatch, Reducer, StateUpdater, useCallback, useContext, useDebugValue, useEffect, useErrorBoundary, useId as useElementId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState } from "preact/hooks";
|
|
9
10
|
import { AnyComponent, Attributes, ClassAttributes, Component, ComponentChild, ComponentChildren, ComponentClass, ComponentConstructor, ComponentFactory, ComponentProps, ComponentType, ComponentType as ComponentType$1, Consumer, Context, ContextType, ErrorInfo, Fragment, FunctionComponent, FunctionalComponent, JSX, Key, PreactConsumer, PreactContext, PreactDOMAttributes, PreactProvider, Provider, Ref, RefCallback, RefObject, RenderableProps, TargetedAnimationEvent, TargetedClipboardEvent, TargetedCommandEvent, TargetedCompositionEvent, TargetedDragEvent, TargetedEvent, TargetedFocusEvent, TargetedInputEvent, TargetedKeyboardEvent, TargetedMouseEvent, TargetedPictureInPictureEvent, TargetedPointerEvent, TargetedSnapEvent, TargetedSubmitEvent, TargetedToggleEvent, TargetedTouchEvent, TargetedTransitionEvent, TargetedUIEvent, TargetedWheelEvent, VNode, cloneElement, createContext, createElement, createRef, h, isValidElement, toChildArray } from "preact";
|
|
10
11
|
//#region src/client/files.d.ts
|
|
11
12
|
declare const Files: {
|
|
12
13
|
readonly url: (file: FileValue) => string;
|
|
13
14
|
};
|
|
14
15
|
//#endregion
|
|
16
|
+
//#region src/client/id.d.ts
|
|
17
|
+
type IdState = {
|
|
18
|
+
readonly status: "pending";
|
|
19
|
+
readonly outcome?: SessionOutcome;
|
|
20
|
+
} | {
|
|
21
|
+
readonly status: "error";
|
|
22
|
+
readonly error: string;
|
|
23
|
+
readonly outcome?: SessionOutcome;
|
|
24
|
+
} | {
|
|
25
|
+
readonly status: "signedOut";
|
|
26
|
+
readonly outcome?: SessionOutcome;
|
|
27
|
+
} | {
|
|
28
|
+
readonly status: "signedIn";
|
|
29
|
+
readonly user: User;
|
|
30
|
+
readonly outcome?: SessionOutcome;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
15
33
|
//#region src/client/query.d.ts
|
|
16
34
|
declare const QuerySkipTypeId: unique symbol;
|
|
17
35
|
interface QuerySkip {
|
|
@@ -42,6 +60,18 @@ declare function usePaginatedQuery<Args extends PaginationArguments, Item, Failu
|
|
|
42
60
|
declare function usePaginatedQuery<Args extends PaginationArguments, Item, Failure extends ErrorValue>(reference: FunctionReference<"Query", Args, PaginationPage<Item>, Failure>, args: NoInfer<ApplicationPaginationArguments<Args>> | QuerySkip, options?: PaginatedQueryOptions): QueryResult$1<PaginatedQueryValue<Item>, Failure>;
|
|
43
61
|
type Mutation<Args, Success, Failure extends ErrorValue> = [Args] extends [void] ? () => Promise<SettledResult<Success, Failure>> : (args: Args) => Promise<SettledResult<Success, Failure>>;
|
|
44
62
|
declare const useMutation: <Args extends object | void, Success, Failure extends ErrorValue>(reference: FunctionReference<"Mutation", Args, Success, Failure>) => Mutation<Args, Success, Failure>;
|
|
63
|
+
type IdOptions = {
|
|
64
|
+
readonly profile?: ReadonlyArray<ProfileField>;
|
|
65
|
+
readonly returnTo?: string;
|
|
66
|
+
};
|
|
67
|
+
type IdResult = IdState & {
|
|
68
|
+
readonly signIn: (options?: IdOptions) => Promise<void>;
|
|
69
|
+
readonly requestProfile: (fields: ReadonlyArray<ProfileField>, options?: {
|
|
70
|
+
readonly returnTo?: string;
|
|
71
|
+
}) => Promise<void>;
|
|
72
|
+
readonly signOut: () => Promise<void>;
|
|
73
|
+
};
|
|
74
|
+
declare function useId(): IdResult;
|
|
45
75
|
//#endregion
|
|
46
76
|
//#region src/client/app.d.ts
|
|
47
77
|
interface AppDefinition<Component extends ComponentType$1<{}> = ComponentType$1<{}>> {
|
|
@@ -57,5 +87,5 @@ declare const Result: {
|
|
|
57
87
|
type Result<Value, Error extends ErrorValue> = SettledResult<Value, Error>;
|
|
58
88
|
type QueryResult<Value, Error extends ErrorValue> = QueryResult$1<Value, Error>;
|
|
59
89
|
//#endregion
|
|
60
|
-
export { type AnyComponent, type AppDefinition, type Attributes, type ClassAttributes, Component, type ComponentChild, type ComponentChildren, type ComponentClass, type ComponentConstructor, type ComponentFactory, type ComponentProps, type ComponentType, type Consumer, type Context, type ContextType, type Dispatch, type ErrorInfo, type FileFormat, type FileMetadata, type FileMimeType, type FileValue, Files, Fragment, type FunctionComponent, type FunctionalComponent, type InternalServerError, type JSX, type Key, type PaginatedQueryOptions, type PaginatedQueryValue, type PaginationStatus, type PreactConsumer, type PreactContext, type PreactDOMAttributes, type PreactProvider, type Provider, Query, QueryResult, type QuerySkip, type Reducer, type Ref, type RefCallback, type RefObject, type RenderableProps, Result, type StateUpdater, type TargetedAnimationEvent, type TargetedClipboardEvent, type TargetedCommandEvent, type TargetedCompositionEvent, type TargetedDragEvent, type TargetedEvent, type TargetedFocusEvent, type TargetedInputEvent, type TargetedKeyboardEvent, type TargetedMouseEvent, type TargetedPictureInPictureEvent, type TargetedPointerEvent, type TargetedSnapEvent, type TargetedSubmitEvent, type TargetedToggleEvent, type TargetedTouchEvent, type TargetedTransitionEvent, type TargetedUIEvent, type TargetedWheelEvent, type VNode, app, cloneElement, createContext, createElement, createRef, h, isValidElement, toChildArray, useCallback, useContext, useDebugValue, useEffect, useErrorBoundary, useId, useImperativeHandle, useLayoutEffect, useMemo, useMutation, usePaginatedQuery, useQuery, useReducer, useRef, useState };
|
|
90
|
+
export { type AnyComponent, type AppDefinition, type Attributes, type ClassAttributes, Component, type ComponentChild, type ComponentChildren, type ComponentClass, type ComponentConstructor, type ComponentFactory, type ComponentProps, type ComponentType, type Consumer, type Context, type ContextType, type Dispatch, type ErrorInfo, type FileFormat, type FileMetadata, type FileMimeType, type FileValue, Files, Fragment, type FunctionComponent, type FunctionalComponent, type IdOptions, type IdResult, type InternalServerError, type JSX, type Key, type PaginatedQueryOptions, type PaginatedQueryValue, type PaginationStatus, type PreactConsumer, type PreactContext, type PreactDOMAttributes, type PreactProvider, type ProfileField, type Provider, Query, QueryResult, type QuerySkip, type Reducer, type Ref, type RefCallback, type RefObject, type RenderableProps, Result, type StateUpdater, type TargetedAnimationEvent, type TargetedClipboardEvent, type TargetedCommandEvent, type TargetedCompositionEvent, type TargetedDragEvent, type TargetedEvent, type TargetedFocusEvent, type TargetedInputEvent, type TargetedKeyboardEvent, type TargetedMouseEvent, type TargetedPictureInPictureEvent, type TargetedPointerEvent, type TargetedSnapEvent, type TargetedSubmitEvent, type TargetedToggleEvent, type TargetedTouchEvent, type TargetedTransitionEvent, type TargetedUIEvent, type TargetedWheelEvent, type User, type UserId, type VNode, app, cloneElement, createContext, createElement, createRef, h, isValidElement, toChildArray, useCallback, useContext, useDebugValue, useEffect, useElementId, useErrorBoundary, useId, useImperativeHandle, useLayoutEffect, useMemo, useMutation, usePaginatedQuery, useQuery, useReducer, useRef, useState };
|
|
61
91
|
//# sourceMappingURL=client.d.ts.map
|