@orieljs/framework 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
Files changed (86) hide show
  1. package/NOTICE +4 -0
  2. package/README.md +10 -1
  3. package/TRADEMARKS.md +33 -0
  4. package/dist/{chunk-POEP4B2M.js → chunk-7ZQZYDOC.js} +745 -105
  5. package/dist/chunk-7ZQZYDOC.js.map +1 -0
  6. package/dist/{chunk-I63ZFMX6.js → chunk-GVNLZZTN.js} +1 -1
  7. package/dist/chunk-GVNLZZTN.js.map +1 -0
  8. package/dist/{chunk-ZOEPKBVF.js → chunk-SPQUX3C7.js} +1347 -428
  9. package/dist/chunk-SPQUX3C7.js.map +1 -0
  10. package/dist/{chunk-MFTZQMZM.js → chunk-VOYW3R5J.js} +4 -4
  11. package/dist/chunk-VOYW3R5J.js.map +1 -0
  12. package/dist/contracts.d.ts +515 -17
  13. package/dist/contracts.js +1 -1
  14. package/dist/index.d-WQpfdIbG.d.ts +630 -0
  15. package/dist/index.d.ts +964 -152
  16. package/dist/index.js +4279 -866
  17. package/dist/index.js.map +1 -1
  18. package/dist/{jsx-runtime-CBZQYYDS.d.ts → jsx-runtime-6um4Mwfb.d.ts} +96 -5
  19. package/dist/jsx-runtime.d.ts +2 -2
  20. package/dist/jsx-runtime.js +3 -3
  21. package/dist/{testing-BM481Hdz.d.ts → testing-CKwfWJGn.d.ts} +180 -15
  22. package/dist/testing.d.ts +2 -2
  23. package/dist/testing.js +3 -3
  24. package/docs/authentication.md +487 -0
  25. package/docs/authorization.md +435 -0
  26. package/docs/cache.md +647 -0
  27. package/docs/collections.md +2270 -0
  28. package/docs/configuration.md +334 -0
  29. package/docs/console.md +651 -0
  30. package/docs/container.md +430 -0
  31. package/docs/controllers.md +406 -0
  32. package/docs/csrf.md +126 -0
  33. package/docs/database-testing.md +144 -0
  34. package/docs/database.md +236 -0
  35. package/docs/deployment.md +276 -0
  36. package/docs/eloquent-collections.md +218 -0
  37. package/docs/eloquent-factories.md +255 -0
  38. package/docs/eloquent-mutators.md +254 -0
  39. package/docs/eloquent-observers.md +145 -0
  40. package/docs/eloquent-relationships.md +557 -0
  41. package/docs/eloquent.md +494 -0
  42. package/docs/encryption.md +104 -0
  43. package/docs/errors.md +318 -0
  44. package/docs/events.md +336 -0
  45. package/docs/facades.md +278 -0
  46. package/docs/hashing.md +118 -0
  47. package/docs/helpers.md +1281 -0
  48. package/docs/http-tests.md +386 -0
  49. package/docs/inertia.md +485 -0
  50. package/docs/installation.md +209 -0
  51. package/docs/lifecycle.md +234 -0
  52. package/docs/live-tests.md +226 -0
  53. package/docs/live.md +910 -0
  54. package/docs/logging.md +255 -0
  55. package/docs/mail.md +619 -0
  56. package/docs/middleware.md +384 -0
  57. package/docs/migrations.md +416 -0
  58. package/docs/mocking.md +264 -0
  59. package/docs/navigation.json +273 -0
  60. package/docs/notifications.md +225 -0
  61. package/docs/pagination.md +247 -0
  62. package/docs/passwords.md +207 -0
  63. package/docs/providers.md +187 -0
  64. package/docs/queries.md +600 -0
  65. package/docs/queues.md +330 -0
  66. package/docs/requests.md +533 -0
  67. package/docs/responses.md +444 -0
  68. package/docs/routing.md +738 -0
  69. package/docs/scheduling.md +277 -0
  70. package/docs/seeding.md +122 -0
  71. package/docs/session.md +409 -0
  72. package/docs/starter-kits.md +396 -0
  73. package/docs/storage.md +192 -0
  74. package/docs/structure.md +264 -0
  75. package/docs/testing.md +165 -0
  76. package/docs/time-travel.md +138 -0
  77. package/docs/validation.md +1792 -0
  78. package/docs/verification.md +152 -0
  79. package/docs/views.md +566 -0
  80. package/docs/vite.md +322 -0
  81. package/package.json +34 -32
  82. package/dist/chunk-I63ZFMX6.js.map +0 -1
  83. package/dist/chunk-MFTZQMZM.js.map +0 -1
  84. package/dist/chunk-POEP4B2M.js.map +0 -1
  85. package/dist/chunk-ZOEPKBVF.js.map +0 -1
  86. package/dist/index.d-BJyJx6U1.d.ts +0 -319
