@orieljs/framework 0.1.0-alpha.3 → 0.1.0-alpha.4
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-WEGTH46M.js → chunk-3DETYZMZ.js} +3 -3
- package/dist/{chunk-IRHK7GH7.js → chunk-DCI2T7WJ.js} +24 -3
- package/dist/chunk-DCI2T7WJ.js.map +1 -0
- package/dist/{chunk-I2OMKIQZ.js → chunk-SBZQ6L3Z.js} +2213 -137
- package/dist/chunk-SBZQ6L3Z.js.map +1 -0
- package/dist/{chunk-3ZRPBRAE.js → chunk-WSGWYXAO.js} +3 -1
- package/dist/chunk-WSGWYXAO.js.map +1 -0
- package/dist/contracts.d.ts +155 -132
- package/dist/contracts.js +3 -1
- package/dist/index.d.ts +543 -285
- package/dist/index.js +805 -2053
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.js +3 -3
- package/dist/{testing--F6FODc_.d.ts → testing-D3dCOkTm.d.ts} +208 -86
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/package.json +30 -30
- package/dist/chunk-3ZRPBRAE.js.map +0 -1
- package/dist/chunk-HU43NADT.js +0 -745
- package/dist/chunk-HU43NADT.js.map +0 -1
- package/dist/chunk-I2OMKIQZ.js.map +0 -1
- package/dist/chunk-IRHK7GH7.js.map +0 -1
- package/dist/chunk-S7YC43IH.js +0 -93
- package/dist/chunk-S7YC43IH.js.map +0 -1
- package/dist/chunk-TIE5OAMF.js +0 -474
- package/dist/chunk-TIE5OAMF.js.map +0 -1
- package/dist/chunk-UPZAML2Q.js +0 -3653
- package/dist/chunk-UPZAML2Q.js.map +0 -1
- package/dist/jsx-runtime-CZ6JqBQo.d.ts +0 -345
- /package/dist/{chunk-WEGTH46M.js.map → chunk-3DETYZMZ.js.map} +0 -0
package/dist/jsx-runtime.js
CHANGED
|
@@ -37,6 +37,44 @@ interface Container$1 {
|
|
|
37
37
|
}
|
|
38
38
|
declare const Container$1: Token$1<Container$1>;
|
|
39
39
|
|
|
40
|
+
/** The session of the current request (scoped). Loaded and saved by the StartSession middleware. */
|
|
41
|
+
interface Session$1 {
|
|
42
|
+
getId(): string;
|
|
43
|
+
start(): Promise<void>;
|
|
44
|
+
save(): Promise<void>;
|
|
45
|
+
all(): Record<string, unknown>;
|
|
46
|
+
has(key: string): boolean;
|
|
47
|
+
get<T = unknown>(key: string, defaultValue?: T): T;
|
|
48
|
+
put(key: string | Record<string, unknown>, value?: unknown): void;
|
|
49
|
+
push(key: string, value: unknown): void;
|
|
50
|
+
pull<T = unknown>(key: string, defaultValue?: T): T;
|
|
51
|
+
forget(...keys: string[]): void;
|
|
52
|
+
flush(): void;
|
|
53
|
+
flash(key: string, value: unknown): void;
|
|
54
|
+
now(key: string, value: unknown): void;
|
|
55
|
+
reflash(): void;
|
|
56
|
+
keep(...keys: string[]): void;
|
|
57
|
+
getOldInput<T = unknown>(key?: string, defaultValue?: T): T;
|
|
58
|
+
flashInput(input: Record<string, unknown>): void;
|
|
59
|
+
token(): string;
|
|
60
|
+
regenerateToken(): void;
|
|
61
|
+
regenerate(destroy?: boolean): Promise<void>;
|
|
62
|
+
invalidate(): Promise<void>;
|
|
63
|
+
previousUrl(): string | undefined;
|
|
64
|
+
setPreviousUrl(url: string): void;
|
|
65
|
+
}
|
|
66
|
+
declare const Session$1: Token$2<Session$1>;
|
|
67
|
+
interface UploadedFile$1 {
|
|
68
|
+
readonly clientName: string;
|
|
69
|
+
readonly mimeType: string;
|
|
70
|
+
readonly size: number;
|
|
71
|
+
extension(): string;
|
|
72
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
73
|
+
/** Stores on a Filesystem disk. Returns the stored path. */
|
|
74
|
+
store(directory: string, disk?: string): Promise<string>;
|
|
75
|
+
storeAs(directory: string, name: string, disk?: string): Promise<string>;
|
|
76
|
+
}
|
|
77
|
+
|
|
40
78
|
interface ServiceProvider$2 {
|
|
41
79
|
/** Bind things into the container. Synchronous. Don't resolve other services here. */
|
|
42
80
|
register?(): void;
|
|
@@ -98,44 +136,6 @@ interface Enumerable<T> extends Iterable<T>, Arrayable<unknown[]> {
|
|
|
98
136
|
isEmpty(): boolean;
|
|
99
137
|
}
|
|
100
138
|
|
|
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
139
|
interface Encrypter {
|
|
140
140
|
/** JSON-serializes unless serialize=false (then value must be a string). AES-256-GCM, keyed by APP_KEY. */
|
|
141
141
|
encrypt(value: unknown, serialize?: boolean): string;
|
|
@@ -962,6 +962,12 @@ declare class HttpClient {
|
|
|
962
962
|
request(method: string, uri: string, options?: RequestOptions): Promise<TestResponse>;
|
|
963
963
|
/** Runs `fn` in a scope prepared like a request's (carried session, actingAs users), e.g. for assertAuthenticated(). */
|
|
964
964
|
inScope<T>(fn: (scope: Container$1) => T | Promise<T>): Promise<T>;
|
|
965
|
+
/**
|
|
966
|
+
* Runs `run` in a request scope like this client's requests have (a request for `method uri` bound, the carried
|
|
967
|
+
* session, actingAs users), then carries the session and the users on, as after a request. Live.test() runs its
|
|
968
|
+
* mount and updates through it.
|
|
969
|
+
*/
|
|
970
|
+
withinRequest<T>(run: () => Promise<T>, method?: string, uri?: string): Promise<T>;
|
|
965
971
|
/** Runs the request through the app's real HttpKernel, in a request scope this client owns. */
|
|
966
972
|
protected send(request: Request): Promise<TestResponse>;
|
|
967
973
|
/** Prepares the request scope: recorders, the carried session and actingAs users. */
|
|
@@ -1035,6 +1041,11 @@ declare abstract class InteractsWithApplication {
|
|
|
1035
1041
|
protected defineEnvironment(_app: Application$1): void | Promise<void>;
|
|
1036
1042
|
setUp(): Promise<void>;
|
|
1037
1043
|
tearDown(): Promise<void>;
|
|
1044
|
+
/**
|
|
1045
|
+
* Laravel's withoutVite(): in this test's requests vite([...]) and viteReactRefresh() render nothing, so feature
|
|
1046
|
+
* tests of pages pass before `vite build` has written public/build/manifest.json.
|
|
1047
|
+
*/
|
|
1048
|
+
withoutVite(): this;
|
|
1038
1049
|
/** Runs in tearDown(), before the application is thrown away (in registration order). */
|
|
1039
1050
|
beforeApplicationDestroyed(callback: Callback): void;
|
|
1040
1051
|
}
|
|
@@ -1046,6 +1057,8 @@ declare abstract class MakesHttpRequests extends InteractsWithApplication {
|
|
|
1046
1057
|
/** The current test's HTTP client (created on first use). */
|
|
1047
1058
|
protected get http(): HttpClient;
|
|
1048
1059
|
protected createHttpClient(): HttpClient;
|
|
1060
|
+
/** Live.test() runs in this test's request scope (Live reads the same token: no import between the packages). */
|
|
1061
|
+
setUp(): Promise<void>;
|
|
1049
1062
|
tearDown(): Promise<void>;
|
|
1050
1063
|
withHeaders(headers: Headers$1): this;
|
|
1051
1064
|
withHeader(name: string, value: string): this;
|
|
@@ -1589,50 +1602,6 @@ interface Container {
|
|
|
1589
1602
|
}
|
|
1590
1603
|
declare const Container: Token<Container>;
|
|
1591
1604
|
|
|
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
1605
|
/** The session of the current request (scoped). Loaded and saved by the StartSession middleware. */
|
|
1637
1606
|
interface Session {
|
|
1638
1607
|
getId(): string;
|
|
@@ -1704,6 +1673,8 @@ interface HttpRequest {
|
|
|
1704
1673
|
header(name: string, defaultValue: string): string;
|
|
1705
1674
|
bearerToken(): string | undefined;
|
|
1706
1675
|
ip(): string | undefined;
|
|
1676
|
+
/** The raw body as text (Laravel's getContent()); '' when there is none. */
|
|
1677
|
+
content(): string;
|
|
1707
1678
|
expectsJson(): boolean;
|
|
1708
1679
|
ajax(): boolean;
|
|
1709
1680
|
query<T = unknown>(key?: string, defaultValue?: T): T;
|
|
@@ -1730,6 +1701,130 @@ interface HttpRequest {
|
|
|
1730
1701
|
validate<T = Record<string, unknown>>(rules: Rules, messages?: Record<string, string>, attributes?: Record<string, string>): Promise<T>;
|
|
1731
1702
|
}
|
|
1732
1703
|
declare const HttpRequest: Token$2<HttpRequest>;
|
|
1704
|
+
type Next = (request: HttpRequest) => Promise<Response>;
|
|
1705
|
+
interface Middleware {
|
|
1706
|
+
handle(request: HttpRequest, next: Next, ...parameters: string[]): Promise<Response>;
|
|
1707
|
+
terminate?(request: HttpRequest, response: Response): Promise<void>;
|
|
1708
|
+
}
|
|
1709
|
+
type MiddlewareClass = new (...args: any[]) => Middleware;
|
|
1710
|
+
|
|
1711
|
+
interface ServiceProvider$1 {
|
|
1712
|
+
/** Bind things into the container. Synchronous. Don't resolve other services here. */
|
|
1713
|
+
register?(): void;
|
|
1714
|
+
/** Runs after every provider is registered. May be async (e.g. importing route files). */
|
|
1715
|
+
boot?(): void | Promise<void>;
|
|
1716
|
+
}
|
|
1717
|
+
type ServiceProviderClass = new (app: Application) => ServiceProvider$1;
|
|
1718
|
+
interface Application extends Container {
|
|
1719
|
+
readonly version: string;
|
|
1720
|
+
basePath(path?: string): string;
|
|
1721
|
+
appPath(path?: string): string;
|
|
1722
|
+
bootstrapPath(path?: string): string;
|
|
1723
|
+
configPath(path?: string): string;
|
|
1724
|
+
databasePath(path?: string): string;
|
|
1725
|
+
publicPath(path?: string): string;
|
|
1726
|
+
resourcePath(path?: string): string;
|
|
1727
|
+
storagePath(path?: string): string;
|
|
1728
|
+
/** With no args returns the environment name. With args returns whether it matches any of them. */
|
|
1729
|
+
environment(): string;
|
|
1730
|
+
environment(...environments: string[]): boolean;
|
|
1731
|
+
isProduction(): boolean;
|
|
1732
|
+
isLocal(): boolean;
|
|
1733
|
+
runningInConsole(): boolean;
|
|
1734
|
+
/** Mark the app as running in the console (the CLI entry point calls this). Defaults to true. */
|
|
1735
|
+
setRunningInConsole(value?: boolean): void;
|
|
1736
|
+
runningUnitTests(): boolean;
|
|
1737
|
+
/** Registers the provider. If the app is already booted, the provider is booted immediately. */
|
|
1738
|
+
register(provider: ServiceProvider$1 | ServiceProviderClass): Promise<ServiceProvider$1>;
|
|
1739
|
+
getProviders(): ServiceProvider$1[];
|
|
1740
|
+
boot(): Promise<void>;
|
|
1741
|
+
isBooted(): boolean;
|
|
1742
|
+
booting(callback: (app: Application) => void | Promise<void>): void;
|
|
1743
|
+
booted(callback: (app: Application) => void | Promise<void>): void;
|
|
1744
|
+
/** Handle one HTTP request in a fresh request scope via the bound HttpKernel. */
|
|
1745
|
+
handle(request: Request): Promise<Response>;
|
|
1746
|
+
/** Register a callback that terminate() runs, in registration order. */
|
|
1747
|
+
terminating(callback: () => void | Promise<void>): void;
|
|
1748
|
+
terminate(): Promise<void>;
|
|
1749
|
+
}
|
|
1750
|
+
declare const Application: Token$2<Application>;
|
|
1751
|
+
interface Htmlable {
|
|
1752
|
+
toHtml(): string;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
/** Public method names of a controller (excludes non-function members). */
|
|
1756
|
+
type ActionMethods<C> = {
|
|
1757
|
+
[K in keyof C]: C[K] extends (...args: any[]) => unknown ? K : never;
|
|
1758
|
+
}[keyof C] & string;
|
|
1759
|
+
type ControllerAction<C> = readonly [Class<C>, ActionMethods<C>];
|
|
1760
|
+
type RouteClosure = (...args: any[]) => unknown;
|
|
1761
|
+
/** A class with __invoke(): Route.get('/counter', Counter) (single-action controllers, full-page Live components). */
|
|
1762
|
+
type InvokableClass = Class<{
|
|
1763
|
+
__invoke(...args: any[]): unknown;
|
|
1764
|
+
}>;
|
|
1765
|
+
type RouteAction = RouteClosure | ControllerAction<any> | InvokableClass;
|
|
1766
|
+
type MiddlewareReference = string | MiddlewareClass;
|
|
1767
|
+
interface Route {
|
|
1768
|
+
readonly methods: readonly string[];
|
|
1769
|
+
readonly uri: string;
|
|
1770
|
+
getName(): string | undefined;
|
|
1771
|
+
name(name: string): this;
|
|
1772
|
+
middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): this;
|
|
1773
|
+
withoutMiddleware(...middleware: MiddlewareReference[]): this;
|
|
1774
|
+
where(parameter: string, pattern: string): this;
|
|
1775
|
+
where(patterns: Record<string, string>): this;
|
|
1776
|
+
}
|
|
1777
|
+
interface RouteRegistrar {
|
|
1778
|
+
prefix(prefix: string): RouteRegistrar;
|
|
1779
|
+
name(prefix: string): RouteRegistrar;
|
|
1780
|
+
middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): RouteRegistrar;
|
|
1781
|
+
controller(controller: Class<unknown>): RouteRegistrar;
|
|
1782
|
+
group(routes: () => void | Promise<void>): Promise<void>;
|
|
1783
|
+
}
|
|
1784
|
+
interface ResourceOptions {
|
|
1785
|
+
only?: string[];
|
|
1786
|
+
except?: string[];
|
|
1787
|
+
parameters?: Record<string, string>;
|
|
1788
|
+
names?: Record<string, string>;
|
|
1789
|
+
}
|
|
1790
|
+
interface Router {
|
|
1791
|
+
get<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1792
|
+
post<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1793
|
+
put<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1794
|
+
patch<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1795
|
+
delete<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1796
|
+
options<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1797
|
+
any<C>(uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1798
|
+
match<C>(methods: string[], uri: string, action: ControllerAction<C> | RouteClosure | InvokableClass | string): Route;
|
|
1799
|
+
redirect(from: string, to: string, status?: number): Route;
|
|
1800
|
+
view(uri: string, view: string, data?: Record<string, unknown>): Route;
|
|
1801
|
+
/** Route.inertia('/about', 'About', props): a GET route that renders an Inertia page (Laravel's Route::inertia). */
|
|
1802
|
+
inertia(uri: string, component: string, props?: Record<string, unknown>): Route;
|
|
1803
|
+
resource(name: string, controller: Class<unknown>, options?: ResourceOptions): void;
|
|
1804
|
+
apiResource(name: string, controller: Class<unknown>, options?: ResourceOptions): void;
|
|
1805
|
+
fallback(action: RouteAction): Route;
|
|
1806
|
+
prefix(prefix: string): RouteRegistrar;
|
|
1807
|
+
name(prefix: string): RouteRegistrar;
|
|
1808
|
+
middleware(...middleware: Array<MiddlewareReference | readonly MiddlewareReference[]>): RouteRegistrar;
|
|
1809
|
+
controller(controller: Class<unknown>): RouteRegistrar;
|
|
1810
|
+
/** Explicit model binding: Route.model('author', User). */
|
|
1811
|
+
model(parameter: string, model: Class<unknown>): void;
|
|
1812
|
+
/** Custom binding resolver. */
|
|
1813
|
+
bind(parameter: string, resolver: (value: string) => unknown | Promise<unknown>): void;
|
|
1814
|
+
pattern(parameter: string, pattern: string): void;
|
|
1815
|
+
/** Name a middleware class, e.g. aliasMiddleware('auth', Authenticate). */
|
|
1816
|
+
aliasMiddleware(name: string, middleware: MiddlewareClass): this;
|
|
1817
|
+
/** Define (or replace) a middleware group such as 'web' or 'api'. */
|
|
1818
|
+
middlewareGroup(name: string, middleware: MiddlewareReference[]): this;
|
|
1819
|
+
/** Append to a group unless it is already present. */
|
|
1820
|
+
pushMiddlewareToGroup(group: string, middleware: MiddlewareReference): this;
|
|
1821
|
+
getMiddlewareGroups(): Record<string, MiddlewareReference[]>;
|
|
1822
|
+
getRoutes(): readonly Route[];
|
|
1823
|
+
current(): Route | undefined;
|
|
1824
|
+
/** Match the request, bind parameters, run the route middleware and the action. Called by the Http kernel. */
|
|
1825
|
+
dispatch(request: HttpRequest): Promise<Response>;
|
|
1826
|
+
}
|
|
1827
|
+
declare const Router: Token$2<Router>;
|
|
1733
1828
|
|
|
1734
1829
|
type ErrorKind = 'Http' | 'Server' | 'ModelNotFound' | 'Validation' | 'Authentication' | 'Authorization' | 'TokenMismatch' | 'BindingResolution' | 'CircularDependency' | 'ContainerNotAvailable';
|
|
1735
1830
|
/** Every error thrown by the framework implements this. The exception handler switches on `kind`. */
|
|
@@ -1894,13 +1989,22 @@ declare function Locked(_target: unknown, context: ClassFieldDecoratorContext |
|
|
|
1894
1989
|
/** @Computed: a getter cached for the rest of the request, never part of the component's state. */
|
|
1895
1990
|
declare function Computed<T>(getter: (this: object) => T, context: ClassGetterDecoratorContext): (this: object) => T;
|
|
1896
1991
|
|
|
1992
|
+
/**
|
|
1993
|
+
* Runs Live.test()'s mount and each update. The testing package binds one for every test, so they run in a request
|
|
1994
|
+
* scope like the test's HTTP requests (a request, the carried session, actingAs users) and what they change carries
|
|
1995
|
+
* on to the next request. Without one they run in the current scope.
|
|
1996
|
+
*/
|
|
1997
|
+
type TestRequestScope = <T>(run: () => Promise<T>) => Promise<T>;
|
|
1998
|
+
declare const TestRequestScope: Token<TestRequestScope>;
|
|
1897
1999
|
/**
|
|
1898
2000
|
* 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
|
|
2001
|
+
* (no HTTP), inside the test's request scope. Actions are async (`await counter.call('increment')`); assertions are
|
|
2002
|
+
* sync and return `this`.
|
|
1900
2003
|
*/
|
|
1901
2004
|
declare class Testable<C extends Component = Component> {
|
|
1902
2005
|
#private;
|
|
1903
2006
|
private readonly manager;
|
|
2007
|
+
private readonly scope;
|
|
1904
2008
|
private constructor();
|
|
1905
2009
|
/** Mounts `component` with `params`, as `<Live component={…} {...params} />` would. */
|
|
1906
2010
|
static create<C extends Component>(component: Class<C> | string, params?: Record<string, unknown>): Promise<Testable<C>>;
|
|
@@ -1988,8 +2092,12 @@ declare class LiveComponentManager implements LiveManager {
|
|
|
1988
2092
|
/** Applies each component's updates and calls, re-renders it and returns its new snapshot and effects. */
|
|
1989
2093
|
update(request: LiveUpdateRequest): Promise<LiveUpdateResponse>;
|
|
1990
2094
|
updateComponent(snapshotJson: string, updates: Record<string, unknown>, calls: Call[]): Promise<ComponentResult>;
|
|
1991
|
-
/**
|
|
1992
|
-
|
|
2095
|
+
/**
|
|
2096
|
+
* The route action of POST /oriel/live/update. Each component's update runs behind the auth middleware of the route
|
|
2097
|
+
* that rendered its page (Livewire's persistent middleware): a signed-out tab gets a 401, never the action. When a
|
|
2098
|
+
* middleware answers instead (a redirect), that is the response.
|
|
2099
|
+
*/
|
|
2100
|
+
handle(request: HttpRequest): Promise<LiveUpdateResponse | Response>;
|
|
1993
2101
|
/** A full-page component (Route.get('/counter', Counter)): mounted with the route parameters, inside the layout. */
|
|
1994
2102
|
page(component: Component): Promise<unknown>;
|
|
1995
2103
|
/** Parses and checks a snapshot: a bad checksum throws before anything is hydrated. */
|
|
@@ -2065,4 +2173,18 @@ declare class InvalidLiveRequestError extends LiveError {
|
|
|
2065
2173
|
readonly status: number;
|
|
2066
2174
|
}
|
|
2067
2175
|
|
|
2068
|
-
|
|
2176
|
+
/** The route middleware an update re-applies by default (config live.persistent_middleware), by alias. */
|
|
2177
|
+
declare const PERSISTENT_MIDDLEWARE: string[];
|
|
2178
|
+
/** A route middleware after alias and group expansion: 'auth:web' → { cls: Authenticate, parameters: ['web'] }. */
|
|
2179
|
+
interface PersistentMiddleware {
|
|
2180
|
+
readonly cls: MiddlewareClass;
|
|
2181
|
+
readonly parameters: readonly string[];
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Livewire's persistent middleware: the route that rendered the page (the component's memo path and method) is
|
|
2185
|
+
* matched again, and the middleware among `persistent` (aliases) that it ran are returned, to run before an update.
|
|
2186
|
+
* A path no route matches has none.
|
|
2187
|
+
*/
|
|
2188
|
+
declare function persistentMiddleware(router: Router, persistent: readonly string[], method: string, path: string): PersistentMiddleware[];
|
|
2189
|
+
|
|
2190
|
+
export { RefreshDatabase as $, AnonymousNotifiable as A, BusFake as B, Component as C, DatabaseMigrations as D, EventFake as E, FakeDisk as F, type DispatchedEvent as G, type ExpectedErrors as H, InvalidLiveRequestError as I, FakeFile as J, HttpClient as K, Live as L, MailFake as M, NotificationFake as N, On as O, PERSISTENT_MIDDLEWARE as P, QueueFake as Q, InteractsWithApplication as R, InteractsWithConsole as S, type Target as T, UPDATE_URI as U, InteractsWithDatabase as V, type JsonStructure as W, MailRecord as X, MakesHttpRequests as Y, PendingCommand as Z, type PushedJob as _, type ComponentResult as a, RefreshDatabaseState as a0, type RequestData as a1, type RequestOptions as a2, type ResponseContext as a3, type ResponseCookie as a4, type SentNotification as a5, StorageFake as a6, TESTING_ENVIRONMENT as a7, type TableOrModel as a8, TestCase as a9, type TestHooks as aa, TestResponse as ab, type TestTrait as ac, actingAsAuthFactory as ad, addresses as ae, applyEnvironment as af, cookieHeader as ag, cookiePrefix as ah, decryptCookie as ai, encryptCookie as aj, flatten as ak, guessMimeType as al, inertiaPageOf as am, install as an, isExpired as ao, matches as ap, nameOf as aq, recordingExceptionHandler as ar, recordingViewFactory as as, responseCookies as at, runCommand as au, usingInMemoryDatabase as av, 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, PendingEvent as l, type PersistentMiddleware as m, PropertyNotUpdatableError as n, TestRequestScope as o, Testable as p, componentName as q, live as r, persistentMiddleware as s, AssertableInertia as t, AssertableJson as u, type BatchRecord as v, type BootOptions as w, type CountOrFilter as x, type DatabaseTestOptions as y, DatabaseTransactions as z };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AnonymousNotifiable,
|
|
1
|
+
export { A as AnonymousNotifiable, t as AssertableInertia, u as AssertableJson, v as BatchRecord, w as BootOptions, B as BusFake, x as CountOrFilter, D as DatabaseMigrations, y as DatabaseTestOptions, z as DatabaseTransactions, G as DispatchedEvent, E as EventFake, H as ExpectedErrors, F as FakeDisk, J as FakeFile, K as HttpClient, R as InteractsWithApplication, S as InteractsWithConsole, V as InteractsWithDatabase, W as JsonStructure, L as Live, M as MailFake, X as MailRecord, Y as MakesHttpRequests, N as NotificationFake, Z as PendingCommand, _ as PushedJob, Q as QueueFake, $ as RefreshDatabase, a0 as RefreshDatabaseState, a1 as RequestData, a2 as RequestOptions, a3 as ResponseContext, a4 as ResponseCookie, a5 as SentNotification, a6 as StorageFake, a7 as TESTING_ENVIRONMENT, a8 as TableOrModel, T as Target, a9 as TestCase, aa as TestHooks, ab as TestResponse, ac as TestTrait, p as Testable, ad as actingAsAuthFactory, ae as addresses, af as applyEnvironment, ag as cookieHeader, ah as cookiePrefix, ai as decryptCookie, aj as encryptCookie, ak as flatten, al as guessMimeType, am as inertiaPageOf, an as install, ao as isExpired, ap as matches, aq as nameOf, ar as recordingExceptionHandler, as as recordingViewFactory, at as responseCookies, au as runCommand, av as usingInMemoryDatabase } from './testing-D3dCOkTm.js';
|
|
2
2
|
import './contracts.js';
|
|
3
3
|
import './index.d-DOlTeG-8.js';
|
package/dist/testing.js
CHANGED
|
@@ -45,9 +45,9 @@ import {
|
|
|
45
45
|
responseCookies,
|
|
46
46
|
runCommand,
|
|
47
47
|
usingInMemoryDatabase
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-SBZQ6L3Z.js";
|
|
49
|
+
import "./chunk-DCI2T7WJ.js";
|
|
50
|
+
import "./chunk-WSGWYXAO.js";
|
|
51
51
|
export {
|
|
52
52
|
AnonymousNotifiable,
|
|
53
53
|
AssertableInertia,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orieljs/framework",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "Oriel: a Laravel-style, full-stack TypeScript framework for Node.js and Bun.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,35 +56,35 @@
|
|
|
56
56
|
"pluralize": "8.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@orieljs/
|
|
60
|
-
"@orieljs/
|
|
61
|
-
"@orieljs/
|
|
62
|
-
"@orieljs/
|
|
63
|
-
"@orieljs/
|
|
64
|
-
"@orieljs/console": "0.1.0-alpha.
|
|
65
|
-
"@orieljs/
|
|
66
|
-
"@orieljs/
|
|
67
|
-
"@orieljs/
|
|
68
|
-
"@orieljs/
|
|
69
|
-
"@orieljs/
|
|
70
|
-
"@orieljs/events": "0.1.0-alpha.
|
|
71
|
-
"@orieljs/filesystem": "0.1.0-alpha.
|
|
72
|
-
"@orieljs/
|
|
73
|
-
"@orieljs/
|
|
74
|
-
"@orieljs/http": "0.1.0-alpha.
|
|
75
|
-
"@orieljs/inertia": "0.1.0-alpha.
|
|
76
|
-
"@orieljs/
|
|
77
|
-
"@orieljs/
|
|
78
|
-
"@orieljs/
|
|
79
|
-
"@orieljs/
|
|
80
|
-
"@orieljs/
|
|
81
|
-
"@orieljs/
|
|
82
|
-
"@orieljs/
|
|
83
|
-
"@orieljs/
|
|
84
|
-
"@orieljs/
|
|
85
|
-
"@orieljs/
|
|
86
|
-
"@orieljs/
|
|
87
|
-
"@orieljs/
|
|
59
|
+
"@orieljs/bus": "0.1.0-alpha.4",
|
|
60
|
+
"@orieljs/cache": "0.1.0-alpha.4",
|
|
61
|
+
"@orieljs/auth": "0.1.0-alpha.4",
|
|
62
|
+
"@orieljs/container": "0.1.0-alpha.4",
|
|
63
|
+
"@orieljs/collections": "0.1.0-alpha.4",
|
|
64
|
+
"@orieljs/console": "0.1.0-alpha.4",
|
|
65
|
+
"@orieljs/contracts": "0.1.0-alpha.4",
|
|
66
|
+
"@orieljs/config": "0.1.0-alpha.4",
|
|
67
|
+
"@orieljs/cookie": "0.1.0-alpha.4",
|
|
68
|
+
"@orieljs/encryption": "0.1.0-alpha.4",
|
|
69
|
+
"@orieljs/database": "0.1.0-alpha.4",
|
|
70
|
+
"@orieljs/events": "0.1.0-alpha.4",
|
|
71
|
+
"@orieljs/filesystem": "0.1.0-alpha.4",
|
|
72
|
+
"@orieljs/foundation": "0.1.0-alpha.4",
|
|
73
|
+
"@orieljs/hashing": "0.1.0-alpha.4",
|
|
74
|
+
"@orieljs/http": "0.1.0-alpha.4",
|
|
75
|
+
"@orieljs/inertia": "0.1.0-alpha.4",
|
|
76
|
+
"@orieljs/log": "0.1.0-alpha.4",
|
|
77
|
+
"@orieljs/mail": "0.1.0-alpha.4",
|
|
78
|
+
"@orieljs/notifications": "0.1.0-alpha.4",
|
|
79
|
+
"@orieljs/queue": "0.1.0-alpha.4",
|
|
80
|
+
"@orieljs/routing": "0.1.0-alpha.4",
|
|
81
|
+
"@orieljs/session": "0.1.0-alpha.4",
|
|
82
|
+
"@orieljs/support": "0.1.0-alpha.4",
|
|
83
|
+
"@orieljs/live": "0.1.0-alpha.4",
|
|
84
|
+
"@orieljs/pipeline": "0.1.0-alpha.4",
|
|
85
|
+
"@orieljs/view": "0.1.0-alpha.4",
|
|
86
|
+
"@orieljs/validation": "0.1.0-alpha.4",
|
|
87
|
+
"@orieljs/testing": "0.1.0-alpha.4"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"pg": "^8.23.0",
|