@orieljs/framework 0.1.0-alpha.2 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-HU43NADT.js +745 -0
- package/dist/chunk-HU43NADT.js.map +1 -0
- package/dist/chunk-I2OMKIQZ.js +4693 -0
- package/dist/chunk-I2OMKIQZ.js.map +1 -0
- package/dist/chunk-S7YC43IH.js +93 -0
- package/dist/chunk-S7YC43IH.js.map +1 -0
- package/dist/chunk-WEGTH46M.js +478 -0
- package/dist/chunk-WEGTH46M.js.map +1 -0
- package/dist/contracts.d.ts +31 -13
- package/dist/contracts.js +1 -1
- package/dist/index.d-DOlTeG-8.d.ts +99 -0
- package/dist/index.d.ts +53 -44
- package/dist/index.js +43 -4
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime-WKTl3EEw.d.ts +254 -0
- package/dist/jsx-runtime.d.ts +2 -1
- package/dist/jsx-runtime.js +3 -3
- package/dist/testing--F6FODc_.d.ts +2068 -0
- package/dist/testing.d.ts +3 -1553
- package/dist/testing.js +7 -3
- package/package.json +31 -29
|
@@ -0,0 +1,2068 @@
|
|
|
1
|
+
import { Token as Token$2 } from './contracts.js';
|
|
2
|
+
import { S as ServiceProvider$3, A as Application$2 } from './index.d-DOlTeG-8.js';
|
|
3
|
+
|
|
4
|
+
/** A typed, runtime-unique key for container bindings. */
|
|
5
|
+
interface Token$1<T> {
|
|
6
|
+
readonly id: symbol;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
/** Phantom field: only carries T at the type level. Never set at runtime. */
|
|
9
|
+
readonly __type?: T;
|
|
10
|
+
}
|
|
11
|
+
type Class$1<T> = abstract new (...args: any[]) => T;
|
|
12
|
+
type Abstract$1<T> = Token$1<T> | Class$1<T>;
|
|
13
|
+
type Factory$1<T> = (container: Container$1) => T;
|
|
14
|
+
type Concrete$1<T> = Factory$1<T> | (new () => T);
|
|
15
|
+
interface Container$1 {
|
|
16
|
+
/** New instance on every make(). A class with no concrete binds to itself (constructed with no args). Root only; throws on a scope. */
|
|
17
|
+
bind<T>(abstract: Abstract$1<T>, concrete?: Concrete$1<T>): void;
|
|
18
|
+
/** One instance for the life of this container and its scopes. Root only; throws on a scope. */
|
|
19
|
+
singleton<T>(abstract: Abstract$1<T>, concrete?: Concrete$1<T>): void;
|
|
20
|
+
/** One instance per scope (e.g. per HTTP request or queue job). Root only; throws on a scope. */
|
|
21
|
+
scoped<T>(abstract: Abstract$1<T>, concrete?: Concrete$1<T>): void;
|
|
22
|
+
/** Register an existing object as a shared instance. Returns it. On a scope it stays local to that scope. */
|
|
23
|
+
instance<T>(abstract: Abstract$1<T>, instance: T): T;
|
|
24
|
+
/** Resolve. Unbound classes are constructed with `new Class()`. Unbound tokens throw BindingResolutionError. */
|
|
25
|
+
make<T>(abstract: Abstract$1<T>): T;
|
|
26
|
+
bound(abstract: Abstract$1<unknown>): boolean;
|
|
27
|
+
resolved(abstract: Abstract$1<unknown>): boolean;
|
|
28
|
+
/** Decorate or replace an instance each time it's resolved (applied before resolving callbacks). Root only; throws on a scope. */
|
|
29
|
+
extend<T>(abstract: Abstract$1<T>, extender: (instance: T, container: Container$1) => T): void;
|
|
30
|
+
/** Called after each resolution of the abstract. Root only; throws on a scope. */
|
|
31
|
+
resolving<T>(abstract: Abstract$1<T>, callback: (instance: T, container: Container$1) => void): void;
|
|
32
|
+
forgetInstance(abstract: Abstract$1<unknown>): void;
|
|
33
|
+
/** A child container: shares bindings and singletons with its parent, and has its own scoped instances. Bindings can't be registered on it. */
|
|
34
|
+
createScope(): Container$1;
|
|
35
|
+
/** Run fn with this container as the "current" one for inject(), helpers and facades (AsyncLocalStorage). */
|
|
36
|
+
run<R>(fn: () => R): R;
|
|
37
|
+
}
|
|
38
|
+
declare const Container$1: Token$1<Container$1>;
|
|
39
|
+
|
|
40
|
+
interface ServiceProvider$2 {
|
|
41
|
+
/** Bind things into the container. Synchronous. Don't resolve other services here. */
|
|
42
|
+
register?(): void;
|
|
43
|
+
/** Runs after every provider is registered. May be async (e.g. importing route files). */
|
|
44
|
+
boot?(): void | Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
type ServiceProviderClass$1 = new (app: Application$1) => ServiceProvider$2;
|
|
47
|
+
interface Application$1 extends Container$1 {
|
|
48
|
+
readonly version: string;
|
|
49
|
+
basePath(path?: string): string;
|
|
50
|
+
appPath(path?: string): string;
|
|
51
|
+
bootstrapPath(path?: string): string;
|
|
52
|
+
configPath(path?: string): string;
|
|
53
|
+
databasePath(path?: string): string;
|
|
54
|
+
publicPath(path?: string): string;
|
|
55
|
+
resourcePath(path?: string): string;
|
|
56
|
+
storagePath(path?: string): string;
|
|
57
|
+
/** With no args returns the environment name. With args returns whether it matches any of them. */
|
|
58
|
+
environment(): string;
|
|
59
|
+
environment(...environments: string[]): boolean;
|
|
60
|
+
isProduction(): boolean;
|
|
61
|
+
isLocal(): boolean;
|
|
62
|
+
runningInConsole(): boolean;
|
|
63
|
+
/** Mark the app as running in the console (the CLI entry point calls this). Defaults to true. */
|
|
64
|
+
setRunningInConsole(value?: boolean): void;
|
|
65
|
+
runningUnitTests(): boolean;
|
|
66
|
+
/** Registers the provider. If the app is already booted, the provider is booted immediately. */
|
|
67
|
+
register(provider: ServiceProvider$2 | ServiceProviderClass$1): Promise<ServiceProvider$2>;
|
|
68
|
+
getProviders(): ServiceProvider$2[];
|
|
69
|
+
boot(): Promise<void>;
|
|
70
|
+
isBooted(): boolean;
|
|
71
|
+
booting(callback: (app: Application$1) => void | Promise<void>): void;
|
|
72
|
+
booted(callback: (app: Application$1) => void | Promise<void>): void;
|
|
73
|
+
/** Handle one HTTP request in a fresh request scope via the bound HttpKernel. */
|
|
74
|
+
handle(request: Request): Promise<Response>;
|
|
75
|
+
/** Register a callback that terminate() runs, in registration order. */
|
|
76
|
+
terminating(callback: () => void | Promise<void>): void;
|
|
77
|
+
terminate(): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
declare const Application$1: Token$2<Application$1>;
|
|
80
|
+
interface ExceptionHandler {
|
|
81
|
+
report(error: unknown): Promise<void>;
|
|
82
|
+
shouldReport(error: unknown): boolean;
|
|
83
|
+
/** `request` is the scoped HttpRequest (Contracts/Http) when available, else the raw Request. */
|
|
84
|
+
render(request: unknown, error: unknown): Promise<Response>;
|
|
85
|
+
}
|
|
86
|
+
declare const ExceptionHandler: Token$2<ExceptionHandler>;
|
|
87
|
+
|
|
88
|
+
interface Arrayable<T = unknown> {
|
|
89
|
+
toArray(): T;
|
|
90
|
+
}
|
|
91
|
+
interface Htmlable$1 {
|
|
92
|
+
toHtml(): string;
|
|
93
|
+
}
|
|
94
|
+
/** The minimal collection surface contracts rely on (implemented by @orieljs/collections). */
|
|
95
|
+
interface Enumerable<T> extends Iterable<T>, Arrayable<unknown[]> {
|
|
96
|
+
all(): T[];
|
|
97
|
+
count(): number;
|
|
98
|
+
isEmpty(): boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** The session of the current request (scoped). Loaded and saved by the StartSession middleware. */
|
|
102
|
+
interface Session$1 {
|
|
103
|
+
getId(): string;
|
|
104
|
+
start(): Promise<void>;
|
|
105
|
+
save(): Promise<void>;
|
|
106
|
+
all(): Record<string, unknown>;
|
|
107
|
+
has(key: string): boolean;
|
|
108
|
+
get<T = unknown>(key: string, defaultValue?: T): T;
|
|
109
|
+
put(key: string | Record<string, unknown>, value?: unknown): void;
|
|
110
|
+
push(key: string, value: unknown): void;
|
|
111
|
+
pull<T = unknown>(key: string, defaultValue?: T): T;
|
|
112
|
+
forget(...keys: string[]): void;
|
|
113
|
+
flush(): void;
|
|
114
|
+
flash(key: string, value: unknown): void;
|
|
115
|
+
now(key: string, value: unknown): void;
|
|
116
|
+
reflash(): void;
|
|
117
|
+
keep(...keys: string[]): void;
|
|
118
|
+
getOldInput<T = unknown>(key?: string, defaultValue?: T): T;
|
|
119
|
+
flashInput(input: Record<string, unknown>): void;
|
|
120
|
+
token(): string;
|
|
121
|
+
regenerateToken(): void;
|
|
122
|
+
regenerate(destroy?: boolean): Promise<void>;
|
|
123
|
+
invalidate(): Promise<void>;
|
|
124
|
+
previousUrl(): string | undefined;
|
|
125
|
+
setPreviousUrl(url: string): void;
|
|
126
|
+
}
|
|
127
|
+
declare const Session$1: Token$2<Session$1>;
|
|
128
|
+
interface UploadedFile$1 {
|
|
129
|
+
readonly clientName: string;
|
|
130
|
+
readonly mimeType: string;
|
|
131
|
+
readonly size: number;
|
|
132
|
+
extension(): string;
|
|
133
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
134
|
+
/** Stores on a Filesystem disk. Returns the stored path. */
|
|
135
|
+
store(directory: string, disk?: string): Promise<string>;
|
|
136
|
+
storeAs(directory: string, name: string, disk?: string): Promise<string>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface Encrypter {
|
|
140
|
+
/** JSON-serializes unless serialize=false (then value must be a string). AES-256-GCM, keyed by APP_KEY. */
|
|
141
|
+
encrypt(value: unknown, serialize?: boolean): string;
|
|
142
|
+
decrypt<T = unknown>(payload: string, unserialize?: boolean): T;
|
|
143
|
+
encryptString(value: string): string;
|
|
144
|
+
decryptString(payload: string): string;
|
|
145
|
+
getKey(): Uint8Array;
|
|
146
|
+
}
|
|
147
|
+
declare const Encrypter: Token$2<Encrypter>;
|
|
148
|
+
|
|
149
|
+
interface View extends Htmlable$1 {
|
|
150
|
+
readonly name: string;
|
|
151
|
+
with(key: string | Record<string, unknown>, value?: unknown): this;
|
|
152
|
+
render(): Promise<string>;
|
|
153
|
+
}
|
|
154
|
+
/** Resolves 'posts.index' → resources/views/posts/index.tsx and renders it to HTML on the server. */
|
|
155
|
+
interface ViewFactory {
|
|
156
|
+
make(name: string, data?: Record<string, unknown>): View;
|
|
157
|
+
exists(name: string): boolean;
|
|
158
|
+
share(key: string | Record<string, unknown>, value?: unknown): void;
|
|
159
|
+
composer(views: string | string[], composer: (view: View) => void | Promise<void>): void;
|
|
160
|
+
/** Renders TSX (an element, a string, an Htmlable, a View, promises of them) to HTML, like Blade::render(). */
|
|
161
|
+
renderToString(node: unknown): Promise<string>;
|
|
162
|
+
}
|
|
163
|
+
declare const ViewFactory: Token$2<ViewFactory>;
|
|
164
|
+
|
|
165
|
+
type Operator = '=' | '!=' | '<>' | '<' | '<=' | '>' | '>=' | 'like' | 'not like' | 'ilike' | 'in' | 'not in';
|
|
166
|
+
type Row = Record<string, unknown>;
|
|
167
|
+
/** The minimal query surface other components rely on (Queue, Cache, Session, Validation, Notifications). */
|
|
168
|
+
interface QueryBuilder<T = Row> {
|
|
169
|
+
select(...columns: string[]): this;
|
|
170
|
+
where(column: string, value: unknown): this;
|
|
171
|
+
where(column: string, operator: Operator, value: unknown): this;
|
|
172
|
+
where(conditions: Row): this;
|
|
173
|
+
orWhere(column: string, value: unknown): this;
|
|
174
|
+
orWhere(column: string, operator: Operator, value: unknown): this;
|
|
175
|
+
whereIn(column: string, values: readonly unknown[]): this;
|
|
176
|
+
whereNotIn(column: string, values: readonly unknown[]): this;
|
|
177
|
+
whereNull(column: string): this;
|
|
178
|
+
whereNotNull(column: string): this;
|
|
179
|
+
orderBy(column: string, direction?: 'asc' | 'desc'): this;
|
|
180
|
+
limit(count: number): this;
|
|
181
|
+
offset(count: number): this;
|
|
182
|
+
lockForUpdate(): this;
|
|
183
|
+
get(): Promise<Enumerable<T>>;
|
|
184
|
+
first(): Promise<T | undefined>;
|
|
185
|
+
find(id: unknown): Promise<T | undefined>;
|
|
186
|
+
value<V = unknown>(column: string): Promise<V | undefined>;
|
|
187
|
+
pluck<V = unknown>(column: string): Promise<Enumerable<V>>;
|
|
188
|
+
count(): Promise<number>;
|
|
189
|
+
exists(): Promise<boolean>;
|
|
190
|
+
insert(values: Row | Row[]): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Inserts rows, skipping any that violate a unique key instead of failing (Laravel's insertOrIgnore). Returns the
|
|
193
|
+
* number of rows inserted. Nothing is thrown for a duplicate, so a caller's transaction stays usable on Postgres.
|
|
194
|
+
*/
|
|
195
|
+
insertOrIgnore(values: Row | Row[]): Promise<number>;
|
|
196
|
+
insertGetId(values: Row, keyName?: string): Promise<number | string>;
|
|
197
|
+
update(values: Row): Promise<number>;
|
|
198
|
+
upsert(values: Row | Row[], uniqueBy: string[], update?: string[]): Promise<number>;
|
|
199
|
+
increment(column: string, amount?: number, extra?: Row): Promise<number>;
|
|
200
|
+
decrement(column: string, amount?: number, extra?: Row): Promise<number>;
|
|
201
|
+
delete(): Promise<number>;
|
|
202
|
+
}
|
|
203
|
+
type DriverName = 'pgsql' | 'mysql' | 'sqlite';
|
|
204
|
+
interface DatabaseConnection {
|
|
205
|
+
getName(): string;
|
|
206
|
+
getDriverName(): DriverName;
|
|
207
|
+
table<T = Row>(table: string): QueryBuilder<T>;
|
|
208
|
+
select<T = Row>(sql: string, bindings?: readonly unknown[]): Promise<T[]>;
|
|
209
|
+
statement(sql: string, bindings?: readonly unknown[]): Promise<void>;
|
|
210
|
+
/** Nested calls use savepoints. Rolls back if fn throws. */
|
|
211
|
+
transaction<R>(fn: (connection: DatabaseConnection) => Promise<R>): Promise<R>;
|
|
212
|
+
/**
|
|
213
|
+
* Start a transaction that stays open, for every caller of this connection, until commit()/rollBack().
|
|
214
|
+
* Nested calls use savepoints. Meant for test isolation (RefreshDatabase); app code uses transaction(fn).
|
|
215
|
+
*/
|
|
216
|
+
beginTransaction(): Promise<void>;
|
|
217
|
+
commit(): Promise<void>;
|
|
218
|
+
/** Rolls back the innermost level opened by beginTransaction(). Does nothing when none is open. */
|
|
219
|
+
rollBack(): Promise<void>;
|
|
220
|
+
/** 0 outside a transaction. */
|
|
221
|
+
transactionLevel(): number;
|
|
222
|
+
}
|
|
223
|
+
interface DatabaseManager extends DatabaseConnection {
|
|
224
|
+
connection(name?: string): DatabaseConnection;
|
|
225
|
+
disconnect(name?: string): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
declare const DatabaseManager: Token$2<DatabaseManager>;
|
|
228
|
+
/** What non-Database components may rely on from a model instance. */
|
|
229
|
+
interface ModelInstance {
|
|
230
|
+
exists: boolean;
|
|
231
|
+
getKey(): unknown;
|
|
232
|
+
getKeyName(): string;
|
|
233
|
+
getTable(): string;
|
|
234
|
+
getRouteKey(): unknown;
|
|
235
|
+
getRouteKeyName(): string;
|
|
236
|
+
getAttribute<T = unknown>(key: string): T;
|
|
237
|
+
setAttribute(key: string, value: unknown): this;
|
|
238
|
+
fill(attributes: Row): this;
|
|
239
|
+
save(): Promise<boolean>;
|
|
240
|
+
delete(): Promise<boolean>;
|
|
241
|
+
refresh(): Promise<this>;
|
|
242
|
+
toArray(): Row;
|
|
243
|
+
toJSON(): Row;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface Authenticatable {
|
|
247
|
+
getAuthIdentifierName(): string;
|
|
248
|
+
getAuthIdentifier(): unknown;
|
|
249
|
+
getAuthPassword(): string;
|
|
250
|
+
getRememberToken(): string | undefined;
|
|
251
|
+
setRememberToken(value: string): void;
|
|
252
|
+
getRememberTokenName(): string;
|
|
253
|
+
}
|
|
254
|
+
type Credentials = Record<string, unknown>;
|
|
255
|
+
interface UserProvider {
|
|
256
|
+
retrieveById(id: unknown): Promise<Authenticatable | undefined>;
|
|
257
|
+
retrieveByToken(id: unknown, token: string): Promise<Authenticatable | undefined>;
|
|
258
|
+
updateRememberToken(user: Authenticatable, token: string): Promise<void>;
|
|
259
|
+
retrieveByCredentials(credentials: Credentials): Promise<Authenticatable | undefined>;
|
|
260
|
+
validateCredentials(user: Authenticatable, credentials: Credentials): Promise<boolean>;
|
|
261
|
+
}
|
|
262
|
+
interface Guard {
|
|
263
|
+
check(): Promise<boolean>;
|
|
264
|
+
guest(): Promise<boolean>;
|
|
265
|
+
user<T extends Authenticatable = Authenticatable>(): Promise<T | undefined>;
|
|
266
|
+
id(): Promise<unknown>;
|
|
267
|
+
validate(credentials: Credentials): Promise<boolean>;
|
|
268
|
+
hasUser(): boolean;
|
|
269
|
+
setUser(user: Authenticatable): void;
|
|
270
|
+
}
|
|
271
|
+
interface StatefulGuard extends Guard {
|
|
272
|
+
attempt(credentials: Credentials, remember?: boolean): Promise<boolean>;
|
|
273
|
+
once(credentials: Credentials): Promise<boolean>;
|
|
274
|
+
login(user: Authenticatable, remember?: boolean): Promise<void>;
|
|
275
|
+
loginUsingId(id: unknown, remember?: boolean): Promise<Authenticatable | false>;
|
|
276
|
+
logout(): Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
interface AuthFactory {
|
|
279
|
+
guard(name?: string): StatefulGuard | Guard;
|
|
280
|
+
shouldUse(name: string): void;
|
|
281
|
+
extend(driver: string, factory: (name: string, config: Record<string, unknown>) => Guard): void;
|
|
282
|
+
provider(driver: string, factory: (config: Record<string, unknown>) => UserProvider): void;
|
|
283
|
+
}
|
|
284
|
+
declare const AuthFactory: Token$2<AuthFactory>;
|
|
285
|
+
|
|
286
|
+
/** Options a job class may declare as public fields. Their presence (or implementing ShouldQueue) makes things queueable. */
|
|
287
|
+
interface ShouldQueue {
|
|
288
|
+
connection?: string;
|
|
289
|
+
queue?: string;
|
|
290
|
+
/** Seconds. */
|
|
291
|
+
delay?: number;
|
|
292
|
+
tries?: number;
|
|
293
|
+
/** Seconds, or a per-attempt list. */
|
|
294
|
+
backoff?: number | number[];
|
|
295
|
+
/** Seconds. */
|
|
296
|
+
timeout?: number;
|
|
297
|
+
uniqueId?(): string;
|
|
298
|
+
}
|
|
299
|
+
/** A job: public fields are its serialized data; handle() runs on the worker (inject() works inside it). */
|
|
300
|
+
interface Job extends Partial<ShouldQueue> {
|
|
301
|
+
handle(): unknown | Promise<unknown>;
|
|
302
|
+
failed?(error: unknown): void | Promise<void>;
|
|
303
|
+
}
|
|
304
|
+
interface QueuePayload {
|
|
305
|
+
uuid: string;
|
|
306
|
+
/** ClassRegistry name. */
|
|
307
|
+
job: string;
|
|
308
|
+
displayName: string;
|
|
309
|
+
data: Record<string, unknown>;
|
|
310
|
+
attempts: number;
|
|
311
|
+
maxTries?: number;
|
|
312
|
+
backoff?: number[];
|
|
313
|
+
timeout?: number;
|
|
314
|
+
/** Unix ms. */
|
|
315
|
+
pushedAt: number;
|
|
316
|
+
batchId?: string;
|
|
317
|
+
chain?: QueuePayload[];
|
|
318
|
+
/** Unix ms after which the job fails instead of retrying. */
|
|
319
|
+
retryUntil?: number;
|
|
320
|
+
/** Mark the job failed (instead of releasing it) when it times out. */
|
|
321
|
+
failOnTimeout?: boolean;
|
|
322
|
+
}
|
|
323
|
+
interface QueueJob {
|
|
324
|
+
getJobId(): string;
|
|
325
|
+
getQueue(): string;
|
|
326
|
+
payload(): QueuePayload;
|
|
327
|
+
attempts(): number;
|
|
328
|
+
delete(): Promise<void>;
|
|
329
|
+
release(delaySeconds?: number): Promise<void>;
|
|
330
|
+
/** Marks as failed: stores it via FailedJobProvider and calls job.failed(). */
|
|
331
|
+
fail(error: unknown): Promise<void>;
|
|
332
|
+
isDeleted(): boolean;
|
|
333
|
+
isReleased(): boolean;
|
|
334
|
+
}
|
|
335
|
+
interface Queue {
|
|
336
|
+
push(job: Job, queue?: string): Promise<string>;
|
|
337
|
+
later(delaySeconds: number, job: Job, queue?: string): Promise<string>;
|
|
338
|
+
pushRaw(payload: QueuePayload, queue?: string, delaySeconds?: number): Promise<string>;
|
|
339
|
+
pop(queue?: string): Promise<QueueJob | undefined>;
|
|
340
|
+
size(queue?: string): Promise<number>;
|
|
341
|
+
clear(queue?: string): Promise<number>;
|
|
342
|
+
}
|
|
343
|
+
interface QueueManager extends Queue {
|
|
344
|
+
connection(name?: string): Queue;
|
|
345
|
+
extend(driver: string, factory: (config: Record<string, unknown>) => Queue): void;
|
|
346
|
+
}
|
|
347
|
+
declare const QueueManager: Token$2<QueueManager>;
|
|
348
|
+
|
|
349
|
+
interface Batch {
|
|
350
|
+
readonly id: string;
|
|
351
|
+
readonly name: string;
|
|
352
|
+
readonly totalJobs: number;
|
|
353
|
+
readonly pendingJobs: number;
|
|
354
|
+
readonly failedJobs: number;
|
|
355
|
+
progress(): number;
|
|
356
|
+
finished(): boolean;
|
|
357
|
+
cancelled(): boolean;
|
|
358
|
+
cancel(): Promise<void>;
|
|
359
|
+
}
|
|
360
|
+
interface PendingChain {
|
|
361
|
+
onConnection(connection: string): this;
|
|
362
|
+
onQueue(queue: string): this;
|
|
363
|
+
/** Runs as a job if any job in the chain fails. Callbacks are jobs, because closures can't be serialized. */
|
|
364
|
+
catch(job: Job): this;
|
|
365
|
+
dispatch(): Promise<void>;
|
|
366
|
+
}
|
|
367
|
+
interface PendingBatch {
|
|
368
|
+
name(name: string): this;
|
|
369
|
+
onConnection(connection: string): this;
|
|
370
|
+
onQueue(queue: string): this;
|
|
371
|
+
allowFailures(allow?: boolean): this;
|
|
372
|
+
then(job: Job): this;
|
|
373
|
+
catch(job: Job): this;
|
|
374
|
+
finally(job: Job): this;
|
|
375
|
+
dispatch(): Promise<Batch>;
|
|
376
|
+
}
|
|
377
|
+
interface BusDispatcher {
|
|
378
|
+
/** Queues it when the job is queueable (implements ShouldQueue / declares queue options), otherwise runs it now. */
|
|
379
|
+
dispatch(job: Job): Promise<unknown>;
|
|
380
|
+
dispatchSync(job: Job): Promise<unknown>;
|
|
381
|
+
/** Runs after the current response is sent (or the current job finishes). */
|
|
382
|
+
dispatchAfterResponse(job: Job): void;
|
|
383
|
+
chain(jobs: Job[]): PendingChain;
|
|
384
|
+
batch(jobs: Job[]): PendingBatch;
|
|
385
|
+
findBatch(id: string): Promise<Batch | undefined>;
|
|
386
|
+
}
|
|
387
|
+
declare const BusDispatcher: Token$2<BusDispatcher>;
|
|
388
|
+
/** What PendingBatch hands to the repository. Callbacks are jobs, because closures can't be serialized. */
|
|
389
|
+
interface PendingBatchOptions {
|
|
390
|
+
name: string;
|
|
391
|
+
then: Job[];
|
|
392
|
+
catch: Job[];
|
|
393
|
+
finally: Job[];
|
|
394
|
+
allowFailures: boolean;
|
|
395
|
+
connection?: string;
|
|
396
|
+
queue?: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface Address {
|
|
400
|
+
address: string;
|
|
401
|
+
name?: string;
|
|
402
|
+
}
|
|
403
|
+
/** A plain email string, an Address, or anything with email (+ optional name), such as a User model. */
|
|
404
|
+
type MailRecipient = string | Address | {
|
|
405
|
+
email: string;
|
|
406
|
+
name?: string;
|
|
407
|
+
};
|
|
408
|
+
interface Envelope {
|
|
409
|
+
from?: MailRecipient;
|
|
410
|
+
to?: MailRecipient[];
|
|
411
|
+
cc?: MailRecipient[];
|
|
412
|
+
bcc?: MailRecipient[];
|
|
413
|
+
replyTo?: MailRecipient[];
|
|
414
|
+
subject?: string;
|
|
415
|
+
tags?: string[];
|
|
416
|
+
metadata?: Record<string, string>;
|
|
417
|
+
}
|
|
418
|
+
interface Content {
|
|
419
|
+
/** A View name, rendered by ViewFactory (TSX). */
|
|
420
|
+
view?: string;
|
|
421
|
+
/** A plain-text view name. */
|
|
422
|
+
text?: string;
|
|
423
|
+
/** Raw HTML (used when no view is given). */
|
|
424
|
+
htmlString?: string;
|
|
425
|
+
/** Raw plain-text body (used when no text view is given). */
|
|
426
|
+
textString?: string;
|
|
427
|
+
with?: Record<string, unknown>;
|
|
428
|
+
}
|
|
429
|
+
interface Attachment {
|
|
430
|
+
name: string;
|
|
431
|
+
path?: string;
|
|
432
|
+
data?: Uint8Array | string;
|
|
433
|
+
mime?: string;
|
|
434
|
+
}
|
|
435
|
+
/** Laravel 10+ style mailable: envelope() + content() + attachments(). */
|
|
436
|
+
interface Mailable {
|
|
437
|
+
envelope(): Envelope | Promise<Envelope>;
|
|
438
|
+
content(): Content | Promise<Content>;
|
|
439
|
+
attachments?(): Attachment[] | Promise<Attachment[]>;
|
|
440
|
+
}
|
|
441
|
+
/** Fully rendered message handed to a transport. */
|
|
442
|
+
interface OutgoingMessage {
|
|
443
|
+
from: Address;
|
|
444
|
+
to: Address[];
|
|
445
|
+
cc: Address[];
|
|
446
|
+
bcc: Address[];
|
|
447
|
+
replyTo: Address[];
|
|
448
|
+
subject: string;
|
|
449
|
+
html?: string;
|
|
450
|
+
text?: string;
|
|
451
|
+
attachments: Attachment[];
|
|
452
|
+
headers: Record<string, string>;
|
|
453
|
+
}
|
|
454
|
+
interface SentMessage {
|
|
455
|
+
messageId: string;
|
|
456
|
+
message: OutgoingMessage;
|
|
457
|
+
}
|
|
458
|
+
interface MailTransport {
|
|
459
|
+
send(message: OutgoingMessage): Promise<SentMessage>;
|
|
460
|
+
}
|
|
461
|
+
interface PendingMail {
|
|
462
|
+
cc(recipients: MailRecipient | MailRecipient[]): this;
|
|
463
|
+
bcc(recipients: MailRecipient | MailRecipient[]): this;
|
|
464
|
+
send(mailable: Mailable): Promise<SentMessage | undefined>;
|
|
465
|
+
queue(mailable: Mailable): Promise<void>;
|
|
466
|
+
later(delaySeconds: number, mailable: Mailable): Promise<void>;
|
|
467
|
+
}
|
|
468
|
+
interface Mailer {
|
|
469
|
+
to(recipients: MailRecipient | MailRecipient[]): PendingMail;
|
|
470
|
+
/** Sends to the recipients given in the mailable's envelope. Queues it if the mailable is queueable. */
|
|
471
|
+
send(mailable: Mailable): Promise<SentMessage | undefined>;
|
|
472
|
+
queue(mailable: Mailable): Promise<void>;
|
|
473
|
+
}
|
|
474
|
+
interface MailManager extends Mailer {
|
|
475
|
+
mailer(name?: string): Mailer;
|
|
476
|
+
extend(transport: string, factory: (config: Record<string, unknown>) => MailTransport): void;
|
|
477
|
+
}
|
|
478
|
+
declare const MailManager: Token$2<MailManager>;
|
|
479
|
+
|
|
480
|
+
interface Notifiable {
|
|
481
|
+
/** e.g. 'mail' → email address, 'database' → the model itself. */
|
|
482
|
+
routeNotificationFor(channel: string, notification: Notification): unknown;
|
|
483
|
+
}
|
|
484
|
+
interface Notification {
|
|
485
|
+
/** Optional id; set by the dispatcher when missing. */
|
|
486
|
+
id?: string;
|
|
487
|
+
via(notifiable: Notifiable): string[];
|
|
488
|
+
/** Returns a Mailable (Contracts/Mail) or the Notifications MailMessage builder. */
|
|
489
|
+
toMail?(notifiable: Notifiable): unknown;
|
|
490
|
+
toDatabase?(notifiable: Notifiable): Record<string, unknown>;
|
|
491
|
+
toArray?(notifiable: Notifiable): Record<string, unknown>;
|
|
492
|
+
}
|
|
493
|
+
interface NotificationChannel {
|
|
494
|
+
send(notifiable: Notifiable, notification: Notification): Promise<void>;
|
|
495
|
+
}
|
|
496
|
+
interface NotificationDispatcher {
|
|
497
|
+
/** Queues it when the notification is queueable, otherwise sends immediately. */
|
|
498
|
+
send(notifiables: Notifiable | Notifiable[], notification: Notification): Promise<void>;
|
|
499
|
+
sendNow(notifiables: Notifiable | Notifiable[], notification: Notification, channels?: string[]): Promise<void>;
|
|
500
|
+
/** On-demand: Notification.route('mail', 'a@b.c').notify(n). */
|
|
501
|
+
route(channel: string, route: unknown): Notifiable & {
|
|
502
|
+
notify(notification: Notification): Promise<void>;
|
|
503
|
+
};
|
|
504
|
+
extend(channel: string, factory: () => NotificationChannel): void;
|
|
505
|
+
}
|
|
506
|
+
declare const NotificationDispatcher: Token$2<NotificationDispatcher>;
|
|
507
|
+
|
|
508
|
+
type ListenerClass<E> = Class$1<{
|
|
509
|
+
handle(event: E): unknown;
|
|
510
|
+
}>;
|
|
511
|
+
type Listener<E> = ((event: E) => unknown) | ListenerClass<E>;
|
|
512
|
+
interface EventDispatcher {
|
|
513
|
+
/** Class events (recommended) or string events like 'eloquent.created: Post'. */
|
|
514
|
+
listen<E>(events: Class$1<E> | string | Array<Class$1<E> | string>, listener: Listener<E>): void;
|
|
515
|
+
hasListeners(event: Class$1<unknown> | string): boolean;
|
|
516
|
+
/** Runs listeners in registration order. Listener classes that are queueable are queued. Returns results. */
|
|
517
|
+
dispatch(event: object | string, payload?: unknown[]): Promise<unknown[]>;
|
|
518
|
+
/** Stops at the first listener that returns something other than undefined. Returns that value. */
|
|
519
|
+
until(event: object | string, payload?: unknown[]): Promise<unknown>;
|
|
520
|
+
subscribe(subscriber: Class$1<{
|
|
521
|
+
subscribe(events: EventDispatcher): void;
|
|
522
|
+
}>): void;
|
|
523
|
+
forget(event: Class$1<unknown> | string): void;
|
|
524
|
+
}
|
|
525
|
+
declare const EventDispatcher: Token$2<EventDispatcher>;
|
|
526
|
+
|
|
527
|
+
interface PutOptions {
|
|
528
|
+
visibility?: 'public' | 'private';
|
|
529
|
+
mimeType?: string;
|
|
530
|
+
}
|
|
531
|
+
/** Paths are relative to the disk root. Throws on paths that escape it ('../'). */
|
|
532
|
+
interface Filesystem {
|
|
533
|
+
exists(path: string): Promise<boolean>;
|
|
534
|
+
missing(path: string): Promise<boolean>;
|
|
535
|
+
get(path: string): Promise<string>;
|
|
536
|
+
getBytes(path: string): Promise<Uint8Array>;
|
|
537
|
+
readStream(path: string): Promise<ReadableStream<Uint8Array>>;
|
|
538
|
+
put(path: string, contents: string | Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<boolean>;
|
|
539
|
+
/** Stores under a generated unique name. Returns the stored path. */
|
|
540
|
+
putFile(directory: string, file: UploadedFile$1, options?: PutOptions): Promise<string>;
|
|
541
|
+
putFileAs(directory: string, file: UploadedFile$1, name: string, options?: PutOptions): Promise<string>;
|
|
542
|
+
delete(paths: string | string[]): Promise<boolean>;
|
|
543
|
+
copy(from: string, to: string): Promise<boolean>;
|
|
544
|
+
move(from: string, to: string): Promise<boolean>;
|
|
545
|
+
size(path: string): Promise<number>;
|
|
546
|
+
lastModified(path: string): Promise<Date>;
|
|
547
|
+
mimeType(path: string): Promise<string | undefined>;
|
|
548
|
+
url(path: string): string;
|
|
549
|
+
temporaryUrl(path: string, expiresAt: Date): Promise<string>;
|
|
550
|
+
files(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
551
|
+
directories(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
552
|
+
makeDirectory(path: string): Promise<boolean>;
|
|
553
|
+
deleteDirectory(path: string): Promise<boolean>;
|
|
554
|
+
/** Absolute local path (local disks only). */
|
|
555
|
+
path(path: string): string;
|
|
556
|
+
}
|
|
557
|
+
interface FilesystemManager extends Filesystem {
|
|
558
|
+
disk(name?: string): Filesystem;
|
|
559
|
+
extend(driver: string, factory: (config: Record<string, unknown>) => Filesystem): void;
|
|
560
|
+
}
|
|
561
|
+
declare const FilesystemManager: Token$2<FilesystemManager>;
|
|
562
|
+
|
|
563
|
+
/** Infinite-scroll metadata for one prop (page.scrollProps[path]). */
|
|
564
|
+
interface InertiaScrollProp {
|
|
565
|
+
pageName: string;
|
|
566
|
+
previousPage: string | number | null;
|
|
567
|
+
nextPage: string | number | null;
|
|
568
|
+
currentPage: string | number | null;
|
|
569
|
+
reset: boolean;
|
|
570
|
+
}
|
|
571
|
+
/** A once prop the client keeps between visits (page.onceProps[key]). `expiresAt` is epoch milliseconds. */
|
|
572
|
+
interface InertiaOnceProp {
|
|
573
|
+
prop: string;
|
|
574
|
+
expiresAt: number | null;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* The Inertia page object (protocol v3, @inertiajs/core 3.x). Only component, props, url and version are always
|
|
578
|
+
* present; the other fields are left out when empty or false.
|
|
579
|
+
*/
|
|
580
|
+
interface InertiaPage {
|
|
581
|
+
component: string;
|
|
582
|
+
props: Record<string, unknown>;
|
|
583
|
+
/** Path and query, never absolute: '/posts?page=2'. */
|
|
584
|
+
url: string;
|
|
585
|
+
/** '' when the app has no asset version. */
|
|
586
|
+
version: string;
|
|
587
|
+
sharedProps?: string[];
|
|
588
|
+
mergeProps?: string[];
|
|
589
|
+
prependProps?: string[];
|
|
590
|
+
deepMergeProps?: string[];
|
|
591
|
+
/** '<prop path>.<key field>', e.g. 'posts.data.id'. */
|
|
592
|
+
matchPropsOn?: string[];
|
|
593
|
+
/** Group name → prop paths loaded after the first render. */
|
|
594
|
+
deferredProps?: Record<string, string[]>;
|
|
595
|
+
rescuedProps?: string[];
|
|
596
|
+
scrollProps?: Record<string, InertiaScrollProp>;
|
|
597
|
+
onceProps?: Record<string, InertiaOnceProp>;
|
|
598
|
+
clearHistory?: true;
|
|
599
|
+
encryptHistory?: true;
|
|
600
|
+
flash?: Record<string, unknown>;
|
|
601
|
+
preserveFragment?: true;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Laravel's PendingCommand: `await t.artisan('inspire').expectsOutput('…').assertExitCode(0)`.
|
|
606
|
+
* It runs through ConsoleKernel.call() when awaited (or run()), then checks every expectation against the
|
|
607
|
+
* buffered output (stdout then stderr, as ConsoleKernel.output() returns it) and the exit code.
|
|
608
|
+
*
|
|
609
|
+
* The result must be awaited (or run() called): unlike Laravel, where the command runs when the
|
|
610
|
+
* PendingCommand is destroyed, nothing runs here until then, so an un-awaited `t.artisan(...)` never runs
|
|
611
|
+
* and checks nothing.
|
|
612
|
+
*/
|
|
613
|
+
declare class PendingCommand implements PromiseLike<number> {
|
|
614
|
+
private readonly app;
|
|
615
|
+
readonly command: string;
|
|
616
|
+
readonly parameters: Record<string, unknown>;
|
|
617
|
+
private readonly checks;
|
|
618
|
+
private result;
|
|
619
|
+
constructor(app: Application$1, command: string, parameters?: Record<string, unknown>);
|
|
620
|
+
/** A line of output equals `line` exactly; with no argument, the command printed something. */
|
|
621
|
+
expectsOutput(line?: string): this;
|
|
622
|
+
/** No line equals `line`; with no argument, the command printed nothing at all. */
|
|
623
|
+
doesntExpectOutput(line?: string): this;
|
|
624
|
+
expectsOutputToContain(text: string): this;
|
|
625
|
+
doesntExpectOutputToContain(text: string): this;
|
|
626
|
+
assertExitCode(code: number): this;
|
|
627
|
+
assertNotExitCode(code: number): this;
|
|
628
|
+
assertSuccessful(): this;
|
|
629
|
+
assertOk(): this;
|
|
630
|
+
assertFailed(): this;
|
|
631
|
+
/** Runs the command once and checks the expectations; resolves to the exit code. */
|
|
632
|
+
run(): Promise<number>;
|
|
633
|
+
then<R1 = number, R2 = never>(onfulfilled?: ((value: number) => R1 | PromiseLike<R1>) | null, onrejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null): Promise<R1 | R2>;
|
|
634
|
+
private execute;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/** A table name, or a model (its table, and its connection when it has one). */
|
|
638
|
+
type TableOrModel = string | ModelInstance;
|
|
639
|
+
|
|
640
|
+
/** Laravel's JSON structure: `['id', { author: ['name'] }]`, and `'*'` for "every element". */
|
|
641
|
+
type JsonStructure = Array<string | {
|
|
642
|
+
[key: string]: JsonStructure;
|
|
643
|
+
}> | {
|
|
644
|
+
[key: string]: JsonStructure;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
type Json = unknown;
|
|
648
|
+
type Scope<T extends AssertableJson> = (json: T) => unknown;
|
|
649
|
+
/**
|
|
650
|
+
* Laravel's Illuminate\Testing\Fluent\AssertableJson: fluent, scoped assertions over decoded JSON. Inside a scope
|
|
651
|
+
* (has(key, callback), first(), each()) every property must be interacted with, or etc() must be called.
|
|
652
|
+
*/
|
|
653
|
+
declare class AssertableJson {
|
|
654
|
+
protected readonly props: Json;
|
|
655
|
+
protected readonly path: string | undefined;
|
|
656
|
+
protected interactedKeys: string[];
|
|
657
|
+
constructor(props: Json, path?: string | undefined);
|
|
658
|
+
static fromJson(json: Json): AssertableJson;
|
|
659
|
+
/** A child scope of the same class (subclasses override to keep their extra state out of scopes). */
|
|
660
|
+
protected newScope(props: Json, path: string): AssertableJson;
|
|
661
|
+
protected dotPath(key?: string): string;
|
|
662
|
+
/** The value at `key` in this scope, or the whole scope. */
|
|
663
|
+
protected prop(key?: string): Json;
|
|
664
|
+
/** A literal key of this scope wins over a dot path, like Laravel's Arr::get (keys such as 'items.0.name'). */
|
|
665
|
+
private hasOwnKey;
|
|
666
|
+
private exists;
|
|
667
|
+
protected interactsWith(key: string | number): void;
|
|
668
|
+
/** Every property of the scope was checked (called when a scope ends). */
|
|
669
|
+
interacted(): void;
|
|
670
|
+
/** Allow the properties this scope didn't check. */
|
|
671
|
+
etc(): this;
|
|
672
|
+
/** has('key'), has('key', 3), has('key', json => …), has('key', 3, first => …), or has(3) for the root size. */
|
|
673
|
+
has(key: string | number, length?: number | Scope<this>, callback?: Scope<this>): this;
|
|
674
|
+
/** hasAll(['a', 'b']) or hasAll({ items: 3 }). */
|
|
675
|
+
hasAll(keys: string | string[] | Record<string, number>): this;
|
|
676
|
+
hasAny(keys: string | string[]): this;
|
|
677
|
+
missing(key: string): this;
|
|
678
|
+
missingAll(keys: string | string[]): this;
|
|
679
|
+
/** count(3) checks this scope's size; count('items', 3) a property's. */
|
|
680
|
+
count(key: string | number, length?: number): this;
|
|
681
|
+
countBetween(key: string, min: number, max: number): this;
|
|
682
|
+
/** where('name', 'Ann'), or where('name', value => value.startsWith('A')). Objects compare ignoring key order. */
|
|
683
|
+
where(key: string, expected: unknown): this;
|
|
684
|
+
whereNot(key: string, expected: unknown): this;
|
|
685
|
+
whereNull(key: string): this;
|
|
686
|
+
whereNotNull(key: string): this;
|
|
687
|
+
whereAll(bindings: Record<string, unknown>): this;
|
|
688
|
+
/** whereType('id', 'integer'), whereType('name', 'string|null'), whereType('tags', ['array', 'null']). */
|
|
689
|
+
whereType(key: string, expected: string | string[]): this;
|
|
690
|
+
whereAllType(bindings: Record<string, string | string[]>): this;
|
|
691
|
+
/** The list contains every expected value (or one passing the callback); a string contains the substring. */
|
|
692
|
+
whereContains(key: string, expected: unknown): this;
|
|
693
|
+
protected scope(key: string, callback: Scope<this>): this;
|
|
694
|
+
first(callback: Scope<this>): this;
|
|
695
|
+
each(callback: Scope<this>): this;
|
|
696
|
+
when(condition: unknown, callback: (json: this) => unknown, otherwise?: (json: this) => unknown): this;
|
|
697
|
+
dump(key?: string): this;
|
|
698
|
+
toArray(): Json;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/** The page object of a response: the JSON body of an Inertia visit, or the page script of a first visit. */
|
|
702
|
+
declare function inertiaPageOf(response: TestResponse): InertiaPage;
|
|
703
|
+
/** Inertia's AssertableInertia: AssertableJson over the page props, plus the page component, url, version and flash. */
|
|
704
|
+
declare class AssertableInertia extends AssertableJson {
|
|
705
|
+
#private;
|
|
706
|
+
static fromTestResponse(response: TestResponse): AssertableInertia;
|
|
707
|
+
/** Scopes are plain AssertableJson: the page-level methods only make sense at the root. */
|
|
708
|
+
protected newScope(props: unknown, path: string): AssertableJson;
|
|
709
|
+
get page(): InertiaPage;
|
|
710
|
+
/** The component name; the page file must exist unless `shouldExist` is false (inertia.testing.ensure_pages_exist). */
|
|
711
|
+
component(value?: string, shouldExist?: boolean): this;
|
|
712
|
+
url(value: string): this;
|
|
713
|
+
version(value: string): this;
|
|
714
|
+
/** The flash data has `key` (dot paths allowed), equal to `expected` when given. */
|
|
715
|
+
hasFlash(key: string, ...expected: [] | [unknown]): this;
|
|
716
|
+
missingFlash(key: string): this;
|
|
717
|
+
static assertFlashHas(flash: Record<string, unknown>, key: string, ...expected: [] | [unknown]): void;
|
|
718
|
+
static assertFlashMissing(flash: Record<string, unknown>, key: string): void;
|
|
719
|
+
/**
|
|
720
|
+
* Requests the page again as a partial reload (only/except) and checks it is the same page. Uses the test's
|
|
721
|
+
* HTTP client, so the session and cookies carry over.
|
|
722
|
+
*/
|
|
723
|
+
reload(callback?: (page: AssertableInertia) => unknown, only?: string | string[], except?: string | string[]): Promise<this>;
|
|
724
|
+
reloadOnly(only: string | string[], callback?: (page: AssertableInertia) => unknown): Promise<this>;
|
|
725
|
+
reloadExcept(except: string | string[], callback?: (page: AssertableInertia) => unknown): Promise<this>;
|
|
726
|
+
/** Loads the deferred props of every group (or the given groups) in one partial reload. */
|
|
727
|
+
loadDeferredProps(groupsOrCallback: string | string[] | ((page: AssertableInertia) => unknown), callback?: (page: AssertableInertia) => unknown): Promise<this>;
|
|
728
|
+
toArray(): Record<string, unknown>;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/** Laravel's CookieValuePrefix: hmac_sha1(name + 'v2', key) + '|' (41 characters), as Auth's EncryptCookies writes it. */
|
|
732
|
+
declare function cookiePrefix(name: string, key: Uint8Array): string;
|
|
733
|
+
/** What EncryptCookies puts in a browser cookie: encrypt(prefix + value, serialize: false). */
|
|
734
|
+
declare function encryptCookie(encrypter: Encrypter, name: string, value: string): string;
|
|
735
|
+
/** The plain value of an encrypted cookie, or undefined when it doesn't decrypt or its prefix is wrong. */
|
|
736
|
+
declare function decryptCookie(encrypter: Encrypter, name: string, value: string): string | undefined;
|
|
737
|
+
interface ResponseCookie {
|
|
738
|
+
name: string;
|
|
739
|
+
/** URI-decoded, still encrypted if the app encrypted it. */
|
|
740
|
+
value: string;
|
|
741
|
+
path?: string;
|
|
742
|
+
domain?: string;
|
|
743
|
+
maxAge?: number;
|
|
744
|
+
expires?: Date;
|
|
745
|
+
httpOnly: boolean;
|
|
746
|
+
secure: boolean;
|
|
747
|
+
sameSite?: string;
|
|
748
|
+
}
|
|
749
|
+
/** Max-Age <= 0 or an Expires in the past: the server is deleting the cookie. */
|
|
750
|
+
declare function isExpired(cookie: ResponseCookie, now?: number): boolean;
|
|
751
|
+
declare function responseCookies(response: Response): ResponseCookie[];
|
|
752
|
+
declare function cookieHeader(cookies: Map<string, string>): string;
|
|
753
|
+
|
|
754
|
+
/** Field → messages, as Http flashes them per bag: `errors: { [bag]: { field: string[] } }`. */
|
|
755
|
+
type ErrorMessages = Record<string, string[]>;
|
|
756
|
+
/** `'email'`, `['email', 'name']` or `{ email: 'must be valid' }` (message fragments). */
|
|
757
|
+
type ExpectedErrors = string | string[] | Record<string, string | string[]>;
|
|
758
|
+
/** What the HTTP client knows about the request that produced a response. */
|
|
759
|
+
interface ResponseContext {
|
|
760
|
+
/** The raw request sent to the kernel (redirect URLs are resolved against it). */
|
|
761
|
+
request?: Request;
|
|
762
|
+
/** The application that handled it. */
|
|
763
|
+
app?: Application$1;
|
|
764
|
+
/** The request's session after the response. */
|
|
765
|
+
session?: Session$1;
|
|
766
|
+
/** Views made while handling the request, in order. */
|
|
767
|
+
views?: View[];
|
|
768
|
+
/** The last error the exception handler rendered. */
|
|
769
|
+
exception?: unknown;
|
|
770
|
+
/** The client that sent the request (Inertia reloads reuse it, keeping the session and cookies). */
|
|
771
|
+
client?: HttpClient;
|
|
772
|
+
}
|
|
773
|
+
/** Laravel's TestResponse: a Response with its body already read, plus fluent assertions. */
|
|
774
|
+
declare class TestResponse {
|
|
775
|
+
readonly baseResponse: Response;
|
|
776
|
+
readonly content: string;
|
|
777
|
+
readonly context: ResponseContext;
|
|
778
|
+
private decoded;
|
|
779
|
+
constructor(baseResponse: Response, content: string, context?: ResponseContext);
|
|
780
|
+
/** Reads the body once, so every assertion is synchronous. */
|
|
781
|
+
static from(response: Response, context?: ResponseContext): Promise<TestResponse>;
|
|
782
|
+
get status(): number;
|
|
783
|
+
get headers(): Headers;
|
|
784
|
+
/** The error the exception handler rendered for this request, if any. */
|
|
785
|
+
get exception(): unknown;
|
|
786
|
+
getContent(): string;
|
|
787
|
+
/** The decoded JSON body, or the value at a dot path (`data.0.id`). */
|
|
788
|
+
json<T = unknown>(path?: string): T;
|
|
789
|
+
dump(path?: string): this;
|
|
790
|
+
assertStatus(status: number): this;
|
|
791
|
+
assertOk(): this;
|
|
792
|
+
assertCreated(): this;
|
|
793
|
+
assertAccepted(): this;
|
|
794
|
+
assertMovedPermanently(): this;
|
|
795
|
+
assertFound(): this;
|
|
796
|
+
assertNotModified(): this;
|
|
797
|
+
assertBadRequest(): this;
|
|
798
|
+
assertUnauthorized(): this;
|
|
799
|
+
assertPaymentRequired(): this;
|
|
800
|
+
assertForbidden(): this;
|
|
801
|
+
assertNotFound(): this;
|
|
802
|
+
assertMethodNotAllowed(): this;
|
|
803
|
+
assertNotAcceptable(): this;
|
|
804
|
+
assertRequestTimeout(): this;
|
|
805
|
+
assertConflict(): this;
|
|
806
|
+
assertGone(): this;
|
|
807
|
+
assertUnsupportedMediaType(): this;
|
|
808
|
+
assertUnprocessable(): this;
|
|
809
|
+
assertTooManyRequests(): this;
|
|
810
|
+
assertInternalServerError(): this;
|
|
811
|
+
assertServiceUnavailable(): this;
|
|
812
|
+
/** 204 (or `status`) with an empty body. */
|
|
813
|
+
assertNoContent(status?: number): this;
|
|
814
|
+
assertSuccessful(): this;
|
|
815
|
+
assertClientError(): this;
|
|
816
|
+
assertServerError(): this;
|
|
817
|
+
/** A redirect status (201, 301, 302, 303, 307, 308); with `uri`, the Location must match it. */
|
|
818
|
+
assertRedirect(uri?: string): this;
|
|
819
|
+
assertRedirectContains(uri: string): this;
|
|
820
|
+
/** Relative and absolute forms of the same URL are equal (both are resolved against the request URL). */
|
|
821
|
+
assertLocation(uri: string): this;
|
|
822
|
+
assertHeader(name: string, value?: string): this;
|
|
823
|
+
assertHeaderMissing(name: string): this;
|
|
824
|
+
/** Content-Disposition: attachment (optionally with this file name). */
|
|
825
|
+
assertDownload(filename?: string): this;
|
|
826
|
+
assertContent(value: string): this;
|
|
827
|
+
/** The content contains the value(s); values are HTML-escaped first unless `escape` is false (Laravel). */
|
|
828
|
+
assertSee(value: string | string[], escape?: boolean): this;
|
|
829
|
+
assertDontSee(value: string | string[], escape?: boolean): this;
|
|
830
|
+
assertSeeInOrder(values: string[], escape?: boolean): this;
|
|
831
|
+
/** Like assertSee, against the content with its tags stripped. */
|
|
832
|
+
assertSeeText(value: string | string[], escape?: boolean): this;
|
|
833
|
+
assertDontSeeText(value: string | string[], escape?: boolean): this;
|
|
834
|
+
assertSeeTextInOrder(values: string[], escape?: boolean): this;
|
|
835
|
+
/**
|
|
836
|
+
* The response JSON contains `data` (a subset match: extra keys in the response are fine), or fluent
|
|
837
|
+
* assertions: assertJson(json => json.has('data', 3).etc()).
|
|
838
|
+
*/
|
|
839
|
+
assertJson(data: Record<string, unknown> | unknown[] | ((json: AssertableJson) => unknown)): this;
|
|
840
|
+
/**
|
|
841
|
+
* An Inertia page response, with optional fluent assertions over its props. An async callback (reload(),
|
|
842
|
+
* loadDeferredProps()) makes this return a promise: await it.
|
|
843
|
+
*/
|
|
844
|
+
assertInertia(callback: (page: AssertableInertia) => Promise<unknown>): Promise<this>;
|
|
845
|
+
assertInertia(callback?: (page: AssertableInertia) => unknown): this;
|
|
846
|
+
/** The Inertia page object of this response. */
|
|
847
|
+
inertiaPage(): InertiaPage;
|
|
848
|
+
/** The page props, or one prop by dot path. */
|
|
849
|
+
inertiaProps<T = unknown>(key?: string): T;
|
|
850
|
+
/** Inertia flash data waiting in the session for the next page (after a redirect). */
|
|
851
|
+
assertInertiaFlash(key: string, ...expected: [] | [unknown]): this;
|
|
852
|
+
assertInertiaFlashMissing(key: string): this;
|
|
853
|
+
/** The response JSON equals `data` exactly (object key order is ignored). */
|
|
854
|
+
assertExactJson(data: unknown): this;
|
|
855
|
+
/** The value at `path` equals `expected` (strictly), or passes the predicate. */
|
|
856
|
+
assertJsonPath(path: string, expected: unknown): this;
|
|
857
|
+
assertJsonMissingPath(path: string): this;
|
|
858
|
+
/** Each key/value pair appears somewhere in the JSON (Laravel's assertJsonFragment). */
|
|
859
|
+
assertJsonFragment(data: Record<string, unknown>): this;
|
|
860
|
+
/** Passes when at least one pair of `data` is absent (Laravel's assertJsonMissing). */
|
|
861
|
+
assertJsonMissing(data: Record<string, unknown>): this;
|
|
862
|
+
/** `['id', { author: ['name'] }]`, `{ data: { '*': ['id'] } }`; without a structure, just checks it's JSON. */
|
|
863
|
+
assertJsonStructure(structure?: JsonStructure): this;
|
|
864
|
+
/** The JSON (or the value at `key`) has `count` elements. */
|
|
865
|
+
assertJsonCount(count: number, key?: string): this;
|
|
866
|
+
/** assertRedirect() to the URL of a named route (resolved with the app's UrlGenerator). */
|
|
867
|
+
assertRedirectToRoute(name: string, parameters?: unknown): this;
|
|
868
|
+
/** The JSON body has validation errors for these keys (and messages containing these fragments). */
|
|
869
|
+
assertJsonValidationErrors(errors: ExpectedErrors, responseKey?: string): this;
|
|
870
|
+
/** No validation errors in the JSON (or none for these keys). */
|
|
871
|
+
assertJsonMissingValidationErrors(keys?: string | string[], responseKey?: string): this;
|
|
872
|
+
/** No validation errors: JSON responses are checked in the body, others in the session. */
|
|
873
|
+
assertValid(keys?: string | string[], errorBag?: string, responseKey?: string): this;
|
|
874
|
+
/** Validation errors for these keys (message fragments match with "contains"): JSON body or session. */
|
|
875
|
+
assertInvalid(errors: ExpectedErrors, errorBag?: string, responseKey?: string): this;
|
|
876
|
+
/** The request's session after the response (flashed data is still there). */
|
|
877
|
+
session(): Session$1;
|
|
878
|
+
/** A key (with an optional value or predicate), several keys, or a { key: value } record. */
|
|
879
|
+
assertSessionHas(key: string | string[] | Record<string, unknown>, value?: unknown): this;
|
|
880
|
+
assertSessionHasAll(bindings: Record<string, unknown>): this;
|
|
881
|
+
assertSessionMissing(key: string | string[], value?: unknown): this;
|
|
882
|
+
/** Old input flashed with the redirect (withInput()). */
|
|
883
|
+
assertSessionHasInput(key: string | string[] | Record<string, unknown>, value?: unknown): this;
|
|
884
|
+
/**
|
|
885
|
+
* The session has errors in `errorBag`: any at all, these keys, or these exact messages (Laravel's rules).
|
|
886
|
+
* `format` is a ':message' template applied to the actual messages first.
|
|
887
|
+
*/
|
|
888
|
+
assertSessionHasErrors(keys?: ExpectedErrors, format?: string, errorBag?: string): this;
|
|
889
|
+
assertSessionHasErrorsIn(errorBag: string, keys?: ExpectedErrors, format?: string): this;
|
|
890
|
+
/** No errors in any bag. */
|
|
891
|
+
assertSessionHasNoErrors(): this;
|
|
892
|
+
/** No errors in the bag (or none for these keys). */
|
|
893
|
+
assertSessionDoesntHaveErrors(keys?: string | string[], format?: string, errorBag?: string): this;
|
|
894
|
+
/** A cookie the response sets (the last Set-Cookie with that name). */
|
|
895
|
+
getCookie(name: string): ResponseCookie | undefined;
|
|
896
|
+
/** The cookie is set; with `value`, its (decrypted, unless `encrypted` is false) value matches. */
|
|
897
|
+
assertCookie(name: string, value?: string, encrypted?: boolean): this;
|
|
898
|
+
assertPlainCookie(name: string, value?: string): this;
|
|
899
|
+
assertCookieExpired(name: string): this;
|
|
900
|
+
assertCookieNotExpired(name: string): this;
|
|
901
|
+
assertCookieMissing(name: string): this;
|
|
902
|
+
/**
|
|
903
|
+
* The view the route returned. A request can make other views too (a mailable's, an error page), so this is the
|
|
904
|
+
* last view whose rendered HTML is the response body, else the last view made.
|
|
905
|
+
*/
|
|
906
|
+
get original(): View | undefined;
|
|
907
|
+
assertViewIs(name: string): this;
|
|
908
|
+
/** The view received `key` (dot paths allowed), optionally with this value or passing this predicate. */
|
|
909
|
+
assertViewHas(key: string | string[] | Record<string, unknown>, value?: unknown): this;
|
|
910
|
+
assertViewHasAll(bindings: string[] | Record<string, unknown>): this;
|
|
911
|
+
assertViewMissing(key: string): this;
|
|
912
|
+
/** The data the view received (dot path), or all of it. */
|
|
913
|
+
viewData<T = unknown>(key?: string): T;
|
|
914
|
+
protected absolute(url: string): string;
|
|
915
|
+
protected excerpt(text?: string): string;
|
|
916
|
+
/** Adds the rendered exception (or the body) to a status failure, like Laravel does. */
|
|
917
|
+
protected statusMessage(message: string): string;
|
|
918
|
+
protected isJson(): boolean;
|
|
919
|
+
protected sessionErrors(errorBag: string): ErrorMessages;
|
|
920
|
+
private formatted;
|
|
921
|
+
/** Laravel's assertInvalid/assertJsonValidationErrors: each key present; each expected fragment contained in a message. */
|
|
922
|
+
private assertErrorsContain;
|
|
923
|
+
private ensureView;
|
|
924
|
+
private viewDataOf;
|
|
925
|
+
private decrypted;
|
|
926
|
+
private needles;
|
|
927
|
+
private inOrder;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
type RequestData = Record<string, unknown>;
|
|
931
|
+
interface RequestOptions {
|
|
932
|
+
data?: RequestData;
|
|
933
|
+
headers?: Record<string, string>;
|
|
934
|
+
/** Send data as a JSON body (the *Json methods). */
|
|
935
|
+
json?: boolean;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Laravel's MakesHttpRequests state for one test: default headers, cookies, the session carried between
|
|
939
|
+
* requests, actingAs users and options, plus the dispatch itself.
|
|
940
|
+
*/
|
|
941
|
+
declare class HttpClient {
|
|
942
|
+
protected readonly app: Application$1;
|
|
943
|
+
readonly headers: Record<string, string>;
|
|
944
|
+
/** Cookies to encrypt on send (withCookie) and to send as-is (withUnencryptedCookie, or captured from responses). */
|
|
945
|
+
readonly cookies: Map<string, {
|
|
946
|
+
value: string;
|
|
947
|
+
encrypt: boolean;
|
|
948
|
+
}>;
|
|
949
|
+
/** actingAs() users by guard name (undefined = the default guard). */
|
|
950
|
+
readonly users: Map<string | undefined, Authenticatable>;
|
|
951
|
+
followRedirects: boolean;
|
|
952
|
+
handleExceptions: boolean;
|
|
953
|
+
/** The guard actingAs(user, guard) made the default. */
|
|
954
|
+
defaultGuard: string | undefined;
|
|
955
|
+
/** Session attributes carried from one request to the next (Laravel keeps one session store per test). */
|
|
956
|
+
session: Record<string, unknown> | undefined;
|
|
957
|
+
/** from(url): the session's previous URL for the next request only (Laravel sets it once). */
|
|
958
|
+
previousUrl: string | undefined;
|
|
959
|
+
/** Requests whose actingAs users reached the guards (the AuthFactory they went through). */
|
|
960
|
+
private readonly actingAsApplied;
|
|
961
|
+
constructor(app: Application$1);
|
|
962
|
+
request(method: string, uri: string, options?: RequestOptions): Promise<TestResponse>;
|
|
963
|
+
/** Runs `fn` in a scope prepared like a request's (carried session, actingAs users), e.g. for assertAuthenticated(). */
|
|
964
|
+
inScope<T>(fn: (scope: Container$1) => T | Promise<T>): Promise<T>;
|
|
965
|
+
/** Runs the request through the app's real HttpKernel, in a request scope this client owns. */
|
|
966
|
+
protected send(request: Request): Promise<TestResponse>;
|
|
967
|
+
/** Prepares the request scope: recorders, the carried session and actingAs users. */
|
|
968
|
+
protected beforeRequest(scope: Container$1, context: ResponseContext): void;
|
|
969
|
+
/** Keeps the session for the next request, like Laravel's per-test session store, and the guards' users. */
|
|
970
|
+
protected afterRequest(_scope: Container$1, context: ResponseContext): Promise<void>;
|
|
971
|
+
/**
|
|
972
|
+
* Laravel's actingAs() sets the user on the guard once, so a logout (or a login as someone else) in the
|
|
973
|
+
* request sticks. Reads each actingAs guard back and forgets or replaces its user to match.
|
|
974
|
+
*/
|
|
975
|
+
protected syncActingAs(auth: AuthFactory): Promise<void>;
|
|
976
|
+
/** The request's (scoped) Session, created now so the carried attributes are in place before StartSession. */
|
|
977
|
+
protected scopeSession(scope: Container$1): Session$1 | undefined;
|
|
978
|
+
buildRequest(method: string, uri: string, options: RequestOptions): Request;
|
|
979
|
+
protected baseUrl(): string;
|
|
980
|
+
protected cookieHeader(): string;
|
|
981
|
+
/** Like a browser: cookies the app sets are sent back on later requests in the same test; deleted ones are dropped. */
|
|
982
|
+
protected rememberCookies(response: Response): void;
|
|
983
|
+
}
|
|
984
|
+
/** `{ user: { name: 'a' }, tags: ['x'] }` → `user[name]=a`, `tags[0]=x` (the PHP bracket form Http parses). */
|
|
985
|
+
declare function flatten(data: RequestData, prefix?: string): Array<[string, string | Blob]>;
|
|
986
|
+
|
|
987
|
+
/** The test runner's per-test hooks. Pass Vitest's: `{ beforeEach, afterEach }`. */
|
|
988
|
+
interface TestHooks {
|
|
989
|
+
beforeEach(fn: () => unknown): void;
|
|
990
|
+
afterEach(fn: () => unknown): void;
|
|
991
|
+
}
|
|
992
|
+
/** A Laravel-style trait (RefreshDatabase, …): setUp runs after the app boots; clean-up goes in beforeApplicationDestroyed. */
|
|
993
|
+
interface TestTrait {
|
|
994
|
+
setUp(test: InteractsWithApplication): void | Promise<void>;
|
|
995
|
+
}
|
|
996
|
+
interface BootOptions {
|
|
997
|
+
hooks?: TestHooks;
|
|
998
|
+
/** Extra traits for this file, like `use RefreshDatabase;`. */
|
|
999
|
+
uses?: TestTrait[];
|
|
1000
|
+
}
|
|
1001
|
+
type Callback = () => void | Promise<void>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Laravel's TestCase lifecycle: a brand-new application for every test (createApplication() → boot → traits),
|
|
1004
|
+
* and a full teardown after it, so no state survives from one test to the next.
|
|
1005
|
+
*/
|
|
1006
|
+
declare abstract class InteractsWithApplication {
|
|
1007
|
+
/** Set once in tests/TestCase.ts: `static override hooks = { beforeEach, afterEach }` (from vitest). */
|
|
1008
|
+
static hooks?: TestHooks;
|
|
1009
|
+
/** Traits this test case uses (Laravel's `use RefreshDatabase;`). */
|
|
1010
|
+
readonly uses: TestTrait[];
|
|
1011
|
+
private application;
|
|
1012
|
+
private extraTraits;
|
|
1013
|
+
private destroying;
|
|
1014
|
+
/**
|
|
1015
|
+
* Creates the test case and registers its setUp/tearDown as beforeEach/afterEach hooks.
|
|
1016
|
+
* `const t = TestCase.boot()` at the top of a test file (or inside a describe block).
|
|
1017
|
+
*/
|
|
1018
|
+
static boot<T extends InteractsWithApplication>(this: (new () => T) & {
|
|
1019
|
+
hooks?: TestHooks;
|
|
1020
|
+
}, options?: BootOptions): T;
|
|
1021
|
+
/** The current test's application. */
|
|
1022
|
+
get app(): Application$1;
|
|
1023
|
+
/**
|
|
1024
|
+
* A fresh application for one test. tests/TestCase.ts overrides this to call bootstrap/app's factory.
|
|
1025
|
+
* The default builds one at basePath() with providers(), for package tests with no skeleton.
|
|
1026
|
+
*/
|
|
1027
|
+
createApplication(): Promise<Application$1>;
|
|
1028
|
+
/** Used by the default createApplication(). */
|
|
1029
|
+
protected basePath(): string;
|
|
1030
|
+
/** Used by the default createApplication(). */
|
|
1031
|
+
protected providers(): Array<ServiceProvider$2 | ServiceProviderClass$1>;
|
|
1032
|
+
/** The variables applied (unless already set) before each application is created. */
|
|
1033
|
+
protected environment(): Record<string, string>;
|
|
1034
|
+
/** Adjust the fresh app before it boots, e.g. `app.make(ConfigRepository).set('mail.default', 'array')`. */
|
|
1035
|
+
protected defineEnvironment(_app: Application$1): void | Promise<void>;
|
|
1036
|
+
setUp(): Promise<void>;
|
|
1037
|
+
tearDown(): Promise<void>;
|
|
1038
|
+
/** Runs in tearDown(), before the application is thrown away (in registration order). */
|
|
1039
|
+
beforeApplicationDestroyed(callback: Callback): void;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
type Headers$1 = Record<string, string>;
|
|
1043
|
+
/** Laravel's MakesHttpRequests: requests run in-process through the app's HttpKernel. State lasts for one test. */
|
|
1044
|
+
declare abstract class MakesHttpRequests extends InteractsWithApplication {
|
|
1045
|
+
private client;
|
|
1046
|
+
/** The current test's HTTP client (created on first use). */
|
|
1047
|
+
protected get http(): HttpClient;
|
|
1048
|
+
protected createHttpClient(): HttpClient;
|
|
1049
|
+
tearDown(): Promise<void>;
|
|
1050
|
+
withHeaders(headers: Headers$1): this;
|
|
1051
|
+
withHeader(name: string, value: string): this;
|
|
1052
|
+
withToken(token: string, type?: string): this;
|
|
1053
|
+
withBasicAuth(username: string, password: string): this;
|
|
1054
|
+
/** Removes the Authorization header, whatever case it was set with (header names are case-insensitive). */
|
|
1055
|
+
withoutToken(): this;
|
|
1056
|
+
/** Cookies are encrypted the way EncryptCookies expects when the app has an Encrypter. */
|
|
1057
|
+
withCookies(cookies: Record<string, string>): this;
|
|
1058
|
+
withCookie(name: string, value: string): this;
|
|
1059
|
+
withUnencryptedCookies(cookies: Record<string, string>): this;
|
|
1060
|
+
withUnencryptedCookie(name: string, value: string): this;
|
|
1061
|
+
/** Follow redirects (always with GET, like Laravel) and return the final response. */
|
|
1062
|
+
followingRedirects(): this;
|
|
1063
|
+
/** Sets the Referer and the session's previous URL, so redirect()->back() goes there. */
|
|
1064
|
+
from(url: string): this;
|
|
1065
|
+
/** Puts data in the session for the following requests (Laravel's withSession()). */
|
|
1066
|
+
withSession(data: Record<string, unknown>): this;
|
|
1067
|
+
/** Empties the session carried between requests. */
|
|
1068
|
+
flushSession(): this;
|
|
1069
|
+
/** Every following request is authenticated as `user` on `guard` (which also becomes the default guard). */
|
|
1070
|
+
actingAs(user: Authenticatable, guard?: string): this;
|
|
1071
|
+
be(user: Authenticatable, guard?: string): this;
|
|
1072
|
+
/** Errors escape from the request instead of being rendered (Laravel's withoutExceptionHandling()). */
|
|
1073
|
+
withoutExceptionHandling(): this;
|
|
1074
|
+
withExceptionHandling(): this;
|
|
1075
|
+
/** The user is authenticated (after the requests so far: carried session and actingAs). */
|
|
1076
|
+
assertAuthenticated(guard?: string): Promise<this>;
|
|
1077
|
+
assertGuest(guard?: string): Promise<this>;
|
|
1078
|
+
/** Same identifier and class as `user`. */
|
|
1079
|
+
assertAuthenticatedAs(user: Authenticatable, guard?: string): Promise<this>;
|
|
1080
|
+
protected isAuthenticated(guard?: string): Promise<boolean>;
|
|
1081
|
+
get(uri: string, headers?: Headers$1): Promise<TestResponse>;
|
|
1082
|
+
getJson(uri: string, headers?: Headers$1): Promise<TestResponse>;
|
|
1083
|
+
post(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1084
|
+
postJson(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1085
|
+
put(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1086
|
+
putJson(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1087
|
+
patch(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1088
|
+
patchJson(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1089
|
+
delete(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1090
|
+
deleteJson(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1091
|
+
options(uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1092
|
+
head(uri: string, headers?: Headers$1): Promise<TestResponse>;
|
|
1093
|
+
/** A JSON request with any verb; GET/HEAD data goes into the query string. */
|
|
1094
|
+
json(method: string, uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1095
|
+
/** Any verb with form data (Laravel's call()). */
|
|
1096
|
+
call(method: string, uri: string, data?: RequestData, headers?: Headers$1): Promise<TestResponse>;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/** Laravel's InteractsWithDatabase: database assertions and seeding, plus the options RefreshDatabase reads. */
|
|
1100
|
+
declare abstract class InteractsWithDatabase extends MakesHttpRequests {
|
|
1101
|
+
/** Seed after RefreshDatabase/DatabaseMigrations migrate (Laravel's $seed). */
|
|
1102
|
+
seed: boolean;
|
|
1103
|
+
/** Seed with this seeder class instead of DatabaseSeeder (Laravel's $seeder). */
|
|
1104
|
+
seeder: string | undefined;
|
|
1105
|
+
/** Connections RefreshDatabase/DatabaseTransactions wrap in a transaction (undefined = the default connection). */
|
|
1106
|
+
connectionsToTransact: Array<string | undefined>;
|
|
1107
|
+
protected get database(): DatabaseManager;
|
|
1108
|
+
assertDatabaseHas(table: TableOrModel, data: Row, connection?: string): Promise<this>;
|
|
1109
|
+
assertDatabaseMissing(table: TableOrModel, data: Row, connection?: string): Promise<this>;
|
|
1110
|
+
assertDatabaseCount(table: TableOrModel, count: number, connection?: string): Promise<this>;
|
|
1111
|
+
assertDatabaseEmpty(table: TableOrModel, connection?: string): Promise<this>;
|
|
1112
|
+
assertModelExists(model: ModelInstance): Promise<this>;
|
|
1113
|
+
assertModelMissing(model: ModelInstance): Promise<this>;
|
|
1114
|
+
assertSoftDeleted(table: TableOrModel, data?: Row, connection?: string, deletedAtColumn?: string): Promise<this>;
|
|
1115
|
+
assertNotSoftDeleted(table: TableOrModel, data?: Row, connection?: string, deletedAtColumn?: string): Promise<this>;
|
|
1116
|
+
/** Runs `db:seed` (with a seeder class name, like Laravel's $this->seed(UserSeeder::class)). */
|
|
1117
|
+
runSeeder(seeder?: string): Promise<this>;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/** Laravel's InteractsWithConsole: `await t.artisan('cmd', { user: 1, '--queue': 'high' }).assertExitCode(0)`. */
|
|
1121
|
+
declare abstract class InteractsWithConsole extends InteractsWithDatabase {
|
|
1122
|
+
/** The command runs when the returned PendingCommand is awaited; without `await` it never runs. */
|
|
1123
|
+
artisan(command: string, parameters?: Record<string, unknown>): PendingCommand;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Laravel's TestCase. Extend it in tests/TestCase.ts (override createApplication() and set `static hooks`),
|
|
1128
|
+
* then in each file: `const t = TestCase.boot()`, or `TestCase.boot({ uses: [RefreshDatabase] })`.
|
|
1129
|
+
*/
|
|
1130
|
+
declare abstract class TestCase extends InteractsWithConsole {
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Laravel's phpunit.xml <env> block. Applied before every test's application is created; variables that are
|
|
1135
|
+
* already set (the shell, CI, vitest.config) win, like phpunit's non-forced <env>.
|
|
1136
|
+
*/
|
|
1137
|
+
declare const TESTING_ENVIRONMENT: Readonly<Record<string, string>>;
|
|
1138
|
+
declare function applyEnvironment(values: Record<string, string>, env?: NodeJS.ProcessEnv): void;
|
|
1139
|
+
|
|
1140
|
+
/** The request scope's ViewFactory: records every view made, so TestResponse can assert on it (assertViewIs/Has). */
|
|
1141
|
+
declare function recordingViewFactory(factory: ViewFactory, views: View[]): ViewFactory;
|
|
1142
|
+
/**
|
|
1143
|
+
* The request scope's ExceptionHandler: records the error it renders (for failure messages and
|
|
1144
|
+
* withoutExceptionHandling()), then renders it as usual.
|
|
1145
|
+
*/
|
|
1146
|
+
declare function recordingExceptionHandler(handler: ExceptionHandler, record: (error: unknown) => void): ExceptionHandler;
|
|
1147
|
+
/**
|
|
1148
|
+
* The request scope's AuthFactory for actingAs(): the users are put on the scope's guards the first time
|
|
1149
|
+
* anything touches auth. That is after the kernel bound HttpRequest, so request.user() sees them too.
|
|
1150
|
+
* `onApply` runs when that happens, so the client knows to read the guards back after the request.
|
|
1151
|
+
*/
|
|
1152
|
+
declare function actingAsAuthFactory(auth: AuthFactory, users: Map<string | undefined, Authenticatable>, defaultGuard: string | undefined, onApply?: () => void): AuthFactory;
|
|
1153
|
+
|
|
1154
|
+
/** Options a test case may declare (InteractsWithDatabase declares them): Laravel's $seed, $seeder, $connectionsToTransact. */
|
|
1155
|
+
interface DatabaseTestOptions {
|
|
1156
|
+
seed?: boolean;
|
|
1157
|
+
seeder?: string;
|
|
1158
|
+
connectionsToTransact?: Array<string | undefined>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Replaces the once-per-process `migrate:fresh` that RefreshDatabase runs on a file or server database, for a test
|
|
1161
|
+
* case that must not wipe the whole database. It must leave the schema migrated, and seeded when seed/seeder ask
|
|
1162
|
+
* for it. (Laravel's migrateFreshUsing() returns options for migrate:fresh; here it replaces the command.)
|
|
1163
|
+
*/
|
|
1164
|
+
migrateFreshUsing?(): void | Promise<void>;
|
|
1165
|
+
}
|
|
1166
|
+
/** Laravel's RefreshDatabaseState: the schema is migrated once per process (per worker). */
|
|
1167
|
+
declare const RefreshDatabaseState: {
|
|
1168
|
+
migrated: boolean;
|
|
1169
|
+
};
|
|
1170
|
+
/** Runs a console command through the ConsoleKernel contract; a non-zero exit fails the test with its output. */
|
|
1171
|
+
declare function runCommand(app: Application$1, command: string, parameters?: Record<string, unknown>): Promise<void>;
|
|
1172
|
+
/** Laravel's usingInMemoryDatabase(): the default connection's database is ':memory:'. */
|
|
1173
|
+
declare function usingInMemoryDatabase(app: Application$1): boolean;
|
|
1174
|
+
/**
|
|
1175
|
+
* Laravel's RefreshDatabase.
|
|
1176
|
+
* - In-memory SQLite: every test's new application has an empty database, so it just runs `migrate`.
|
|
1177
|
+
* - Otherwise: `migrate:fresh` once per process (or the test's own migrateFreshUsing()), then each test runs inside a
|
|
1178
|
+
* transaction that is rolled back.
|
|
1179
|
+
*/
|
|
1180
|
+
declare const RefreshDatabase: TestTrait;
|
|
1181
|
+
/** Laravel's DatabaseMigrations: `migrate:fresh` before each test, `migrate:rollback` after it. */
|
|
1182
|
+
declare const DatabaseMigrations: TestTrait;
|
|
1183
|
+
/** Laravel's DatabaseTransactions: each test runs in a transaction that is rolled back (no migrations). */
|
|
1184
|
+
declare const DatabaseTransactions: TestTrait;
|
|
1185
|
+
|
|
1186
|
+
/** What an assertion targets: a class (exact constructor), or a name (a string event, a class name or a registry name). */
|
|
1187
|
+
type Target<T = unknown> = Class$1<T> | string;
|
|
1188
|
+
/** A count, or a filter over the recorded items. */
|
|
1189
|
+
type CountOrFilter<A extends unknown[]> = number | ((...args: A) => boolean);
|
|
1190
|
+
/** Swaps the fake in through the facade machinery (`facade(token).swap(fake)`: an instance on the current container). */
|
|
1191
|
+
declare function install<T extends object, F extends T>(token: Token$1<T>, fake: F): F;
|
|
1192
|
+
declare function nameOf(target: Target | object): string;
|
|
1193
|
+
/** A recorded object (or string event) matches a target: same constructor, or the same (class) name. */
|
|
1194
|
+
declare function matches(item: unknown, target: Target): boolean;
|
|
1195
|
+
|
|
1196
|
+
/** One dispatch: the event object (or name) and its payload. */
|
|
1197
|
+
interface DispatchedEvent {
|
|
1198
|
+
event: object | string;
|
|
1199
|
+
payload: unknown[];
|
|
1200
|
+
}
|
|
1201
|
+
type EventFilter<E> = (event: E, payload: unknown[]) => boolean;
|
|
1202
|
+
/**
|
|
1203
|
+
* Laravel's Event::fake(): records dispatched events instead of running listeners. With a list, only those
|
|
1204
|
+
* events are faked and everything else reaches the original dispatcher (so model events keep working).
|
|
1205
|
+
*/
|
|
1206
|
+
declare class EventFake implements EventDispatcher {
|
|
1207
|
+
readonly dispatcher: EventDispatcher | undefined;
|
|
1208
|
+
private readonly eventsToFake;
|
|
1209
|
+
private eventsToDispatch;
|
|
1210
|
+
readonly events: DispatchedEvent[];
|
|
1211
|
+
constructor(dispatcher: EventDispatcher | undefined, eventsToFake?: Target[], eventsToDispatch?: Target[]);
|
|
1212
|
+
/** Installs the fake (on the current container) and returns it: `const events = EventFake.fake([OrderShipped])`. */
|
|
1213
|
+
static fake(eventsToFake?: Target | Target[]): EventFake;
|
|
1214
|
+
/** Fakes every event except these. */
|
|
1215
|
+
static fakeExcept(eventsToDispatch: Target | Target[]): EventFake;
|
|
1216
|
+
private static original;
|
|
1217
|
+
except(events: Target | Target[]): this;
|
|
1218
|
+
listen<E>(events: Class$1<E> | string | Array<Class$1<E> | string>, listener: Listener<E>): void;
|
|
1219
|
+
hasListeners(event: Class$1<unknown> | string): boolean;
|
|
1220
|
+
dispatch(event: object | string, payload?: unknown[]): Promise<unknown[]>;
|
|
1221
|
+
/** Faked events return undefined (never false), so halting model events such as `saving` still proceed. */
|
|
1222
|
+
until(event: object | string, payload?: unknown[]): Promise<unknown>;
|
|
1223
|
+
subscribe(subscriber: Class$1<{
|
|
1224
|
+
subscribe(events: EventDispatcher): void;
|
|
1225
|
+
}>): void;
|
|
1226
|
+
forget(event: Class$1<unknown> | string): void;
|
|
1227
|
+
/** Dispatched at least once; a number asserts the exact count; a function filters (event, payload). */
|
|
1228
|
+
assertDispatched<E>(event: Class$1<E> | string, callback?: CountOrFilter<[E, unknown[]]>): void;
|
|
1229
|
+
assertDispatchedTimes<E>(event: Class$1<E> | string, times?: number): void;
|
|
1230
|
+
assertNotDispatched<E>(event: Class$1<E> | string, callback?: EventFilter<E>): void;
|
|
1231
|
+
assertNothingDispatched(): void;
|
|
1232
|
+
/** The original dispatcher has a listener for the event. */
|
|
1233
|
+
assertListening(event: Class$1<unknown> | string): void;
|
|
1234
|
+
/** The recorded events (objects, or names for string events) that match. */
|
|
1235
|
+
dispatched<E>(event: Class$1<E> | string, callback?: EventFilter<E>): E[];
|
|
1236
|
+
hasDispatched(event: Class$1<unknown> | string): boolean;
|
|
1237
|
+
private shouldFake;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
type Filter$3<J> = (job: J) => boolean;
|
|
1241
|
+
/** What a faked Bus.batch([...]).dispatch() recorded (Laravel's PendingBatchFake): the options Bus would store, plus the jobs. */
|
|
1242
|
+
interface BatchRecord extends PendingBatchOptions {
|
|
1243
|
+
readonly id: string;
|
|
1244
|
+
readonly jobs: Job[];
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* Laravel's Bus::fake(): records dispatch/dispatchSync/dispatchAfterResponse, chains and batches instead of
|
|
1248
|
+
* running or queueing them. With a list, only those jobs are faked; others go to the original dispatcher.
|
|
1249
|
+
*/
|
|
1250
|
+
declare class BusFake implements BusDispatcher {
|
|
1251
|
+
readonly dispatcher: BusDispatcher | undefined;
|
|
1252
|
+
private readonly jobsToFake;
|
|
1253
|
+
private jobsToDispatch;
|
|
1254
|
+
readonly commands: Job[];
|
|
1255
|
+
readonly commandsSync: Job[];
|
|
1256
|
+
readonly commandsAfterResponse: Job[];
|
|
1257
|
+
readonly batches: BatchRecord[];
|
|
1258
|
+
/** The rest of the chain, by the first job (Bus.chain([a, b, c]) records a with [b, c]). */
|
|
1259
|
+
readonly chains: Map<Job, Job[]>;
|
|
1260
|
+
constructor(dispatcher: BusDispatcher | undefined, jobsToFake?: Target[], jobsToDispatch?: Target[]);
|
|
1261
|
+
static fake(jobsToFake?: Target | Target[]): BusFake;
|
|
1262
|
+
static fakeExcept(jobsToDispatch: Target | Target[]): BusFake;
|
|
1263
|
+
private static original;
|
|
1264
|
+
except(jobs: Target | Target[]): this;
|
|
1265
|
+
dispatch(job: Job): Promise<unknown>;
|
|
1266
|
+
dispatchSync(job: Job): Promise<unknown>;
|
|
1267
|
+
dispatchAfterResponse(job: Job): void;
|
|
1268
|
+
/**
|
|
1269
|
+
* Bus's terminating callback flushes whatever BusDispatcher is bound, which is this fake: forward to the real
|
|
1270
|
+
* dispatcher so the after-response jobs it didn't fake still run (Laravel runs them). Faked ones never run.
|
|
1271
|
+
*/
|
|
1272
|
+
flushAfterResponse(): Promise<void>;
|
|
1273
|
+
chain(jobs: Job[]): PendingChain;
|
|
1274
|
+
batch(jobs: Job[]): PendingBatch;
|
|
1275
|
+
findBatch(id: string): Promise<Batch | undefined>;
|
|
1276
|
+
/** Dispatched in any way (dispatch, dispatchSync or dispatchAfterResponse); a number asserts the count. */
|
|
1277
|
+
assertDispatched<J extends Job>(job: Target<J>, callback?: CountOrFilter<[J]>): void;
|
|
1278
|
+
assertDispatchedTimes<J extends Job>(job: Target<J>, times?: number): void;
|
|
1279
|
+
assertNotDispatched<J extends Job>(job: Target<J>, callback?: Filter$3<J>): void;
|
|
1280
|
+
assertNothingDispatched(): void;
|
|
1281
|
+
assertDispatchedSync<J extends Job>(job: Target<J>, callback?: CountOrFilter<[J]>): void;
|
|
1282
|
+
assertNotDispatchedSync<J extends Job>(job: Target<J>, callback?: Filter$3<J>): void;
|
|
1283
|
+
assertDispatchedAfterResponse<J extends Job>(job: Target<J>, callback?: CountOrFilter<[J]>): void;
|
|
1284
|
+
assertNotDispatchedAfterResponse<J extends Job>(job: Target<J>, callback?: Filter$3<J>): void;
|
|
1285
|
+
/** `[First, Second, new Third(1)]`: a dispatched First whose chain is exactly the rest (classes or equal instances). */
|
|
1286
|
+
assertChained(expectedChain: Array<Target | Job>): void;
|
|
1287
|
+
assertDispatchedWithoutChain<J extends Job>(job: Target<J>, callback?: Filter$3<J>): void;
|
|
1288
|
+
/** A batch was dispatched that passes the check. */
|
|
1289
|
+
assertBatched(callback: (batch: BatchRecord) => boolean): void;
|
|
1290
|
+
assertBatchCount(count: number): void;
|
|
1291
|
+
assertNothingBatched(): void;
|
|
1292
|
+
dispatched<J extends Job>(job: Target<J>, callback?: Filter$3<J>): J[];
|
|
1293
|
+
dispatchedSync<J extends Job>(job: Target<J>, callback?: Filter$3<J>): J[];
|
|
1294
|
+
dispatchedAfterResponse<J extends Job>(job: Target<J>, callback?: Filter$3<J>): J[];
|
|
1295
|
+
hasDispatched<J extends Job>(job: Target<J>): boolean;
|
|
1296
|
+
private shouldFake;
|
|
1297
|
+
private real;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/** One push: the job (or raw payload), where it went, and when. */
|
|
1301
|
+
interface PushedJob {
|
|
1302
|
+
job: Job | QueuePayload;
|
|
1303
|
+
raw: boolean;
|
|
1304
|
+
connection: string | undefined;
|
|
1305
|
+
queue: string | undefined;
|
|
1306
|
+
delay: number | undefined;
|
|
1307
|
+
}
|
|
1308
|
+
type Filter$2<J> = (job: J, queue: string | undefined, connection: string | undefined) => boolean;
|
|
1309
|
+
/**
|
|
1310
|
+
* Laravel's Queue::fake(): records push/later/pushRaw (on any connection) instead of queueing. Jobs that Bus
|
|
1311
|
+
* dispatches to a queue land here too, because Bus resolves QueueManager when it queues.
|
|
1312
|
+
*/
|
|
1313
|
+
declare class QueueFake implements QueueManager {
|
|
1314
|
+
readonly manager: QueueManager | undefined;
|
|
1315
|
+
private readonly jobsToFake;
|
|
1316
|
+
private jobsToPush;
|
|
1317
|
+
readonly jobs: PushedJob[];
|
|
1318
|
+
constructor(manager: QueueManager | undefined, jobsToFake?: Target[], jobsToPush?: Target[]);
|
|
1319
|
+
static fake(jobsToFake?: Target | Target[]): QueueFake;
|
|
1320
|
+
static fakeExcept(jobsToPush: Target | Target[]): QueueFake;
|
|
1321
|
+
private static original;
|
|
1322
|
+
except(jobs: Target | Target[]): this;
|
|
1323
|
+
/**
|
|
1324
|
+
* A recording view of the connection (pushes remember its name). Its size()/clear() only see the jobs pushed
|
|
1325
|
+
* through that connection name (no name: the jobs pushed without one, i.e. through the manager or connection()).
|
|
1326
|
+
*/
|
|
1327
|
+
connection(name?: string): Queue;
|
|
1328
|
+
push(job: Job, queue?: string): Promise<string>;
|
|
1329
|
+
later(delaySeconds: number, job: Job, queue?: string): Promise<string>;
|
|
1330
|
+
pushRaw(payload: QueuePayload, queue?: string, delaySeconds?: number): Promise<string>;
|
|
1331
|
+
pop(_queue?: string): Promise<QueueJob | undefined>;
|
|
1332
|
+
/** Jobs on `queue` (every queue when omitted), whatever connection they were pushed on, like Laravel's fake. */
|
|
1333
|
+
size(queue?: string): Promise<number>;
|
|
1334
|
+
/** Removes the jobs size() counts and returns how many. */
|
|
1335
|
+
clear(queue?: string): Promise<number>;
|
|
1336
|
+
extend(_driver: string, _factory: (config: Record<string, unknown>) => Queue): void;
|
|
1337
|
+
/** Pushed at least once; a number asserts the count; a filter gets (job, queue, connection). */
|
|
1338
|
+
assertPushed<J extends Job>(job: Target<J>, callback?: CountOrFilter<[J, string | undefined, string | undefined]>): void;
|
|
1339
|
+
assertPushedTimes<J extends Job>(job: Target<J>, times?: number): void;
|
|
1340
|
+
assertPushedOn<J extends Job>(queue: string, job: Target<J>, callback?: Filter$2<J>): void;
|
|
1341
|
+
assertNotPushed<J extends Job>(job: Target<J>, callback?: Filter$2<J>): void;
|
|
1342
|
+
assertNothingPushed(): void;
|
|
1343
|
+
assertCount(expected: number): void;
|
|
1344
|
+
/** The job was pushed with exactly this chain (Bus stores it on the first job under the protocol key). */
|
|
1345
|
+
assertPushedWithChain<J extends Job>(job: Target<J>, expectedChain: Array<Target | Job>, callback?: Filter$2<J>): void;
|
|
1346
|
+
assertPushedWithoutChain<J extends Job>(job: Target<J>, callback?: Filter$2<J>): void;
|
|
1347
|
+
/** Pushed jobs matching the target (raw payloads match by their registry name or display name). */
|
|
1348
|
+
pushed<J extends Job>(job: Target<J>, callback?: Filter$2<J>): J[];
|
|
1349
|
+
hasPushed<J extends Job>(job: Target<J>): boolean;
|
|
1350
|
+
private record;
|
|
1351
|
+
private recordRaw;
|
|
1352
|
+
/** The job is on `queue` (any when undefined) and, when `connection` is given, was pushed on that connection name. */
|
|
1353
|
+
private on;
|
|
1354
|
+
private remove;
|
|
1355
|
+
private targets;
|
|
1356
|
+
private nameOf;
|
|
1357
|
+
private shouldFake;
|
|
1358
|
+
private real;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/** A mailable the fake saw, with its resolved recipients (PendingMail's, else the envelope's) and subject. */
|
|
1362
|
+
declare class MailRecord<M extends Mailable = Mailable> {
|
|
1363
|
+
readonly mailable: M;
|
|
1364
|
+
readonly mailer: string | undefined;
|
|
1365
|
+
readonly to: Address[];
|
|
1366
|
+
readonly cc: Address[];
|
|
1367
|
+
readonly bcc: Address[];
|
|
1368
|
+
readonly subject: string | undefined;
|
|
1369
|
+
readonly queued: boolean;
|
|
1370
|
+
readonly delay: number | undefined;
|
|
1371
|
+
constructor(mailable: M, mailer: string | undefined, to: Address[], cc: Address[], bcc: Address[], subject: string | undefined, queued: boolean, delay: number | undefined);
|
|
1372
|
+
hasTo(address: MailRecipient): boolean;
|
|
1373
|
+
hasCc(address: MailRecipient): boolean;
|
|
1374
|
+
hasBcc(address: MailRecipient): boolean;
|
|
1375
|
+
hasSubject(subject: string): boolean;
|
|
1376
|
+
}
|
|
1377
|
+
type Filter$1<M extends Mailable> = (mailable: M, mail: MailRecord<M>) => boolean;
|
|
1378
|
+
/**
|
|
1379
|
+
* Laravel's Mail::fake(): records what would have been sent or queued. Queueable mailables (the Queue/Bus
|
|
1380
|
+
* protocol's rule) sent with send() count as queued, like the real Mailer. Nothing is rendered or delivered.
|
|
1381
|
+
*/
|
|
1382
|
+
declare class MailFake implements MailManager {
|
|
1383
|
+
readonly manager: MailManager | undefined;
|
|
1384
|
+
readonly records: MailRecord[];
|
|
1385
|
+
constructor(manager?: MailManager | undefined);
|
|
1386
|
+
static fake(): MailFake;
|
|
1387
|
+
mailer(name?: string): Mailer;
|
|
1388
|
+
to(recipients: MailRecipient | MailRecipient[]): PendingMail;
|
|
1389
|
+
send(mailable: Mailable): Promise<SentMessage | undefined>;
|
|
1390
|
+
queue(mailable: Mailable): Promise<void>;
|
|
1391
|
+
extend(_transport: string, _factory: (config: Record<string, unknown>) => MailTransport): void;
|
|
1392
|
+
/** Sent (not queued) at least once; a number asserts the count; a filter gets (mailable, record). */
|
|
1393
|
+
assertSent<M extends Mailable>(mailable: Target<M>, callback?: CountOrFilter<[M, MailRecord<M>]>): void;
|
|
1394
|
+
assertSentTimes<M extends Mailable>(mailable: Target<M>, times?: number): void;
|
|
1395
|
+
assertNotSent<M extends Mailable>(mailable: Target<M>, callback?: Filter$1<M>): void;
|
|
1396
|
+
assertNothingSent(): void;
|
|
1397
|
+
assertSentCount(count: number): void;
|
|
1398
|
+
assertQueued<M extends Mailable>(mailable: Target<M>, callback?: CountOrFilter<[M, MailRecord<M>]>): void;
|
|
1399
|
+
assertNotQueued<M extends Mailable>(mailable: Target<M>, callback?: Filter$1<M>): void;
|
|
1400
|
+
assertNothingQueued(): void;
|
|
1401
|
+
assertQueuedCount(count: number): void;
|
|
1402
|
+
/** Sent or queued. */
|
|
1403
|
+
assertOutgoingCount(count: number): void;
|
|
1404
|
+
assertNothingOutgoing(): void;
|
|
1405
|
+
sent<M extends Mailable>(mailable: Target<M>, callback?: Filter$1<M>): M[];
|
|
1406
|
+
queued<M extends Mailable>(mailable: Target<M>, callback?: Filter$1<M>): M[];
|
|
1407
|
+
hasSent(mailable: Target<Mailable>): boolean;
|
|
1408
|
+
hasQueued(mailable: Target<Mailable>): boolean;
|
|
1409
|
+
private pending;
|
|
1410
|
+
private sendVia;
|
|
1411
|
+
private queueVia;
|
|
1412
|
+
private record;
|
|
1413
|
+
private matching;
|
|
1414
|
+
}
|
|
1415
|
+
/** MailRecipient(s) → Address[] (strings, Address objects, or anything with email + name, such as a User model). */
|
|
1416
|
+
declare function addresses(recipients: MailRecipient | MailRecipient[]): Address[];
|
|
1417
|
+
|
|
1418
|
+
/** One delivery the fake recorded: to whom, what, and on which channels (the notification's via()). */
|
|
1419
|
+
interface SentNotification {
|
|
1420
|
+
notifiable: Notifiable;
|
|
1421
|
+
notification: Notification;
|
|
1422
|
+
channels: string[];
|
|
1423
|
+
}
|
|
1424
|
+
type Filter<N extends Notification> = (notification: N, channels: string[], notifiable: Notifiable) => boolean;
|
|
1425
|
+
/** Notification.route('mail', 'a@b.c'): an on-demand notifiable (Laravel's AnonymousNotifiable). */
|
|
1426
|
+
declare class AnonymousNotifiable implements Notifiable {
|
|
1427
|
+
private readonly dispatcher;
|
|
1428
|
+
readonly routes: Map<string, unknown>;
|
|
1429
|
+
constructor(dispatcher: NotificationDispatcher);
|
|
1430
|
+
route(channel: string, route: unknown): this;
|
|
1431
|
+
routeNotificationFor(channel: string): unknown;
|
|
1432
|
+
notify(notification: Notification): Promise<void>;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Laravel's Notification::fake(): records notifications (send, sendNow, on-demand routes) instead of
|
|
1436
|
+
* delivering or queueing them. The Notifiable mixin's notify() resolves the dispatcher per call, so it lands here.
|
|
1437
|
+
*/
|
|
1438
|
+
declare class NotificationFake implements NotificationDispatcher {
|
|
1439
|
+
readonly dispatcher: NotificationDispatcher | undefined;
|
|
1440
|
+
readonly notifications: SentNotification[];
|
|
1441
|
+
constructor(dispatcher?: NotificationDispatcher | undefined);
|
|
1442
|
+
static fake(): NotificationFake;
|
|
1443
|
+
send(notifiables: Notifiable | Iterable<Notifiable>, notification: Notification): Promise<void>;
|
|
1444
|
+
sendNow(notifiables: Notifiable | Iterable<Notifiable>, notification: Notification, channels?: string[]): Promise<void>;
|
|
1445
|
+
route(channel: string, route: unknown): AnonymousNotifiable;
|
|
1446
|
+
/** The Notifications provider calls this in boot(); a fake has no channels to register. */
|
|
1447
|
+
extend(_channel: string, _factory: () => NotificationChannel): void;
|
|
1448
|
+
/** Sent to the notifiable(s); a number asserts the count; a filter gets (notification, channels, notifiable). */
|
|
1449
|
+
assertSentTo<N extends Notification>(notifiable: Notifiable | Iterable<Notifiable>, notification: Target<N>, callback?: CountOrFilter<[N, string[], Notifiable]>): void;
|
|
1450
|
+
assertSentToTimes<N extends Notification>(notifiable: Notifiable, notification: Target<N>, times?: number): void;
|
|
1451
|
+
assertNotSentTo<N extends Notification>(notifiable: Notifiable | Iterable<Notifiable>, notification: Target<N>, callback?: Filter<N>): void;
|
|
1452
|
+
/** Sent through Notification.route(...) (an anonymous notifiable). */
|
|
1453
|
+
assertSentOnDemand<N extends Notification>(notification: Target<N>, callback?: CountOrFilter<[N, string[], AnonymousNotifiable]>): void;
|
|
1454
|
+
assertNothingSent(): void;
|
|
1455
|
+
assertNothingSentTo(notifiable: Notifiable): void;
|
|
1456
|
+
/** Sent this many times in total, to anyone. */
|
|
1457
|
+
assertSentTimes(notification: Target<Notification>, times: number): void;
|
|
1458
|
+
assertCount(expected: number): void;
|
|
1459
|
+
sent<N extends Notification>(notifiable: Notifiable, notification: Target<N> | Class$1<N>, callback?: Filter<N>): N[];
|
|
1460
|
+
hasSent(notifiable: Notifiable, notification: Target<Notification>): boolean;
|
|
1461
|
+
private record;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
interface StoredFile {
|
|
1465
|
+
bytes: Uint8Array;
|
|
1466
|
+
visibility: 'public' | 'private';
|
|
1467
|
+
mimeType: string | undefined;
|
|
1468
|
+
modified: Date;
|
|
1469
|
+
}
|
|
1470
|
+
declare function guessMimeType(path: string): string | undefined;
|
|
1471
|
+
/**
|
|
1472
|
+
* An in-memory disk implementing the Filesystem contract, with Laravel's fake-disk assertions. (Laravel's fake
|
|
1473
|
+
* writes to storage/framework/testing/disks; this one keeps files in memory, so there's nothing to clean up.)
|
|
1474
|
+
*/
|
|
1475
|
+
declare class FakeDisk implements Filesystem {
|
|
1476
|
+
readonly name: string;
|
|
1477
|
+
private readonly urlPrefix;
|
|
1478
|
+
/** Stored files by normalized path. */
|
|
1479
|
+
readonly stored: Map<string, StoredFile>;
|
|
1480
|
+
/** Directories made explicitly (others exist because files are in them). */
|
|
1481
|
+
readonly made: Set<string>;
|
|
1482
|
+
constructor(name: string, urlPrefix?: string);
|
|
1483
|
+
exists(path: string): Promise<boolean>;
|
|
1484
|
+
missing(path: string): Promise<boolean>;
|
|
1485
|
+
get(path: string): Promise<string>;
|
|
1486
|
+
getBytes(path: string): Promise<Uint8Array>;
|
|
1487
|
+
readStream(path: string): Promise<ReadableStream<Uint8Array>>;
|
|
1488
|
+
put(path: string, contents: string | Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<boolean>;
|
|
1489
|
+
putFile(directory: string, file: UploadedFile$1, options?: PutOptions): Promise<string>;
|
|
1490
|
+
putFileAs(directory: string, file: UploadedFile$1, name: string, options?: PutOptions): Promise<string>;
|
|
1491
|
+
delete(paths: string | string[]): Promise<boolean>;
|
|
1492
|
+
copy(from: string, to: string): Promise<boolean>;
|
|
1493
|
+
move(from: string, to: string): Promise<boolean>;
|
|
1494
|
+
size(path: string): Promise<number>;
|
|
1495
|
+
lastModified(path: string): Promise<Date>;
|
|
1496
|
+
mimeType(path: string): Promise<string | undefined>;
|
|
1497
|
+
url(path: string): string;
|
|
1498
|
+
temporaryUrl(path: string, expiresAt: Date): Promise<string>;
|
|
1499
|
+
files(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
1500
|
+
directories(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
1501
|
+
makeDirectory(path: string): Promise<boolean>;
|
|
1502
|
+
deleteDirectory(path: string): Promise<boolean>;
|
|
1503
|
+
/** A virtual absolute path (the files only exist in memory). */
|
|
1504
|
+
path(path: string): string;
|
|
1505
|
+
/** The file(s) exist; with `content`, the (single) file has exactly that content. */
|
|
1506
|
+
assertExists(path: string | string[], content?: string): Promise<this>;
|
|
1507
|
+
assertMissing(path: string | string[]): Promise<this>;
|
|
1508
|
+
assertDirectoryEmpty(path: string): Promise<this>;
|
|
1509
|
+
assertCount(path: string, count: number, recursive?: boolean): Promise<this>;
|
|
1510
|
+
private read;
|
|
1511
|
+
private isDirectory;
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Laravel's Storage::fake('avatars'): swaps the FilesystemManager for one whose faked disks live in memory
|
|
1515
|
+
* (other disks still reach the real manager). Returns the fake disk.
|
|
1516
|
+
*/
|
|
1517
|
+
declare class StorageFake implements FilesystemManager {
|
|
1518
|
+
readonly manager: FilesystemManager | undefined;
|
|
1519
|
+
private readonly defaultDisk;
|
|
1520
|
+
readonly disks: Map<string, FakeDisk>;
|
|
1521
|
+
constructor(manager: FilesystemManager | undefined, defaultDisk: string);
|
|
1522
|
+
static fake(disk?: string): FakeDisk;
|
|
1523
|
+
disk(name?: string): Filesystem;
|
|
1524
|
+
extend(driver: string, factory: (config: Record<string, unknown>) => Filesystem): void;
|
|
1525
|
+
exists(path: string): Promise<boolean>;
|
|
1526
|
+
missing(path: string): Promise<boolean>;
|
|
1527
|
+
get(path: string): Promise<string>;
|
|
1528
|
+
getBytes(path: string): Promise<Uint8Array<ArrayBufferLike>>;
|
|
1529
|
+
readStream(path: string): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>;
|
|
1530
|
+
put(path: string, contents: string | Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<boolean>;
|
|
1531
|
+
putFile(directory: string, file: UploadedFile$1, options?: PutOptions): Promise<string>;
|
|
1532
|
+
putFileAs(directory: string, file: UploadedFile$1, name: string, options?: PutOptions): Promise<string>;
|
|
1533
|
+
delete(paths: string | string[]): Promise<boolean>;
|
|
1534
|
+
copy(from: string, to: string): Promise<boolean>;
|
|
1535
|
+
move(from: string, to: string): Promise<boolean>;
|
|
1536
|
+
size(path: string): Promise<number>;
|
|
1537
|
+
lastModified(path: string): Promise<Date>;
|
|
1538
|
+
mimeType(path: string): Promise<string | undefined>;
|
|
1539
|
+
url(path: string): string;
|
|
1540
|
+
temporaryUrl(path: string, expiresAt: Date): Promise<string>;
|
|
1541
|
+
files(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
1542
|
+
directories(directory?: string, recursive?: boolean): Promise<string[]>;
|
|
1543
|
+
makeDirectory(path: string): Promise<boolean>;
|
|
1544
|
+
deleteDirectory(path: string): Promise<boolean>;
|
|
1545
|
+
path(path: string): string;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
/** Laravel's UploadedFile::fake(): File objects to post as multipart uploads (t.post(uri, { avatar: file })). */
|
|
1549
|
+
declare const FakeFile: {
|
|
1550
|
+
/** A file of `kilobytes` KiB (zero bytes), typed by `mimeType` or the extension. */
|
|
1551
|
+
create(name: string, kilobytes?: number, mimeType?: string): File;
|
|
1552
|
+
/** A real PNG image of the given size (typed by the name's extension, like Laravel's image()). */
|
|
1553
|
+
image(name: string, width?: number, height?: number): File;
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
/** A typed, runtime-unique key for container bindings. */
|
|
1557
|
+
interface Token<T> {
|
|
1558
|
+
readonly id: symbol;
|
|
1559
|
+
readonly description: string;
|
|
1560
|
+
/** Phantom field: only carries T at the type level. Never set at runtime. */
|
|
1561
|
+
readonly __type?: T;
|
|
1562
|
+
}
|
|
1563
|
+
type Class<T> = abstract new (...args: any[]) => T;
|
|
1564
|
+
type Abstract<T> = Token<T> | Class<T>;
|
|
1565
|
+
type Factory<T> = (container: Container) => T;
|
|
1566
|
+
type Concrete<T> = Factory<T> | (new () => T);
|
|
1567
|
+
interface Container {
|
|
1568
|
+
/** New instance on every make(). A class with no concrete binds to itself (constructed with no args). Root only; throws on a scope. */
|
|
1569
|
+
bind<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void;
|
|
1570
|
+
/** One instance for the life of this container and its scopes. Root only; throws on a scope. */
|
|
1571
|
+
singleton<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void;
|
|
1572
|
+
/** One instance per scope (e.g. per HTTP request or queue job). Root only; throws on a scope. */
|
|
1573
|
+
scoped<T>(abstract: Abstract<T>, concrete?: Concrete<T>): void;
|
|
1574
|
+
/** Register an existing object as a shared instance. Returns it. On a scope it stays local to that scope. */
|
|
1575
|
+
instance<T>(abstract: Abstract<T>, instance: T): T;
|
|
1576
|
+
/** Resolve. Unbound classes are constructed with `new Class()`. Unbound tokens throw BindingResolutionError. */
|
|
1577
|
+
make<T>(abstract: Abstract<T>): T;
|
|
1578
|
+
bound(abstract: Abstract<unknown>): boolean;
|
|
1579
|
+
resolved(abstract: Abstract<unknown>): boolean;
|
|
1580
|
+
/** Decorate or replace an instance each time it's resolved (applied before resolving callbacks). Root only; throws on a scope. */
|
|
1581
|
+
extend<T>(abstract: Abstract<T>, extender: (instance: T, container: Container) => T): void;
|
|
1582
|
+
/** Called after each resolution of the abstract. Root only; throws on a scope. */
|
|
1583
|
+
resolving<T>(abstract: Abstract<T>, callback: (instance: T, container: Container) => void): void;
|
|
1584
|
+
forgetInstance(abstract: Abstract<unknown>): void;
|
|
1585
|
+
/** A child container: shares bindings and singletons with its parent, and has its own scoped instances. Bindings can't be registered on it. */
|
|
1586
|
+
createScope(): Container;
|
|
1587
|
+
/** Run fn with this container as the "current" one for inject(), helpers and facades (AsyncLocalStorage). */
|
|
1588
|
+
run<R>(fn: () => R): R;
|
|
1589
|
+
}
|
|
1590
|
+
declare const Container: Token<Container>;
|
|
1591
|
+
|
|
1592
|
+
interface ServiceProvider$1 {
|
|
1593
|
+
/** Bind things into the container. Synchronous. Don't resolve other services here. */
|
|
1594
|
+
register?(): void;
|
|
1595
|
+
/** Runs after every provider is registered. May be async (e.g. importing route files). */
|
|
1596
|
+
boot?(): void | Promise<void>;
|
|
1597
|
+
}
|
|
1598
|
+
type ServiceProviderClass = new (app: Application) => ServiceProvider$1;
|
|
1599
|
+
interface Application extends Container {
|
|
1600
|
+
readonly version: string;
|
|
1601
|
+
basePath(path?: string): string;
|
|
1602
|
+
appPath(path?: string): string;
|
|
1603
|
+
bootstrapPath(path?: string): string;
|
|
1604
|
+
configPath(path?: string): string;
|
|
1605
|
+
databasePath(path?: string): string;
|
|
1606
|
+
publicPath(path?: string): string;
|
|
1607
|
+
resourcePath(path?: string): string;
|
|
1608
|
+
storagePath(path?: string): string;
|
|
1609
|
+
/** With no args returns the environment name. With args returns whether it matches any of them. */
|
|
1610
|
+
environment(): string;
|
|
1611
|
+
environment(...environments: string[]): boolean;
|
|
1612
|
+
isProduction(): boolean;
|
|
1613
|
+
isLocal(): boolean;
|
|
1614
|
+
runningInConsole(): boolean;
|
|
1615
|
+
/** Mark the app as running in the console (the CLI entry point calls this). Defaults to true. */
|
|
1616
|
+
setRunningInConsole(value?: boolean): void;
|
|
1617
|
+
runningUnitTests(): boolean;
|
|
1618
|
+
/** Registers the provider. If the app is already booted, the provider is booted immediately. */
|
|
1619
|
+
register(provider: ServiceProvider$1 | ServiceProviderClass): Promise<ServiceProvider$1>;
|
|
1620
|
+
getProviders(): ServiceProvider$1[];
|
|
1621
|
+
boot(): Promise<void>;
|
|
1622
|
+
isBooted(): boolean;
|
|
1623
|
+
booting(callback: (app: Application) => void | Promise<void>): void;
|
|
1624
|
+
booted(callback: (app: Application) => void | Promise<void>): void;
|
|
1625
|
+
/** Handle one HTTP request in a fresh request scope via the bound HttpKernel. */
|
|
1626
|
+
handle(request: Request): Promise<Response>;
|
|
1627
|
+
/** Register a callback that terminate() runs, in registration order. */
|
|
1628
|
+
terminating(callback: () => void | Promise<void>): void;
|
|
1629
|
+
terminate(): Promise<void>;
|
|
1630
|
+
}
|
|
1631
|
+
declare const Application: Token$2<Application>;
|
|
1632
|
+
interface Htmlable {
|
|
1633
|
+
toHtml(): string;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
/** The session of the current request (scoped). Loaded and saved by the StartSession middleware. */
|
|
1637
|
+
interface Session {
|
|
1638
|
+
getId(): string;
|
|
1639
|
+
start(): Promise<void>;
|
|
1640
|
+
save(): Promise<void>;
|
|
1641
|
+
all(): Record<string, unknown>;
|
|
1642
|
+
has(key: string): boolean;
|
|
1643
|
+
get<T = unknown>(key: string, defaultValue?: T): T;
|
|
1644
|
+
put(key: string | Record<string, unknown>, value?: unknown): void;
|
|
1645
|
+
push(key: string, value: unknown): void;
|
|
1646
|
+
pull<T = unknown>(key: string, defaultValue?: T): T;
|
|
1647
|
+
forget(...keys: string[]): void;
|
|
1648
|
+
flush(): void;
|
|
1649
|
+
flash(key: string, value: unknown): void;
|
|
1650
|
+
now(key: string, value: unknown): void;
|
|
1651
|
+
reflash(): void;
|
|
1652
|
+
keep(...keys: string[]): void;
|
|
1653
|
+
getOldInput<T = unknown>(key?: string, defaultValue?: T): T;
|
|
1654
|
+
flashInput(input: Record<string, unknown>): void;
|
|
1655
|
+
token(): string;
|
|
1656
|
+
regenerateToken(): void;
|
|
1657
|
+
regenerate(destroy?: boolean): Promise<void>;
|
|
1658
|
+
invalidate(): Promise<void>;
|
|
1659
|
+
previousUrl(): string | undefined;
|
|
1660
|
+
setPreviousUrl(url: string): void;
|
|
1661
|
+
}
|
|
1662
|
+
declare const Session: Token$2<Session>;
|
|
1663
|
+
|
|
1664
|
+
/** A rule object (Laravel's ValidationRule). Call fail() to reject the value. */
|
|
1665
|
+
interface ValidationRule {
|
|
1666
|
+
validate(attribute: string, value: unknown, fail: (message: string) => void, data: Record<string, unknown>): void | Promise<void>;
|
|
1667
|
+
}
|
|
1668
|
+
/** 'required|string|max:255', or an array mixing strings and rule objects. Keys support dot + `*` wildcards. */
|
|
1669
|
+
type Rules = Record<string, string | ReadonlyArray<string | ValidationRule>>;
|
|
1670
|
+
interface MessageBag {
|
|
1671
|
+
has(key: string): boolean;
|
|
1672
|
+
first(key?: string): string | undefined;
|
|
1673
|
+
get(key: string): string[];
|
|
1674
|
+
all(): string[];
|
|
1675
|
+
isEmpty(): boolean;
|
|
1676
|
+
count(): number;
|
|
1677
|
+
toObject(): Record<string, string[]>;
|
|
1678
|
+
}
|
|
1679
|
+
interface UploadedFile {
|
|
1680
|
+
readonly clientName: string;
|
|
1681
|
+
readonly mimeType: string;
|
|
1682
|
+
readonly size: number;
|
|
1683
|
+
extension(): string;
|
|
1684
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1685
|
+
/** Stores on a Filesystem disk. Returns the stored path. */
|
|
1686
|
+
store(directory: string, disk?: string): Promise<string>;
|
|
1687
|
+
storeAs(directory: string, name: string, disk?: string): Promise<string>;
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Oriel's request wrapper (one per request, scoped).
|
|
1691
|
+
* The Http kernel awaits `load()` before any middleware runs, so every input accessor below is synchronous.
|
|
1692
|
+
*/
|
|
1693
|
+
interface HttpRequest {
|
|
1694
|
+
readonly raw: Request;
|
|
1695
|
+
load(): Promise<this>;
|
|
1696
|
+
method(): string;
|
|
1697
|
+
isMethod(method: string): boolean;
|
|
1698
|
+
url(): string;
|
|
1699
|
+
fullUrl(): string;
|
|
1700
|
+
path(): string;
|
|
1701
|
+
is(...patterns: string[]): boolean;
|
|
1702
|
+
routeIs(...names: string[]): boolean;
|
|
1703
|
+
header(name: string): string | undefined;
|
|
1704
|
+
header(name: string, defaultValue: string): string;
|
|
1705
|
+
bearerToken(): string | undefined;
|
|
1706
|
+
ip(): string | undefined;
|
|
1707
|
+
expectsJson(): boolean;
|
|
1708
|
+
ajax(): boolean;
|
|
1709
|
+
query<T = unknown>(key?: string, defaultValue?: T): T;
|
|
1710
|
+
input<T = unknown>(key?: string, defaultValue?: T): T;
|
|
1711
|
+
all(): Record<string, unknown>;
|
|
1712
|
+
only(...keys: string[]): Record<string, unknown>;
|
|
1713
|
+
except(...keys: string[]): Record<string, unknown>;
|
|
1714
|
+
has(...keys: string[]): boolean;
|
|
1715
|
+
filled(key: string): boolean;
|
|
1716
|
+
boolean(key: string, defaultValue?: boolean): boolean;
|
|
1717
|
+
integer(key: string, defaultValue?: number): number;
|
|
1718
|
+
merge(values: Record<string, unknown>): this;
|
|
1719
|
+
file(key: string): UploadedFile | undefined;
|
|
1720
|
+
cookie(name: string): string | undefined;
|
|
1721
|
+
/** Replace the parsed request cookies (EncryptCookies calls this after decrypting). */
|
|
1722
|
+
setCookies(cookies: Record<string, string>): void;
|
|
1723
|
+
/** Route parameter (after model binding), or every parameter when called with no key. */
|
|
1724
|
+
route<T = unknown>(key?: string): T;
|
|
1725
|
+
session(): Session;
|
|
1726
|
+
/** The user resolved earlier by auth middleware. Undefined for guests. Use `await Auth.user()` to resolve lazily. */
|
|
1727
|
+
user<T = unknown>(guard?: string): T | undefined;
|
|
1728
|
+
setUserResolver(resolver: (guard?: string) => unknown): void;
|
|
1729
|
+
/** Validates this request's input via the ValidationFactory; throws a Validation OrielError (422) on failure. */
|
|
1730
|
+
validate<T = Record<string, unknown>>(rules: Rules, messages?: Record<string, string>, attributes?: Record<string, string>): Promise<T>;
|
|
1731
|
+
}
|
|
1732
|
+
declare const HttpRequest: Token$2<HttpRequest>;
|
|
1733
|
+
|
|
1734
|
+
type ErrorKind = 'Http' | 'Server' | 'ModelNotFound' | 'Validation' | 'Authentication' | 'Authorization' | 'TokenMismatch' | 'BindingResolution' | 'CircularDependency' | 'ContainerNotAvailable';
|
|
1735
|
+
/** Every error thrown by the framework implements this. The exception handler switches on `kind`. */
|
|
1736
|
+
interface OrielError extends Error {
|
|
1737
|
+
readonly kind: ErrorKind;
|
|
1738
|
+
/** HTTP status the error should render as, when relevant. */
|
|
1739
|
+
readonly status?: number;
|
|
1740
|
+
readonly headers?: Record<string, string>;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
interface LiveSnapshot {
|
|
1744
|
+
data: Record<string, unknown>;
|
|
1745
|
+
memo: {
|
|
1746
|
+
id: string;
|
|
1747
|
+
/** ClassRegistry name of the component. */
|
|
1748
|
+
name: string;
|
|
1749
|
+
path: string;
|
|
1750
|
+
method: string;
|
|
1751
|
+
children: Record<string, [tag: string, id: string]>;
|
|
1752
|
+
errors: Record<string, string[]>;
|
|
1753
|
+
};
|
|
1754
|
+
/** HMAC-SHA256 of JSON(data + memo), keyed by APP_KEY. */
|
|
1755
|
+
checksum: string;
|
|
1756
|
+
}
|
|
1757
|
+
interface LiveEffects {
|
|
1758
|
+
html?: string;
|
|
1759
|
+
/** Browser events from this.dispatch(); `self` keeps one on this component, `to` sends it to one component name. */
|
|
1760
|
+
dispatches?: Array<{
|
|
1761
|
+
name: string;
|
|
1762
|
+
params: Record<string, unknown>;
|
|
1763
|
+
self?: true;
|
|
1764
|
+
to?: string;
|
|
1765
|
+
}>;
|
|
1766
|
+
/** Events this component listens to (@On, static listeners); sent with the first render. */
|
|
1767
|
+
listeners?: string[];
|
|
1768
|
+
redirect?: string;
|
|
1769
|
+
/** Follow `redirect` with o:navigate instead of a full page load. */
|
|
1770
|
+
redirectUsingNavigate?: true;
|
|
1771
|
+
returns?: unknown[];
|
|
1772
|
+
}
|
|
1773
|
+
interface LiveUpdateRequest {
|
|
1774
|
+
components: Array<{
|
|
1775
|
+
/** JSON-encoded LiveSnapshot. */
|
|
1776
|
+
snapshot: string;
|
|
1777
|
+
updates: Record<string, unknown>;
|
|
1778
|
+
calls: Array<{
|
|
1779
|
+
method: string;
|
|
1780
|
+
params: unknown[];
|
|
1781
|
+
}>;
|
|
1782
|
+
}>;
|
|
1783
|
+
}
|
|
1784
|
+
interface LiveUpdateResponse {
|
|
1785
|
+
components: Array<{
|
|
1786
|
+
snapshot: string;
|
|
1787
|
+
effects: LiveEffects;
|
|
1788
|
+
}>;
|
|
1789
|
+
}
|
|
1790
|
+
interface LiveManager {
|
|
1791
|
+
register(component: Class<unknown>, name?: string): void;
|
|
1792
|
+
/** Server-renders the first HTML (snapshot embedded). `key` identifies a child inside its parent (o:key). */
|
|
1793
|
+
mount(component: string | Class<unknown>, params?: Record<string, unknown>, key?: string): Promise<string>;
|
|
1794
|
+
/** Checks checksums and CSRF, then applies updates and calls, re-renders and returns new snapshots. */
|
|
1795
|
+
update(request: LiveUpdateRequest): Promise<LiveUpdateResponse>;
|
|
1796
|
+
/**
|
|
1797
|
+
* A full-page component (Route.get('/counter', Counter)): mounts `component` (a component instance) with the current route's parameters and
|
|
1798
|
+
* returns the response, its layout view or a redirect.
|
|
1799
|
+
*/
|
|
1800
|
+
page(component: object): Promise<unknown>;
|
|
1801
|
+
isLiveRequest(request: HttpRequest): boolean;
|
|
1802
|
+
}
|
|
1803
|
+
declare const LiveManager: Token$2<LiveManager>;
|
|
1804
|
+
|
|
1805
|
+
declare abstract class ServiceProvider implements ServiceProvider$3 {
|
|
1806
|
+
protected readonly app: Application$2;
|
|
1807
|
+
constructor(app: Application$2);
|
|
1808
|
+
register(): void;
|
|
1809
|
+
boot(): void | Promise<void>;
|
|
1810
|
+
/** Package defaults under `key`; values the app already set win (shallow merge, like Laravel). */
|
|
1811
|
+
protected mergeConfigFrom(defaults: Record<string, unknown>, key: string): void;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
/** Marks Live component classes (Symbol.for, so two copies of the package agree). */
|
|
1815
|
+
declare const COMPONENT: unique symbol;
|
|
1816
|
+
/** A browser event queued by dispatch(). `to` is resolved to a component name when the effects are built. */
|
|
1817
|
+
interface QueuedDispatch {
|
|
1818
|
+
name: string;
|
|
1819
|
+
params: Record<string, unknown>;
|
|
1820
|
+
self?: true;
|
|
1821
|
+
to?: string | Class<Component>;
|
|
1822
|
+
}
|
|
1823
|
+
/** The validation errors of a component (Laravel's MessageBag), for render(): `this.errors.first('title')`. */
|
|
1824
|
+
declare class ErrorBag implements MessageBag {
|
|
1825
|
+
private readonly messages;
|
|
1826
|
+
constructor(messages: Record<string, string[]>);
|
|
1827
|
+
has(key: string): boolean;
|
|
1828
|
+
first(key?: string): string | undefined;
|
|
1829
|
+
get(key: string): string[];
|
|
1830
|
+
all(): string[];
|
|
1831
|
+
any(): boolean;
|
|
1832
|
+
isEmpty(): boolean;
|
|
1833
|
+
count(): number;
|
|
1834
|
+
toObject(): Record<string, string[]>;
|
|
1835
|
+
}
|
|
1836
|
+
/** What dispatch() returns: `this.dispatch('saved').self()` or `.to(Sidebar)`. */
|
|
1837
|
+
declare class PendingEvent {
|
|
1838
|
+
private readonly event;
|
|
1839
|
+
constructor(event: QueuedDispatch);
|
|
1840
|
+
/** Only this component's own listeners receive the event. */
|
|
1841
|
+
self(): this;
|
|
1842
|
+
/** Only components of this class (or registered name) receive the event. */
|
|
1843
|
+
to(component: string | Class<Component>): this;
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* A Live component (Livewire 3): public fields are its state, public methods are actions the browser can call, and
|
|
1847
|
+
* render() returns its TSX. Lifecycle hooks, all optional: `boot()`, `mount(params)`, `hydrate()`, `dehydrate()`,
|
|
1848
|
+
* `updating(name, value)`/`updated(name, value)` and per property `updatingTitle(value)`/`updatedTitle(value)`,
|
|
1849
|
+
* `rendering()`/`rendered(html)`. Fields that must not be state use `#private` syntax.
|
|
1850
|
+
*/
|
|
1851
|
+
declare abstract class Component {
|
|
1852
|
+
static readonly [COMPONENT] = true;
|
|
1853
|
+
/** The view that wraps a full-page component (default: config `live.layout`). */
|
|
1854
|
+
static layout?: string;
|
|
1855
|
+
/** The page title passed to the layout as `title`. */
|
|
1856
|
+
static title?: string;
|
|
1857
|
+
/** Static fallbacks for runtimes without decorators: { event: 'method' }, locked names, computed getter names. */
|
|
1858
|
+
static listeners?: Record<string, string>;
|
|
1859
|
+
static locked?: string[];
|
|
1860
|
+
static computed?: string[];
|
|
1861
|
+
abstract render(): unknown;
|
|
1862
|
+
getId(): string;
|
|
1863
|
+
getName(): string;
|
|
1864
|
+
/** Dispatches a browser event; every component listening for it (@On) runs its handler. */
|
|
1865
|
+
dispatch(name: string, params?: Record<string, unknown>): PendingEvent;
|
|
1866
|
+
/** Sends the browser to `url` after this request; `navigate` uses o:navigate instead of a full page load. */
|
|
1867
|
+
redirect(url: string, options?: {
|
|
1868
|
+
navigate?: boolean;
|
|
1869
|
+
}): void;
|
|
1870
|
+
redirectRoute(name: string, parameters?: unknown, options?: {
|
|
1871
|
+
navigate?: boolean;
|
|
1872
|
+
}): void;
|
|
1873
|
+
/**
|
|
1874
|
+
* Validates the public state. On success clears the error bag and returns the validated data; on failure fills the
|
|
1875
|
+
* error bag and throws (the rest of the action is skipped and the component re-renders with `errors`).
|
|
1876
|
+
*/
|
|
1877
|
+
validate<T = Record<string, unknown>>(rules: Rules, messages?: Record<string, string>, attributes?: Record<string, string>): Promise<T>;
|
|
1878
|
+
addError(key: string, message: string): void;
|
|
1879
|
+
/** Clears every error, or only those of `keys`. */
|
|
1880
|
+
resetErrorBag(...keys: string[]): void;
|
|
1881
|
+
get errors(): ErrorBag;
|
|
1882
|
+
/** Puts public properties (all of them when none are named) back to their initial values. */
|
|
1883
|
+
reset(...properties: string[]): void;
|
|
1884
|
+
/** Keeps the current HTML: the response carries the new state but no `html` effect. */
|
|
1885
|
+
skipRender(): void;
|
|
1886
|
+
/** A full-page component as a route action: Route.get('/counter', Counter). Route parameters go to mount(). */
|
|
1887
|
+
__invoke(): Promise<unknown>;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/** @On('post-created'): calls the method when the event is dispatched (by this or any component, or the browser). */
|
|
1891
|
+
declare function On(event: string): (_method: unknown, context: ClassMethodDecoratorContext) => void;
|
|
1892
|
+
/** @Locked: a property the browser can't change, or a method the browser can't call. */
|
|
1893
|
+
declare function Locked(_target: unknown, context: ClassFieldDecoratorContext | ClassMethodDecoratorContext): void;
|
|
1894
|
+
/** @Computed: a getter cached for the rest of the request, never part of the component's state. */
|
|
1895
|
+
declare function Computed<T>(getter: (this: object) => T, context: ClassGetterDecoratorContext): (this: object) => T;
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* Livewire's Livewire::test(): drives one component through the real mount → snapshot → checksum → update pipeline
|
|
1899
|
+
* (no HTTP). Actions are async (`await counter.call('increment')`); assertions are sync and return `this`.
|
|
1900
|
+
*/
|
|
1901
|
+
declare class Testable<C extends Component = Component> {
|
|
1902
|
+
#private;
|
|
1903
|
+
private readonly manager;
|
|
1904
|
+
private constructor();
|
|
1905
|
+
/** Mounts `component` with `params`, as `<Live component={…} {...params} />` would. */
|
|
1906
|
+
static create<C extends Component>(component: Class<C> | string, params?: Record<string, unknown>): Promise<Testable<C>>;
|
|
1907
|
+
/** The component instance after the last request. */
|
|
1908
|
+
instance(): C;
|
|
1909
|
+
/** A public property (dotted paths reach into arrays and objects). */
|
|
1910
|
+
get<T = unknown>(path: string): T;
|
|
1911
|
+
/** The last rendered HTML, without the o:id, o:snapshot and o:effects attributes (Livewire strips them too). */
|
|
1912
|
+
html(): string;
|
|
1913
|
+
/** The effects of the last request. */
|
|
1914
|
+
effects(): LiveEffects;
|
|
1915
|
+
set(path: string | Record<string, unknown>, value?: unknown): Promise<this>;
|
|
1916
|
+
call(method: string, ...params: unknown[]): Promise<this>;
|
|
1917
|
+
toggle(path: string): Promise<this>;
|
|
1918
|
+
/** Dispatches an event to this component, as the browser does for its listeners. */
|
|
1919
|
+
dispatch(event: string, params?: Record<string, unknown>): Promise<this>;
|
|
1920
|
+
refresh(): Promise<this>;
|
|
1921
|
+
assertSet(path: string, value: unknown): this;
|
|
1922
|
+
assertNotSet(path: string, value: unknown): this;
|
|
1923
|
+
/** Each value, HTML-escaped, appears in the rendered HTML. */
|
|
1924
|
+
assertSee(...values: string[]): this;
|
|
1925
|
+
assertDontSee(...values: string[]): this;
|
|
1926
|
+
/** Each value appears in the rendered HTML as written (not escaped). */
|
|
1927
|
+
assertSeeHtml(...values: string[]): this;
|
|
1928
|
+
assertDispatched(name: string, params?: Record<string, unknown>): this;
|
|
1929
|
+
assertNotDispatched(name: string): this;
|
|
1930
|
+
/** The error bag has errors for every key given (or any error at all with no keys). */
|
|
1931
|
+
assertHasErrors(keys?: string | string[]): this;
|
|
1932
|
+
/** No errors for the keys given (or none at all with no keys). */
|
|
1933
|
+
assertHasNoErrors(keys?: string | string[]): this;
|
|
1934
|
+
assertRedirect(url?: string): this;
|
|
1935
|
+
assertNoRedirect(): this;
|
|
1936
|
+
/** The last call returned `value`. */
|
|
1937
|
+
assertReturned(value: unknown): this;
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
/** Props of `<Live component={Counter} count={3} o:key="c1" />`: the rest become mount params. */
|
|
1941
|
+
interface LiveProps {
|
|
1942
|
+
component: Class<Component> | string;
|
|
1943
|
+
/** Identifies a child inside its parent across re-renders (Livewire's :key / wire:key). */
|
|
1944
|
+
'o:key'?: string | number;
|
|
1945
|
+
[param: string]: unknown;
|
|
1946
|
+
}
|
|
1947
|
+
/** Blade's @livewire('counter', ['count' => 3], key('c1')): the component's first render, as trusted HTML. */
|
|
1948
|
+
declare function live(component: Class<Component> | string, params?: Record<string, unknown>, key?: string | number): Promise<Htmlable>;
|
|
1949
|
+
/** `<Live component={Counter} />` in any view or component. */
|
|
1950
|
+
declare function LiveComponent({ component, 'o:key': key, children: _children, ...params }: LiveProps): Promise<Htmlable>;
|
|
1951
|
+
/** The `<Live />` element, and the Live facade: Live.component(name, Class), Live.test(Component). */
|
|
1952
|
+
declare const Live: typeof LiveComponent & {
|
|
1953
|
+
/** Registers a component under a name (components in app/Live are registered at boot). */
|
|
1954
|
+
component(name: string, component: Class<Component>): void;
|
|
1955
|
+
/** Livewire::test(): mounts `component` for assertions. */
|
|
1956
|
+
test<C extends Component>(component: Class<C> | string, params?: Record<string, unknown>): Promise<Testable<C>>;
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
type Call = {
|
|
1960
|
+
method: string;
|
|
1961
|
+
params: unknown[];
|
|
1962
|
+
};
|
|
1963
|
+
/** One component after a mount or an update: the live instance (for Live.test), its snapshot, effects and HTML. */
|
|
1964
|
+
interface ComponentResult {
|
|
1965
|
+
instance: Component;
|
|
1966
|
+
snapshot: LiveSnapshot;
|
|
1967
|
+
effects: LiveEffects;
|
|
1968
|
+
/** The rendered HTML with o:id (and, after a mount, o:snapshot/o:effects); undefined after skipRender(). */
|
|
1969
|
+
html?: string;
|
|
1970
|
+
tag?: string;
|
|
1971
|
+
}
|
|
1972
|
+
/** Livewire's update request handling and first render, on Oriel's contracts. */
|
|
1973
|
+
declare class LiveComponentManager implements LiveManager {
|
|
1974
|
+
private readonly app;
|
|
1975
|
+
constructor(app: Application);
|
|
1976
|
+
/** The request scope when there is one (sessions, the current route), else the application. */
|
|
1977
|
+
private container;
|
|
1978
|
+
private registry;
|
|
1979
|
+
/** Live.component('counter', Counter): registers a component under a name the snapshots use. */
|
|
1980
|
+
register(component: Class<unknown>, name?: string): void;
|
|
1981
|
+
/** The registered name of a component class, registering it under its kebab-case class name the first time. */
|
|
1982
|
+
nameOf(component: Class<Component>): string;
|
|
1983
|
+
resolve(name: string): Class<Component>;
|
|
1984
|
+
isLiveRequest(request: HttpRequest): boolean;
|
|
1985
|
+
/** The first render: HTML with o:id, o:snapshot and o:effects on the root element. */
|
|
1986
|
+
mount(component: string | Class<unknown>, params?: Record<string, unknown>, key?: string): Promise<string>;
|
|
1987
|
+
mountComponent(component: string | Class<unknown>, params?: Record<string, unknown>, existing?: Component): Promise<ComponentResult>;
|
|
1988
|
+
/** Applies each component's updates and calls, re-renders it and returns its new snapshot and effects. */
|
|
1989
|
+
update(request: LiveUpdateRequest): Promise<LiveUpdateResponse>;
|
|
1990
|
+
updateComponent(snapshotJson: string, updates: Record<string, unknown>, calls: Call[]): Promise<ComponentResult>;
|
|
1991
|
+
/** The route action of POST /oriel/live/update. */
|
|
1992
|
+
handle(request: HttpRequest): Promise<LiveUpdateResponse>;
|
|
1993
|
+
/** A full-page component (Route.get('/counter', Counter)): mounted with the route parameters, inside the layout. */
|
|
1994
|
+
page(component: Component): Promise<unknown>;
|
|
1995
|
+
/** Parses and checks a snapshot: a bad checksum throws before anything is hydrated. */
|
|
1996
|
+
private verify;
|
|
1997
|
+
private key;
|
|
1998
|
+
/** The request body, read from the raw JSON when the request has it, so TrimStrings can't alter typed values. */
|
|
1999
|
+
private payload;
|
|
2000
|
+
/** Makes every computed getter (static `computed` too) cache its value for the rest of the request. */
|
|
2001
|
+
private prepareComputed;
|
|
2002
|
+
private applyUpdate;
|
|
2003
|
+
/** Runs one call from the browser: a magic action, an event, or a public method. Returns its return value. */
|
|
2004
|
+
private call;
|
|
2005
|
+
/** Renders the component (rendering/rendered hooks, nested children tracked) and checks for a single root. */
|
|
2006
|
+
private render;
|
|
2007
|
+
/** Dispatches, redirects: the effects every response carries. */
|
|
2008
|
+
private effects;
|
|
2009
|
+
/** dehydrate() hook, then the state as snapshot data, the error bag, and the checksum over both. */
|
|
2010
|
+
private snapshot;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
/** The URI the client runtime posts updates to. */
|
|
2014
|
+
declare const UPDATE_URI = "/oriel/live/update";
|
|
2015
|
+
/**
|
|
2016
|
+
* Binds the LiveManager, merges the `live` config, registers POST /oriel/live/update (named `live.update`, in the `web`
|
|
2017
|
+
* group: sessions and CSRF apply), the make:live command, and the components under app/Live.
|
|
2018
|
+
*/
|
|
2019
|
+
declare class LiveServiceProvider extends ServiceProvider {
|
|
2020
|
+
register(): void;
|
|
2021
|
+
boot(): Promise<void>;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/** A component's Livewire name from its path under app/Live: Posts/CreatePost.tsx → posts.create-post. */
|
|
2025
|
+
declare function componentName(file: string): string;
|
|
2026
|
+
|
|
2027
|
+
/** A Live programming error (unsupported state, a missing root element, an unknown component): a 500. */
|
|
2028
|
+
declare class LiveError extends Error implements OrielError {
|
|
2029
|
+
readonly name: string;
|
|
2030
|
+
readonly kind: ErrorKind;
|
|
2031
|
+
readonly status: number;
|
|
2032
|
+
}
|
|
2033
|
+
/** A snapshot whose checksum doesn't match (tampered with, or signed with another APP_KEY). Nothing is hydrated. */
|
|
2034
|
+
declare class CorruptComponentPayloadError extends LiveError {
|
|
2035
|
+
readonly name: string;
|
|
2036
|
+
readonly kind: ErrorKind;
|
|
2037
|
+
readonly status: number;
|
|
2038
|
+
constructor(component?: string);
|
|
2039
|
+
}
|
|
2040
|
+
/** The browser asked for a method that isn't a public action of the component. */
|
|
2041
|
+
declare class MethodNotCallableError extends LiveError {
|
|
2042
|
+
readonly name: string;
|
|
2043
|
+
readonly kind: ErrorKind;
|
|
2044
|
+
readonly status: number;
|
|
2045
|
+
constructor(method: string, component: string);
|
|
2046
|
+
}
|
|
2047
|
+
/** The browser tried to set a property that is locked, computed, private (`_x`) or not declared. */
|
|
2048
|
+
declare class PropertyNotUpdatableError extends LiveError {
|
|
2049
|
+
readonly name: string;
|
|
2050
|
+
readonly kind: ErrorKind;
|
|
2051
|
+
readonly status: number;
|
|
2052
|
+
constructor(path: string, component: string);
|
|
2053
|
+
}
|
|
2054
|
+
/** A snapshot names a component that isn't registered. */
|
|
2055
|
+
declare class LiveComponentNotFoundError extends LiveError {
|
|
2056
|
+
readonly name: string;
|
|
2057
|
+
readonly kind: ErrorKind;
|
|
2058
|
+
readonly status: number;
|
|
2059
|
+
constructor(component: string);
|
|
2060
|
+
}
|
|
2061
|
+
/** An update request without the X-Oriel-Live header or with a malformed body. */
|
|
2062
|
+
declare class InvalidLiveRequestError extends LiveError {
|
|
2063
|
+
readonly name: string;
|
|
2064
|
+
readonly kind: ErrorKind;
|
|
2065
|
+
readonly status: number;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
export { type ResponseContext as $, AnonymousNotifiable as A, BusFake as B, Component as C, DatabaseMigrations as D, EventFake as E, FakeDisk as F, InteractsWithConsole as G, HttpClient as H, InvalidLiveRequestError as I, InteractsWithDatabase as J, type JsonStructure as K, Live as L, MailFake as M, NotificationFake as N, On as O, PendingEvent as P, QueueFake as Q, MailRecord as R, MakesHttpRequests as S, type Target as T, UPDATE_URI as U, PendingCommand as V, type PushedJob as W, RefreshDatabase as X, RefreshDatabaseState as Y, type RequestData as Z, type RequestOptions as _, type ComponentResult as a, type ResponseCookie as a0, type SentNotification as a1, StorageFake as a2, TESTING_ENVIRONMENT as a3, type TableOrModel as a4, TestCase as a5, type TestHooks as a6, TestResponse as a7, type TestTrait as a8, actingAsAuthFactory as a9, addresses as aa, applyEnvironment as ab, cookieHeader as ac, cookiePrefix as ad, decryptCookie as ae, encryptCookie as af, flatten as ag, guessMimeType as ah, inertiaPageOf as ai, install as aj, isExpired as ak, matches as al, nameOf as am, recordingExceptionHandler as an, recordingViewFactory as ao, responseCookies as ap, runCommand as aq, usingInMemoryDatabase as ar, Computed as b, CorruptComponentPayloadError as c, ErrorBag as d, LiveComponentManager as e, LiveComponentNotFoundError as f, LiveError as g, type LiveProps as h, LiveServiceProvider as i, Locked as j, MethodNotCallableError as k, PropertyNotUpdatableError as l, Testable as m, componentName as n, live as o, AssertableInertia as p, AssertableJson as q, type BatchRecord as r, type BootOptions as s, type CountOrFilter as t, type DatabaseTestOptions as u, DatabaseTransactions as v, type DispatchedEvent as w, type ExpectedErrors as x, FakeFile as y, InteractsWithApplication as z };
|