@securitydept/client 0.3.0-beta.3 → 0.3.0-beta.6
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 -0
- package/dist/create-99Ksgl_O.mjs +952 -0
- package/dist/create-99Ksgl_O.mjs.map +1 -0
- package/dist/handle-TnxwtQ4T.mjs +634 -0
- package/dist/handle-TnxwtQ4T.mjs.map +1 -0
- package/dist/index-Cg_iY2yY.d.mts +608 -0
- package/dist/index-DmIapvr-.d.mts +1669 -0
- package/dist/index-O1A3CdBV.d.mts +119 -0
- package/dist/index.d.mts +3 -353
- package/dist/index.mjs +1127 -364
- package/dist/index.mjs.map +1 -1
- package/dist/router-DUh3bhLy.mjs +245 -0
- package/dist/router-DUh3bhLy.mjs.map +1 -0
- package/dist/rx/index.d.mts +68 -0
- package/dist/rx/index.mjs +2 -0
- package/dist/rx-B3OU17wu.mjs +1105 -0
- package/dist/rx-B3OU17wu.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/index.mjs +29 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/test/index.d.mts +101 -0
- package/dist/test/index.mjs +270 -0
- package/dist/test/index.mjs.map +1 -0
- package/dist/uri-string-BPNbIMgv.mjs +300 -0
- package/dist/uri-string-BPNbIMgv.mjs.map +1 -0
- package/dist/web/index.d.mts +93 -363
- package/dist/web/index.mjs +335 -428
- package/dist/web/index.mjs.map +1 -1
- package/dist/webext/index.d.mts +73 -0
- package/dist/webext/index.mjs +231 -0
- package/dist/webext/index.mjs.map +1 -0
- package/package.json +28 -21
- package/dist/auth-coordination/index.d.mts +0 -198
- package/dist/auth-coordination/index.mjs +0 -107
- package/dist/auth-coordination/index.mjs.map +0 -1
- package/dist/client-environment-CaumNmir.mjs +0 -812
- package/dist/client-environment-CaumNmir.mjs.map +0 -1
- package/dist/client-environment-CdHtVxKW.d.mts +0 -401
- package/dist/events/index.d.mts +0 -2
- package/dist/events/index.mjs +0 -2
- package/dist/events-BUlfsRfl.mjs +0 -127
- package/dist/events-BUlfsRfl.mjs.map +0 -1
- package/dist/index-C4xlKhG7.d.mts +0 -102
- package/dist/index-COUt5x9Z.d.mts +0 -39
- package/dist/persistence/index.d.mts +0 -3
- package/dist/persistence/index.mjs +0 -2
- package/dist/persistence/web/index.d.mts +0 -16
- package/dist/persistence/web/index.mjs +0 -2
- package/dist/persistence-CSB8770k.mjs +0 -108
- package/dist/persistence-CSB8770k.mjs.map +0 -1
- package/dist/planner-host-BTWie0lo.mjs +0 -197
- package/dist/planner-host-BTWie0lo.mjs.map +0 -1
- package/dist/planner-host-DN9dRsQx.d.mts +0 -190
- package/dist/types-BJqUdH2e.d.mts +0 -32
- package/dist/types-BwcnUGNl.d.mts +0 -52
- package/dist/web-DQmMqZnR.mjs +0 -51
- package/dist/web-DQmMqZnR.mjs.map +0 -1
- package/dist/web-router/index.d.mts +0 -259
- package/dist/web-router/index.mjs +0 -395
- package/dist/web-router/index.mjs.map +0 -1
|
@@ -0,0 +1,1669 @@
|
|
|
1
|
+
import { $ as ErrorPresentationDescriptor, B as WritableSignalTrait, C as IdleCallbackTrait, D as ComputedSignalTrait, E as TimestampProviderTrait, F as ResourceSnapshot, G as ClientError, Ht as SecuritydeptInjectionToken, J as ClientErrorKind, L as ResourceTrait, O as ReadableSignalTrait, R as ResourceWhenValueOptions, St as DisposableTrait, T as TimeTrait, Tt as SYMBOL_DISPOSE, Ut as SecuritydeptInjectorTrait, W as CancellationTokenTrait, Wt as SecuritydeptProvider, ct as EventSubjectTrait, dt as InteropObservableTrait, nt as UserRecovery, rt as EventObserverTrait, st as EventStreamTrait, tt as ReadErrorPresentationDescriptorOptions, yt as SecuritydeptInjector, z as SignalOptions } from "./index-Cg_iY2yY.mjs";
|
|
2
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
+
//#region src/injection/destroy.d.ts
|
|
4
|
+
declare abstract class SecuritydeptDestroyRef implements DisposableTrait {
|
|
5
|
+
abstract readonly destroyed: boolean;
|
|
6
|
+
abstract onDestroy(callback: () => void): () => void;
|
|
7
|
+
abstract dispose(): void;
|
|
8
|
+
[SYMBOL_DISPOSE](): void;
|
|
9
|
+
}
|
|
10
|
+
declare function createSecuritydeptDestroyRef(): SecuritydeptDestroyRef;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/compat/base64.d.ts
|
|
13
|
+
declare const Base64CompatErrorCode: {
|
|
14
|
+
readonly EncoderUnavailable: "compat.base64.encoder_unavailable";
|
|
15
|
+
readonly DecoderUnavailable: "compat.base64.decoder_unavailable";
|
|
16
|
+
};
|
|
17
|
+
type Base64CompatErrorCode = (typeof Base64CompatErrorCode)[keyof typeof Base64CompatErrorCode];
|
|
18
|
+
declare function encodeUint8ArrayToBase64(value: Uint8Array): string;
|
|
19
|
+
declare function decodeBase64ToUint8Array(value: string): Uint8Array;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/compat/generator.d.ts
|
|
22
|
+
declare function promisesToRacedAsyncGenerator<T>(promises: Promise<T>[]): AsyncGenerator<T, void, unknown>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/page/index.d.ts
|
|
25
|
+
interface PageLifecycleTrait<TResumeEvent = unknown> {
|
|
26
|
+
resume: EventStreamTrait<TResumeEvent>;
|
|
27
|
+
}
|
|
28
|
+
declare const PAGE_LIFECYCLE_TRAIT_TOKEN: SecuritydeptInjectionToken<PageLifecycleTrait<unknown> | null>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/errors/error-attributes.d.ts
|
|
31
|
+
interface ErrorSummary {
|
|
32
|
+
errorName: string;
|
|
33
|
+
errorKind?: ClientErrorKind;
|
|
34
|
+
errorCode?: string;
|
|
35
|
+
recovery?: UserRecovery;
|
|
36
|
+
}
|
|
37
|
+
/** Extract secret-safe diagnostic attributes without copying runtime messages. */
|
|
38
|
+
declare function describeError(error: unknown): ErrorSummary;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/errors/presentation-descriptor.d.ts
|
|
41
|
+
declare function readErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/std/events/from-abort.d.ts
|
|
44
|
+
type AbortSignalStdSource = Pick<AbortSignal, "aborted" | "reason"> & {
|
|
45
|
+
addEventListener?: (type: "abort", listener: EventListener) => void;
|
|
46
|
+
removeEventListener?: (type: "abort", listener: EventListener) => void;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Adapt an `AbortSignal`-like source into an event stream of abort reasons.
|
|
50
|
+
*/
|
|
51
|
+
declare function abortSignalToEventStream(signal: AbortSignalStdSource): EventStreamTrait<unknown>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/events/create.d.ts
|
|
54
|
+
/**
|
|
55
|
+
* Create a new event stream from a producer function.
|
|
56
|
+
*
|
|
57
|
+
* The producer receives an observer and should call `next()` to emit values,
|
|
58
|
+
* `error()` to signal an error, and `complete()` to signal completion.
|
|
59
|
+
* It may return a teardown function that will be called on unsubscribe.
|
|
60
|
+
*/
|
|
61
|
+
declare function createEventStream<T>(producer: (observer: EventObserverTrait<T>) => (() => void) | void): EventStreamTrait<T>;
|
|
62
|
+
declare function createEventSubject<T>(): EventSubjectTrait<T>;
|
|
63
|
+
declare function createEventReplaySubject<T>(bufferSize?: number): EventSubjectTrait<T>;
|
|
64
|
+
declare function createEmptyEventStream<T>(): EventStreamTrait<T>;
|
|
65
|
+
declare function createNeverEventStream<T>(): EventStreamTrait<T>;
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/events/interop.d.ts
|
|
68
|
+
type ToEventStreamInput<T> = InteropObservableTrait<T> | Promise<T> | AsyncIterable<T> | PromiseLike<T> | ArrayLike<T> | Iterable<T> | EventStreamTrait<T> | ReadableSignalTrait<T>;
|
|
69
|
+
declare function toEventStream<T>(input: ToEventStreamInput<T>): EventStreamTrait<T>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/protocol/json-rpc/types.d.ts
|
|
72
|
+
declare const JsonRpcIdSchema: import("arktype").BaseType<string | number, {}>;
|
|
73
|
+
type JsonRpcId = typeof JsonRpcIdSchema.infer;
|
|
74
|
+
declare const JsonRpcErrorPayloadSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
75
|
+
code: number;
|
|
76
|
+
message: string;
|
|
77
|
+
data?: unknown;
|
|
78
|
+
}, {}>;
|
|
79
|
+
type JsonRpcErrorPayload = typeof JsonRpcErrorPayloadSchema.infer;
|
|
80
|
+
declare const JsonRpcRequestMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
81
|
+
jsonrpc: "2.0";
|
|
82
|
+
id: string | number;
|
|
83
|
+
method: string;
|
|
84
|
+
params?: unknown;
|
|
85
|
+
}, {}>;
|
|
86
|
+
type JsonRpcRequestMessage = typeof JsonRpcRequestMessageSchema.infer;
|
|
87
|
+
declare const JsonRpcNotificationMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
88
|
+
jsonrpc: "2.0";
|
|
89
|
+
method: string;
|
|
90
|
+
params?: unknown;
|
|
91
|
+
}, {}>;
|
|
92
|
+
type JsonRpcNotificationMessage = typeof JsonRpcNotificationMessageSchema.infer;
|
|
93
|
+
declare const JsonRpcSuccessResponseMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
94
|
+
jsonrpc: "2.0";
|
|
95
|
+
id: string | number;
|
|
96
|
+
result: unknown;
|
|
97
|
+
}, {}>;
|
|
98
|
+
type JsonRpcSuccessResponseMessage = typeof JsonRpcSuccessResponseMessageSchema.infer;
|
|
99
|
+
declare const JsonRpcErrorResponseMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
100
|
+
jsonrpc: "2.0";
|
|
101
|
+
id: string | number;
|
|
102
|
+
error: {
|
|
103
|
+
code: number;
|
|
104
|
+
message: string;
|
|
105
|
+
data?: unknown;
|
|
106
|
+
};
|
|
107
|
+
}, {}>;
|
|
108
|
+
type JsonRpcErrorResponseMessage = typeof JsonRpcErrorResponseMessageSchema.infer;
|
|
109
|
+
declare const JsonRpcMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
110
|
+
jsonrpc: "2.0";
|
|
111
|
+
id: string | number;
|
|
112
|
+
method: string;
|
|
113
|
+
params?: unknown;
|
|
114
|
+
} | {
|
|
115
|
+
jsonrpc: "2.0";
|
|
116
|
+
method: string;
|
|
117
|
+
params?: unknown;
|
|
118
|
+
} | {
|
|
119
|
+
jsonrpc: "2.0";
|
|
120
|
+
id: string | number;
|
|
121
|
+
result: unknown;
|
|
122
|
+
} | {
|
|
123
|
+
jsonrpc: "2.0";
|
|
124
|
+
id: string | number;
|
|
125
|
+
error: {
|
|
126
|
+
code: number;
|
|
127
|
+
message: string;
|
|
128
|
+
data?: unknown;
|
|
129
|
+
};
|
|
130
|
+
}, {}>;
|
|
131
|
+
type JsonRpcMessage = typeof JsonRpcMessageSchema.infer;
|
|
132
|
+
interface JsonRpcRequestEvent {
|
|
133
|
+
id: JsonRpcId;
|
|
134
|
+
method: string;
|
|
135
|
+
params?: unknown;
|
|
136
|
+
}
|
|
137
|
+
interface JsonRpcNotificationEvent {
|
|
138
|
+
method: string;
|
|
139
|
+
params?: unknown;
|
|
140
|
+
}
|
|
141
|
+
interface JsonRpcRequestOptions {
|
|
142
|
+
timeoutMs?: number;
|
|
143
|
+
}
|
|
144
|
+
interface JsonRpcSendOptions {
|
|
145
|
+
send(message: JsonRpcMessage): void;
|
|
146
|
+
}
|
|
147
|
+
interface CreateJsonRpcClientOptions extends JsonRpcSendOptions {
|
|
148
|
+
time: TimeTrait;
|
|
149
|
+
defaultRequestTimeoutMs?: number;
|
|
150
|
+
}
|
|
151
|
+
interface CreateJsonRpcServerOptions extends JsonRpcSendOptions {}
|
|
152
|
+
interface CreateJsonRpcServerAndClientOptions extends JsonRpcSendOptions {
|
|
153
|
+
time: TimeTrait;
|
|
154
|
+
defaultRequestTimeoutMs?: number;
|
|
155
|
+
}
|
|
156
|
+
interface JsonRpcClientTrait extends DisposableTrait {
|
|
157
|
+
readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
|
|
158
|
+
request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
|
|
159
|
+
notify(method: string, params?: unknown): void;
|
|
160
|
+
receive(message: unknown): void;
|
|
161
|
+
rejectAllPendingRequests(reason: unknown): void;
|
|
162
|
+
}
|
|
163
|
+
interface JsonRpcServerTrait extends DisposableTrait {
|
|
164
|
+
readonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;
|
|
165
|
+
readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
|
|
166
|
+
notify(method: string, params?: unknown): void;
|
|
167
|
+
receive(message: unknown): void;
|
|
168
|
+
respondSuccess(id: JsonRpcId, result: unknown): void;
|
|
169
|
+
respondError(id: JsonRpcId, error: JsonRpcErrorPayload): void;
|
|
170
|
+
}
|
|
171
|
+
interface JsonRpcServerAndClientTrait extends JsonRpcClientTrait, JsonRpcServerTrait {}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/protocol/json-rpc/create.d.ts
|
|
174
|
+
declare function createJsonRpcClient(options: CreateJsonRpcClientOptions): JsonRpcClientTrait;
|
|
175
|
+
declare function createJsonRpcServer(options: CreateJsonRpcServerOptions): JsonRpcServerTrait;
|
|
176
|
+
declare function createJsonRpcServerAndClient(options: CreateJsonRpcServerAndClientOptions): JsonRpcServerAndClientTrait;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/signals/computed.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* Create a lazy computed signal.
|
|
181
|
+
*
|
|
182
|
+
* Dependencies are collected dynamically while `compute()` runs.
|
|
183
|
+
*/
|
|
184
|
+
declare function createComputed<T>(compute: () => T, options?: SignalOptions<T>): ComputedSignalTrait<T>;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/signals/error.d.ts
|
|
187
|
+
declare const ResourceErrorCode: {
|
|
188
|
+
readonly ValueUnavailable: "resource.value_unavailable";
|
|
189
|
+
};
|
|
190
|
+
type ResourceErrorCode = (typeof ResourceErrorCode)[keyof typeof ResourceErrorCode];
|
|
191
|
+
interface ResourceValueUnavailableErrorOptions {
|
|
192
|
+
readonly status: string;
|
|
193
|
+
}
|
|
194
|
+
declare class ResourceError extends Error {
|
|
195
|
+
readonly name = "ResourceError";
|
|
196
|
+
readonly code: ResourceErrorCode;
|
|
197
|
+
readonly status?: string;
|
|
198
|
+
constructor(message: string, options: {
|
|
199
|
+
code: ResourceErrorCode;
|
|
200
|
+
status?: string;
|
|
201
|
+
});
|
|
202
|
+
static valueUnavailable(options: ResourceValueUnavailableErrorOptions): ResourceError;
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/signals/resource.d.ts
|
|
206
|
+
interface ResourceStreamContext<T, R> {
|
|
207
|
+
readonly request: R;
|
|
208
|
+
readonly previous: ResourceSnapshot<T>;
|
|
209
|
+
}
|
|
210
|
+
interface CreateResourceOptions<T, R = undefined> {
|
|
211
|
+
readonly request?: ReadableSignalTrait<R | undefined> | (() => R | undefined);
|
|
212
|
+
readonly stream: (context: ResourceStreamContext<T, R>) => ToEventStreamInput<T>;
|
|
213
|
+
}
|
|
214
|
+
declare function createResource<T, R = undefined>(options: CreateResourceOptions<T, R>): ResourceTrait<T>;
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/signals/resource-snapshot.d.ts
|
|
217
|
+
declare function whenResourceSnapshotValue<T>(snapshotSignal: ReadableSignalTrait<ResourceSnapshot<T>>, options?: ResourceWhenValueOptions): Promise<T>;
|
|
218
|
+
type AnyResourceSnapshotSelector = (value: any) => ReadableSignalTrait<ResourceSnapshot<unknown>>;
|
|
219
|
+
declare function flattenResourceSnapshot<T1, T2>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>): ResourceSnapshot<T2>;
|
|
220
|
+
declare function flattenResourceSnapshot<T1, T2, T3>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>): ResourceSnapshot<T3>;
|
|
221
|
+
declare function flattenResourceSnapshot<T1, T2, T3, T4>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>, select3: (value: T3) => ReadableSignalTrait<ResourceSnapshot<T4>>): ResourceSnapshot<T4>;
|
|
222
|
+
declare function flattenResourceSnapshot<T1, T2, T3, T4, T5>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>, select3: (value: T3) => ReadableSignalTrait<ResourceSnapshot<T4>>, select4: (value: T4) => ReadableSignalTrait<ResourceSnapshot<T5>>): ResourceSnapshot<T5>;
|
|
223
|
+
declare function flattenResourceSnapshot(sourceSnapshot: ResourceSnapshot<unknown>, select: AnyResourceSnapshotSelector, ...selectors: readonly AnyResourceSnapshotSelector[]): ResourceSnapshot<unknown>;
|
|
224
|
+
declare const ResourceSnapshotUpdateKind: {
|
|
225
|
+
readonly Load: "load";
|
|
226
|
+
readonly Resolve: "resolve";
|
|
227
|
+
readonly Fail: "fail";
|
|
228
|
+
readonly FailWithValue: "fail_with_value";
|
|
229
|
+
};
|
|
230
|
+
type ResourceSnapshotUpdateKind = (typeof ResourceSnapshotUpdateKind)[keyof typeof ResourceSnapshotUpdateKind];
|
|
231
|
+
type ResourceSnapshotUpdate<T> = {
|
|
232
|
+
readonly kind: typeof ResourceSnapshotUpdateKind.Load;
|
|
233
|
+
} | {
|
|
234
|
+
readonly kind: typeof ResourceSnapshotUpdateKind.Resolve;
|
|
235
|
+
readonly value: T;
|
|
236
|
+
} | {
|
|
237
|
+
readonly kind: typeof ResourceSnapshotUpdateKind.Fail;
|
|
238
|
+
readonly error: unknown;
|
|
239
|
+
} | {
|
|
240
|
+
readonly kind: typeof ResourceSnapshotUpdateKind.FailWithValue;
|
|
241
|
+
readonly value: T;
|
|
242
|
+
readonly error: unknown;
|
|
243
|
+
};
|
|
244
|
+
declare function reduceResourceSnapshot<T>(previous: ResourceSnapshot<T>, update: ResourceSnapshotUpdate<T>): ResourceSnapshot<T>;
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/signals/signal.d.ts
|
|
247
|
+
/**
|
|
248
|
+
* Minimal writable signal implementation.
|
|
249
|
+
* `set()` always publishes a write. Equality-based value-version suppression is
|
|
250
|
+
* handled by the underlying Rx signal for computed dependency validation.
|
|
251
|
+
*/
|
|
252
|
+
declare function createSignal<T>(initial: T, options?: SignalOptions<T>): WritableSignalTrait<T>;
|
|
253
|
+
/**
|
|
254
|
+
* Create a read-only view of a writable signal.
|
|
255
|
+
*/
|
|
256
|
+
declare function readonlySignal<T>(signal: WritableSignalTrait<T>): ReadableSignalTrait<T>;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/popup/handle.d.ts
|
|
259
|
+
interface PopupMessageChannelTrait<TOutgoing = unknown, TIncoming = unknown> {
|
|
260
|
+
outgoing: EventSubjectTrait<TOutgoing>;
|
|
261
|
+
incoming: EventStreamTrait<TIncoming>;
|
|
262
|
+
}
|
|
263
|
+
interface PopupWindowHandleTrait extends DisposableTrait {
|
|
264
|
+
messaging: PopupMessageChannelTrait;
|
|
265
|
+
readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
|
|
266
|
+
close(): void;
|
|
267
|
+
dispose(): void;
|
|
268
|
+
notify(method: string, params?: unknown): Promise<void>;
|
|
269
|
+
}
|
|
270
|
+
interface PopupClientWindowHandleTrait extends PopupWindowHandleTrait {
|
|
271
|
+
readonly failure: ReadableSignalTrait<ClientError | null>;
|
|
272
|
+
readonly isActive: ReadableSignalTrait<boolean>;
|
|
273
|
+
request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
|
|
274
|
+
}
|
|
275
|
+
interface PopupServerWindowHandleTrait extends PopupWindowHandleTrait {}
|
|
276
|
+
interface PopupClientWindowHandleOptions {
|
|
277
|
+
close(): void;
|
|
278
|
+
messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
|
|
279
|
+
time: TimeTrait;
|
|
280
|
+
closedStream: EventStreamTrait<boolean>;
|
|
281
|
+
}
|
|
282
|
+
interface PopupServerWindowHandleOptions {
|
|
283
|
+
close(): void;
|
|
284
|
+
messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* popup opener
|
|
288
|
+
*/
|
|
289
|
+
declare class PopupClientWindowHandle implements PopupClientWindowHandleTrait {
|
|
290
|
+
readonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
|
|
291
|
+
private disposed;
|
|
292
|
+
private readonly jsonRpc;
|
|
293
|
+
private readonly session;
|
|
294
|
+
private readonly incomingSubscription;
|
|
295
|
+
private readonly closePopup;
|
|
296
|
+
constructor(options: PopupClientWindowHandleOptions);
|
|
297
|
+
get onNotification(): EventStreamTrait<JsonRpcNotificationEvent>;
|
|
298
|
+
get failure(): ReadableSignalTrait<ClientError | null>;
|
|
299
|
+
get isActive(): ReadableSignalTrait<boolean>;
|
|
300
|
+
notify(method: string, params?: unknown): Promise<void>;
|
|
301
|
+
request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
|
|
302
|
+
close(): void;
|
|
303
|
+
dispose(): void;
|
|
304
|
+
[SYMBOL_DISPOSE](): void;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* popup target
|
|
308
|
+
*/
|
|
309
|
+
declare class PopupServerWindowHandle implements PopupServerWindowHandleTrait {
|
|
310
|
+
readonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
|
|
311
|
+
private disposed;
|
|
312
|
+
private readonly jsonRpc;
|
|
313
|
+
private readonly session;
|
|
314
|
+
private readonly incomingSubscription;
|
|
315
|
+
private readonly closePopup;
|
|
316
|
+
constructor(options: PopupServerWindowHandleOptions);
|
|
317
|
+
get onNotification(): EventStreamTrait<JsonRpcNotificationEvent>;
|
|
318
|
+
get onRequest(): EventStreamTrait<JsonRpcRequestEvent>;
|
|
319
|
+
notify(method: string, params?: unknown): Promise<void>;
|
|
320
|
+
close(): void;
|
|
321
|
+
dispose(): void;
|
|
322
|
+
[SYMBOL_DISPOSE](): void;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/popup/errors.d.ts
|
|
326
|
+
declare const PopupErrorCode: {
|
|
327
|
+
readonly Blocked: "popup.blocked";
|
|
328
|
+
readonly Closed: "popup.closed_by_user";
|
|
329
|
+
};
|
|
330
|
+
type PopupErrorCode = (typeof PopupErrorCode)[keyof typeof PopupErrorCode];
|
|
331
|
+
declare function readPopupErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/popup/session.d.ts
|
|
334
|
+
interface CreatePopupClientSessionOptions {
|
|
335
|
+
jsonRpc: JsonRpcClientTrait;
|
|
336
|
+
time: TimeTrait;
|
|
337
|
+
closedStream: EventStreamTrait<boolean>;
|
|
338
|
+
readyTimeoutMs?: number;
|
|
339
|
+
heartbeatIntervalMs?: number;
|
|
340
|
+
heartbeatTimeoutMs?: number;
|
|
341
|
+
}
|
|
342
|
+
interface CreatePopupServerSessionOptions {
|
|
343
|
+
jsonRpc: JsonRpcServerTrait;
|
|
344
|
+
}
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/popup/index.d.ts
|
|
347
|
+
declare const PopupAttachFailureReason: {
|
|
348
|
+
readonly MissingOpener: "missing_opener";
|
|
349
|
+
readonly MissingOrigin: "missing_origin";
|
|
350
|
+
};
|
|
351
|
+
type PopupAttachFailureReason = (typeof PopupAttachFailureReason)[keyof typeof PopupAttachFailureReason];
|
|
352
|
+
interface PopupAttachSuccess {
|
|
353
|
+
kind: "success";
|
|
354
|
+
handle: PopupServerWindowHandleTrait;
|
|
355
|
+
}
|
|
356
|
+
interface PopupAttachFailure {
|
|
357
|
+
kind: "failure";
|
|
358
|
+
reason: PopupAttachFailureReason;
|
|
359
|
+
error: ClientError;
|
|
360
|
+
}
|
|
361
|
+
type PopupAttachResult = PopupAttachSuccess | PopupAttachFailure;
|
|
362
|
+
interface PopupOpenOptions {
|
|
363
|
+
target?: string;
|
|
364
|
+
width?: number;
|
|
365
|
+
height?: number;
|
|
366
|
+
expectedOrigin?: string;
|
|
367
|
+
}
|
|
368
|
+
interface PopupTrait {
|
|
369
|
+
open(url: string, options?: PopupOpenOptions): PopupClientWindowHandleTrait;
|
|
370
|
+
attach(): PopupAttachResult;
|
|
371
|
+
}
|
|
372
|
+
declare const POPUP_TRAIT_TOKEN: SecuritydeptInjectionToken<PopupTrait | null>;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/validation/schemas/uri.d.ts
|
|
375
|
+
declare const UriStringSchema: import("arktype/internal/variants/string.ts").StringType<string, {}>;
|
|
376
|
+
declare const BaseURIStringSchema: import("arktype/internal/variants/string.ts").StringType<string, {}>;
|
|
377
|
+
declare const UriRelativeStringSchema: import("arktype/internal/variants/string.ts").StringType<string, {}>;
|
|
378
|
+
declare const UriReferenceStringSchema: import("arktype/internal/variants/string.ts").StringType<string, {}>;
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/router/metadata.d.ts
|
|
381
|
+
/** Route-data key holding the SecurityDept metadata blob for a segment. */
|
|
382
|
+
declare const SECURITYDEPT_ROUTE_METADATA_KEY = "__securitydept__";
|
|
383
|
+
/** Serializable SecurityDept route metadata. */
|
|
384
|
+
interface SecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement> {
|
|
385
|
+
requirements?: readonly TAuthRequirement[];
|
|
386
|
+
composition?: RequirementsComposition;
|
|
387
|
+
}
|
|
388
|
+
/** Read SecurityDept route metadata from a route `data` bag. */
|
|
389
|
+
declare function readSecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement>(data: object | undefined): SecuritydeptRouteMetadata<TAuthRequirement> | undefined;
|
|
390
|
+
/** Merge SecurityDept route metadata into a route `data` bag. */
|
|
391
|
+
declare function writeSecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement>(base: object | undefined, patch: SecuritydeptRouteMetadata<TAuthRequirement>): Record<string, unknown>;
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region src/struct/uri-string.d.ts
|
|
394
|
+
/**
|
|
395
|
+
* Thrown when a string cannot be parsed into the requested URI variant.
|
|
396
|
+
*/
|
|
397
|
+
declare class UriParseError extends Error {
|
|
398
|
+
readonly input: string;
|
|
399
|
+
readonly kind: string;
|
|
400
|
+
constructor(input: string, kind: string, options?: ErrorOptions);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* The relative components of a URL — pathname, search, and hash.
|
|
404
|
+
*
|
|
405
|
+
* All fields use the same format as the native `URL` accessors:
|
|
406
|
+
* - `pathname` starts with `/` (e.g. `"/path"`).
|
|
407
|
+
* - `search` includes the leading `?` when present (e.g. `"?q=1"`).
|
|
408
|
+
* - `hash` includes the leading `#` when present (e.g. `"#section"`).
|
|
409
|
+
*/
|
|
410
|
+
interface UriRelativeParts {
|
|
411
|
+
readonly pathname: string;
|
|
412
|
+
readonly search: string;
|
|
413
|
+
readonly hash: string;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Minimal structural type for URI fragment parsing.
|
|
417
|
+
*
|
|
418
|
+
* Matches any value that exposes a URL-style `hash` accessor — for example
|
|
419
|
+
* `URL`, `Location`, or {@link UriReferenceString}.
|
|
420
|
+
*/
|
|
421
|
+
interface UriFragmentPart {
|
|
422
|
+
readonly hash: string;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Minimal structural type for URI reference parsing.
|
|
426
|
+
*
|
|
427
|
+
* Matches any value that can be serialized via `toString()` — for example
|
|
428
|
+
* native `URL`, `Location`, or {@link UriReferenceString}.
|
|
429
|
+
*/
|
|
430
|
+
interface UriReferenceStringLike {
|
|
431
|
+
toString(): string;
|
|
432
|
+
}
|
|
433
|
+
type UriReferenceStringInput = string | UriReferenceStringLike;
|
|
434
|
+
type UriSearchParamsInit = NonNullable<ConstructorParameters<typeof URLSearchParams>[0]>;
|
|
435
|
+
/**
|
|
436
|
+
* Immutable wrapper around a URI-reference string.
|
|
437
|
+
*
|
|
438
|
+
* A URI-reference (RFC 3986 §4.1) is either an absolute URI or a relative
|
|
439
|
+
* reference. Concrete subclasses {@link UriString} and
|
|
440
|
+
* {@link UriRelativeString} carry the additional type-level guarantee of
|
|
441
|
+
* which variant they hold.
|
|
442
|
+
*
|
|
443
|
+
* Instances created via `UriReferenceString.parse` / `.tryParse` are always
|
|
444
|
+
* one of the two subclasses, so {@link isAbsolute} and {@link isRelative}
|
|
445
|
+
* narrow correctly.
|
|
446
|
+
*/
|
|
447
|
+
declare class UriReferenceString {
|
|
448
|
+
/** The original, unmodified input string. */
|
|
449
|
+
protected readonly _raw: string;
|
|
450
|
+
/**
|
|
451
|
+
* Eagerly parsed URL helper.
|
|
452
|
+
*
|
|
453
|
+
* - Absolute URIs: `new URL(raw)`.
|
|
454
|
+
* - Relative URIs: `new URL(raw, RELATIVE_URI_SENTINEL_BASE)`.
|
|
455
|
+
*
|
|
456
|
+
* For relative URIs the scheme and host originate from the sentinel and
|
|
457
|
+
* MUST NOT be used for origin-sensitive operations.
|
|
458
|
+
*/
|
|
459
|
+
protected readonly _parsed: URL;
|
|
460
|
+
protected readonly _isAbsolute: boolean;
|
|
461
|
+
protected constructor(raw: string, parsed: URL, isAbsolute: boolean);
|
|
462
|
+
/**
|
|
463
|
+
* Parse any valid URI reference (absolute or relative).
|
|
464
|
+
*
|
|
465
|
+
* The returned instance is always a {@link UriString} or
|
|
466
|
+
* {@link UriRelativeString}.
|
|
467
|
+
*
|
|
468
|
+
* @throws {UriParseError} when the input is not a valid URI reference.
|
|
469
|
+
*/
|
|
470
|
+
static parse(input: UriReferenceStringInput): UriReferenceString;
|
|
471
|
+
/**
|
|
472
|
+
* Try to parse a URI reference, returning `null` on failure.
|
|
473
|
+
*
|
|
474
|
+
* The returned instance is always a {@link UriString} or
|
|
475
|
+
* {@link UriRelativeString}.
|
|
476
|
+
*/
|
|
477
|
+
static tryParse(input: UriReferenceStringInput): UriReferenceString | null;
|
|
478
|
+
/** Create from a native `URL`. Always produces a {@link UriString}. */
|
|
479
|
+
static fromURL(url: URL): UriString;
|
|
480
|
+
/**
|
|
481
|
+
* Create from the relative components of a URL.
|
|
482
|
+
* Always produces a {@link UriRelativeString}.
|
|
483
|
+
*/
|
|
484
|
+
static fromURLRelative(parts: UriRelativeParts): UriRelativeString;
|
|
485
|
+
/** The original input string. */
|
|
486
|
+
get raw(): string;
|
|
487
|
+
get pathname(): string;
|
|
488
|
+
get hash(): string;
|
|
489
|
+
get search(): string;
|
|
490
|
+
get searchParams(): URLSearchParams;
|
|
491
|
+
/** Type-guard: narrows to {@link UriString} when the reference is absolute. */
|
|
492
|
+
isAbsolute(): this is UriString;
|
|
493
|
+
/** Type-guard: narrows to {@link UriRelativeString} when the reference is relative. */
|
|
494
|
+
isRelative(): this is UriRelativeString;
|
|
495
|
+
/** Narrow to {@link UriString} or return `null`. */
|
|
496
|
+
asAbsolute(): UriString | null;
|
|
497
|
+
/** Narrow to {@link UriRelativeString} or return `null`. */
|
|
498
|
+
asRelative(): UriRelativeString | null;
|
|
499
|
+
/**
|
|
500
|
+
* Returns a new instance with `hash` replaced.
|
|
501
|
+
*
|
|
502
|
+
* @param value URL-style hash, including a leading `#` when non-empty.
|
|
503
|
+
*/
|
|
504
|
+
setHash(value: string): this;
|
|
505
|
+
/** Returns a new instance with the complete query parameter set replaced. */
|
|
506
|
+
setSearchParams(init?: UriSearchParamsInit): this;
|
|
507
|
+
/**
|
|
508
|
+
* Convert to a native `URL`.
|
|
509
|
+
*
|
|
510
|
+
* A `base` is required when the reference is relative; it is ignored
|
|
511
|
+
* for absolute references.
|
|
512
|
+
*
|
|
513
|
+
* @throws {TypeError} when the reference is relative and no base is provided.
|
|
514
|
+
*/
|
|
515
|
+
toURL(base?: string | URL): URL;
|
|
516
|
+
toString(): string;
|
|
517
|
+
valueOf(): string;
|
|
518
|
+
toJSON(): string;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Immutable wrapper around an absolute URI string.
|
|
522
|
+
*
|
|
523
|
+
* An absolute URI (RFC 3986 §4.3) always starts with a scheme component
|
|
524
|
+
* (e.g. `https://example.com/path`).
|
|
525
|
+
*/
|
|
526
|
+
declare class UriString extends UriReferenceString {
|
|
527
|
+
protected constructor(raw: string, parsed: URL);
|
|
528
|
+
/**
|
|
529
|
+
* Parse an absolute URI string.
|
|
530
|
+
*
|
|
531
|
+
* @throws {UriParseError} when the input is not a valid absolute URI.
|
|
532
|
+
*/
|
|
533
|
+
static parse(input: string): UriString;
|
|
534
|
+
/**
|
|
535
|
+
* Try to parse an absolute URI, returning `null` if the input is not
|
|
536
|
+
* a valid absolute URI.
|
|
537
|
+
*/
|
|
538
|
+
static tryParse(input: string | UriString): UriString | null;
|
|
539
|
+
/** Create from a native `URL`, using its `href` as the raw string. */
|
|
540
|
+
static fromURL(url: URL): UriString;
|
|
541
|
+
/**
|
|
542
|
+
* Not supported — relative parts cannot produce an absolute URI.
|
|
543
|
+
*
|
|
544
|
+
* @throws {TypeError} unconditionally.
|
|
545
|
+
*/
|
|
546
|
+
static fromURLRelative(_parts: UriRelativeParts): never;
|
|
547
|
+
get host(): string;
|
|
548
|
+
get hostname(): string;
|
|
549
|
+
get origin(): string;
|
|
550
|
+
get password(): string;
|
|
551
|
+
get port(): string;
|
|
552
|
+
get protocol(): string;
|
|
553
|
+
get username(): string;
|
|
554
|
+
/** Convert to a native `URL`. No base is required for absolute URIs. */
|
|
555
|
+
toURL(): URL;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Immutable wrapper around a relative URI reference string.
|
|
559
|
+
*
|
|
560
|
+
* A relative reference (RFC 3986 §4.2) has no scheme and must be resolved
|
|
561
|
+
* against a base URI to obtain an absolute URI.
|
|
562
|
+
*
|
|
563
|
+
* Internally, the raw string is parsed against a sentinel base
|
|
564
|
+
* (`http://localhost`) to enable eager validation and URL-component
|
|
565
|
+
* extraction. The sentinel origin is never leaked through the public API.
|
|
566
|
+
*/
|
|
567
|
+
declare class UriRelativeString extends UriReferenceString {
|
|
568
|
+
protected constructor(raw: string, parsed: URL);
|
|
569
|
+
/**
|
|
570
|
+
* Parse a relative URI reference.
|
|
571
|
+
*
|
|
572
|
+
* @throws {UriParseError} when the input is absolute or not a valid
|
|
573
|
+
* relative URI reference.
|
|
574
|
+
*/
|
|
575
|
+
static parse(input: string): UriRelativeString;
|
|
576
|
+
/**
|
|
577
|
+
* Try to parse a relative URI reference, returning `null` if the input
|
|
578
|
+
* is an absolute URI or otherwise invalid.
|
|
579
|
+
*/
|
|
580
|
+
static tryParse(input: string | UriRelativeString): UriRelativeString | null;
|
|
581
|
+
/**
|
|
582
|
+
* Not supported — a native `URL` is always absolute and cannot be
|
|
583
|
+
* represented as a relative URI reference.
|
|
584
|
+
*
|
|
585
|
+
* @throws {TypeError} unconditionally.
|
|
586
|
+
*/
|
|
587
|
+
static fromURL(_url: URL): never;
|
|
588
|
+
/**
|
|
589
|
+
* Create from the relative components of a URL.
|
|
590
|
+
*
|
|
591
|
+
* Concatenates `pathname + search + hash` into a relative URI string.
|
|
592
|
+
*/
|
|
593
|
+
static fromURLRelative(parts: UriRelativeParts): UriRelativeString;
|
|
594
|
+
/**
|
|
595
|
+
* Convert to a native `URL` by resolving against the given base.
|
|
596
|
+
*
|
|
597
|
+
* @param base - The base URL to resolve against (required).
|
|
598
|
+
*/
|
|
599
|
+
toURL(base: string | URL): URL;
|
|
600
|
+
}
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/protocol/compat-fragment.d.ts
|
|
603
|
+
declare const SECURITYDEPT_COMPAT_FRAGMENT_VERSION = "v1";
|
|
604
|
+
type CompatFragmentParameters = Record<string, string>;
|
|
605
|
+
interface CompatFragment {
|
|
606
|
+
payload: string;
|
|
607
|
+
parameters: CompatFragmentParameters;
|
|
608
|
+
}
|
|
609
|
+
interface AppendOrReplaceCompatFragmentOptions {
|
|
610
|
+
payload: string | URLSearchParams | CompatFragmentParameters;
|
|
611
|
+
}
|
|
612
|
+
interface TakeCompatFragmentResult<T> {
|
|
613
|
+
compatFragment: CompatFragment | null;
|
|
614
|
+
fragment: string;
|
|
615
|
+
url: UpdatedUriFragment<T>;
|
|
616
|
+
}
|
|
617
|
+
interface TakeCompatFragmentOptions<T> {
|
|
618
|
+
condition?: (compatFragment: CompatFragment) => boolean;
|
|
619
|
+
update: UpdateUriFragmentHash<T>;
|
|
620
|
+
}
|
|
621
|
+
interface AppendOrReplaceCompatFragmentResult<T> {
|
|
622
|
+
fragment: string;
|
|
623
|
+
url: UpdatedUriFragment<T>;
|
|
624
|
+
}
|
|
625
|
+
type UpdatedUriFragment<T> = T extends string ? string : T;
|
|
626
|
+
type UpdateUriFragmentHash<T> = (input: T, hash: string) => UpdatedUriFragment<T>;
|
|
627
|
+
declare function appendOrReplaceCompatFragment<T extends string | UriFragmentPart>(input: T, options: AppendOrReplaceCompatFragmentOptions, update: UpdateUriFragmentHash<T>): AppendOrReplaceCompatFragmentResult<T>;
|
|
628
|
+
declare function parseCompatFragment(input: string | UriFragmentPart): CompatFragment | null;
|
|
629
|
+
declare function takeCompatFragment<T extends string | UriFragmentPart>(input: T, options: TakeCompatFragmentOptions<T>): TakeCompatFragmentResult<T>;
|
|
630
|
+
declare function isCompatFragmentBlock(block: string): boolean;
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/router/router.d.ts
|
|
633
|
+
declare const RouterNavigationIntent: {
|
|
634
|
+
readonly AuthRedirect: "auth_redirect";
|
|
635
|
+
readonly PostAuthRedirect: "post_auth_redirect";
|
|
636
|
+
readonly CallbackCleanup: "callback_cleanup";
|
|
637
|
+
readonly ExternalOpen: "external_open";
|
|
638
|
+
};
|
|
639
|
+
type RouterNavigationIntent = (typeof RouterNavigationIntent)[keyof typeof RouterNavigationIntent];
|
|
640
|
+
declare const RouterNavigationMode: {
|
|
641
|
+
readonly Push: "push";
|
|
642
|
+
readonly Replace: "replace";
|
|
643
|
+
readonly External: "external";
|
|
644
|
+
};
|
|
645
|
+
type RouterNavigationMode = (typeof RouterNavigationMode)[keyof typeof RouterNavigationMode];
|
|
646
|
+
interface RouterNavigationRequest {
|
|
647
|
+
url: UriReferenceString;
|
|
648
|
+
intent: RouterNavigationIntent;
|
|
649
|
+
mode: RouterNavigationMode;
|
|
650
|
+
state?: unknown;
|
|
651
|
+
}
|
|
652
|
+
interface RouterTrait {
|
|
653
|
+
currentUrl(): UriReferenceString | null;
|
|
654
|
+
navigate(request: RouterNavigationRequest): void | Promise<void>;
|
|
655
|
+
}
|
|
656
|
+
interface TakeCompatFragmentFromRouterOptions {
|
|
657
|
+
condition?: (compatFragment: CompatFragment) => boolean;
|
|
658
|
+
}
|
|
659
|
+
declare function takeCompatFragmentFromRouter(router: RouterTrait, options?: TakeCompatFragmentFromRouterOptions): Promise<CompatFragment | null>;
|
|
660
|
+
declare const ROUTER_TRAIT_TOKEN: SecuritydeptInjectionToken<RouterTrait | null>;
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/span/types.d.ts
|
|
663
|
+
interface SpanCreateOptions {
|
|
664
|
+
idFactory?: () => string;
|
|
665
|
+
attributes?: Record<string, unknown>;
|
|
666
|
+
mutable?: false;
|
|
667
|
+
}
|
|
668
|
+
interface MutableSpanCreateOptions extends Omit<SpanCreateOptions, "mutable"> {
|
|
669
|
+
mutable: true;
|
|
670
|
+
}
|
|
671
|
+
interface SpanTrait {
|
|
672
|
+
readonly id: string;
|
|
673
|
+
readonly parent?: SpanTrait;
|
|
674
|
+
readonly attributes: Readonly<Record<string, unknown>>;
|
|
675
|
+
fork(options: MutableSpanCreateOptions): MutableSpanTrait;
|
|
676
|
+
fork(options?: SpanCreateOptions): SpanTrait;
|
|
677
|
+
fork(options?: SpanCreateOptions | MutableSpanCreateOptions): SpanTrait | MutableSpanTrait;
|
|
678
|
+
}
|
|
679
|
+
interface MutableSpanTrait extends SpanTrait {
|
|
680
|
+
setAttributes(attributes: Record<string, unknown>): void;
|
|
681
|
+
}
|
|
682
|
+
declare const SPAN_TRAIT_TOKEN: SecuritydeptInjectionToken<SpanTrait>;
|
|
683
|
+
interface OperationSpanTrait extends MutableSpanTrait {
|
|
684
|
+
addEvent(type: string, attributes?: Record<string, unknown>): void;
|
|
685
|
+
recordError(error: unknown, attributes?: Record<string, unknown>): void;
|
|
686
|
+
}
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/validation/validator.d.ts
|
|
689
|
+
/**
|
|
690
|
+
* Successful validation result.
|
|
691
|
+
*
|
|
692
|
+
* Contains the parsed, typed output value from the schema.
|
|
693
|
+
*/
|
|
694
|
+
interface ValidationSuccess<T> {
|
|
695
|
+
readonly success: true;
|
|
696
|
+
readonly value: T;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Failed validation result.
|
|
700
|
+
*
|
|
701
|
+
* Contains the list of issues reported by the schema.
|
|
702
|
+
*/
|
|
703
|
+
interface ValidationFailure {
|
|
704
|
+
readonly success: false;
|
|
705
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Discriminated union of validation outcomes.
|
|
709
|
+
*
|
|
710
|
+
* Consumers can narrow on `success` to access either the typed value
|
|
711
|
+
* or the issue list.
|
|
712
|
+
*/
|
|
713
|
+
type ValidationResult<T> = ValidationSuccess<T> | ValidationFailure;
|
|
714
|
+
type TraitInputValidator = StandardSchemaV1<unknown, unknown>;
|
|
715
|
+
type TraitInputBundledSchema = StandardSchemaV1<unknown, unknown>;
|
|
716
|
+
interface WithTraitInputValidator<TValidator = TraitInputValidator> {
|
|
717
|
+
validators?: TValidator;
|
|
718
|
+
}
|
|
719
|
+
interface ValidateTraitInputOptions {
|
|
720
|
+
value: unknown;
|
|
721
|
+
bundledSchema: TraitInputBundledSchema;
|
|
722
|
+
validator?: TraitInputValidator;
|
|
723
|
+
optional?: boolean;
|
|
724
|
+
onInvalid(failure: ValidationFailure): never;
|
|
725
|
+
}
|
|
726
|
+
declare function formatValidationFailure(failure: ValidationFailure | undefined): string | null;
|
|
727
|
+
declare function throwValidationClientError(options: {
|
|
728
|
+
code: string;
|
|
729
|
+
source: string;
|
|
730
|
+
messagePrefix: string;
|
|
731
|
+
failure?: ValidationFailure;
|
|
732
|
+
}): never;
|
|
733
|
+
/**
|
|
734
|
+
* Validate an unknown input against a `@standard-schema`-compatible schema.
|
|
735
|
+
*
|
|
736
|
+
* This is the foundation-level entry point for SDK validation. It accepts
|
|
737
|
+
* any schema implementing `StandardSchemaV1` and returns a discriminated
|
|
738
|
+
* `ValidationResult`.
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* ```ts
|
|
742
|
+
* import { validateWithSchema } from "@securitydept/client";
|
|
743
|
+
* import { z } from "zod";
|
|
744
|
+
*
|
|
745
|
+
* const UserSchema = z.object({ name: z.string() });
|
|
746
|
+
* const result = await validateWithSchema(UserSchema, { name: "Alice" });
|
|
747
|
+
* if (result.success) {
|
|
748
|
+
* console.log(result.value.name);
|
|
749
|
+
* } else {
|
|
750
|
+
* console.error(result.issues);
|
|
751
|
+
* }
|
|
752
|
+
* ```
|
|
753
|
+
*/
|
|
754
|
+
declare function validateWithSchema<I, O>(schema: StandardSchemaV1<I, O>, input: unknown): Promise<ValidationResult<O>>;
|
|
755
|
+
/**
|
|
756
|
+
* Validate an unknown input synchronously against a `@standard-schema`-compatible schema.
|
|
757
|
+
*
|
|
758
|
+
* Only use this when you know the schema's validate function returns synchronously.
|
|
759
|
+
* Throws if the schema returns a Promise.
|
|
760
|
+
*/
|
|
761
|
+
declare function validateWithSchemaSync<I, O>(schema: StandardSchemaV1<I, O>, input: unknown): ValidationResult<O>;
|
|
762
|
+
declare function validateTraitInput(options: ValidateTraitInputOptions): void;
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region src/std/time.d.ts
|
|
765
|
+
interface TimeTraitStdHost {
|
|
766
|
+
Date: Pick<DateConstructor, "now">;
|
|
767
|
+
setTimeout(handler: () => void, delayMs: number): unknown;
|
|
768
|
+
clearTimeout(handle: unknown): void;
|
|
769
|
+
}
|
|
770
|
+
interface TimeForStdCreateOptions {
|
|
771
|
+
host?: TimeTraitStdHost;
|
|
772
|
+
}
|
|
773
|
+
declare function createTimeForStd(options?: TimeForStdCreateOptions & WithTraitInputValidator<TraitInputValidator>): TimeTrait;
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region src/std/transport/authorization-interceptor.d.ts
|
|
776
|
+
type AuthorizationSignal = ReadableSignalTrait<string | null | undefined> | ResourceTrait<string | null | undefined>;
|
|
777
|
+
type AuthorizationInterceptedFetchPredicate = (input: RequestInfo | URL, init: RequestInit | undefined) => boolean | Promise<boolean>;
|
|
778
|
+
interface CreateAuthorizationInterceptedFetchOptions {
|
|
779
|
+
readonly predicate: AuthorizationInterceptedFetchPredicate;
|
|
780
|
+
readonly authorization: AuthorizationSignal;
|
|
781
|
+
}
|
|
782
|
+
declare function createAuthorizationInterceptedFetch(fetchImpl: typeof fetch, options: CreateAuthorizationInterceptedFetchOptions): typeof fetch;
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/transport/types.d.ts
|
|
785
|
+
declare const TransportErrorCode: {
|
|
786
|
+
readonly RequestFailed: "transport.request_failed";
|
|
787
|
+
readonly ResponseDecodeFailed: "transport.response_decode_failed";
|
|
788
|
+
readonly InvalidStdFetchOptions: "transport.invalid_std_fetch_options";
|
|
789
|
+
readonly InvalidAngularOptions: "transport.invalid_angular_options";
|
|
790
|
+
};
|
|
791
|
+
type TransportErrorCode = (typeof TransportErrorCode)[keyof typeof TransportErrorCode];
|
|
792
|
+
/** Neutral HTTP request representation. */
|
|
793
|
+
interface HttpRequest {
|
|
794
|
+
url: string;
|
|
795
|
+
method: string;
|
|
796
|
+
headers: Record<string, string>;
|
|
797
|
+
body?: unknown;
|
|
798
|
+
cancellationToken?: CancellationTokenTrait;
|
|
799
|
+
}
|
|
800
|
+
/** Neutral HTTP response representation. */
|
|
801
|
+
interface HttpResponse {
|
|
802
|
+
status: number;
|
|
803
|
+
headers: Record<string, string>;
|
|
804
|
+
body?: unknown;
|
|
805
|
+
}
|
|
806
|
+
type HttpResponseJsonBody = Record<string, unknown>;
|
|
807
|
+
/** Neutral request executor trait. */
|
|
808
|
+
interface BaseTransportTrait {
|
|
809
|
+
execute(request: HttpRequest): Promise<HttpResponse>;
|
|
810
|
+
}
|
|
811
|
+
declare const TRANSPORT_TRAIT_TOKEN: SecuritydeptInjectionToken<BaseTransportTrait>;
|
|
812
|
+
//#endregion
|
|
813
|
+
//#region src/std/transport/base-transport.d.ts
|
|
814
|
+
declare const FetchTransportRedirectKind: {
|
|
815
|
+
readonly Follow: "follow";
|
|
816
|
+
readonly Manual: "manual";
|
|
817
|
+
};
|
|
818
|
+
type FetchTransportRedirectKind = (typeof FetchTransportRedirectKind)[keyof typeof FetchTransportRedirectKind];
|
|
819
|
+
interface BaseTransportForStdFetchCreateOptions {
|
|
820
|
+
redirect?: FetchTransportRedirectKind;
|
|
821
|
+
fetch?: typeof fetch;
|
|
822
|
+
baseUrl?: string | URL;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Default `BaseTransportTrait` backed by the global `fetch` API.
|
|
826
|
+
*
|
|
827
|
+
* The caller is responsible for ensuring `fetch` is available in the runtime.
|
|
828
|
+
* No polyfill is injected.
|
|
829
|
+
*/
|
|
830
|
+
declare function createBaseTransportForStdFetch(options?: BaseTransportForStdFetchCreateOptions & WithTraitInputValidator<TraitInputValidator>): BaseTransportTrait;
|
|
831
|
+
//#endregion
|
|
832
|
+
//#region src/storage/types.d.ts
|
|
833
|
+
declare const StorageChangeEventOrigin: {
|
|
834
|
+
readonly Local: "local";
|
|
835
|
+
readonly External: "external";
|
|
836
|
+
};
|
|
837
|
+
type StorageChangeEventOrigin = (typeof StorageChangeEventOrigin)[keyof typeof StorageChangeEventOrigin];
|
|
838
|
+
interface StorageChangeEvent {
|
|
839
|
+
readonly origin: StorageChangeEventOrigin;
|
|
840
|
+
readonly key: string | null;
|
|
841
|
+
readonly oldValue: string | null;
|
|
842
|
+
readonly newValue: string | null;
|
|
843
|
+
}
|
|
844
|
+
/** Low-level key-value storage trait. */
|
|
845
|
+
interface StorageTrait {
|
|
846
|
+
readonly storageEvent?: EventStreamTrait<StorageChangeEvent>;
|
|
847
|
+
get(key: string): string | null | Promise<string | null>;
|
|
848
|
+
set(key: string, value: string): void | Promise<void>;
|
|
849
|
+
/**
|
|
850
|
+
* Atomically read and remove a record within the store's consistency domain.
|
|
851
|
+
*/
|
|
852
|
+
take?(key: string): string | null | Promise<string | null>;
|
|
853
|
+
remove(key: string): void | Promise<void>;
|
|
854
|
+
}
|
|
855
|
+
/** Storage whose operations complete synchronously in the current realm. */
|
|
856
|
+
interface SyncStorageTrait extends StorageTrait {
|
|
857
|
+
get(key: string): string | null;
|
|
858
|
+
set(key: string, value: string): void;
|
|
859
|
+
take?(key: string): string | null;
|
|
860
|
+
remove(key: string): void;
|
|
861
|
+
}
|
|
862
|
+
declare const REALM_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<SyncStorageTrait>;
|
|
863
|
+
declare const PERSISTENT_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<StorageTrait | null>;
|
|
864
|
+
declare const SESSION_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<StorageTrait | null>;
|
|
865
|
+
/** Serialization codec for typed values. */
|
|
866
|
+
interface Codec<T> {
|
|
867
|
+
encode(value: T): string;
|
|
868
|
+
decode(raw: string): T;
|
|
869
|
+
}
|
|
870
|
+
/** Semantic store for long-lived auth state. */
|
|
871
|
+
interface PersistentAuthStore<T> {
|
|
872
|
+
load(): Promise<T | null>;
|
|
873
|
+
save(value: T): Promise<void>;
|
|
874
|
+
clear(): Promise<void>;
|
|
875
|
+
}
|
|
876
|
+
/** Semantic store for recoverable state (survives page reload). */
|
|
877
|
+
interface RecoverableStateStore<T> {
|
|
878
|
+
load(): Promise<T | null>;
|
|
879
|
+
save(value: T): Promise<void>;
|
|
880
|
+
clear(): Promise<void>;
|
|
881
|
+
}
|
|
882
|
+
/** Semantic store for ephemeral flow state (one-time-use). */
|
|
883
|
+
interface EphemeralFlowStore<T> {
|
|
884
|
+
load(): Promise<T | null>;
|
|
885
|
+
save(value: T): Promise<void>;
|
|
886
|
+
consume(): Promise<T | null>;
|
|
887
|
+
clear(): Promise<void>;
|
|
888
|
+
}
|
|
889
|
+
/** Semantic store for keyed ephemeral flow state (one-time-use per key). */
|
|
890
|
+
interface KeyedEphemeralFlowStore<T> {
|
|
891
|
+
load(key: string): Promise<T | null>;
|
|
892
|
+
save(key: string, value: T): Promise<void>;
|
|
893
|
+
take(key: string): Promise<T | null>;
|
|
894
|
+
clear(key: string): Promise<void>;
|
|
895
|
+
}
|
|
896
|
+
/** Versioned storage envelope — first-version migration support. */
|
|
897
|
+
interface StoredEnvelope<T> {
|
|
898
|
+
version: number;
|
|
899
|
+
storedAt: number;
|
|
900
|
+
expiresAt?: number;
|
|
901
|
+
value: T;
|
|
902
|
+
}
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region src/tracing/types.d.ts
|
|
905
|
+
declare const TracingLevel: {
|
|
906
|
+
readonly Debug: "debug";
|
|
907
|
+
readonly Info: "info";
|
|
908
|
+
readonly Warn: "warn";
|
|
909
|
+
readonly Error: "error";
|
|
910
|
+
};
|
|
911
|
+
type TracingLevel = (typeof TracingLevel)[keyof typeof TracingLevel];
|
|
912
|
+
declare const OperationTraceEventType: {
|
|
913
|
+
readonly Started: "operation.started";
|
|
914
|
+
readonly Event: "operation.event";
|
|
915
|
+
readonly Error: "operation.error";
|
|
916
|
+
readonly Ended: "operation.ended";
|
|
917
|
+
};
|
|
918
|
+
type OperationTraceEventType = (typeof OperationTraceEventType)[keyof typeof OperationTraceEventType];
|
|
919
|
+
interface TracingEvent {
|
|
920
|
+
name: string;
|
|
921
|
+
at: number;
|
|
922
|
+
span: SpanTrait;
|
|
923
|
+
level: TracingLevel;
|
|
924
|
+
target: string;
|
|
925
|
+
fields?: Record<string, unknown>;
|
|
926
|
+
}
|
|
927
|
+
interface TracingTrait extends DisposableTrait {
|
|
928
|
+
record(event: TracingEvent): void;
|
|
929
|
+
readonly events: EventStreamTrait<TracingEvent>;
|
|
930
|
+
}
|
|
931
|
+
declare const TRACING_TRAIT_TOKEN: SecuritydeptInjectionToken<TracingTrait>;
|
|
932
|
+
//#endregion
|
|
933
|
+
//#region src/tracing/subscriber/types.d.ts
|
|
934
|
+
interface TracingSubscriberTrait {
|
|
935
|
+
record(event: TracingEvent): void;
|
|
936
|
+
}
|
|
937
|
+
//#endregion
|
|
938
|
+
//#region src/tracing/create.d.ts
|
|
939
|
+
interface TracingCreateOptions {
|
|
940
|
+
subscribers?: readonly TracingSubscriberTrait[];
|
|
941
|
+
}
|
|
942
|
+
declare function createTracing(options?: TracingCreateOptions & WithTraitInputValidator<TraitInputValidator>): TracingTrait;
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/environment/types.d.ts
|
|
945
|
+
/**
|
|
946
|
+
* Foundation dependency environment injected into client-side auth runtimes
|
|
947
|
+
* via explicit wiring at the composition root.
|
|
948
|
+
*
|
|
949
|
+
* `transport`, `time`, `realmStorage`, `span`, and `tracing` are the required baseline
|
|
950
|
+
* capabilities. Optional page/router/popup/storage traits stay explicit.
|
|
951
|
+
* Raw host-material inputs such as `window`, `location`, or browser storage
|
|
952
|
+
* handles are intentionally outside this contract and should be resolved by
|
|
953
|
+
* host-specific creators before a `FoundationEnvironment` is assembled.
|
|
954
|
+
*/
|
|
955
|
+
interface FoundationEnvironment {
|
|
956
|
+
injector: SecuritydeptInjector;
|
|
957
|
+
transport: BaseTransportTrait;
|
|
958
|
+
time: TimeTrait;
|
|
959
|
+
realmStorage: SyncStorageTrait;
|
|
960
|
+
idleCallback?: IdleCallbackTrait;
|
|
961
|
+
persistentStorage?: StorageTrait;
|
|
962
|
+
sessionStorage?: StorageTrait;
|
|
963
|
+
span: SpanTrait;
|
|
964
|
+
tracing: TracingTrait;
|
|
965
|
+
router?: RouterTrait;
|
|
966
|
+
pageLifecycle?: PageLifecycleTrait;
|
|
967
|
+
popup?: PopupTrait;
|
|
968
|
+
}
|
|
969
|
+
interface ServiceWorkerEnvironment extends FoundationEnvironment {}
|
|
970
|
+
declare const ENVIRONMENT_TOKEN: SecuritydeptInjectionToken<FoundationEnvironment>;
|
|
971
|
+
interface EnvironmentValidators {
|
|
972
|
+
transport?: TraitInputValidator;
|
|
973
|
+
transportForStdFetchCreateOptions?: TraitInputValidator;
|
|
974
|
+
time?: TraitInputValidator;
|
|
975
|
+
timeForStdCreateOptions?: TraitInputValidator;
|
|
976
|
+
realmStorage?: TraitInputValidator;
|
|
977
|
+
idleCallback?: TraitInputValidator;
|
|
978
|
+
persistentStorage?: TraitInputValidator;
|
|
979
|
+
sessionStorage?: TraitInputValidator;
|
|
980
|
+
span?: TraitInputValidator;
|
|
981
|
+
spanCreateOptions?: TraitInputValidator;
|
|
982
|
+
tracing?: TraitInputValidator;
|
|
983
|
+
tracingCreateOptions?: TraitInputValidator;
|
|
984
|
+
router?: TraitInputValidator;
|
|
985
|
+
pageLifecycle?: TraitInputValidator;
|
|
986
|
+
popup?: TraitInputValidator;
|
|
987
|
+
}
|
|
988
|
+
//#endregion
|
|
989
|
+
//#region src/environment/create.d.ts
|
|
990
|
+
interface CreateFoundationEnvironmentOptions {
|
|
991
|
+
providers?: readonly SecuritydeptProvider[];
|
|
992
|
+
transport?: BaseTransportTrait;
|
|
993
|
+
transportForStdFetchCreateOptions?: BaseTransportForStdFetchCreateOptions;
|
|
994
|
+
time?: TimeTrait;
|
|
995
|
+
timeForStdCreateOptions?: TimeForStdCreateOptions;
|
|
996
|
+
realmStorage?: SyncStorageTrait;
|
|
997
|
+
span?: SpanTrait;
|
|
998
|
+
spanCreateOptions?: SpanCreateOptions;
|
|
999
|
+
tracing?: TracingTrait;
|
|
1000
|
+
tracingCreateOptions?: TracingCreateOptions;
|
|
1001
|
+
idleCallback?: IdleCallbackTrait | null;
|
|
1002
|
+
persistentStorage?: StorageTrait | null;
|
|
1003
|
+
sessionStorage?: StorageTrait | null;
|
|
1004
|
+
router?: RouterTrait | null;
|
|
1005
|
+
pageLifecycle?: PageLifecycleTrait | null;
|
|
1006
|
+
popup?: PopupTrait | null;
|
|
1007
|
+
validators?: EnvironmentValidators;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Create a `FoundationEnvironment` from explicit trait units and defaults.
|
|
1011
|
+
*
|
|
1012
|
+
* This helper owns foundation-wide baseline resolution and trait-graph wiring.
|
|
1013
|
+
*
|
|
1014
|
+
* It may resolve:
|
|
1015
|
+
* - public std adapters such as
|
|
1016
|
+
* `transportForStdFetchCreateOptions -> transport` and `timeForStdCreateOptions -> time`
|
|
1017
|
+
* - public hostless baseline constructors such as
|
|
1018
|
+
* `spanCreateOptions -> span` and `tracingCreateOptions -> tracing`
|
|
1019
|
+
*
|
|
1020
|
+
* Host-material discovery such as resolving `window`, `location`, `history`,
|
|
1021
|
+
* or browser storage handles belongs to explicit host adapters such as
|
|
1022
|
+
* `@securitydept/client/web`, which must first resolve those inputs into
|
|
1023
|
+
* concrete traits before calling this helper.
|
|
1024
|
+
*/
|
|
1025
|
+
declare function createFoundationEnvironment(overrides: CreateFoundationEnvironmentOptions): FoundationEnvironment;
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region src/auth-coordination/contract.d.ts
|
|
1028
|
+
interface AuthRequirement {
|
|
1029
|
+
/** Unique entity id for this requirement within the plan. */
|
|
1030
|
+
readonly id: string;
|
|
1031
|
+
/** Human-readable label (for logging / debugging). */
|
|
1032
|
+
readonly label?: string;
|
|
1033
|
+
}
|
|
1034
|
+
interface StaticAttrsAuthRequirementInput<TAttributes = Record<string, unknown>> {
|
|
1035
|
+
readonly id?: string;
|
|
1036
|
+
readonly label?: string;
|
|
1037
|
+
readonly attributes?: TAttributes;
|
|
1038
|
+
}
|
|
1039
|
+
declare class StaticAttrsAuthRequirement<TAttributes = Record<string, unknown>> implements AuthRequirement {
|
|
1040
|
+
readonly id: string;
|
|
1041
|
+
readonly label: string | undefined;
|
|
1042
|
+
readonly attributes: TAttributes | undefined;
|
|
1043
|
+
protected constructor(id: string, label: string | undefined, attributes: TAttributes | undefined);
|
|
1044
|
+
static create<TAttributes = Record<string, unknown>>(input?: StaticAttrsAuthRequirementInput<TAttributes>): StaticAttrsAuthRequirement<TAttributes>;
|
|
1045
|
+
static createList<TAttributes = Record<string, unknown>>(inputs: readonly StaticAttrsAuthRequirementInput<TAttributes>[]): readonly StaticAttrsAuthRequirement<TAttributes>[];
|
|
1046
|
+
}
|
|
1047
|
+
/** Outcome of resolving a single requirement. */
|
|
1048
|
+
declare const ResolutionStatus: {
|
|
1049
|
+
readonly Fulfilled: "fulfilled";
|
|
1050
|
+
readonly Failed: "failed";
|
|
1051
|
+
readonly Skipped: "skipped";
|
|
1052
|
+
};
|
|
1053
|
+
type ResolutionStatus = (typeof ResolutionStatus)[keyof typeof ResolutionStatus];
|
|
1054
|
+
/** The resolution result for a single requirement. */
|
|
1055
|
+
interface RequirementResolution {
|
|
1056
|
+
/** The requirement ID this resolution applies to. */
|
|
1057
|
+
requirementId: string;
|
|
1058
|
+
/** Outcome status. */
|
|
1059
|
+
status: ResolutionStatus;
|
|
1060
|
+
/** Optional error or reason for failure/skip. */
|
|
1061
|
+
reason?: string;
|
|
1062
|
+
}
|
|
1063
|
+
/** Overall plan status. */
|
|
1064
|
+
declare const PlanStatus: {
|
|
1065
|
+
/** There are still pending requirements. */
|
|
1066
|
+
readonly Pending: "pending";
|
|
1067
|
+
/** All requirements have been resolved. */
|
|
1068
|
+
readonly Settled: "settled";
|
|
1069
|
+
};
|
|
1070
|
+
type PlanStatus = (typeof PlanStatus)[keyof typeof PlanStatus];
|
|
1071
|
+
/** Error thrown when a planner contract is violated (e.g. duplicate ids). */
|
|
1072
|
+
declare class RequirementPlannerError extends Error {
|
|
1073
|
+
constructor(message: string);
|
|
1074
|
+
}
|
|
1075
|
+
/** Result of an authentication check. */
|
|
1076
|
+
type AuthenticatedCheck = boolean | Promise<boolean>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Return value of an unauthenticated handler.
|
|
1079
|
+
*
|
|
1080
|
+
* - `true` — the requirement is now satisfied (resolved as fulfilled);
|
|
1081
|
+
* the pipeline records the resolution and may continue.
|
|
1082
|
+
* - `false` — block: the requirement cannot proceed.
|
|
1083
|
+
* - `string` — redirect to the given location.
|
|
1084
|
+
* - A never-settling `Promise` — used when a full-page external redirect has
|
|
1085
|
+
* started; the step intentionally never resolves so the host navigation is
|
|
1086
|
+
* not finalized while the page is leaving.
|
|
1087
|
+
*/
|
|
1088
|
+
type UnauthenticatedAction = boolean | string | Promise<boolean | string>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Behaviour evaluation context handed to every behaviour callback.
|
|
1091
|
+
*
|
|
1092
|
+
* Reflects the planner state at the moment the callback is invoked.
|
|
1093
|
+
*/
|
|
1094
|
+
type RequirementBehaviourContext<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = {
|
|
1095
|
+
readonly planContext: TPlanContext;
|
|
1096
|
+
readonly environment: FoundationEnvironment;
|
|
1097
|
+
/** The full effective requirement list for the active plan. */
|
|
1098
|
+
readonly requirements: readonly TAuthRequirement[];
|
|
1099
|
+
/** Resolutions collected so far (in requirement order). */
|
|
1100
|
+
readonly resolutionList: readonly RequirementResolution[];
|
|
1101
|
+
};
|
|
1102
|
+
/** Stream of unauthenticated requirements discovered by the planner. */
|
|
1103
|
+
type RequirementCandidateGenerator<TAuthRequirement extends AuthRequirement = AuthRequirement> = AsyncGenerator<TAuthRequirement, void, unknown>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Context handed to candidate selection.
|
|
1106
|
+
*
|
|
1107
|
+
* `candidateList` is intentionally a stream: selectors that can act on the
|
|
1108
|
+
* first available unauthenticated requirement do not need to wait for all
|
|
1109
|
+
* checks to complete, while chooser-style selectors can still collect the full
|
|
1110
|
+
* stream with `for await`.
|
|
1111
|
+
*/
|
|
1112
|
+
type RequirementCandidateSelectionContext<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = RequirementBehaviourContext<TAuthRequirement, TPlanContext> & {
|
|
1113
|
+
/** Requirements not yet satisfied, yielded as their checks complete. */
|
|
1114
|
+
readonly candidateList: RequirementCandidateGenerator<TAuthRequirement>;
|
|
1115
|
+
};
|
|
1116
|
+
/** Decide whether a single requirement is already satisfied. */
|
|
1117
|
+
type CheckAuthenticated<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (requirement: TAuthRequirement, context: RequirementBehaviourContext<TAuthRequirement, TPlanContext>) => AuthenticatedCheck;
|
|
1118
|
+
/** Decide what to do when a selected requirement is unauthenticated. */
|
|
1119
|
+
type OnUnauthenticated<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (requirement: TAuthRequirement, context: RequirementBehaviourContext<TAuthRequirement, TPlanContext>) => UnauthenticatedAction;
|
|
1120
|
+
/**
|
|
1121
|
+
* Reduce the candidate set to the single requirement to act on next.
|
|
1122
|
+
*
|
|
1123
|
+
* The default strategy picks the first unauthenticated candidate yielded by the
|
|
1124
|
+
* stream. Chooser-style strategies may collect the full stream when they need
|
|
1125
|
+
* a complete candidate set.
|
|
1126
|
+
*/
|
|
1127
|
+
type SelectCandidate<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (context: RequirementCandidateSelectionContext<TAuthRequirement, TPlanContext>) => TAuthRequirement | undefined | Promise<TAuthRequirement | undefined>;
|
|
1128
|
+
/** The full behaviour contract resolved by a planner host. */
|
|
1129
|
+
interface RequirementBehaviour<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> {
|
|
1130
|
+
checkAuthenticated: CheckAuthenticated<TAuthRequirement, TPlanContext>;
|
|
1131
|
+
onUnauthenticated: OnUnauthenticated<TAuthRequirement, TPlanContext>;
|
|
1132
|
+
selectCandidate: SelectCandidate<TAuthRequirement, TPlanContext>;
|
|
1133
|
+
}
|
|
1134
|
+
interface RouteStateSnapshotTrait {
|
|
1135
|
+
readonly url: string;
|
|
1136
|
+
}
|
|
1137
|
+
interface RouteBehaviourContextExtra {
|
|
1138
|
+
readonly routeState: RouteStateSnapshotTrait;
|
|
1139
|
+
}
|
|
1140
|
+
declare function isRouteStateSnapshotTrait(value: unknown): value is RouteStateSnapshotTrait;
|
|
1141
|
+
declare function isRouteBehaviourContextExtra(value: unknown): value is RouteBehaviourContextExtra;
|
|
1142
|
+
type RequirementBehaviourWithRouteContext<TAuthRequirement extends AuthRequirement = AuthRequirement> = RequirementBehaviour<TAuthRequirement, RouteBehaviourContextExtra>;
|
|
1143
|
+
/** Outcome of a pipeline step or run. */
|
|
1144
|
+
declare const PipelineOutcome: {
|
|
1145
|
+
/** No candidates remain — the plan is satisfied. */
|
|
1146
|
+
readonly Settled: "settled";
|
|
1147
|
+
/** A candidate was resolved as fulfilled; more may remain. */
|
|
1148
|
+
readonly Resolved: "resolved";
|
|
1149
|
+
/** A candidate's handler blocked progress. */
|
|
1150
|
+
readonly Blocked: "blocked";
|
|
1151
|
+
/** A candidate's handler requested a redirect. */
|
|
1152
|
+
readonly Redirect: "redirect";
|
|
1153
|
+
};
|
|
1154
|
+
type PipelineOutcome = (typeof PipelineOutcome)[keyof typeof PipelineOutcome];
|
|
1155
|
+
/** Result of a single {@link BaseRequirementPlanner.runStep}. */
|
|
1156
|
+
type PipelineStepResult<TAuthRequirement extends AuthRequirement = AuthRequirement> = {
|
|
1157
|
+
outcome: typeof PipelineOutcome.Settled;
|
|
1158
|
+
} | {
|
|
1159
|
+
outcome: typeof PipelineOutcome.Resolved;
|
|
1160
|
+
requirement: TAuthRequirement;
|
|
1161
|
+
} | {
|
|
1162
|
+
outcome: typeof PipelineOutcome.Blocked;
|
|
1163
|
+
requirement: TAuthRequirement;
|
|
1164
|
+
} | {
|
|
1165
|
+
outcome: typeof PipelineOutcome.Redirect;
|
|
1166
|
+
requirement: TAuthRequirement;
|
|
1167
|
+
location: string;
|
|
1168
|
+
};
|
|
1169
|
+
/** Result of {@link BaseRequirementPlanner.runUntilSettled}. */
|
|
1170
|
+
type PipelineRunResult<TAuthRequirement extends AuthRequirement = AuthRequirement> = {
|
|
1171
|
+
outcome: typeof PipelineOutcome.Settled;
|
|
1172
|
+
resolutions: readonly RequirementResolution[];
|
|
1173
|
+
} | {
|
|
1174
|
+
outcome: typeof PipelineOutcome.Blocked;
|
|
1175
|
+
requirement: TAuthRequirement;
|
|
1176
|
+
} | {
|
|
1177
|
+
outcome: typeof PipelineOutcome.Redirect;
|
|
1178
|
+
requirement: TAuthRequirement;
|
|
1179
|
+
location: string;
|
|
1180
|
+
};
|
|
1181
|
+
/**
|
|
1182
|
+
* How a route segment's requirements compose with the inherited parent chain.
|
|
1183
|
+
*
|
|
1184
|
+
* - `inherit` — keep the parent requirements unchanged (segment adds nothing)
|
|
1185
|
+
* - `merge` — inherit parent requirements, then append/override with the
|
|
1186
|
+
* segment's own (same-id entries replace the parent's)
|
|
1187
|
+
* - `replace` — discard the parent chain, use only the segment's requirements
|
|
1188
|
+
*/
|
|
1189
|
+
declare const RequirementsComposition: {
|
|
1190
|
+
readonly Inherit: "inherit";
|
|
1191
|
+
readonly Merge: "merge";
|
|
1192
|
+
readonly Replace: "replace";
|
|
1193
|
+
};
|
|
1194
|
+
type RequirementsComposition = (typeof RequirementsComposition)[keyof typeof RequirementsComposition];
|
|
1195
|
+
/** A single node in a matched route chain. */
|
|
1196
|
+
interface RouteTreeSegment<TAuthRequirement extends AuthRequirement = AuthRequirement> {
|
|
1197
|
+
/** Route segment identifier (e.g. route name or path pattern). */
|
|
1198
|
+
routeId: string;
|
|
1199
|
+
/** Auth requirements declared on this route segment. */
|
|
1200
|
+
requirements: readonly TAuthRequirement[];
|
|
1201
|
+
/** Composition strategy against the inherited chain. Defaults to `merge`. */
|
|
1202
|
+
composition?: RequirementsComposition;
|
|
1203
|
+
}
|
|
1204
|
+
/** A requirements declaration annotated with its composition strategy. */
|
|
1205
|
+
interface RouteRequirementsDeclaration<TAuthRequirement extends AuthRequirement = AuthRequirement> {
|
|
1206
|
+
composition: RequirementsComposition;
|
|
1207
|
+
requirements: readonly TAuthRequirement[];
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Apply a route requirements declaration onto an effective requirement map.
|
|
1211
|
+
*
|
|
1212
|
+
* Reuse `effective` across a route chain so merge/replace fold in O(total
|
|
1213
|
+
* requirements) without rebuilding parent state each segment. When omitted, a
|
|
1214
|
+
* fresh map is created for one-shot composition.
|
|
1215
|
+
*/
|
|
1216
|
+
declare function resolveEffectiveRequirements<TAuthRequirement extends AuthRequirement = AuthRequirement>(child: RouteRequirementsDeclaration<TAuthRequirement>, effective?: Map<string, TAuthRequirement>): Map<string, TAuthRequirement>;
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region src/auth-coordination/planner-host.d.ts
|
|
1219
|
+
declare const REQUIREMENT_PLANNER_HOST: SecuritydeptInjectionToken<RequirementPlannerHost<unknown>>;
|
|
1220
|
+
type RequirementPlannerHostBehaviour<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> = TBehaviour | (() => TBehaviour);
|
|
1221
|
+
interface ProvideRequirementPlannerHostOptions<TBehaviour = Partial<RequirementBehaviour>> {
|
|
1222
|
+
readonly parent?: RequirementPlannerHost<TBehaviour>;
|
|
1223
|
+
readonly environment?: FoundationEnvironment;
|
|
1224
|
+
}
|
|
1225
|
+
interface InjectRequirementPlannerHostOptions {
|
|
1226
|
+
readonly injector: SecuritydeptInjectorTrait;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Default candidate selector: first unauthenticated candidate as soon as it is
|
|
1230
|
+
* discovered.
|
|
1231
|
+
*
|
|
1232
|
+
* If every requirement is already fulfilled the stream completes and the
|
|
1233
|
+
* selector returns `undefined`.
|
|
1234
|
+
*/
|
|
1235
|
+
declare function defaultSelectCandidate<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}>(): SelectCandidate<TAuthRequirement, TPlanContext>;
|
|
1236
|
+
/** Options for {@link RequirementPlannerHost.fromBehaviour}. */
|
|
1237
|
+
interface RequirementPlannerHostOptions<TRequirementBehaviour = Partial<RequirementBehaviour>> {
|
|
1238
|
+
/** Parent host to inherit unspecified behaviour from. */
|
|
1239
|
+
parent?: RequirementPlannerHost<TRequirementBehaviour>;
|
|
1240
|
+
environment?: FoundationEnvironment;
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* A coordination-scope host that resolves behaviour through a parent chain.
|
|
1244
|
+
*
|
|
1245
|
+
* Construct via {@link RequirementPlannerHost.fromBehaviour}. Each behaviour
|
|
1246
|
+
* field is optional at host construction time; missing required behaviour is
|
|
1247
|
+
* resolved from `parent` and fails fast during planner build if no host in the
|
|
1248
|
+
* chain provides it.
|
|
1249
|
+
*
|
|
1250
|
+
* @example
|
|
1251
|
+
* ```ts
|
|
1252
|
+
* const root = RequirementPlannerHost.fromBehaviour({
|
|
1253
|
+
* checkAuthenticated: (req) => isAuthenticated(req),
|
|
1254
|
+
* onUnauthenticated: (req) => `/login/${req.id}`,
|
|
1255
|
+
* });
|
|
1256
|
+
*
|
|
1257
|
+
* // Feature scope overrides only the chooser, inheriting the rest.
|
|
1258
|
+
* const feature = RequirementPlannerHost.fromBehaviour(
|
|
1259
|
+
* { selectCandidate: async (ctx) => showChooser(ctx.candidateList) },
|
|
1260
|
+
* { parent: root },
|
|
1261
|
+
* );
|
|
1262
|
+
* ```
|
|
1263
|
+
*/
|
|
1264
|
+
declare class RequirementPlannerHost<TBehaviour = Partial<RequirementBehaviour>> {
|
|
1265
|
+
readonly environment: FoundationEnvironment | undefined;
|
|
1266
|
+
readonly parent: RequirementPlannerHost<TBehaviour> | undefined;
|
|
1267
|
+
/** The parent host, or undefined at the root. */
|
|
1268
|
+
private readonly _behaviour;
|
|
1269
|
+
protected constructor(behaviour: TBehaviour, environment: FoundationEnvironment | undefined, parent: RequirementPlannerHost<TBehaviour> | undefined);
|
|
1270
|
+
/** Create a host scope from a partial behaviour and optional parent. */
|
|
1271
|
+
static fromBehaviour<TBehaviour = Partial<RequirementBehaviour>>(behaviour: TBehaviour, options?: RequirementPlannerHostOptions<TBehaviour>): RequirementPlannerHost<TBehaviour>;
|
|
1272
|
+
resolveBehaviourOptionFor<K extends keyof TBehaviour>(key: K): Promise<TBehaviour[K] | undefined>;
|
|
1273
|
+
resolveBehaviourFor<K extends keyof TBehaviour>(key: K, defaultValue: () => NonNullable<TBehaviour[K]> | Promise<NonNullable<TBehaviour[K]>>): Promise<NonNullable<TBehaviour[K]>>;
|
|
1274
|
+
resolveEnvironmentOption(): Promise<FoundationEnvironment | undefined>;
|
|
1275
|
+
resolveEnvironment(defaultValue: () => FoundationEnvironment | Promise<FoundationEnvironment>): Promise<FoundationEnvironment>;
|
|
1276
|
+
}
|
|
1277
|
+
declare function provideRequirementPlannerHost<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(behaviour: RequirementPlannerHostBehaviour<TAuthRequirement, TPlanContext, TBehaviour>, options?: ProvideRequirementPlannerHostOptions<TBehaviour>): SecuritydeptProvider<RequirementPlannerHost<TBehaviour>>;
|
|
1278
|
+
declare function injectRequirementPlannerHost<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(options: InjectRequirementPlannerHostOptions): RequirementPlannerHost<TBehaviour> | null;
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region src/auth-coordination/planner/base-planner.d.ts
|
|
1281
|
+
/**
|
|
1282
|
+
* Mutable pipeline state for one run: bound behaviour plus requirement list
|
|
1283
|
+
* and evolving resolutions.
|
|
1284
|
+
*/
|
|
1285
|
+
interface RequirementPlan<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> extends Readonly<RequirementBehaviour<TAuthRequirement, TPlanContext>> {
|
|
1286
|
+
readonly planContext: TPlanContext;
|
|
1287
|
+
readonly environment: FoundationEnvironment;
|
|
1288
|
+
readonly requirements: readonly TAuthRequirement[];
|
|
1289
|
+
resolutionList: RequirementResolution[];
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Abstract base for all requirement planners.
|
|
1293
|
+
*
|
|
1294
|
+
* Subclasses supply requirements via {@link buildRequirementList}. Pipeline
|
|
1295
|
+
* state lives on {@link RequirementPlan}, produced by {@link buildPlan}.
|
|
1296
|
+
*/
|
|
1297
|
+
declare abstract class BaseRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> {
|
|
1298
|
+
protected readonly host: RequirementPlannerHost<TBehaviour>;
|
|
1299
|
+
protected initialResolutions: readonly RequirementResolution[];
|
|
1300
|
+
abstract get planContext(): TPlanContext;
|
|
1301
|
+
protected constructor(host: RequirementPlannerHost<TBehaviour>, initialResolutions?: readonly RequirementResolution[]);
|
|
1302
|
+
/**
|
|
1303
|
+
* Pipeline step 0: resolve host behaviour and materialize requirements into
|
|
1304
|
+
* a {@link RequirementPlan}.
|
|
1305
|
+
*
|
|
1306
|
+
* Behaviour and the requirement list stay fixed on the returned plan until
|
|
1307
|
+
* the next `buildPlan()` call. Resolve host parent chains (and any
|
|
1308
|
+
* injection-context capture) here — not between async steps.
|
|
1309
|
+
*/
|
|
1310
|
+
buildPlan(): Promise<RequirementPlan<TAuthRequirement, TPlanContext>>;
|
|
1311
|
+
/**
|
|
1312
|
+
* Return the effective requirement map for this planner.
|
|
1313
|
+
*
|
|
1314
|
+
* Keys are requirement ids; {@link Map} insertion order defines evaluation
|
|
1315
|
+
* order. Subclasses own deduplication policy when folding multiple sources.
|
|
1316
|
+
*/
|
|
1317
|
+
protected abstract buildRequirementList(): Map<string, TAuthRequirement> | Promise<Map<string, TAuthRequirement>>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Materialize the effective requirement list (also invoked by {@link buildPlan}).
|
|
1320
|
+
*/
|
|
1321
|
+
resolveRequirementList(): Promise<readonly TAuthRequirement[]>;
|
|
1322
|
+
/**
|
|
1323
|
+
* Pipeline step 1 — one loop iteration: select a candidate, run
|
|
1324
|
+
* `onUnauthenticated`, then reduce `plan` state.
|
|
1325
|
+
*/
|
|
1326
|
+
runStep(plan: RequirementPlan<TAuthRequirement, TPlanContext>): Promise<PipelineStepResult<TAuthRequirement>>;
|
|
1327
|
+
protected reduceFromAction(plan: RequirementPlan<TAuthRequirement, TPlanContext>, candidate: TAuthRequirement, action: Exclude<UnauthenticatedAction, Promise<unknown>>): PipelineStepResult<TAuthRequirement>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Run the full pipeline: {@link buildPlan}, step 1, then loop step 2 until
|
|
1330
|
+
* settled or a terminal outcome (`blocked`, `redirect`, or a never-settling
|
|
1331
|
+
* action).
|
|
1332
|
+
*/
|
|
1333
|
+
runUntilSettled(): Promise<PipelineRunResult<TAuthRequirement>>;
|
|
1334
|
+
runUntilSettledWithPlan(plan: RequirementPlan<TAuthRequirement, TPlanContext>): Promise<PipelineRunResult<TAuthRequirement>>;
|
|
1335
|
+
private createCandidateStream;
|
|
1336
|
+
private recordFulfilled;
|
|
1337
|
+
}
|
|
1338
|
+
//#endregion
|
|
1339
|
+
//#region src/auth-coordination/planner/merge-planner.d.ts
|
|
1340
|
+
/**
|
|
1341
|
+
* A planner whose effective requirements are the ordered union of its source
|
|
1342
|
+
* planners. Overlapping ids follow Map semantics (later source wins).
|
|
1343
|
+
*
|
|
1344
|
+
* @example
|
|
1345
|
+
* ```ts
|
|
1346
|
+
* const planner = MergeRequirementPlanner.fromPlanners(host, [
|
|
1347
|
+
* sessionPlanner,
|
|
1348
|
+
* oidcPlanner,
|
|
1349
|
+
* ]);
|
|
1350
|
+
* ```
|
|
1351
|
+
*/
|
|
1352
|
+
declare class MergeRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> extends BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour> {
|
|
1353
|
+
private readonly sources;
|
|
1354
|
+
get planContext(): TPlanContext;
|
|
1355
|
+
protected constructor(host: RequirementPlannerHost<TBehaviour>, sources: readonly BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>[]);
|
|
1356
|
+
/** Create a merge planner from an ordered list of source planners. */
|
|
1357
|
+
static fromPlanners<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(host: RequirementPlannerHost<TBehaviour>, planners: readonly BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>[]): MergeRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>;
|
|
1358
|
+
protected buildRequirementList(): Promise<Map<string, TAuthRequirement>>;
|
|
1359
|
+
}
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region src/auth-coordination/planner/route-composition-planner.d.ts
|
|
1362
|
+
/**
|
|
1363
|
+
* A planner driven by a matched route chain with composition semantics.
|
|
1364
|
+
*
|
|
1365
|
+
* Construct via {@link fromRouteSegments} for a matched route chain, or
|
|
1366
|
+
* {@link fromRouteTransition} for a transition that preserves shared-prefix
|
|
1367
|
+
* resolutions from the previous planner instance.
|
|
1368
|
+
*/
|
|
1369
|
+
declare class RouteCompositionRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>> extends BaseRequirementPlanner<TAuthRequirement, RouteBehaviourContextExtra, TBehaviour> {
|
|
1370
|
+
private readonly _segments;
|
|
1371
|
+
private readonly _effective;
|
|
1372
|
+
private readonly _planContext;
|
|
1373
|
+
protected constructor(host: RequirementPlannerHost<TBehaviour>, segments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait, preservedResolutions?: readonly RequirementResolution[]);
|
|
1374
|
+
/** Build a planner from a matched route chain. */
|
|
1375
|
+
static fromRouteSegments<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, segments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait): RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Build a planner for a route transition, preserving resolutions for the
|
|
1378
|
+
* shared requirement prefix carried over from `previousPlan`.
|
|
1379
|
+
*/
|
|
1380
|
+
static fromRouteTransition<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, currentSegments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait, previousPlanner: RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>, previousPlan: RequirementPlan<TAuthRequirement, RouteBehaviourContextExtra>): RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>;
|
|
1381
|
+
get planContext(): RouteBehaviourContextExtra;
|
|
1382
|
+
/** The matched route chain backing this planner. */
|
|
1383
|
+
get segments(): readonly RouteTreeSegment<TAuthRequirement>[];
|
|
1384
|
+
/** The folded effective requirement list (composition applied). */
|
|
1385
|
+
get effectiveRequirements(): readonly TAuthRequirement[];
|
|
1386
|
+
protected buildRequirementList(): Map<string, TAuthRequirement>;
|
|
1387
|
+
}
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/auth-coordination/planner/static-planner.d.ts
|
|
1390
|
+
/**
|
|
1391
|
+
* A planner whose effective requirement list is a fixed array supplied at
|
|
1392
|
+
* construction time.
|
|
1393
|
+
*
|
|
1394
|
+
* @example
|
|
1395
|
+
* ```ts
|
|
1396
|
+
* const planner = StaticRequirementPlanner.fromRequirements(host, [
|
|
1397
|
+
* StaticAttrsAuthRequirement.create({ id: "session" }),
|
|
1398
|
+
* ] as Readonly<AuthRequirement[]>);
|
|
1399
|
+
* const plan = await planner.buildPlan();
|
|
1400
|
+
* const step = await planner.runStep(plan);
|
|
1401
|
+
* // or: const result = await planner.runUntilSettled();
|
|
1402
|
+
* ```
|
|
1403
|
+
*/
|
|
1404
|
+
declare class StaticRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement>> = Partial<RequirementBehaviour<TAuthRequirement>>> extends BaseRequirementPlanner<TAuthRequirement, {}, TBehaviour> {
|
|
1405
|
+
private readonly staticRequirements;
|
|
1406
|
+
get planContext(): {};
|
|
1407
|
+
protected constructor(host: RequirementPlannerHost<TBehaviour>, requirements: readonly TAuthRequirement[]);
|
|
1408
|
+
/** Create a static planner from an ordered requirement list. */
|
|
1409
|
+
static fromRequirements<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement>> = Partial<RequirementBehaviour<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, requirements: readonly TAuthRequirement[]): StaticRequirementPlanner<TAuthRequirement, TBehaviour>;
|
|
1410
|
+
protected buildRequirementList(): Map<string, TAuthRequirement>;
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1413
|
+
//#region src/identity/contracts.d.ts
|
|
1414
|
+
interface IdentityPrincipal {
|
|
1415
|
+
subject: string;
|
|
1416
|
+
displayName: string;
|
|
1417
|
+
picture?: string;
|
|
1418
|
+
issuer?: string;
|
|
1419
|
+
claims?: Record<string, unknown>;
|
|
1420
|
+
}
|
|
1421
|
+
interface ProjectIdentityPrincipalOptions {
|
|
1422
|
+
principal?: IdentityPrincipal | null;
|
|
1423
|
+
fallbackDisplayName?: string;
|
|
1424
|
+
fallbackSubject?: string;
|
|
1425
|
+
fallbackIssuer?: string;
|
|
1426
|
+
fallbackClaims?: Record<string, unknown>;
|
|
1427
|
+
}
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/identity/parsers.d.ts
|
|
1430
|
+
declare function parseIdentityPrincipal(input: unknown): IdentityPrincipal;
|
|
1431
|
+
declare function parseIdentityPrincipalWire(input: unknown): IdentityPrincipal;
|
|
1432
|
+
declare function projectIdentityPrincipal(options: ProjectIdentityPrincipalOptions): IdentityPrincipal;
|
|
1433
|
+
//#endregion
|
|
1434
|
+
//#region src/identity/schemas.d.ts
|
|
1435
|
+
declare const IdentityPrincipalSchema: import("arktype/internal/variants/object.ts").ObjectType<(In: {
|
|
1436
|
+
subject: string;
|
|
1437
|
+
displayName?: string | null | undefined;
|
|
1438
|
+
picture?: string | null | undefined;
|
|
1439
|
+
issuer?: string | null | undefined;
|
|
1440
|
+
claims?: object | null | undefined;
|
|
1441
|
+
}) => import("arktype").Out<IdentityPrincipal>, {}>;
|
|
1442
|
+
declare const IdentityPrincipalWireSchema: import("arktype/internal/variants/object.ts").ObjectType<(In: {
|
|
1443
|
+
subject: string;
|
|
1444
|
+
display_name?: string | null | undefined;
|
|
1445
|
+
picture?: string | null | undefined;
|
|
1446
|
+
issuer?: string | null | undefined;
|
|
1447
|
+
claims?: object | null | undefined;
|
|
1448
|
+
}) => import("arktype").Out<IdentityPrincipal>, {}>;
|
|
1449
|
+
//#endregion
|
|
1450
|
+
//#region src/protocol/jwt/types.d.ts
|
|
1451
|
+
type JwtAudienceClaim = string | readonly string[];
|
|
1452
|
+
interface JwtClaimsSet extends Record<string, unknown> {
|
|
1453
|
+
iss?: string;
|
|
1454
|
+
sub?: string;
|
|
1455
|
+
aud?: JwtAudienceClaim;
|
|
1456
|
+
exp?: number;
|
|
1457
|
+
nbf?: number;
|
|
1458
|
+
iat?: number;
|
|
1459
|
+
jti?: string;
|
|
1460
|
+
}
|
|
1461
|
+
interface DecodeJwtPayloadOptions {
|
|
1462
|
+
/**
|
|
1463
|
+
* Optional label used in error messages. It does not affect parsing.
|
|
1464
|
+
*/
|
|
1465
|
+
label?: string;
|
|
1466
|
+
}
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region src/protocol/jwt/decode.d.ts
|
|
1469
|
+
declare function decodeJwtPayload(jwt: string, options?: DecodeJwtPayloadOptions): JwtClaimsSet;
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/protocol/jwt/error.d.ts
|
|
1472
|
+
declare const JwtDecodeErrorCode: {
|
|
1473
|
+
readonly InvalidFormat: "protocol.jwt.invalid_format";
|
|
1474
|
+
readonly InvalidPayload: "protocol.jwt.invalid_payload";
|
|
1475
|
+
readonly InvalidClaim: "protocol.jwt.invalid_claim";
|
|
1476
|
+
};
|
|
1477
|
+
type JwtDecodeErrorCode = (typeof JwtDecodeErrorCode)[keyof typeof JwtDecodeErrorCode];
|
|
1478
|
+
declare class JwtDecodeError extends ClientError {
|
|
1479
|
+
readonly code: JwtDecodeErrorCode;
|
|
1480
|
+
constructor(options: {
|
|
1481
|
+
code: JwtDecodeErrorCode;
|
|
1482
|
+
message: string;
|
|
1483
|
+
cause?: unknown;
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
//#endregion
|
|
1487
|
+
//#region src/scheduling/duration.d.ts
|
|
1488
|
+
/**
|
|
1489
|
+
* Parse a human-readable duration string (for example `5m` or `300s`) into
|
|
1490
|
+
* milliseconds.
|
|
1491
|
+
*/
|
|
1492
|
+
declare function parseDurationToMs(duration: string): number;
|
|
1493
|
+
//#endregion
|
|
1494
|
+
//#region src/span/span.d.ts
|
|
1495
|
+
declare function createRootSpan(options?: SpanCreateOptions & WithTraitInputValidator<TraitInputValidator>): SpanTrait;
|
|
1496
|
+
//#endregion
|
|
1497
|
+
//#region src/std/cancellation/abort-signal.d.ts
|
|
1498
|
+
/**
|
|
1499
|
+
* Bridge a web `AbortSignal` back into the foundation cancellation contract.
|
|
1500
|
+
*
|
|
1501
|
+
* This is the canonical consumer-side path for browser hosts that receive an
|
|
1502
|
+
* `AbortSignal` from framework/runtime APIs (for example React Query queryFns)
|
|
1503
|
+
* but need to call SDK surfaces that accept `CancellationTokenTrait`.
|
|
1504
|
+
*/
|
|
1505
|
+
declare function abortSignalToCancellationToken(signal: AbortSignal): CancellationTokenTrait;
|
|
1506
|
+
declare function abortSignalToCancellationToken(signal?: undefined): undefined;
|
|
1507
|
+
declare function abortSignalToCancellationToken(signal?: AbortSignal): CancellationTokenTrait | undefined;
|
|
1508
|
+
interface AbortSignalBridge extends DisposableTrait {
|
|
1509
|
+
signal?: AbortSignal;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Bridge foundation cancellation to `AbortSignal` without exposing
|
|
1513
|
+
* `AbortSignal` in core contracts.
|
|
1514
|
+
*/
|
|
1515
|
+
declare function cancellationTokenToAbortSignal(token: CancellationTokenTrait): AbortSignalBridge;
|
|
1516
|
+
declare function cancellationTokenToAbortSignal(token?: undefined): undefined;
|
|
1517
|
+
declare function cancellationTokenToAbortSignal(token?: CancellationTokenTrait): AbortSignalBridge | undefined;
|
|
1518
|
+
declare function normalizeAbortError(token: CancellationTokenTrait | undefined, error: unknown): unknown;
|
|
1519
|
+
//#endregion
|
|
1520
|
+
//#region src/storage/ephemeral-flow-store.d.ts
|
|
1521
|
+
interface CreateEphemeralFlowStoreOptions<T> {
|
|
1522
|
+
store: StorageTrait;
|
|
1523
|
+
key: string;
|
|
1524
|
+
codec?: Codec<T>;
|
|
1525
|
+
}
|
|
1526
|
+
interface CreateKeyedEphemeralFlowStoreOptions<T> {
|
|
1527
|
+
store: StorageTrait;
|
|
1528
|
+
keyPrefix: string;
|
|
1529
|
+
codec?: Codec<T>;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Create a typed ephemeral flow-state store backed by a low-level `StorageTrait`.
|
|
1533
|
+
*
|
|
1534
|
+
* Intended for short-lived browser/session coordination state such as pending
|
|
1535
|
+
* redirects or callback fragments.
|
|
1536
|
+
*/
|
|
1537
|
+
declare function createEphemeralFlowStore<T>(options: CreateEphemeralFlowStoreOptions<T>): EphemeralFlowStore<T>;
|
|
1538
|
+
/**
|
|
1539
|
+
* Create a typed keyed ephemeral flow-state store backed by a low-level
|
|
1540
|
+
* `StorageTrait`.
|
|
1541
|
+
*
|
|
1542
|
+
* Intended for short-lived browser/session coordination state where multiple
|
|
1543
|
+
* pending records must coexist and be consumed independently.
|
|
1544
|
+
*/
|
|
1545
|
+
declare function createKeyedEphemeralFlowStore<T>(options: CreateKeyedEphemeralFlowStoreOptions<T>): KeyedEphemeralFlowStore<T>;
|
|
1546
|
+
//#endregion
|
|
1547
|
+
//#region src/storage/json-codec.d.ts
|
|
1548
|
+
/** Default JSON codec. */
|
|
1549
|
+
declare function createJsonCodec<T>(): Codec<T>;
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/storage/memory-store.d.ts
|
|
1552
|
+
/** In-memory `SyncStorageTrait` — useful for realm state, tests, and SSR. */
|
|
1553
|
+
declare function createInMemoryRecordStore(): SyncStorageTrait;
|
|
1554
|
+
//#endregion
|
|
1555
|
+
//#region src/struct/async-lock.d.ts
|
|
1556
|
+
declare const OnceAsyncLockState: {
|
|
1557
|
+
readonly Init: "init";
|
|
1558
|
+
readonly Running: "running";
|
|
1559
|
+
readonly Success: "success";
|
|
1560
|
+
readonly Error: "error";
|
|
1561
|
+
};
|
|
1562
|
+
type OnceAsyncLockState = (typeof OnceAsyncLockState)[keyof typeof OnceAsyncLockState];
|
|
1563
|
+
type OnceAsyncLockInit = {
|
|
1564
|
+
readonly state: typeof OnceAsyncLockState.Init;
|
|
1565
|
+
readonly promise?: never;
|
|
1566
|
+
};
|
|
1567
|
+
type OnceAsyncLockRunning = {
|
|
1568
|
+
readonly state: typeof OnceAsyncLockState.Running;
|
|
1569
|
+
readonly promise: Promise<unknown>;
|
|
1570
|
+
};
|
|
1571
|
+
type OnceAsyncLockSuccess<T> = {
|
|
1572
|
+
readonly state: typeof OnceAsyncLockState.Success;
|
|
1573
|
+
readonly data: T;
|
|
1574
|
+
};
|
|
1575
|
+
type OnceAsyncLockError<E> = {
|
|
1576
|
+
readonly state: typeof OnceAsyncLockState.Error;
|
|
1577
|
+
readonly error: E;
|
|
1578
|
+
};
|
|
1579
|
+
type OnceAsyncLock<T, E> = OnceAsyncLockInit | OnceAsyncLockRunning | OnceAsyncLockSuccess<T> | OnceAsyncLockError<E>;
|
|
1580
|
+
type OnceAsyncLockCallable<F extends (...args: any[]) => PromiseLike<any>, E = unknown> = F & OnceAsyncLock<Awaited<ReturnType<F>>, E> & ReadableSignalTrait<OnceAsyncLock<Awaited<ReturnType<F>>, E>>;
|
|
1581
|
+
declare function createOnceAsyncLockCallable<F extends (...args: any[]) => PromiseLike<any>, E = unknown>(fn: F): OnceAsyncLockCallable<F, E>;
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region src/tracing/operation-runner.d.ts
|
|
1584
|
+
interface RunOperationEnvironment {
|
|
1585
|
+
environment: {
|
|
1586
|
+
time: TimestampProviderTrait;
|
|
1587
|
+
tracing: TracingTrait;
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
interface RunOperationOptionsBase extends RunOperationEnvironment {
|
|
1591
|
+
span: SpanTrait;
|
|
1592
|
+
name: string;
|
|
1593
|
+
target: string;
|
|
1594
|
+
fields?: Record<string, unknown>;
|
|
1595
|
+
idFactory?: () => string;
|
|
1596
|
+
normalizeError?: (error: unknown) => unknown;
|
|
1597
|
+
}
|
|
1598
|
+
interface RunOperationOptions<T> extends RunOperationOptionsBase {
|
|
1599
|
+
execute: (span: OperationSpanTrait) => T;
|
|
1600
|
+
}
|
|
1601
|
+
declare class OperationSpan implements OperationSpanTrait {
|
|
1602
|
+
private readonly _span;
|
|
1603
|
+
private readonly _environment;
|
|
1604
|
+
private readonly _name;
|
|
1605
|
+
private readonly _target;
|
|
1606
|
+
private constructor();
|
|
1607
|
+
static start(options: RunOperationOptionsBase): OperationSpan;
|
|
1608
|
+
get id(): string;
|
|
1609
|
+
get parent(): SpanTrait | undefined;
|
|
1610
|
+
get attributes(): Readonly<Record<string, unknown>>;
|
|
1611
|
+
fork(options: MutableSpanCreateOptions): MutableSpanTrait;
|
|
1612
|
+
fork(options?: SpanCreateOptions): SpanTrait;
|
|
1613
|
+
setAttributes(attributes: Record<string, unknown>): void;
|
|
1614
|
+
addEvent(name: string, fields?: Record<string, unknown>): void;
|
|
1615
|
+
recordError(error: unknown, fields?: Record<string, unknown>): void;
|
|
1616
|
+
recordStarted(): void;
|
|
1617
|
+
recordEnded(outcome: "succeeded" | "failed"): void;
|
|
1618
|
+
private _record;
|
|
1619
|
+
}
|
|
1620
|
+
declare function runOperation<T>(options: RunOperationOptions<T>): T;
|
|
1621
|
+
declare function runOperation<T>(options: RunOperationOptions<Promise<T>>): Promise<T>;
|
|
1622
|
+
//#endregion
|
|
1623
|
+
//#region src/tracing/operation-method.d.ts
|
|
1624
|
+
interface InstrumentMethodThisContext<TArgs extends unknown[]> {
|
|
1625
|
+
args: TArgs;
|
|
1626
|
+
methodName: string;
|
|
1627
|
+
}
|
|
1628
|
+
interface InstrumentMethodResolvedOptions extends Omit<RunOperationOptionsBase, "name"> {
|
|
1629
|
+
name?: string;
|
|
1630
|
+
}
|
|
1631
|
+
type InstrumentMethodThisResolver<TThis extends object, TArgs extends unknown[]> = (this: TThis, context: InstrumentMethodThisContext<TArgs>) => InstrumentMethodResolvedOptions;
|
|
1632
|
+
interface DefineInstrumentMethodDecoratorContext<TFactoryArgs extends unknown[]> {
|
|
1633
|
+
factoryArgs: TFactoryArgs;
|
|
1634
|
+
methodName: string;
|
|
1635
|
+
}
|
|
1636
|
+
type DefineInstrumentMethodDecoratorFactory<TFactoryArgs extends unknown[], TBaseThis extends object = object> = <TThis extends TBaseThis, TArgs extends unknown[]>(context: DefineInstrumentMethodDecoratorContext<TFactoryArgs>) => InstrumentMethodThisResolver<TThis, TArgs>;
|
|
1637
|
+
declare function defineInstrumentMethodDecorator<TFactoryArgs extends unknown[], TBaseThis extends object = object>(factory: DefineInstrumentMethodDecoratorFactory<TFactoryArgs, TBaseThis>): (...factoryArgs: TFactoryArgs) => <TThis extends TBaseThis, TArgs extends unknown[], TReturn>(target: (this: TThis, ...args: TArgs) => TReturn, context: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => TReturn>) => (this: TThis, ...args: TArgs) => TReturn;
|
|
1638
|
+
//#endregion
|
|
1639
|
+
//#region src/tracing/subscriber/console.d.ts
|
|
1640
|
+
declare function createConsoleTracingSubscriber(): TracingSubscriberTrait;
|
|
1641
|
+
//#endregion
|
|
1642
|
+
//#region src/tracing/subscriber/timeline-store.d.ts
|
|
1643
|
+
interface TraceTimelineEntry extends TracingEvent {
|
|
1644
|
+
id: number;
|
|
1645
|
+
recordedAtIso: string;
|
|
1646
|
+
}
|
|
1647
|
+
interface TraceTimelineStore extends TracingSubscriberTrait {
|
|
1648
|
+
get(): readonly TraceTimelineEntry[];
|
|
1649
|
+
subscribe(listener: () => void): () => void;
|
|
1650
|
+
clear(): void;
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* Create a subscriber-side trace timeline store.
|
|
1654
|
+
*
|
|
1655
|
+
* This store consumes tracing events through `record(event)` and keeps a
|
|
1656
|
+
* bounded local timeline for tests and UI surfaces. It is not the tracing
|
|
1657
|
+
* runtime itself.
|
|
1658
|
+
*/
|
|
1659
|
+
declare function createTraceTimelineStore(limit?: number): TraceTimelineStore;
|
|
1660
|
+
//#endregion
|
|
1661
|
+
//#region src/transport/url.d.ts
|
|
1662
|
+
/**
|
|
1663
|
+
* Returns `true` for loopback HTTP URLs that browsers and local tooling often
|
|
1664
|
+
* permit during development flows.
|
|
1665
|
+
*/
|
|
1666
|
+
declare function isLoopbackHttpUrl(url: URL): boolean;
|
|
1667
|
+
//#endregion
|
|
1668
|
+
export { ProvideRequirementPlannerHostOptions as $, appendOrReplaceCompatFragment as $n, createJsonRpcServerAndClient as $r, PersistentAuthStore as $t, cancellationTokenToAbortSignal as A, Base64CompatErrorCode as Ai, throwValidationClientError as An, readPopupErrorPresentationDescriptor as Ar, StaticAttrsAuthRequirementInput as At, IdentityPrincipalSchema as B, RouterNavigationMode as Bn, ResourceSnapshotUpdateKind as Br, ServiceWorkerEnvironment as Bt, OnceAsyncLockSuccess as C, abortSignalToEventStream as Ci, TraitInputValidator as Cn, PopupAttachResult as Cr, ResolutionStatus as Ct, createEphemeralFlowStore as D, PAGE_LIFECYCLE_TRAIT_TOKEN as Di, ValidationSuccess as Dn, CreatePopupClientSessionOptions as Dr, RouteTreeSegment as Dt, createJsonCodec as E, describeError as Ei, ValidationResult as En, PopupTrait as Er, RouteStateSnapshotTrait as Et, JwtDecodeErrorCode as F, SPAN_TRAIT_TOKEN as Fn, PopupServerWindowHandleTrait as Fr, CreateFoundationEnvironmentOptions as Ft, IdentityPrincipal as G, AppendOrReplaceCompatFragmentOptions as Gn, ResourceStreamContext as Gr, TRACING_TRAIT_TOKEN as Gt, parseIdentityPrincipal as H, RouterTrait as Hn, reduceResourceSnapshot as Hr, createTracing as Ht, decodeJwtPayload as I, SpanCreateOptions as In, PopupWindowHandleTrait as Ir, createFoundationEnvironment as It, RouteCompositionRequirementPlanner as J, CompatFragmentParameters as Jn, ResourceErrorCode as Jr, TracingTrait as Jt, ProjectIdentityPrincipalOptions as K, AppendOrReplaceCompatFragmentResult as Kn, createResource as Kr, TracingEvent as Kt, DecodeJwtPayloadOptions as L, SpanTrait as Ln, createSignal as Lr, ENVIRONMENT_TOKEN as Lt, createRootSpan as M, encodeUint8ArrayToBase64 as Mi, validateWithSchema as Mn, PopupClientWindowHandleTrait as Mr, isRouteBehaviourContextExtra as Mt, parseDurationToMs as N, SecuritydeptDestroyRef as Ni, validateWithSchemaSync as Nn, PopupMessageChannelTrait as Nr, isRouteStateSnapshotTrait as Nt, createKeyedEphemeralFlowStore as O, PageLifecycleTrait as Oi, WithTraitInputValidator as On, CreatePopupServerSessionOptions as Or, SelectCandidate as Ot, JwtDecodeError as P, createSecuritydeptDestroyRef as Pi, OperationSpanTrait as Pn, PopupServerWindowHandle as Pr, resolveEffectiveRequirements as Pt, InjectRequirementPlannerHostOptions as Q, UpdateUriFragmentHash as Qn, createJsonRpcServer as Qr, PERSISTENT_STORAGE_TRAIT_TOKEN as Qt, JwtAudienceClaim as R, ROUTER_TRAIT_TOKEN as Rn, readonlySignal as Rr, EnvironmentValidators as Rt, OnceAsyncLockState as S, createNeverEventStream as Si, createTimeForStd as Sn, PopupAttachFailureReason as Sr, RequirementsComposition as St, createInMemoryRecordStore as T, ErrorSummary as Ti, ValidationFailure as Tn, PopupOpenOptions as Tr, RouteRequirementsDeclaration as Tt, parseIdentityPrincipalWire as U, TakeCompatFragmentFromRouterOptions as Un, whenResourceSnapshotValue as Ur, TracingSubscriberTrait as Ut, IdentityPrincipalWireSchema as V, RouterNavigationRequest as Vn, flattenResourceSnapshot as Vr, TracingCreateOptions as Vt, projectIdentityPrincipal as W, takeCompatFragmentFromRouter as Wn, CreateResourceOptions as Wr, OperationTraceEventType as Wt, BaseRequirementPlanner as X, TakeCompatFragmentOptions as Xn, createComputed as Xr, EphemeralFlowStore as Xt, MergeRequirementPlanner as Y, SECURITYDEPT_COMPAT_FRAGMENT_VERSION as Yn, ResourceValueUnavailableErrorOptions as Yr, Codec as Yt, RequirementPlan as Z, TakeCompatFragmentResult as Zn, createJsonRpcClient as Zr, KeyedEphemeralFlowStore as Zt, OnceAsyncLock as _, toEventStream as _i, AuthorizationInterceptedFetchPredicate as _n, UriReferenceStringSchema as _r, RequirementBehaviourWithRouteContext as _t, createConsoleTracingSubscriber as a, JsonRpcErrorResponseMessage as ai, StorageTrait as an, UriReferenceString as ar, injectRequirementPlannerHost as at, OnceAsyncLockInit as b, createEventStream as bi, createAuthorizationInterceptedFetch as bn, POPUP_TRAIT_TOKEN as br, RequirementPlannerError as bt, InstrumentMethodResolvedOptions as c, JsonRpcNotificationEvent as ci, BaseTransportForStdFetchCreateOptions as cn, UriRelativeParts as cr, AuthenticatedCheck as ct, defineInstrumentMethodDecorator as d, JsonRpcRequestMessage as di, BaseTransportTrait as dn, UriString as dr, PipelineOutcome as dt, CreateJsonRpcClientOptions as ei, REALM_STORAGE_TRAIT_TOKEN as en, isCompatFragmentBlock as er, REQUIREMENT_PLANNER_HOST as et, OperationSpan as f, JsonRpcRequestOptions as fi, HttpRequest as fn, SECURITYDEPT_ROUTE_METADATA_KEY as fr, PipelineRunResult as ft, runOperation as g, ToEventStreamInput as gi, TransportErrorCode as gn, BaseURIStringSchema as gr, RequirementBehaviourContext as gt, RunOperationOptionsBase as h, JsonRpcSuccessResponseMessage as hi, TRANSPORT_TRAIT_TOKEN as hn, writeSecuritydeptRouteMetadata as hr, RequirementBehaviour as ht, createTraceTimelineStore as i, JsonRpcErrorPayload as ii, StorageChangeEventOrigin as in, UriParseError as ir, defaultSelectCandidate as it, normalizeAbortError as j, decodeBase64ToUint8Array as ji, validateTraitInput as jn, PopupClientWindowHandle as jr, UnauthenticatedAction as jt, abortSignalToCancellationToken as k, promisesToRacedAsyncGenerator as ki, formatValidationFailure as kn, PopupErrorCode as kr, StaticAttrsAuthRequirement as kt, InstrumentMethodThisContext as l, JsonRpcNotificationMessage as li, FetchTransportRedirectKind as ln, UriRelativeString as lr, CheckAuthenticated as lt, RunOperationOptions as m, JsonRpcServerTrait as mi, HttpResponseJsonBody as mn, readSecuritydeptRouteMetadata as mr, PlanStatus as mt, TraceTimelineEntry as n, CreateJsonRpcServerOptions as ni, SESSION_STORAGE_TRAIT_TOKEN as nn, takeCompatFragment as nr, RequirementPlannerHostBehaviour as nt, DefineInstrumentMethodDecoratorContext as o, JsonRpcId as oi, StoredEnvelope as on, UriReferenceStringInput as or, provideRequirementPlannerHost as ot, RunOperationEnvironment as p, JsonRpcServerAndClientTrait as pi, HttpResponse as pn, SecuritydeptRouteMetadata as pr, PipelineStepResult as pt, StaticRequirementPlanner as q, CompatFragment as qn, ResourceError as qr, TracingLevel as qt, TraceTimelineStore as r, JsonRpcClientTrait as ri, StorageChangeEvent as rn, UriFragmentPart as rr, RequirementPlannerHostOptions as rt, DefineInstrumentMethodDecoratorFactory as s, JsonRpcMessage as si, SyncStorageTrait as sn, UriReferenceStringLike as sr, AuthRequirement as st, isLoopbackHttpUrl as t, CreateJsonRpcServerAndClientOptions as ti, RecoverableStateStore as tn, parseCompatFragment as tr, RequirementPlannerHost as tt, InstrumentMethodThisResolver as u, JsonRpcRequestEvent as ui, createBaseTransportForStdFetch as un, UriSearchParamsInit as ur, OnUnauthenticated as ut, OnceAsyncLockCallable as v, createEmptyEventStream as vi, AuthorizationSignal as vn, UriRelativeStringSchema as vr, RequirementCandidateGenerator as vt, createOnceAsyncLockCallable as w, readErrorPresentationDescriptor as wi, ValidateTraitInputOptions as wn, PopupAttachSuccess as wr, RouteBehaviourContextExtra as wt, OnceAsyncLockRunning as x, createEventSubject as xi, TimeForStdCreateOptions as xn, PopupAttachFailure as xr, RequirementResolution as xt, OnceAsyncLockError as y, createEventReplaySubject as yi, CreateAuthorizationInterceptedFetchOptions as yn, UriStringSchema as yr, RequirementCandidateSelectionContext as yt, JwtClaimsSet as z, RouterNavigationIntent as zn, ResourceSnapshotUpdate as zr, FoundationEnvironment as zt };
|
|
1669
|
+
//# sourceMappingURL=index-DmIapvr-.d.mts.map
|