@orieljs/framework 0.1.0-alpha.4 → 0.1.0-alpha.5

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.
@@ -640,6 +640,8 @@ interface ModelInstance {
640
640
  getTable(): string;
641
641
  getRouteKey(): unknown;
642
642
  getRouteKeyName(): string;
643
+ /** The value stored in a polymorphic `*_type` column for this model: its morph map alias, else its class name. */
644
+ getMorphClass(): string;
643
645
  getAttribute<T = unknown>(key: string): T;
644
646
  setAttribute(key: string, value: unknown): this;
645
647
  fill(attributes: Row): this;
@@ -655,6 +657,19 @@ interface ModelStatic<M extends ModelInstance = ModelInstance> {
655
657
  find(id: unknown): Promise<M | undefined>;
656
658
  findOrFail(id: unknown): Promise<M>;
657
659
  }
660
+ /**
661
+ * What decides a paginator's page and the path of its links when the request doesn't (Laravel's
662
+ * Paginator::currentPageResolver and currentPathResolver, which Livewire's WithPagination replaces). Live binds one for
663
+ * the application, which answers while a WithPagination component mounts, runs an update's hooks and actions, or
664
+ * renders. Unbound, or `undefined` from a method, the paginators read the request (`?page=` and its URL).
665
+ */
666
+ interface PaginationState {
667
+ /** The page to show for `pageName` ('page' by default). */
668
+ currentPage(pageName: string): number | undefined;
669
+ /** The base path of the page links. */
670
+ currentPath(): string | undefined;
671
+ }
672
+ declare const PaginationState: Token<PaginationState>;
658
673
 
659
674
  interface Authenticatable {
660
675
  getAuthIdentifierName(): string;
@@ -723,6 +738,11 @@ interface MustVerifyEmail {
723
738
 
724
739
  /** Options a job class may declare as public fields. Their presence (or implementing ShouldQueue) makes things queueable. */
725
740
  interface ShouldQueue {
741
+ /**
742
+ * Marks the class as queued at run time: `implements ShouldQueue` leaves no trace once compiled, so the interface
743
+ * asks for `readonly shouldQueue = true`. Jobs, listeners, mailables and notifications carrying it are queued.
744
+ */
745
+ readonly shouldQueue: true;
726
746
  connection?: string;
727
747
  queue?: string;
728
748
  /** Seconds. */
@@ -1057,6 +1077,28 @@ interface NotificationDispatcher {
1057
1077
  extend(channel: string, factory: () => NotificationChannel): void;
1058
1078
  }
1059
1079
  declare const NotificationDispatcher: Token<NotificationDispatcher>;
1080
+ /**
1081
+ * A stored database notification (Laravel's DatabaseNotification model): one row of the `notifications` table, with
1082
+ * its snake_case columns. `user.notifications()`, `unreadNotifications()` and `readNotifications()` query these,
1083
+ * newest first.
1084
+ */
1085
+ interface DatabaseNotification extends ModelInstance {
1086
+ /** A UUID. */
1087
+ readonly id: string;
1088
+ /** The notification's class name. */
1089
+ readonly type: string;
1090
+ /** What the notification's toDatabase() (or toArray()) returned. */
1091
+ readonly data: Record<string, unknown>;
1092
+ read_at: Date | null;
1093
+ readonly created_at: Date | null;
1094
+ readonly updated_at: Date | null;
1095
+ /** Sets read_at to now and saves, unless it is already read. */
1096
+ markAsRead(): Promise<void>;
1097
+ /** Clears read_at and saves, unless it is already unread. */
1098
+ markAsUnread(): Promise<void>;
1099
+ read(): boolean;
1100
+ unread(): boolean;
1101
+ }
1060
1102
 
1061
1103
  interface Lock {
1062
1104
  /** Tries once. Returns whether it was acquired. */
@@ -1322,4 +1364,4 @@ interface LiveManager {
1322
1364
  }
1323
1365
  declare const LiveManager: Token<LiveManager>;
1324
1366
 
1325
- 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, 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 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, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, 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 Operator, type OptionValue, type OrielError, type OutgoingMessage, 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 RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type Rules, Schedule, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type UploadedFile, UrlGenerator, type UserProvider, type ValidationError, ValidationFactory, type ValidationRule, type Validator, type View, ViewFactory, token };
1367
+ 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, 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, InertiaFactory, type InertiaOnceProp, type InertiaPage, type InertiaResponse, type InertiaScrollProp, InertiaSsrGateway, type InertiaSsrResponse, 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 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 RouteClosure, type RouteList, RouteModelResolver, type RouteName, type RouteRegistrar, Router, RoutingPaths, type Row, type RuleCallback, type Rules, Schedule, type ScheduledEvent, type SentMessage, type ServiceProvider, type ServiceProviderClass, Session, type SessionHandler, type ShouldQueue, type StatefulGuard, type Token, type UploadedFile, UrlGenerator, type UserProvider, type ValidationError, ValidationFactory, type ValidationRule, type Validator, type View, ViewFactory, token };
package/dist/contracts.js CHANGED
@@ -28,6 +28,7 @@ import {
28
28
  MailManager,
29
29
  MiddlewareCallbacks,
30
30
  NotificationDispatcher,
31
+ PaginationState,
31
32
  PasswordBroker,
32
33
  PipelineFactory,
33
34
  QueueManager,
@@ -43,7 +44,7 @@ import {
43
44
  ValidationFactory,
44
45
  ViewFactory,
45
46
  token
46
- } from "./chunk-WSGWYXAO.js";
47
+ } from "./chunk-BSQKOLSK.js";
47
48
  export {
48
49
  Application,
49
50
  AuthFactory,
@@ -74,6 +75,7 @@ export {
74
75
  MailManager,
75
76
  MiddlewareCallbacks,
76
77
  NotificationDispatcher,
78
+ PaginationState,
77
79
  PasswordBroker,
78
80
  PipelineFactory,
79
81
  QueueManager,