@orieljs/framework 0.1.0-alpha.14 → 0.1.0-alpha.16
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-X4N74JDO.js → chunk-3QHTNAMZ.js} +6 -4
- package/dist/{chunk-X4N74JDO.js.map → chunk-3QHTNAMZ.js.map} +1 -1
- package/dist/{chunk-BKA5F3TH.js → chunk-6AXJB4CD.js} +5 -1
- package/dist/chunk-6AXJB4CD.js.map +1 -0
- package/dist/{chunk-UBSIBGXR.js → chunk-MG4YEWMV.js} +1351 -497
- package/dist/chunk-MG4YEWMV.js.map +1 -0
- package/dist/{chunk-4NCMY3ZS.js → chunk-YNDMTTWL.js} +121 -8
- package/dist/chunk-YNDMTTWL.js.map +1 -0
- package/dist/contracts.d.ts +112 -1
- package/dist/contracts.js +5 -1
- package/dist/{index.d-lffxurFs.d.ts → index.d-DA-Iu2a2.d.ts} +39 -2
- package/dist/index.d.ts +2838 -2101
- package/dist/index.js +1805 -647
- package/dist/index.js.map +1 -1
- package/dist/{jsx-runtime-Bc5KJzwb.d.ts → jsx-runtime-CenT41Y0.d.ts} +1 -1
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +3 -3
- package/dist/{testing-CVpo7aRl.d.ts → testing-B8J_HhF4.d.ts} +6 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +3 -3
- package/docs/authentication.md +45 -3
- package/docs/authorization.md +2 -4
- package/docs/cache.md +29 -5
- package/docs/configuration.md +84 -7
- package/docs/console.md +41 -2
- package/docs/container.md +4 -0
- package/docs/csrf.md +2 -2
- package/docs/database.md +27 -2
- package/docs/deployment.md +42 -18
- package/docs/eloquent-factories.md +7 -3
- package/docs/eloquent-mutators.md +2 -1
- package/docs/eloquent-observers.md +2 -0
- package/docs/eloquent-relationships.md +34 -1
- package/docs/eloquent-resources.md +253 -0
- package/docs/eloquent.md +47 -0
- package/docs/errors.md +12 -3
- package/docs/events.md +3 -1
- package/docs/export.md +3 -3
- package/docs/facades.md +1 -0
- package/docs/helpers.md +33 -2
- package/docs/inertia.md +11 -1
- package/docs/installation.md +6 -2
- package/docs/laravel.md +71 -0
- package/docs/lifecycle.md +9 -5
- package/docs/live.md +88 -8
- package/docs/mail.md +32 -5
- package/docs/middleware.md +20 -12
- package/docs/navigation.json +12 -0
- package/docs/notifications.md +22 -0
- package/docs/pagination.md +4 -0
- package/docs/passwords.md +4 -6
- package/docs/providers.md +4 -6
- package/docs/queues.md +70 -2
- package/docs/requests.md +42 -3
- package/docs/responses.md +9 -5
- package/docs/routing.md +118 -7
- package/docs/scheduling.md +27 -0
- package/docs/session.md +2 -2
- package/docs/starter-kits.md +26 -7
- package/docs/storage.md +10 -4
- package/docs/testing.md +10 -2
- package/docs/two-factor.md +38 -4
- package/docs/upgrade.md +182 -0
- package/docs/validation.md +70 -9
- package/docs/views.md +1 -0
- package/docs/vite.md +20 -1
- package/package.json +43 -35
- package/dist/chunk-4NCMY3ZS.js.map +0 -1
- package/dist/chunk-BKA5F3TH.js.map +0 -1
- package/dist/chunk-UBSIBGXR.js.map +0 -1
package/dist/contracts.d.ts
CHANGED
|
@@ -462,12 +462,28 @@ interface MessageBag {
|
|
|
462
462
|
count(): number;
|
|
463
463
|
toObject(): Record<string, string[]>;
|
|
464
464
|
}
|
|
465
|
+
/** Laravel's ValidatedInput: what `safe()` gives, the validated data with helpers to pick from it. */
|
|
466
|
+
interface ValidatedInput<T extends object = Record<string, unknown>> {
|
|
467
|
+
all(): T;
|
|
468
|
+
only<K extends keyof T & string>(...keys: Array<K | readonly K[]>): Pick<T, K>;
|
|
469
|
+
except<K extends keyof T & string>(...keys: Array<K | readonly K[]>): Omit<T, K>;
|
|
470
|
+
merge<U extends Record<string, unknown>>(values: U): ValidatedInput<T & U>;
|
|
471
|
+
/** A list: the values, or those of the list at `key`. */
|
|
472
|
+
collect(key?: string): unknown[];
|
|
473
|
+
/** Whether every key given is there. */
|
|
474
|
+
has(...keys: Array<string | readonly string[]>): boolean;
|
|
475
|
+
input(key?: string, defaultValue?: unknown): unknown;
|
|
476
|
+
}
|
|
465
477
|
/** `R` is the rules' type: `validated()` is typed from them, as `request().validate()` is. */
|
|
466
478
|
interface Validator<R extends Rules = Rules> {
|
|
467
479
|
passes(): Promise<boolean>;
|
|
468
480
|
fails(): Promise<boolean>;
|
|
469
481
|
/** Only the keys that have rules. Throws ValidationError (Exceptions.ts) on failure. */
|
|
470
482
|
validated<T = InferValidatedType<R>>(): Promise<T>;
|
|
483
|
+
/** validated() as a ValidatedInput, for `only()`, `except()` and `merge()`. */
|
|
484
|
+
safe(): Promise<ValidatedInput<InferValidatedType<R>>>;
|
|
485
|
+
/** Laravel's stopOnFirstFailure(): no field is validated once one has failed (after() callbacks still run). */
|
|
486
|
+
stopOnFirstFailure(stop?: boolean): this;
|
|
471
487
|
/** Valid only after passes()/fails()/validated() has run. */
|
|
472
488
|
errors(): MessageBag;
|
|
473
489
|
after(callback: (validator: Validator) => void | Promise<void>): this;
|
|
@@ -501,6 +517,11 @@ interface UploadedFile {
|
|
|
501
517
|
store(directory: string, disk?: string): Promise<string>;
|
|
502
518
|
storeAs(directory: string, name: string, disk?: string): Promise<string>;
|
|
503
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* Where a request keeps what its last validation returned, for `safe()`: Validation's FormRequest writes it, Http's
|
|
522
|
+
* request reads it.
|
|
523
|
+
*/
|
|
524
|
+
declare const VALIDATED_INPUT: unique symbol;
|
|
504
525
|
/**
|
|
505
526
|
* Oriel's request wrapper (one per request, scoped).
|
|
506
527
|
* The Http kernel awaits `load()` before any middleware runs, so every input accessor below is synchronous.
|
|
@@ -552,6 +573,11 @@ interface HttpRequest {
|
|
|
552
573
|
* validated data is typed from the rules: `validate({ title: 'required|string' })` is `{ title: string }`.
|
|
553
574
|
*/
|
|
554
575
|
validate<const R extends Rules>(rules: R, messages?: Record<string, string>, attributes?: Record<string, string>): Promise<InferValidatedType<R>>;
|
|
576
|
+
/**
|
|
577
|
+
* What the last `validate()` (this request's, or a FormRequest's) returned, as a ValidatedInput. Throws before any.
|
|
578
|
+
* Give the data's type as `T`; a FormRequest's or validate()'s own return value is typed already.
|
|
579
|
+
*/
|
|
580
|
+
safe<T extends object = Record<string, unknown>>(): ValidatedInput<T>;
|
|
555
581
|
}
|
|
556
582
|
declare const HttpRequest: Token<HttpRequest>;
|
|
557
583
|
type Next = (request: HttpRequest) => Promise<Response>;
|
|
@@ -574,6 +600,25 @@ interface MiddlewareConfigurator {
|
|
|
574
600
|
prepend?: MiddlewareClass[];
|
|
575
601
|
remove?: MiddlewareClass[];
|
|
576
602
|
}): this;
|
|
603
|
+
/** Takes middleware out of the global list. */
|
|
604
|
+
remove(...middleware: MiddlewareClass[]): this;
|
|
605
|
+
/** Fields TrimStrings leaves as sent (dotted keys), and callbacks that leave a whole request untouched. */
|
|
606
|
+
trimStrings(options: {
|
|
607
|
+
except?: Array<string | ((request: HttpRequest) => boolean)>;
|
|
608
|
+
}): this;
|
|
609
|
+
/** Callbacks that leave a whole request's empty strings as sent. */
|
|
610
|
+
convertEmptyStringsToNull(options: {
|
|
611
|
+
except?: Array<(request: HttpRequest) => boolean>;
|
|
612
|
+
}): this;
|
|
613
|
+
/** Answers only APP_URL's host and its subdomains, and the hosts listed; another host is a 404. Off in local and testing. */
|
|
614
|
+
trustHosts(options?: {
|
|
615
|
+
at?: Array<string | RegExp> | (() => Array<string | RegExp>);
|
|
616
|
+
subdomains?: boolean;
|
|
617
|
+
}): this;
|
|
618
|
+
/** Paths that still answer while the app is down for maintenance. */
|
|
619
|
+
preventRequestsDuringMaintenance(options: {
|
|
620
|
+
except?: string[];
|
|
621
|
+
}): this;
|
|
577
622
|
alias(aliases: Record<string, MiddlewareClass>): this;
|
|
578
623
|
group(name: string, middleware: Array<MiddlewareClass | string>): this;
|
|
579
624
|
validateCsrfTokens(options: {
|
|
@@ -608,6 +653,24 @@ interface ServiceProvider {
|
|
|
608
653
|
boot?(): void | Promise<void>;
|
|
609
654
|
}
|
|
610
655
|
type ServiceProviderClass = new (app: Application) => ServiceProvider;
|
|
656
|
+
/** What `oriel down` stores, as Laravel's storage/framework/down. */
|
|
657
|
+
interface MaintenanceModeData {
|
|
658
|
+
status: number;
|
|
659
|
+
secret?: string;
|
|
660
|
+
redirect?: string;
|
|
661
|
+
retry?: number;
|
|
662
|
+
refresh?: number;
|
|
663
|
+
/** The page to send while down (`--render`), rendered when the app went down. */
|
|
664
|
+
template?: string;
|
|
665
|
+
}
|
|
666
|
+
/** Laravel's MaintenanceMode: where `down` keeps its state, a file or a cache store. */
|
|
667
|
+
interface MaintenanceMode {
|
|
668
|
+
activate(data: MaintenanceModeData): Promise<void>;
|
|
669
|
+
deactivate(): Promise<void>;
|
|
670
|
+
active(): Promise<boolean>;
|
|
671
|
+
data(): Promise<MaintenanceModeData | undefined>;
|
|
672
|
+
}
|
|
673
|
+
declare const MaintenanceMode: Token<MaintenanceMode>;
|
|
611
674
|
interface Application extends Container {
|
|
612
675
|
readonly version: string;
|
|
613
676
|
basePath(path?: string): string;
|
|
@@ -646,6 +709,10 @@ interface Application extends Container {
|
|
|
646
709
|
onShutdown(callback: () => void | Promise<void>): void;
|
|
647
710
|
/** Runs the shutdown callbacks once, newest first; a failing one is printed and the rest still run. Never rejects. */
|
|
648
711
|
shutdown(): Promise<void>;
|
|
712
|
+
/** The maintenance mode driver `app.maintenance.driver` names (Laravel's maintenanceMode()). */
|
|
713
|
+
maintenanceMode(): MaintenanceMode;
|
|
714
|
+
/** Whether `oriel down` put the app in maintenance mode; false without a driver bound. */
|
|
715
|
+
isDownForMaintenance(): Promise<boolean>;
|
|
649
716
|
}
|
|
650
717
|
declare const Application: Token<Application>;
|
|
651
718
|
interface ExceptionHandler {
|
|
@@ -1073,6 +1140,11 @@ interface DatabaseConnection {
|
|
|
1073
1140
|
rollBack(): Promise<void>;
|
|
1074
1141
|
/** 0 outside a transaction. */
|
|
1075
1142
|
transactionLevel(): number;
|
|
1143
|
+
/**
|
|
1144
|
+
* Runs the callback once the transaction(fn) open here commits (dropped on rollback); at once outside one. `onRollBack`
|
|
1145
|
+
* runs instead if it rolls back.
|
|
1146
|
+
*/
|
|
1147
|
+
afterCommit(callback: () => unknown, onRollBack?: () => unknown): Promise<void>;
|
|
1076
1148
|
}
|
|
1077
1149
|
interface DatabaseManager extends DatabaseConnection {
|
|
1078
1150
|
connection(name?: string): DatabaseConnection;
|
|
@@ -1201,6 +1273,11 @@ interface ShouldQueue {
|
|
|
1201
1273
|
backoff?: number | number[];
|
|
1202
1274
|
/** Seconds. */
|
|
1203
1275
|
timeout?: number;
|
|
1276
|
+
/**
|
|
1277
|
+
* Dispatched inside a database transaction, it's pushed only once the transaction commits, and dropped if it rolls
|
|
1278
|
+
* back; false pushes it at once. Unset, the connection's `after_commit` decides.
|
|
1279
|
+
*/
|
|
1280
|
+
afterCommit?: boolean;
|
|
1204
1281
|
/**
|
|
1205
1282
|
* Laravel's ShouldBeUnique: while a job with this id is pending, another one is dropped. A queued listener's
|
|
1206
1283
|
* receives the event (Laravel 13); a number is used as its string.
|
|
@@ -1251,9 +1328,24 @@ interface Queue {
|
|
|
1251
1328
|
size(queue?: string): Promise<number>;
|
|
1252
1329
|
clear(queue?: string): Promise<number>;
|
|
1253
1330
|
}
|
|
1331
|
+
/** What Queue.before() and after() callbacks receive: Laravel's JobProcessing and JobProcessed events. */
|
|
1332
|
+
interface QueueJobEvent {
|
|
1333
|
+
readonly connectionName: string;
|
|
1334
|
+
readonly job: QueueJob;
|
|
1335
|
+
}
|
|
1336
|
+
/** What Queue.failing() callbacks receive: Laravel's JobFailed event. */
|
|
1337
|
+
interface QueueJobFailedEvent extends QueueJobEvent {
|
|
1338
|
+
readonly exception: unknown;
|
|
1339
|
+
}
|
|
1254
1340
|
interface QueueManager extends Queue {
|
|
1255
1341
|
connection(name?: string): Queue;
|
|
1256
1342
|
extend(driver: string, factory: (config: Record<string, unknown>) => Queue): void;
|
|
1343
|
+
/** Laravel's Queue::before(): listens for JobProcessing, before each job runs. */
|
|
1344
|
+
before(callback: (event: QueueJobEvent) => unknown): void;
|
|
1345
|
+
/** Laravel's Queue::after(): listens for JobProcessed, after each job that ran. */
|
|
1346
|
+
after(callback: (event: QueueJobEvent) => unknown): void;
|
|
1347
|
+
/** Laravel's Queue::failing(): listens for JobFailed, when a job has failed for good. */
|
|
1348
|
+
failing(callback: (event: QueueJobFailedEvent) => unknown): void;
|
|
1257
1349
|
}
|
|
1258
1350
|
declare const QueueManager: Token<QueueManager>;
|
|
1259
1351
|
interface FailedJob {
|
|
@@ -1687,8 +1779,27 @@ interface RateLimiter {
|
|
|
1687
1779
|
/** Seconds until the key's window resets. */
|
|
1688
1780
|
availableIn(key: string): Promise<number>;
|
|
1689
1781
|
clear(key: string): Promise<void>;
|
|
1782
|
+
/** Laravel's RateLimiter::for(): a named limiter, for `throttle:<name>`. */
|
|
1783
|
+
for(name: string, callback: RateLimiterCallback): void;
|
|
1784
|
+
/** The named limiter's callback, or undefined. */
|
|
1785
|
+
limiter(name: string): RateLimiterCallback | undefined;
|
|
1786
|
+
/**
|
|
1787
|
+
* Runs the callback unless `key` has had `maxAttempts` hits in its window, and counts the hit: the callback's result
|
|
1788
|
+
* (true when it returns nothing), or false without running it.
|
|
1789
|
+
*/
|
|
1790
|
+
attempt<T>(key: string, maxAttempts: number, callback: () => T | Promise<T>, decaySeconds?: number): Promise<T | boolean>;
|
|
1690
1791
|
}
|
|
1691
1792
|
declare const RateLimiter: Token<RateLimiter>;
|
|
1793
|
+
/** One limit a named limiter returns (Laravel's Limit): `maxAttempts` hits per `decaySeconds`, counted per `key`. */
|
|
1794
|
+
interface RateLimit {
|
|
1795
|
+
readonly key: string;
|
|
1796
|
+
readonly maxAttempts: number;
|
|
1797
|
+
readonly decaySeconds: number;
|
|
1798
|
+
/** Limit.none(): never limits. */
|
|
1799
|
+
readonly unlimited?: boolean;
|
|
1800
|
+
}
|
|
1801
|
+
/** What RateLimiter.for() takes: the limits for a request. */
|
|
1802
|
+
type RateLimiterCallback = (request: HttpRequest) => RateLimit | RateLimit[] | Promise<RateLimit | RateLimit[]>;
|
|
1692
1803
|
|
|
1693
1804
|
type ListenerClass<E> = Class<{
|
|
1694
1805
|
handle(event: E): unknown;
|
|
@@ -1903,4 +2014,4 @@ interface LiveManager {
|
|
|
1903
2014
|
}
|
|
1904
2015
|
declare const LiveManager: Token<LiveManager>;
|
|
1905
2016
|
|
|
1906
|
-
export { type AbilityCallback, type Abstract, type ActionMethods, type Address, Application, type Arrayable, type Attachment, AuthFactory, type Authenticatable, type AuthenticationError, type Batch, BatchRepository, type BodyInit, BusDispatcher, CacheManager, type CacheRepository, type Class, ClassNames, ClassRegistry, type ClosureCommand, type Command, type CommandContext, type Concrete, type ConfigCallbacks, ConfigRepository, ConsoleKernel, Container, type Content, type ControllerAction, type Cookie, CookieJar, type Credentials, CurrentRoute, type DatabaseConnection, DatabaseManager, type DatabaseNotification, type DriverName, Encrypter, type Enumerable, type Envelope, type ErrorKind, EventDispatcher, ExceptionCallbacks, ExceptionHandler, type ExceptionsConfigurator, type Factory, type FailedJob, FailedJobProvider, type Filesystem, FilesystemManager, Gate, type Guard, Hasher, type HeadersInit, type Htmlable, HttpKernel, HttpRequest, type InValue, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, type InferRuleType, type InferValidatedType, type InvokableClass, type Job, type Jsonable, type Listener, type ListenerClass, type LiveEffects, LiveManager, type LiveSnapshot, type LiveUpdateRequest, type LiveUpdateResponse, type Lock, type LogLevel, LogManager, type Logger, MailManager, type MailRecipient, type MailTransport, type Mailable, type Mailer, type MessageBag, type Middleware, MiddlewareCallbacks, type MiddlewareClass, type MiddlewareConfigurator, type MiddlewareReference, type ModelInstance, type ModelNotFoundError, type ModelStatic, type MustVerifyEmail, type Next, type Notifiable, type Notification, type NotificationChannel, NotificationDispatcher, type NumericValue, type Operator, type OptionValue, type OrielError, type OutgoingMessage, PaginationState, PasswordBroker, type PasswordStatus, type PendingBatch, type PendingBatchOptions, type PendingChain, type PendingMail, type Pipe, type PipeClosure, type PipeNext, type Pipeline, PipelineFactory, type PropCallback, type PutOptions, type QueryBuilder, type Queue, type QueueJob, QueueManager, type QueuePayload, RateLimiter, type RedirectResponse, Redirector, type ResourceOptions, type Responsable, ResponseFactory, type Route, type RouteAction, type RouteArguments, type RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteParameter, type RouteParameters, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type RuleParameterList, type RuleTyping, type Rules, Schedule, type ScheduleHook, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type TypedValidationRule, type UploadedFile, UrlGenerator, type UserProvider, type ValidationError, ValidationFactory, type ValidationRule, type ValidationRuleTypes, type Validator, type View, ViewFactory, token };
|
|
2017
|
+
export { type AbilityCallback, type Abstract, type ActionMethods, type Address, Application, type Arrayable, type Attachment, AuthFactory, type Authenticatable, type AuthenticationError, type Batch, BatchRepository, type BodyInit, BusDispatcher, CacheManager, type CacheRepository, type Class, ClassNames, ClassRegistry, type ClosureCommand, type Command, type CommandContext, type Concrete, type ConfigCallbacks, ConfigRepository, ConsoleKernel, Container, type Content, type ControllerAction, type Cookie, CookieJar, type Credentials, CurrentRoute, type DatabaseConnection, DatabaseManager, type DatabaseNotification, type DriverName, Encrypter, type Enumerable, type Envelope, type ErrorKind, EventDispatcher, ExceptionCallbacks, ExceptionHandler, type ExceptionsConfigurator, type Factory, type FailedJob, FailedJobProvider, type Filesystem, FilesystemManager, Gate, type Guard, Hasher, type HeadersInit, type Htmlable, HttpKernel, HttpRequest, type InValue, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, type InferRuleType, type InferValidatedType, type InvokableClass, type Job, type Jsonable, type Listener, type ListenerClass, type LiveEffects, LiveManager, type LiveSnapshot, type LiveUpdateRequest, type LiveUpdateResponse, type Lock, type LogLevel, LogManager, type Logger, MailManager, type MailRecipient, type MailTransport, type Mailable, type Mailer, MaintenanceMode, type MaintenanceModeData, type MessageBag, type Middleware, MiddlewareCallbacks, type MiddlewareClass, type MiddlewareConfigurator, type MiddlewareReference, type ModelInstance, type ModelNotFoundError, type ModelStatic, type MustVerifyEmail, type Next, type Notifiable, type Notification, type NotificationChannel, NotificationDispatcher, type NumericValue, type Operator, type OptionValue, type OrielError, type OutgoingMessage, PaginationState, PasswordBroker, type PasswordStatus, type PendingBatch, type PendingBatchOptions, type PendingChain, type PendingMail, type Pipe, type PipeClosure, type PipeNext, type Pipeline, PipelineFactory, type PropCallback, type PutOptions, type QueryBuilder, type Queue, type QueueJob, type QueueJobEvent, type QueueJobFailedEvent, QueueManager, type QueuePayload, type RateLimit, RateLimiter, type RateLimiterCallback, type RedirectResponse, Redirector, type ResourceOptions, type Responsable, ResponseFactory, type Route, type RouteAction, type RouteArguments, type RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteParameter, type RouteParameters, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type RuleParameterList, type RuleTyping, type Rules, Schedule, type ScheduleHook, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type TypedValidationRule, type UploadedFile, UrlGenerator, type UserProvider, VALIDATED_INPUT, type ValidatedInput, type ValidationError, ValidationFactory, type ValidationRule, type ValidationRuleTypes, type Validator, type View, ViewFactory, token };
|
package/dist/contracts.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
LiveManager,
|
|
28
28
|
LogManager,
|
|
29
29
|
MailManager,
|
|
30
|
+
MaintenanceMode,
|
|
30
31
|
MiddlewareCallbacks,
|
|
31
32
|
NotificationDispatcher,
|
|
32
33
|
PaginationState,
|
|
@@ -42,10 +43,11 @@ import {
|
|
|
42
43
|
Schedule,
|
|
43
44
|
Session,
|
|
44
45
|
UrlGenerator,
|
|
46
|
+
VALIDATED_INPUT,
|
|
45
47
|
ValidationFactory,
|
|
46
48
|
ViewFactory,
|
|
47
49
|
token
|
|
48
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-6AXJB4CD.js";
|
|
49
51
|
export {
|
|
50
52
|
Application,
|
|
51
53
|
AuthFactory,
|
|
@@ -75,6 +77,7 @@ export {
|
|
|
75
77
|
LiveManager,
|
|
76
78
|
LogManager,
|
|
77
79
|
MailManager,
|
|
80
|
+
MaintenanceMode,
|
|
78
81
|
MiddlewareCallbacks,
|
|
79
82
|
NotificationDispatcher,
|
|
80
83
|
PaginationState,
|
|
@@ -90,6 +93,7 @@ export {
|
|
|
90
93
|
Schedule,
|
|
91
94
|
Session,
|
|
92
95
|
UrlGenerator,
|
|
96
|
+
VALIDATED_INPUT,
|
|
93
97
|
ValidationFactory,
|
|
94
98
|
ViewFactory,
|
|
95
99
|
token
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Enumerable, ServiceProvider as ServiceProvider$1, Application, ClassRegistry as ClassRegistry$1, Class, Abstract, ConfigRepository } from './contracts.js';
|
|
1
|
+
import { Enumerable, ServiceProvider as ServiceProvider$1, Application, ClassRegistry as ClassRegistry$1, Class, ValidatedInput as ValidatedInput$1, Abstract, ConfigRepository } from './contracts.js';
|
|
2
2
|
|
|
3
3
|
type Operator = '=' | '==' | '===' | '!=' | '!==' | '<>' | '<' | '<=' | '>' | '>=';
|
|
4
4
|
|
|
@@ -522,6 +522,32 @@ declare const Arr: {
|
|
|
522
522
|
last<T, D = undefined>(items: readonly T[], predicate?: (item: T, index: number) => boolean, defaultValue?: D): T | D;
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
+
/** Laravel's date serialization: ISO 8601 in UTC with microseconds (2026-01-02T03:04:05.000000Z). */
|
|
526
|
+
declare function serializeDate(date: Date): string;
|
|
527
|
+
|
|
528
|
+
type Keys<K extends string> = Array<K | readonly K[]>;
|
|
529
|
+
/**
|
|
530
|
+
* Laravel's ValidatedInput: what `safe()` gives, the validated data with helpers to pick from it. Keys may be dotted
|
|
531
|
+
* (`address.city`). Each method returns a copy, so changing it leaves the input as it was.
|
|
532
|
+
*/
|
|
533
|
+
declare class ValidatedInput<T extends object = Record<string, unknown>> implements ValidatedInput$1<T> {
|
|
534
|
+
#private;
|
|
535
|
+
constructor(input: T);
|
|
536
|
+
all(): T;
|
|
537
|
+
/** The keys given that are there, as `{ key: value }`; a dotted key is nested. */
|
|
538
|
+
only<K extends keyof T & string>(...keys: Keys<K>): Pick<T, K>;
|
|
539
|
+
/** Everything but the keys given. */
|
|
540
|
+
except<K extends keyof T & string>(...keys: Keys<K>): Omit<T, K>;
|
|
541
|
+
/** A new input with the values added (replacing the keys they share). */
|
|
542
|
+
merge<U extends Record<string, unknown>>(values: U): ValidatedInput<T & U>;
|
|
543
|
+
/** Laravel's collect(), as a list: the input's values, or those of the list (or object) at `key`; a value alone is a list of one. */
|
|
544
|
+
collect(key?: string): unknown[];
|
|
545
|
+
/** Whether every key given is there. */
|
|
546
|
+
has(...keys: Array<string | readonly string[]>): boolean;
|
|
547
|
+
/** The value at `key` (dotted or not), else `defaultValue`; everything without a key. */
|
|
548
|
+
input(key?: string, defaultValue?: unknown): unknown;
|
|
549
|
+
}
|
|
550
|
+
|
|
525
551
|
declare abstract class ServiceProvider implements ServiceProvider$1 {
|
|
526
552
|
protected readonly app: Application;
|
|
527
553
|
constructor(app: Application);
|
|
@@ -571,6 +597,17 @@ declare const value: <T>(v: T | (() => T)) => T;
|
|
|
571
597
|
declare function tap<T>(target: T, callback: (target: T) => void): T;
|
|
572
598
|
/** Calls fn up to `times` times (attempt numbers are 1-based). Rethrows the last error, or the first one `when` rejects. */
|
|
573
599
|
declare function retry<T>(times: number, fn: (attempt: number) => T | Promise<T>, sleepMs?: number | ((attempt: number) => number), when?: (error: unknown) => boolean): Promise<T>;
|
|
600
|
+
/**
|
|
601
|
+
* Laravel's report(): hands an error to the exception handler, which logs it unless its `dontReport` list skips it,
|
|
602
|
+
* and lets the request carry on. Without a handler, it goes to the console.
|
|
603
|
+
*/
|
|
604
|
+
declare function report(error: unknown): Promise<void>;
|
|
605
|
+
/**
|
|
606
|
+
* Laravel's rescue(): runs the callback and returns its value; if it throws, reports the error (unless `report` is
|
|
607
|
+
* false, or a function of the error that returns false) and returns the fallback, or what the fallback function
|
|
608
|
+
* returns for the error.
|
|
609
|
+
*/
|
|
610
|
+
declare function rescue<T, R = undefined>(callback: () => T | Promise<T>, rescue?: R | ((error: unknown) => R | Promise<R>), shouldReport?: boolean | ((error: unknown) => boolean)): Promise<T | R>;
|
|
574
611
|
|
|
575
612
|
/**
|
|
576
613
|
* Laravel's __(): the line for `key` with `:placeholders` filled (`:name`, `:Name` capitalized, `:NAME` upper-cased),
|
|
@@ -636,4 +673,4 @@ declare namespace fileType {
|
|
|
636
673
|
export { fileType_AVIF as AVIF, fileType_BINARY_AND_MARKUP_TYPES as BINARY_AND_MARKUP_TYPES, fileType_BMP as BMP, type fileType_DetectedType as DetectedType, fileType_EMPTY as EMPTY, fileType_GIF as GIF, fileType_HTML as HTML, fileType_JPEG as JPEG, fileType_PDF as PDF, fileType_PNG as PNG, fileType_RASTER_IMAGES as RASTER_IMAGES, fileType_SNIFF_BYTES as SNIFF_BYTES, fileType_SVG as SVG, fileType_TEXT as TEXT, fileType_UNKNOWN as UNKNOWN, fileType_WEBP as WEBP, fileType_XML as XML, fileType_detectFileType as detectFileType };
|
|
637
674
|
}
|
|
638
675
|
|
|
639
|
-
export { Arr as A, Collection as C, type Facade as F, ItemNotFoundError as I, LazyCollection as L, MissingPackageError as M, type Operator as O, ServiceProvider as S, __ as _, Stringable as a, ClassRegistry as b, type FacadeStatics as c, MultipleItemsFoundError as d, Str as e, fileType as f, app as g, collect as h, config as i, facade as j, now as n,
|
|
676
|
+
export { Arr as A, Collection as C, type Facade as F, ItemNotFoundError as I, LazyCollection as L, MissingPackageError as M, type Operator as O, ServiceProvider as S, ValidatedInput as V, __ as _, Stringable as a, ClassRegistry as b, type FacadeStatics as c, MultipleItemsFoundError as d, Str as e, fileType as f, app as g, collect as h, config as i, facade as j, rescue as k, retry as l, now as n, report as r, serializeDate as s, tap as t, value as v };
|