ignotum 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/cli/bin.mjs +13263 -2689
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/platform/_headers +3 -0
- package/dist/platform/_ignotum/v1.0/client.js +12 -0
- package/dist/runtime/{api-B4fwp5a2.d.ts → api-BnUKx9cj-D49Tf0rX.d.ts} +4 -3
- package/dist/runtime/api-C-tltz6s.js +31 -0
- package/dist/runtime/api-C-tltz6s.js.map +1 -0
- package/dist/runtime/artifact-BB5qzoa6.js +42 -0
- package/dist/runtime/artifact-BB5qzoa6.js.map +1 -0
- package/dist/runtime/{bootstrap-BTFScKAc.d.ts → bootstrap-DjTwGJao-DBx5zdFI.d.ts} +64 -64
- package/dist/runtime/{bootstrap-BISQSn_O.js → bootstrap-DlNIfH-r.js} +9 -9
- package/dist/runtime/bootstrap-DlNIfH-r.js.map +1 -0
- package/dist/runtime/client.d.ts +24 -20
- package/dist/runtime/client.js +9 -9
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/id-BI08JkmR.d.ts +1 -0
- package/dist/runtime/{id--1m0NuUL.js → id-BrEnxY-r.js} +118 -53
- package/dist/runtime/id-BrEnxY-r.js.map +1 -0
- package/dist/runtime/{image-Djtjy4Z8.js → image-gofzZeCm.js} +2 -2
- package/dist/runtime/image-gofzZeCm.js.map +1 -0
- package/dist/runtime/{index-D4seNHlX.d.ts → index-Biaw5vdF.d.ts} +2 -2
- package/dist/runtime/internal/api.d.ts +1 -1
- package/dist/runtime/internal/api.js +1 -30
- package/dist/runtime/internal/bootstrap.d.ts +1 -1
- package/dist/runtime/internal/bootstrap.js +1 -1
- package/dist/runtime/internal/client.d.ts +2 -2
- package/dist/runtime/internal/client.js +4 -4
- package/dist/runtime/internal/client.js.map +1 -1
- package/dist/runtime/internal/host.d.ts +4 -4
- package/dist/runtime/internal/host.js +4 -4
- package/dist/runtime/internal/routes.d.ts +1 -1
- package/dist/runtime/internal/routes.js +1 -1
- package/dist/runtime/internal/server.d.ts +3 -2
- package/dist/runtime/internal/server.js +2 -2
- package/dist/runtime/internal/server.js.map +1 -1
- package/dist/runtime/internal/types.d.ts +2 -2
- package/dist/runtime/internal/types.js +1 -1
- package/dist/runtime/{pagination-D3qd6s9N.js → pagination--f4kMKf6.js} +2 -2
- package/dist/runtime/{pagination-D3qd6s9N.js.map → pagination--f4kMKf6.js.map} +1 -1
- package/dist/runtime/pagination-BI08JkmR.d.ts +1 -0
- package/dist/runtime/{router-BSBI1oN1.js → router-C1eC9yy5.js} +462 -419
- package/dist/runtime/router-C1eC9yy5.js.map +1 -0
- package/dist/runtime/routes-DnU39R7c.js +152 -0
- package/dist/runtime/routes-DnU39R7c.js.map +1 -0
- package/dist/runtime/{schema-D1wOqiNH.js → schema-BSjepoNF.js} +271 -6
- package/dist/runtime/schema-BSjepoNF.js.map +1 -0
- package/dist/runtime/server.d.ts +5 -4
- package/dist/runtime/server.js +3 -3
- package/dist/runtime/server.js.map +1 -1
- package/dist/runtime/{sync-DzUwA8W9.js → sync-BwgS19Xy.js} +4 -16
- package/dist/runtime/sync-BwgS19Xy.js.map +1 -0
- package/dist/runtime/{sync-D-GK2sv9.d.ts → sync-By2hX5ev.d.ts} +1 -2
- package/dist/runtime/{types-DeCCyqLU-BIm7rU-0.d.ts → types-DeCCyqLU-CHx7KFtx.d.ts} +2 -2
- package/package.json +7 -1
- package/src/cli/agent-files.ts +2 -0
- package/src/cli/build/asset-names.ts +190 -0
- package/src/cli/build/managed-client.ts +151 -81
- package/src/cli/build/managed-server.ts +4 -4
- package/src/cli/build/managed.ts +5 -6
- package/src/cli/command.ts +7 -15
- package/src/cli/control-client.ts +7 -9
- package/src/cli/deploy.ts +45 -15
- package/src/cli/dev.ts +50 -99
- package/src/cli/image-assets.ts +5 -2
- package/src/cli/managed-client-boundaries.ts +6 -6
- package/src/cli/managed-dev-platform.ts +52 -66
- package/src/cli/managed-exports.ts +5 -66
- package/src/cli/new-app.ts +7 -2
- package/src/cli/path.ts +11 -0
- package/src/cli/route-codegen.ts +2 -1
- package/src/cli/route-static.ts +3 -2
- package/src/cli/upload-journal.ts +130 -0
- package/src/client/bootstrap.ts +1 -110
- package/src/client/errors.ts +1 -70
- package/src/client/files.ts +1 -233
- package/src/client/hooks.ts +1 -367
- package/src/client/id.ts +1 -263
- package/src/client/image.ts +1 -28
- package/src/client/index.ts +1 -126
- package/src/client/jsx-dev-runtime.ts +1 -2
- package/src/client/jsx-runtime.ts +1 -2
- package/src/client/managed-client.ts +1 -729
- package/src/client/managed-upgrade.ts +1 -283
- package/src/client/page-observers.ts +1 -77
- package/src/client/query.ts +1 -17
- package/src/client/recovery-journal.ts +1 -195
- package/src/client/route-boundaries.ts +1 -184
- package/src/client/router-history.ts +1 -152
- package/src/client/router-store.ts +1 -644
- package/src/client/router.ts +1 -324
- package/src/client/routes.ts +1 -28
- package/src/client/sync.ts +1 -286
- package/src/dev-runtime/id.ts +1 -1
- package/src/dev-runtime/managed-functions.ts +10 -18
- package/src/dev-runtime/managed-sync.ts +16 -16
- package/src/dev-runtime/sync.ts +6 -4
- package/src/internal/api.ts +1 -156
- package/src/internal/client.ts +1 -186
- package/src/internal/host.ts +1 -1
- package/src/internal/http-paths.ts +1 -4
- package/src/internal/routes.ts +1 -45
- package/src/internal/server.ts +1 -3
- package/src/internal/types.ts +1 -2
- package/src/server/index.ts +1 -27
- package/dist/cli/managed-release-WHYLZwaS.mjs +0 -10902
- package/dist/cli/managed-release-WHYLZwaS.mjs.map +0 -1
- package/dist/cli/managed-release.d.mts +0 -1
- package/dist/cli/managed-release.mjs +0 -14
- package/dist/cli/managed-release.mjs.map +0 -1
- package/dist/runtime/bootstrap-BISQSn_O.js.map +0 -1
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js +0 -269
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js.map +0 -1
- package/dist/runtime/id--1m0NuUL.js.map +0 -1
- package/dist/runtime/id-CBOt2kDo.d.ts +0 -1
- package/dist/runtime/identity-QjtJRxBD.d.ts +0 -2
- package/dist/runtime/image-Djtjy4Z8.js.map +0 -1
- package/dist/runtime/internal/api.js.map +0 -1
- package/dist/runtime/pagination-CBOt2kDo.d.ts +0 -1
- package/dist/runtime/router-BSBI1oN1.js.map +0 -1
- package/dist/runtime/routes-Ce8TVP-T.js +0 -690
- package/dist/runtime/routes-Ce8TVP-T.js.map +0 -1
- package/dist/runtime/schema-D1wOqiNH.js.map +0 -1
- package/dist/runtime/sync-DzUwA8W9.js.map +0 -1
- package/src/cli/managed-release-bin.ts +0 -13
- package/src/cli/managed-release.ts +0 -260
package/src/client/id.ts
CHANGED
|
@@ -1,263 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
FetchHttpClient,
|
|
4
|
-
HttpClient,
|
|
5
|
-
HttpClientRequest,
|
|
6
|
-
HttpClientResponse,
|
|
7
|
-
} from "effect/unstable/http";
|
|
8
|
-
import {
|
|
9
|
-
DevelopmentSelection,
|
|
10
|
-
developmentSelectionKey,
|
|
11
|
-
SessionOutcome,
|
|
12
|
-
SessionRedirect,
|
|
13
|
-
SessionRequest,
|
|
14
|
-
SessionResponse,
|
|
15
|
-
sessionPath,
|
|
16
|
-
sessionRequestsPath,
|
|
17
|
-
type ProfileField,
|
|
18
|
-
type SessionState,
|
|
19
|
-
type User,
|
|
20
|
-
} from "@ignotum/contracts/id";
|
|
21
|
-
import { IdGenerator } from "@ignotum/shared/id";
|
|
22
|
-
import { SessionEpoch } from "@ignotum/contracts/runtime/id";
|
|
23
|
-
|
|
24
|
-
export class IdRequestError extends Schema.TaggedError<IdRequestError>()("IdRequestError", {
|
|
25
|
-
message: Schema.String,
|
|
26
|
-
}) {}
|
|
27
|
-
|
|
28
|
-
export type IdState =
|
|
29
|
-
| { readonly status: "pending"; readonly outcome?: SessionOutcome }
|
|
30
|
-
| { readonly status: "error"; readonly error: string; readonly outcome?: SessionOutcome }
|
|
31
|
-
| { readonly status: "signedOut"; readonly outcome?: SessionOutcome }
|
|
32
|
-
| { readonly status: "signedIn"; readonly user: User; readonly outcome?: SessionOutcome };
|
|
33
|
-
|
|
34
|
-
const outcomeKey = "ignotum.id.outcome";
|
|
35
|
-
const selectionJson = Schema.fromJsonString(DevelopmentSelection);
|
|
36
|
-
|
|
37
|
-
export class BrowserSession extends Context.Service<
|
|
38
|
-
BrowserSession,
|
|
39
|
-
{
|
|
40
|
-
readonly snapshot: () => IdState;
|
|
41
|
-
readonly current: () => SessionState | undefined;
|
|
42
|
-
readonly subscribe: (listener: () => void) => () => void;
|
|
43
|
-
readonly bootstrap: Effect.Effect<SessionState, IdRequestError>;
|
|
44
|
-
readonly accept: (session: SessionState, serverTime: number) => void;
|
|
45
|
-
readonly suspend: (error?: string) => void;
|
|
46
|
-
readonly socketParameters: () => string;
|
|
47
|
-
readonly start: (
|
|
48
|
-
intent: "signIn" | "requestProfile",
|
|
49
|
-
profile: ReadonlyArray<ProfileField>,
|
|
50
|
-
returnTo?: string,
|
|
51
|
-
) => Effect.Effect<void, IdRequestError>;
|
|
52
|
-
readonly signOut: Effect.Effect<void, IdRequestError>;
|
|
53
|
-
}
|
|
54
|
-
>()("ignotum/client/id/BrowserSession") {
|
|
55
|
-
static readonly layer = Layer.effect(
|
|
56
|
-
BrowserSession,
|
|
57
|
-
Effect.gen(function* () {
|
|
58
|
-
const client = (yield* HttpClient.HttpClient).pipe(HttpClient.filterStatusOk);
|
|
59
|
-
const ids = yield* IdGenerator;
|
|
60
|
-
const bootstrapLock = yield* Semaphore.make(1);
|
|
61
|
-
const listeners = new Set<() => void>();
|
|
62
|
-
let state: IdState = { status: "pending" };
|
|
63
|
-
let current: SessionState | undefined;
|
|
64
|
-
let generation = 0;
|
|
65
|
-
let deadline = Infinity;
|
|
66
|
-
let development = false;
|
|
67
|
-
let selection: DevelopmentSelection | undefined;
|
|
68
|
-
let expiry: ReturnType<typeof setTimeout> | undefined;
|
|
69
|
-
const notify = () => {
|
|
70
|
-
for (const listener of listeners) listener();
|
|
71
|
-
};
|
|
72
|
-
const suspend = (error?: string) => {
|
|
73
|
-
generation += 1;
|
|
74
|
-
deadline = Infinity;
|
|
75
|
-
if (expiry !== undefined) clearTimeout(expiry);
|
|
76
|
-
current = undefined;
|
|
77
|
-
state =
|
|
78
|
-
error === undefined
|
|
79
|
-
? { status: "pending", outcome: state.outcome }
|
|
80
|
-
: { status: "error", error, outcome: state.outcome };
|
|
81
|
-
notify();
|
|
82
|
-
};
|
|
83
|
-
const accept = (session: SessionState, serverTime: number) => {
|
|
84
|
-
generation += 1;
|
|
85
|
-
if (expiry !== undefined) clearTimeout(expiry);
|
|
86
|
-
current = session;
|
|
87
|
-
state =
|
|
88
|
-
session.user === null
|
|
89
|
-
? { status: "signedOut", outcome: state.outcome }
|
|
90
|
-
: { status: "signedIn", user: session.user, outcome: state.outcome };
|
|
91
|
-
const delay = Math.max(0, session.validUntil - serverTime);
|
|
92
|
-
deadline = performance.now() + delay;
|
|
93
|
-
if (delay < 2_147_483_647) expiry = setTimeout(() => suspend(), delay);
|
|
94
|
-
notify();
|
|
95
|
-
};
|
|
96
|
-
const checkExpiry = () => {
|
|
97
|
-
if (current !== undefined && performance.now() >= deadline) suspend();
|
|
98
|
-
};
|
|
99
|
-
globalThis.addEventListener?.("focus", checkExpiry);
|
|
100
|
-
globalThis.document?.addEventListener("visibilitychange", checkExpiry);
|
|
101
|
-
yield* Effect.addFinalizer(() =>
|
|
102
|
-
Effect.sync(() => {
|
|
103
|
-
if (expiry !== undefined) clearTimeout(expiry);
|
|
104
|
-
listeners.clear();
|
|
105
|
-
globalThis.removeEventListener?.("focus", checkExpiry);
|
|
106
|
-
globalThis.document?.removeEventListener("visibilitychange", checkExpiry);
|
|
107
|
-
}),
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const readOutcome = () => {
|
|
111
|
-
try {
|
|
112
|
-
const raw = globalThis.sessionStorage.getItem(outcomeKey);
|
|
113
|
-
if (raw !== null) {
|
|
114
|
-
const decoded = Schema.decodeUnknownOption(SessionOutcome)(raw);
|
|
115
|
-
if (Option.isSome(decoded)) state = { ...state, outcome: decoded.value };
|
|
116
|
-
globalThis.sessionStorage.removeItem(outcomeKey);
|
|
117
|
-
}
|
|
118
|
-
} catch {
|
|
119
|
-
// The authenticated session response remains valid when optional redirect storage is denied.
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const parameters = () => {
|
|
123
|
-
if (!development || selection === undefined) return "";
|
|
124
|
-
const params = new URLSearchParams({ epoch: selection.epoch });
|
|
125
|
-
if (selection.username !== null) params.set("username", selection.username);
|
|
126
|
-
return `?${params}`;
|
|
127
|
-
};
|
|
128
|
-
const readSession = Effect.fn("BrowserSession.read")(function* () {
|
|
129
|
-
return yield* client
|
|
130
|
-
.get(`${sessionPath}${parameters()}`, { headers: { "x-ignotum-request": "1" } })
|
|
131
|
-
.pipe(Effect.flatMap(HttpClientResponse.schemaBodyJson(SessionResponse)));
|
|
132
|
-
});
|
|
133
|
-
let bootstrapGeneration = 0;
|
|
134
|
-
const bootstrap = bootstrapLock
|
|
135
|
-
.withPermits(1)(
|
|
136
|
-
Effect.gen(function* () {
|
|
137
|
-
const admittedGeneration = generation;
|
|
138
|
-
bootstrapGeneration = admittedGeneration;
|
|
139
|
-
const startedAt = performance.now();
|
|
140
|
-
let session = yield* readSession();
|
|
141
|
-
development = session.development === true;
|
|
142
|
-
if (development && selection === undefined) {
|
|
143
|
-
const saved = globalThis.sessionStorage.getItem(developmentSelectionKey);
|
|
144
|
-
const decoded =
|
|
145
|
-
saved === null
|
|
146
|
-
? Option.none<DevelopmentSelection>()
|
|
147
|
-
: Schema.decodeOption(selectionJson)(saved);
|
|
148
|
-
selection = Option.getOrElse(decoded, () => ({
|
|
149
|
-
formatVersion: 1 as const,
|
|
150
|
-
username: null,
|
|
151
|
-
epoch: "",
|
|
152
|
-
}));
|
|
153
|
-
if (selection.epoch === "")
|
|
154
|
-
selection = { ...selection, epoch: yield* ids.generate(SessionEpoch) };
|
|
155
|
-
globalThis.sessionStorage.setItem(
|
|
156
|
-
developmentSelectionKey,
|
|
157
|
-
Schema.encodeSync(selectionJson)(selection),
|
|
158
|
-
);
|
|
159
|
-
session = yield* readSession();
|
|
160
|
-
}
|
|
161
|
-
if (generation !== admittedGeneration) {
|
|
162
|
-
if (current !== undefined) return current;
|
|
163
|
-
return yield* IdRequestError.make({
|
|
164
|
-
message: "Your ID session changed while loading.",
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
readOutcome();
|
|
168
|
-
if (session.outcome !== undefined) state = { ...state, outcome: session.outcome };
|
|
169
|
-
accept(session, session.serverTime + performance.now() - startedAt);
|
|
170
|
-
return session;
|
|
171
|
-
}),
|
|
172
|
-
)
|
|
173
|
-
.pipe(
|
|
174
|
-
Effect.mapError(() =>
|
|
175
|
-
IdRequestError.make({ message: "Could not load your ID session." }),
|
|
176
|
-
),
|
|
177
|
-
Effect.tapError((error) =>
|
|
178
|
-
Effect.sync(() => {
|
|
179
|
-
if (generation === bootstrapGeneration) suspend(error.message);
|
|
180
|
-
}),
|
|
181
|
-
),
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
const start = Effect.fn("BrowserSession.start")(function* (
|
|
185
|
-
intent: "signIn" | "requestProfile",
|
|
186
|
-
profile: ReadonlyArray<ProfileField>,
|
|
187
|
-
returnTo?: string,
|
|
188
|
-
) {
|
|
189
|
-
const session = current ?? (yield* bootstrap);
|
|
190
|
-
if (intent === "requestProfile" && session.user === null)
|
|
191
|
-
return yield* IdRequestError.make({
|
|
192
|
-
message: "Sign in before requesting profile information.",
|
|
193
|
-
});
|
|
194
|
-
const request = yield* Schema.decodeUnknownEffect(SessionRequest)({
|
|
195
|
-
intent,
|
|
196
|
-
profile,
|
|
197
|
-
sessionEpoch: session.sessionEpoch,
|
|
198
|
-
returnTo:
|
|
199
|
-
returnTo ??
|
|
200
|
-
`${globalThis.location.pathname}${globalThis.location.search}${globalThis.location.hash}`,
|
|
201
|
-
}).pipe(
|
|
202
|
-
Effect.mapError(() => IdRequestError.make({ message: "The ID request is invalid." })),
|
|
203
|
-
);
|
|
204
|
-
const redirect = yield* HttpClientRequest.post(sessionRequestsPath).pipe(
|
|
205
|
-
HttpClientRequest.setHeader("x-ignotum-request", "1"),
|
|
206
|
-
HttpClientRequest.bodyJsonUnsafe(request),
|
|
207
|
-
client.execute,
|
|
208
|
-
Effect.flatMap(HttpClientResponse.schemaBodyJson(SessionRedirect)),
|
|
209
|
-
Effect.mapError(() =>
|
|
210
|
-
IdRequestError.make({ message: "Could not start the ID request." }),
|
|
211
|
-
),
|
|
212
|
-
);
|
|
213
|
-
if (current?.sessionEpoch !== session.sessionEpoch)
|
|
214
|
-
return yield* IdRequestError.make({ message: "Your ID session changed. Try again." });
|
|
215
|
-
globalThis.location.assign(redirect.redirectUrl);
|
|
216
|
-
});
|
|
217
|
-
const signOut = Effect.gen(function* () {
|
|
218
|
-
const session = current ?? (yield* bootstrap);
|
|
219
|
-
yield* HttpClientRequest.delete(sessionPath).pipe(
|
|
220
|
-
HttpClientRequest.setHeader("x-ignotum-request", "1"),
|
|
221
|
-
HttpClientRequest.bodyJsonUnsafe({ sessionEpoch: session.sessionEpoch }),
|
|
222
|
-
client.execute,
|
|
223
|
-
Effect.mapError(() => IdRequestError.make({ message: "Could not sign out." })),
|
|
224
|
-
);
|
|
225
|
-
suspend();
|
|
226
|
-
if (development) {
|
|
227
|
-
selection = {
|
|
228
|
-
formatVersion: 1,
|
|
229
|
-
username: null,
|
|
230
|
-
epoch: yield* ids.generate(SessionEpoch),
|
|
231
|
-
};
|
|
232
|
-
globalThis.sessionStorage.setItem(
|
|
233
|
-
developmentSelectionKey,
|
|
234
|
-
Schema.encodeSync(selectionJson)(selection),
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
globalThis.location.reload();
|
|
238
|
-
});
|
|
239
|
-
return BrowserSession.of({
|
|
240
|
-
snapshot: () => {
|
|
241
|
-
checkExpiry();
|
|
242
|
-
return state;
|
|
243
|
-
},
|
|
244
|
-
current: () => {
|
|
245
|
-
checkExpiry();
|
|
246
|
-
return current;
|
|
247
|
-
},
|
|
248
|
-
subscribe: (listener) => {
|
|
249
|
-
listeners.add(listener);
|
|
250
|
-
return () => {
|
|
251
|
-
listeners.delete(listener);
|
|
252
|
-
};
|
|
253
|
-
},
|
|
254
|
-
accept,
|
|
255
|
-
suspend,
|
|
256
|
-
bootstrap,
|
|
257
|
-
start,
|
|
258
|
-
signOut,
|
|
259
|
-
socketParameters: parameters,
|
|
260
|
-
});
|
|
261
|
-
}),
|
|
262
|
-
).pipe(Layer.provide(FetchHttpClient.layer));
|
|
263
|
-
}
|
|
1
|
+
export * from "@ignotum/platform/versions/1/browser/id";
|
package/src/client/image.ts
CHANGED
|
@@ -1,28 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const ImageSourceTypeId: unique symbol;
|
|
4
|
-
|
|
5
|
-
/** A compiler-provided reference to an imported image. */
|
|
6
|
-
export interface ImageSource {
|
|
7
|
-
readonly type: "ImageSource";
|
|
8
|
-
readonly url: string;
|
|
9
|
-
readonly [ImageSourceTypeId]: true;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type ImageProps = Omit<
|
|
13
|
-
JSX.ImgHTMLAttributes<HTMLImageElement>,
|
|
14
|
-
"alt" | "src" | "srcSet" | "srcset"
|
|
15
|
-
> & {
|
|
16
|
-
readonly src: ImageSource;
|
|
17
|
-
readonly alt: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/** Renders an imported image. */
|
|
21
|
-
export const Image = ({ src, alt, ...attributes }: ImageProps): JSX.Element =>
|
|
22
|
-
createElement("img", { ...attributes, src: src.url, alt });
|
|
23
|
-
|
|
24
|
-
/** @internal Creates an image reference from a compiler-resolved URL. */
|
|
25
|
-
export const createImageSource = (url: string): ImageSource => {
|
|
26
|
-
// SAFETY: This factory constructs the complete runtime representation; the brand exists only in types.
|
|
27
|
-
return { type: "ImageSource", url } as ImageSource;
|
|
28
|
-
};
|
|
1
|
+
export * from "@ignotum/platform/versions/1/browser/image";
|
package/src/client/index.ts
CHANGED
|
@@ -1,126 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
ErrorValue,
|
|
4
|
-
QueryResult as ContractQueryResult,
|
|
5
|
-
SettledResult,
|
|
6
|
-
} from "@ignotum/contracts/runtime/result";
|
|
7
|
-
|
|
8
|
-
export const Result = { match: contractResult.match };
|
|
9
|
-
export type Result<Value, Error extends ErrorValue> = SettledResult<Value, Error>;
|
|
10
|
-
export type QueryResult<Value, Error extends ErrorValue> = ContractQueryResult<Value, Error>;
|
|
11
|
-
export type { InternalServerError } from "@ignotum/contracts/runtime/result";
|
|
12
|
-
export type {
|
|
13
|
-
FileFormat,
|
|
14
|
-
FileMetadata,
|
|
15
|
-
FileMimeType,
|
|
16
|
-
FileValue,
|
|
17
|
-
} from "@ignotum/contracts/schema/file";
|
|
18
|
-
export { Files } from "./files.js";
|
|
19
|
-
export { useId, useMutation, usePaginatedQuery, useQuery } from "./hooks.js";
|
|
20
|
-
export type { PaginatedQueryOptions, PaginatedQueryValue, PaginationStatus } from "./hooks.js";
|
|
21
|
-
export { Query } from "./query.js";
|
|
22
|
-
export type { QuerySkip } from "./query.js";
|
|
23
|
-
export { Image } from "./image.js";
|
|
24
|
-
export type { ImageProps, ImageSource } from "./image.js";
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
Component,
|
|
28
|
-
Fragment,
|
|
29
|
-
cloneElement,
|
|
30
|
-
createContext,
|
|
31
|
-
createElement,
|
|
32
|
-
createRef,
|
|
33
|
-
h,
|
|
34
|
-
isValidElement,
|
|
35
|
-
toChildArray,
|
|
36
|
-
} from "preact";
|
|
37
|
-
export type {
|
|
38
|
-
AnyComponent,
|
|
39
|
-
Attributes,
|
|
40
|
-
ClassAttributes,
|
|
41
|
-
ComponentChild,
|
|
42
|
-
ComponentChildren,
|
|
43
|
-
ComponentClass,
|
|
44
|
-
ComponentConstructor,
|
|
45
|
-
ComponentFactory,
|
|
46
|
-
ComponentProps,
|
|
47
|
-
ComponentType,
|
|
48
|
-
Consumer,
|
|
49
|
-
Context,
|
|
50
|
-
ContextType,
|
|
51
|
-
ErrorInfo,
|
|
52
|
-
FunctionComponent,
|
|
53
|
-
FunctionalComponent,
|
|
54
|
-
JSX,
|
|
55
|
-
Key,
|
|
56
|
-
PreactContext,
|
|
57
|
-
PreactConsumer,
|
|
58
|
-
PreactDOMAttributes,
|
|
59
|
-
PreactProvider,
|
|
60
|
-
Provider,
|
|
61
|
-
Ref,
|
|
62
|
-
RefCallback,
|
|
63
|
-
RefObject,
|
|
64
|
-
RenderableProps,
|
|
65
|
-
TargetedAnimationEvent,
|
|
66
|
-
TargetedClipboardEvent,
|
|
67
|
-
TargetedCommandEvent,
|
|
68
|
-
TargetedCompositionEvent,
|
|
69
|
-
TargetedDragEvent,
|
|
70
|
-
TargetedEvent,
|
|
71
|
-
TargetedFocusEvent,
|
|
72
|
-
TargetedInputEvent,
|
|
73
|
-
TargetedKeyboardEvent,
|
|
74
|
-
TargetedMouseEvent,
|
|
75
|
-
TargetedPictureInPictureEvent,
|
|
76
|
-
TargetedPointerEvent,
|
|
77
|
-
TargetedSnapEvent,
|
|
78
|
-
TargetedSubmitEvent,
|
|
79
|
-
TargetedToggleEvent,
|
|
80
|
-
TargetedTouchEvent,
|
|
81
|
-
TargetedTransitionEvent,
|
|
82
|
-
TargetedUIEvent,
|
|
83
|
-
TargetedWheelEvent,
|
|
84
|
-
VNode,
|
|
85
|
-
} from "preact";
|
|
86
|
-
export {
|
|
87
|
-
useCallback,
|
|
88
|
-
useContext,
|
|
89
|
-
useDebugValue,
|
|
90
|
-
useEffect,
|
|
91
|
-
useErrorBoundary,
|
|
92
|
-
useId as useElementId,
|
|
93
|
-
useImperativeHandle,
|
|
94
|
-
useLayoutEffect,
|
|
95
|
-
useMemo,
|
|
96
|
-
useReducer,
|
|
97
|
-
useRef,
|
|
98
|
-
useState,
|
|
99
|
-
} from "preact/hooks";
|
|
100
|
-
export type { Dispatch, Reducer, StateUpdater } from "preact/hooks";
|
|
101
|
-
|
|
102
|
-
export type { User, UserId, ProfileField } from "@ignotum/contracts/id";
|
|
103
|
-
export type { IdResult, IdOptions } from "./hooks.js";
|
|
104
|
-
|
|
105
|
-
export type {
|
|
106
|
-
RouteInputs,
|
|
107
|
-
RouteProps,
|
|
108
|
-
RouteMatch,
|
|
109
|
-
RouteLocation,
|
|
110
|
-
NavigationResult,
|
|
111
|
-
} from "./routes.js";
|
|
112
|
-
|
|
113
|
-
export {
|
|
114
|
-
Link,
|
|
115
|
-
NavLink,
|
|
116
|
-
Redirect,
|
|
117
|
-
url,
|
|
118
|
-
useNavigate,
|
|
119
|
-
useRoute,
|
|
120
|
-
useMatch,
|
|
121
|
-
useLocation,
|
|
122
|
-
useNavigation,
|
|
123
|
-
useBlocker,
|
|
124
|
-
} from "./router.js";
|
|
125
|
-
|
|
126
|
-
export type { BlockerState } from "./router-store.js";
|
|
1
|
+
export * from "@ignotum/platform/versions/1/browser/index";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type { JSX } from "preact/jsx-dev-runtime";
|
|
1
|
+
export * from "@ignotum/platform/versions/1/browser/jsx-dev-runtime";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type { JSX } from "preact/jsx-runtime";
|
|
1
|
+
export * from "@ignotum/platform/versions/1/browser/jsx-runtime";
|