@@ -1,319 +0,0 @@
1
- import { Enumerable, ServiceProvider as ServiceProvider$1, Application, ClassRegistry as ClassRegistry$1, Class, Abstract, ConfigRepository } from './contracts.js';
2
-
3
- type Operator = '=' | '==' | '===' | '!=' | '!==' | '<>' | '<' | '<=' | '>' | '>=';
4
-
5
- type Getter<T, V = unknown> = (keyof T & string) | ((item: T) => V);
6
- declare class Collection<T> implements Enumerable<T> {
7
- protected readonly items: T[];
8
- constructor(items?: Iterable<T>);
9
- static make<T>(items?: Iterable<T>): Collection<T>;
10
- /** Laravel semantics: callback receives 1..n. */
11
- static times<T>(count: number, callback: (index: number) => T): Collection<T>;
12
- [Symbol.iterator](): Iterator<T>;
13
- all(): T[];
14
- count(): number;
15
- isEmpty(): boolean;
16
- isNotEmpty(): boolean;
17
- toArray(): unknown[];
18
- toJSON(): T[];
19
- toJson(): string;
20
- map<U>(callback: (item: T, index: number) => U): Collection<U>;
21
- flatMap<U>(callback: (item: T, index: number) => U | U[] | Collection<U>): Collection<U>;
22
- filter(callback?: (item: T, index: number) => unknown): Collection<T>;
23
- reject(callback: (item: T, index: number) => unknown): Collection<T>;
24
- /** Return false from the callback to stop. */
25
- each(callback: (item: T, index: number) => unknown): this;
26
- reduce<U>(callback: (carry: U, item: T, index: number) => U, initial: U): U;
27
- first(): T | undefined;
28
- first<D = undefined>(callback: (item: T, index: number) => unknown, defaultValue?: D): T | D;
29
- last(): T | undefined;
30
- last<D = undefined>(callback: (item: T, index: number) => unknown, defaultValue?: D): T | D;
31
- where(key: Getter<T>, value: unknown): Collection<T>;
32
- where(key: Getter<T>, operator: Operator, value: unknown): Collection<T>;
33
- firstWhere(key: Getter<T>, value: unknown): T | undefined;
34
- firstWhere(key: Getter<T>, operator: Operator, value: unknown): T | undefined;
35
- whereIn(key: Getter<T>, values: readonly unknown[]): Collection<T>;
36
- whereNotIn(key: Getter<T>, values: readonly unknown[]): Collection<T>;
37
- pluck<K extends keyof T & string>(key: K): Collection<T[K]>;
38
- keyBy(key: Getter<T>): Record<string, T>;
39
- groupBy(key: Getter<T>): Record<string, Collection<T>>;
40
- mapWithKeys<V>(callback: (item: T, index: number) => readonly [string, V]): Record<string, V>;
41
- sortBy(key: Getter<T>, direction?: 'asc' | 'desc'): Collection<T>;
42
- sortByDesc(key: Getter<T>): Collection<T>;
43
- sum(key?: Getter<T>): number;
44
- avg(key?: Getter<T>): number | undefined;
45
- min(key?: Getter<T>): number | undefined;
46
- max(key?: Getter<T>): number | undefined;
47
- unique(key?: Getter<T>): Collection<T>;
48
- chunk(size: number): Collection<Collection<T>>;
49
- /** Negative count takes from the end. */
50
- take(count: number): Collection<T>;
51
- skip(count: number): Collection<T>;
52
- slice(offset: number, length?: number): Collection<T>;
53
- values(): Collection<T>;
54
- contains(key: keyof T & string, value: unknown): boolean;
55
- contains(callback: (item: T) => boolean): boolean;
56
- contains(value: unknown): boolean;
57
- /** Mutates, like Laravel. */
58
- push(...values: T[]): this;
59
- concat(values: Iterable<T>): Collection<T>;
60
- partition(callback: (item: T, index: number) => unknown): [Collection<T>, Collection<T>];
61
- implode(glue: string): string;
62
- implode(key: keyof T & string, glue: string): string;
63
- when<U = this>(condition: unknown, callback: (collection: this) => U): U | this;
64
- pipe<U>(callback: (collection: this) => U): U;
65
- tap(callback: (collection: this) => void): this;
66
- }
67
- declare function collect<T>(items?: Iterable<T>): Collection<T>;
68
-
69
- type Source<T> = () => AsyncIterable<T> | Iterable<T>;
70
- /** Pull-based and async: for DB cursors (Model.lazy()) and large files. */
71
- declare class LazyCollection<T> implements AsyncIterable<T> {
72
- private readonly source;
73
- constructor(source: Source<T>);
74
- static make<T>(source: Source<T>): LazyCollection<T>;
75
- [Symbol.asyncIterator](): AsyncIterator<T>;
76
- map<U>(callback: (item: T, index: number) => U | Promise<U>): LazyCollection<U>;
77
- filter(callback: (item: T, index: number) => unknown): LazyCollection<T>;
78
- take(count: number): LazyCollection<T>;
79
- chunk(size: number): LazyCollection<Collection<T>>;
80
- /** Return false from the callback to stop. */
81
- each(callback: (item: T, index: number) => unknown): Promise<void>;
82
- first(callback?: (item: T) => unknown): Promise<T | undefined>;
83
- count(): Promise<number>;
84
- collect(): Promise<Collection<T>>;
85
- }
86
-
87
- /**
88
- * Laravel's Stringable: a string with Str's helpers as chainable methods, each returning a new Stringable.
89
- * `Str.of(' Café ').trim().slug().toString()` is 'cafe'; `request().string('q')` returns one. It prints as its string.
90
- */
91
- declare class Stringable {
92
- #private;
93
- constructor(value?: string);
94
- after(search: string): Stringable;
95
- afterLast(search: string): Stringable;
96
- append(...values: string[]): Stringable;
97
- ascii(): Stringable;
98
- before(search: string): Stringable;
99
- beforeLast(search: string): Stringable;
100
- between(from: string, to: string): Stringable;
101
- camel(): Stringable;
102
- contains(needles: string | string[]): boolean;
103
- endsWith(needles: string | string[]): boolean;
104
- /** The same string as `value` (a string or another Stringable). */
105
- exactly(value: string | Stringable): boolean;
106
- /** The parts between the delimiters, as a Collection (PHP's explode()). */
107
- explode(delimiter: string): Collection<string>;
108
- finish(cap: string): Stringable;
109
- /** Wildcard match, as Str.is(): `*` matches anything. */
110
- is(pattern: string): boolean;
111
- isEmpty(): boolean;
112
- isNotEmpty(): boolean;
113
- kebab(): Stringable;
114
- lcfirst(): Stringable;
115
- /** The number of characters (code points, as PHP's mb_strlen()). */
116
- length(): number;
117
- limit(limit?: number, end?: string): Stringable;
118
- lower(): Stringable;
119
- /** Strips whitespace and invisible characters from the start, or the characters given. */
120
- ltrim(characters?: string): Stringable;
121
- plural(count?: number): Stringable;
122
- prepend(...values: string[]): Stringable;
123
- /** Replaces every occurrence of the search string (or of each of several) with `replace`. */
124
- replace(search: string | string[], replace: string): Stringable;
125
- /** Strips whitespace and invisible characters from the end, or the characters given. */
126
- rtrim(characters?: string): Stringable;
127
- singular(): Stringable;
128
- slug(separator?: string): Stringable;
129
- snake(delimiter?: string): Stringable;
130
- start(prefix: string): Stringable;
131
- startsWith(needles: string | string[]): boolean;
132
- studly(): Stringable;
133
- title(): Stringable;
134
- /** PHP's filter_var(FILTER_VALIDATE_BOOLEAN): '1', 'true', 'on' and 'yes' (any case, trimmed) are true. */
135
- toBoolean(): boolean;
136
- /** PHP's floatval(): the leading number, else 0. */
137
- toFloat(): number;
138
- /** PHP's intval(): the leading digits, else 0. */
139
- toInteger(): number;
140
- toJSON(): string;
141
- toString(): string;
142
- /** Strips whitespace and invisible characters from both ends (Laravel's Str::trim()), or the characters given. */
143
- trim(characters?: string): Stringable;
144
- ucfirst(): Stringable;
145
- upper(): Stringable;
146
- value(): string;
147
- }
148
-
149
- declare const Str: {
150
- /** Laravel's Str::of(): the value as a Stringable, for chaining: Str.of(title).trim().slug(). */
151
- of: (value?: unknown) => Stringable;
152
- ucfirst: (v: string) => string;
153
- lcfirst: (v: string) => string;
154
- studly: (v: string) => string;
155
- camel: (v: string) => string;
156
- snake: (v: string, delimiter?: string) => string;
157
- kebab: (v: string) => string;
158
- title: (v: string) => string;
159
- /** Laravel's Str::ascii(): the value in plain ASCII ('Café' → 'Cafe', 'Ελληνικά' → 'Ellinika'), as for English. */
160
- ascii: (v: string) => string;
161
- /**
162
- * Laravel's Str::slug(): transliterated to ASCII first (unless `language` is null), '@' read as 'at', then lower-cased
163
- * letters and digits joined by the separator: 'Café crème' → 'cafe-creme'. What has no ASCII form is dropped.
164
- */
165
- slug: (title: string, separator?: string, language?: "en" | null, dictionary?: Readonly<Record<string, string>>) => string;
166
- plural: (v: string, count?: number) => string;
167
- singular: (v: string) => string;
168
- random: (length?: number) => string;
169
- uuid: () => `${string}-${string}-${string}-${string}-${string}`;
170
- /**
171
- * A version 7 UUID (RFC 9562): the time in milliseconds first, so ids from later milliseconds sort after earlier ones
172
- * (within one millisecond the order is random). Throws a TypeError for a time before 1970, after 10889 or invalid.
173
- */
174
- uuid7: (time?: Date) => string;
175
- /**
176
- * A ULID: 26 upper-case Crockford characters, ten for the time in milliseconds and sixteen random, so ids from later
177
- * milliseconds sort after earlier ones. Throws a TypeError for a time before 1970, after 10889 or invalid.
178
- */
179
- ulid: (time?: Date) => string;
180
- /** Laravel's Str::isUuid(): five groups of hex digits, any version. */
181
- isUuid: (value: unknown) => value is string;
182
- /** Laravel's Str::isUlid(): 26 Crockford characters in either case, the first at most 7. */
183
- isUlid: (value: unknown) => value is string;
184
- /** Wildcard match: `*` matches anything; everything else is literal. */
185
- is: (pattern: string, value: string) => boolean;
186
- startsWith: (v: string, needles: string | string[]) => boolean;
187
- endsWith: (v: string, needles: string | string[]) => boolean;
188
- contains: (v: string, needles: string | string[]) => boolean;
189
- after: (v: string, search: string) => string;
190
- afterLast: (v: string, search: string) => string;
191
- before: (v: string, search: string) => string;
192
- beforeLast: (v: string, search: string) => string;
193
- between: (v: string, from: string, to: string) => string;
194
- limit: (v: string, limit?: number, end?: string) => string;
195
- start: (v: string, prefix: string) => string;
196
- finish: (v: string, cap: string) => string;
197
- };
198
-
199
- type Obj = Record<string, unknown>;
200
- declare const Arr: {
201
- get<T = unknown>(target: unknown, key: string | undefined, defaultValue?: T): T;
202
- has(target: unknown, key: string): boolean;
203
- set(target: Obj, key: string, value: unknown): Obj;
204
- forget(target: Obj, key: string): void;
205
- dot(target: Obj, prefix?: string): Obj;
206
- undot(flat: Obj): Obj;
207
- only<T extends Obj>(target: T, keys: string[]): Partial<T>;
208
- except<T extends Obj>(target: T, keys: string[]): Partial<T>;
209
- wrap<T>(value: T | T[] | null | undefined): T[];
210
- first<T, D = undefined>(items: readonly T[], predicate?: (item: T, index: number) => boolean, defaultValue?: D): T | D;
211
- last<T, D = undefined>(items: readonly T[], predicate?: (item: T, index: number) => boolean, defaultValue?: D): T | D;
212
- };
213
-
214
- declare abstract class ServiceProvider implements ServiceProvider$1 {
215
- protected readonly app: Application;
216
- constructor(app: Application);
217
- register(): void;
218
- boot(): void | Promise<void>;
219
- /** Package defaults under `key`; values the app already set win (shallow merge, like Laravel). */
220
- protected mergeConfigFrom(defaults: Record<string, unknown>, key: string): void;
221
- }
222
-
223
- interface FacadeStatics<T> {
224
- getFacadeRoot(): T;
225
- /** Replace the instance in the current container (used by X.fake()). */
226
- swap(instance: T): void;
227
- }
228
- type Facade<T, X = object> = T & X & FacadeStatics<T>;
229
- declare function facade<T extends object, X extends object = object>(abstract: Abstract<T>, extras?: X): Facade<T, X>;
230
-
231
- declare class ClassRegistry implements ClassRegistry$1 {
232
- private readonly byName;
233
- private readonly byClass;
234
- register(cls: Class<unknown>, name?: string): string;
235
- nameOf(cls: Class<unknown>): string | undefined;
236
- resolve<T = unknown>(name: string): Class<T>;
237
- has(name: string): boolean;
238
- }
239
-
240
- /**
241
- * The application, or an abstract resolved from the current container.
242
- * Inside a request scope, app().make()/instance()/… act on that scope, so app().make(X) sees scoped services.
243
- */
244
- declare function app(): Application;
245
- declare function app<T>(abstract: Abstract<T>): T;
246
- declare function config(): ConfigRepository;
247
- declare function config(values: Record<string, unknown>): void;
248
- declare function config<T = unknown>(key: string, defaultValue?: T): T;
249
- declare const now: () => Date;
250
- declare const value: <T>(v: T | (() => T)) => T;
251
- declare function tap<T>(target: T, callback: (target: T) => void): T;
252
- /** Calls fn up to `times` times (attempt numbers are 1-based). Rethrows the last error, or the first one `when` rejects. */
253
- declare function retry<T>(times: number, fn: (attempt: number) => T | Promise<T>, sleepMs?: number | ((attempt: number) => number), when?: (error: unknown) => boolean): Promise<T>;
254
-
255
- /**
256
- * Laravel's __(): the line for `key` with `:placeholders` filled (`:name`, `:Name` capitalized, `:NAME` upper-cased),
257
- * longest placeholder first. A key with no line comes back as is, so a sentence can be its own key:
258
- * __('auth.failed'), __('auth.throttle', { seconds: 30 }), __('A reset link will be sent if the account exists.').
259
- */
260
- declare function __(key: string, replace?: Record<string, string | number>): string;
261
-
262
- /**
263
- * What a file's bytes show it to be, read from its leading bytes the way PHP's finfo reads them for Laravel (the file
264
- * validation rules, and the extension a stored upload gets). The client's file name and MIME type are never consulted.
265
- */
266
- interface DetectedType {
267
- /** 'image/png', 'text/plain', …; 'application/octet-stream' when no format matches, 'application/x-empty' for no bytes. */
268
- readonly mime: string;
269
- /** The extensions that name the type, the usual one first. Empty when the bytes match no format. */
270
- readonly extensions: readonly string[];
271
- }
272
- declare const JPEG: DetectedType;
273
- declare const PNG: DetectedType;
274
- declare const GIF: DetectedType;
275
- declare const WEBP: DetectedType;
276
- declare const AVIF: DetectedType;
277
- declare const BMP: DetectedType;
278
- declare const SVG: DetectedType;
279
- declare const PDF: DetectedType;
280
- declare const HTML: DetectedType;
281
- declare const XML: DetectedType;
282
- declare const TEXT: DetectedType;
283
- declare const UNKNOWN: DetectedType;
284
- declare const EMPTY: DetectedType;
285
- /** The raster formats the image rule accepts: Laravel 12's jpg, jpeg, png, gif, bmp and webp, plus AVIF. */
286
- declare const RASTER_IMAGES: ReadonlySet<string>;
287
- /** Every format recognised by its bytes other than plain text. */
288
- declare const BINARY_AND_MARKUP_TYPES: readonly DetectedType[];
289
- /**
290
- * How much of a file is read to tell its type: the window checked for binary bytes (libmagic reads its first megabyte
291
- * too). Uploads read this much to be named, so naming and validation see the same bytes.
292
- */
293
- declare const SNIFF_BYTES: number;
294
- /** The type the bytes show. */
295
- declare function detectFileType(bytes: Uint8Array): DetectedType;
296
-
297
- declare const fileType_AVIF: typeof AVIF;
298
- declare const fileType_BINARY_AND_MARKUP_TYPES: typeof BINARY_AND_MARKUP_TYPES;
299
- declare const fileType_BMP: typeof BMP;
300
- type fileType_DetectedType = DetectedType;
301
- declare const fileType_EMPTY: typeof EMPTY;
302
- declare const fileType_GIF: typeof GIF;
303
- declare const fileType_HTML: typeof HTML;
304
- declare const fileType_JPEG: typeof JPEG;
305
- declare const fileType_PDF: typeof PDF;
306
- declare const fileType_PNG: typeof PNG;
307
- declare const fileType_RASTER_IMAGES: typeof RASTER_IMAGES;
308
- declare const fileType_SNIFF_BYTES: typeof SNIFF_BYTES;
309
- declare const fileType_SVG: typeof SVG;
310
- declare const fileType_TEXT: typeof TEXT;
311
- declare const fileType_UNKNOWN: typeof UNKNOWN;
312
- declare const fileType_WEBP: typeof WEBP;
313
- declare const fileType_XML: typeof XML;
314
- declare const fileType_detectFileType: typeof detectFileType;
315
- declare namespace fileType {
316
- 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 };
317
- }
318
-
319
- export { Arr as A, Collection as C, type Facade as F, LazyCollection as L, ServiceProvider as S, __ as _, Stringable as a, ClassRegistry as b, type FacadeStatics as c, Str as d, app as e, fileType as f, collect as g, config as h, facade as i, now as n, retry as r, tap as t, value as v };