@h3ravel/contracts 0.28.1 → 0.29.0-alpha.2

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference path="./app.globals.d.ts" />
2
2
  import { H3, H3Event, HTTPResponse, Middleware, MiddlewareOptions, serve } from "h3";
3
+ import { EntryConfig } from "@h3ravel/core";
3
4
  import { IApplication as IApplication$1 } from "@h3ravel/contracts";
4
5
  import { DotNestedKeys as DotNestedKeys$1, DotNestedValue as DotNestedValue$1 } from "@h3ravel/shared";
5
6
  import { Edge } from "edge.js";
@@ -440,7 +441,7 @@ declare abstract class IServerBag extends IParamBag {
440
441
  }
441
442
  //#endregion
442
443
  //#region src/Url/Utils.d.ts
443
- type RouteParams<N = any> = Record<string, N>;
444
+ type RouteParams<N = string | number> = Record<string, N> | N[] | N;
444
445
  //#endregion
445
446
  //#region src/Url/IUrl.d.ts
446
447
  declare abstract class IUrl {
@@ -691,7 +692,7 @@ declare abstract class IHttpRequest {
691
692
  * @param server The SERVER parameters
692
693
  * @param content The raw body data
693
694
  */
694
- abstract initialize(): Promise<void>;
695
+ abstract initialize(): void;
695
696
  /**
696
697
  * Gets a list of content types acceptable by the client browser in preferable order.
697
698
  * @returns {string[]}
@@ -1202,31 +1203,31 @@ declare abstract class IRoute {
1202
1203
  }
1203
1204
  //#endregion
1204
1205
  //#region src/Session/FlashBag.d.ts
1205
- declare class FlashBag {
1206
+ declare abstract class FlashBag {
1206
1207
  /**
1207
1208
  * Flash a value for the next request
1208
1209
  *
1209
1210
  * @param key Key to store in flash
1210
1211
  * @param value Value to be flashed
1211
1212
  */
1212
- flash(key: string, value: any): void;
1213
+ abstract flash(key: string, value: any): void;
1213
1214
  /**
1214
1215
  * Store a temporary value for the current request only
1215
1216
  *
1216
1217
  * @param key Key to store
1217
1218
  * @param value Value to store
1218
1219
  */
1219
- now(key: string, value: any): void;
1220
+ abstract now(key: string, value: any): void;
1220
1221
  /**
1221
1222
  * Reflash all current flash data for another request cycle
1222
1223
  */
1223
- reflash(): void;
1224
+ abstract reflash(): void;
1224
1225
  /**
1225
1226
  * Keep only specific flash keys for the next request
1226
1227
  *
1227
1228
  * @param keys Keys to keep
1228
1229
  */
1229
- keep(keys: string[]): void;
1230
+ abstract keep(keys: string[]): void;
1230
1231
  /**
1231
1232
  * Age flash data at the end of the request
1232
1233
  *
@@ -1234,7 +1235,7 @@ declare class FlashBag {
1234
1235
  * - Moves new flash data to old
1235
1236
  * - Clears new flash data
1236
1237
  */
1237
- ageFlashData(): void;
1238
+ abstract ageFlashData(): void;
1238
1239
  /**
1239
1240
  * Get a flash value
1240
1241
  *
@@ -1242,198 +1243,183 @@ declare class FlashBag {
1242
1243
  * @param defaultValue Default value if key doesn't exist
1243
1244
  * @returns Flash value or default
1244
1245
  */
1245
- get(key: string, defaultValue?: any): any;
1246
+ abstract get(key: string, defaultValue?: any): any;
1246
1247
  /**
1247
1248
  * Check if a flash key exists
1248
1249
  *
1249
1250
  * @param key Key to check
1250
1251
  * @returns Boolean indicating existence
1251
1252
  */
1252
- has(key: string): boolean;
1253
+ abstract has(key: string): boolean;
1253
1254
  /**
1254
1255
  * Get all flash data
1255
1256
  *
1256
1257
  * @returns Combined flash data
1257
1258
  */
1258
- all(): Record<string, any>;
1259
+ abstract all(): Record<string, any>;
1259
1260
  /**
1260
1261
  * Get all flash data keys
1261
1262
  *
1262
1263
  * @returns Combined flash data
1263
1264
  */
1264
- keys(): string[];
1265
+ abstract keys(): string[];
1265
1266
  /**
1266
1267
  * Get the raww flash data
1267
1268
  *
1268
1269
  * @returns raw flash data
1269
1270
  */
1270
- raw(): Record<string, any>;
1271
+ abstract raw(): Record<string, any>;
1271
1272
  /**
1272
1273
  * Clear all flash data
1273
1274
  */
1274
- clear(): void;
1275
+ abstract clear(): void;
1275
1276
  }
1276
1277
  //#endregion
1277
- //#region src/Session/SessionContract.d.ts
1278
+ //#region src/Session/ISessionDriver.d.ts
1278
1279
  /**
1279
1280
  * SessionDriver Interface
1280
1281
  *
1281
1282
  * All session drivers must implement these methods to ensure
1282
1283
  * consistency across different storage mechanisms (memory, files, database, redis).
1283
1284
  */
1284
- interface SessionDriver {
1285
- flashBag: FlashBag;
1285
+ declare abstract class ISessionDriver {
1286
+ abstract flashBag: FlashBag;
1286
1287
  /**
1287
1288
  * Retrieve a value from the session by key.
1288
1289
  *
1289
1290
  * @param key
1290
1291
  * @param defaultValue
1291
1292
  */
1292
- get<T = any>(key: string, defaultValue?: any): T | Promise<T>;
1293
+ abstract get<T = any>(key: string, defaultValue?: any): T | Promise<T>;
1293
1294
  /**
1294
1295
  * Store multiple values in the session.
1295
1296
  *
1296
1297
  * @param key
1297
1298
  * @param defaultValue
1298
1299
  */
1299
- set(value: Record<string, any>): void | Promise<void>;
1300
+ abstract set(value: Record<string, any>): void | Promise<void>;
1300
1301
  /**
1301
1302
  * Retrieve all data from the session including flash
1302
1303
  *
1303
1304
  * @returns
1304
1305
  */
1305
- getAll<T extends Record<string, any>>(): Promise<T> | T;
1306
+ abstract getAll<T extends Record<string, any>>(): Promise<T> | T;
1306
1307
  /**
1307
1308
  * Store a value in the session.
1308
1309
  *
1309
1310
  * @param key
1310
1311
  * @param value
1311
1312
  */
1312
- put(key: string, value: any): void | Promise<void>;
1313
+ abstract put(key: string, value: any): void | Promise<void>;
1313
1314
  /**
1314
1315
  * Append a value to an array key
1315
1316
  *
1316
1317
  * @param key
1317
1318
  * @param value
1318
- */
1319
- push(key: string, value: any): Promise<void> | void;
1319
+ */
1320
+ abstract push(key: string, value: any): Promise<void> | void;
1320
1321
  /**
1321
1322
  * Remove a key from the session.
1322
1323
  *
1323
1324
  * @param key
1324
1325
  */
1325
- forget(key: string): Promise<void> | void;
1326
+ abstract forget(key: string): Promise<void> | void;
1326
1327
  /**
1327
1328
  * Determine if a key is present in the session.
1328
1329
  *
1329
1330
  * @param key
1330
- */
1331
- has(key: string): Promise<boolean> | boolean;
1331
+ */
1332
+ abstract has(key: string): Promise<boolean> | boolean;
1332
1333
  /**
1333
1334
  * Determine if a key exists in the session (even if null).
1334
1335
  *
1335
1336
  * @param key
1336
1337
  */
1337
- exists(key: string): Promise<boolean> | boolean;
1338
+ abstract exists(key: string): Promise<boolean> | boolean;
1338
1339
  /**
1339
1340
  * Get all data from the session.
1340
1341
  */
1341
- all<T extends Record<string, any>>(): Promise<T> | T;
1342
+ abstract all<T extends Record<string, any>>(): Promise<T> | T;
1342
1343
  /**
1343
1344
  * Get only a subset of session keys.
1344
1345
  *
1345
1346
  * @param keys
1346
1347
  */
1347
- only<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
1348
+ abstract only<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
1348
1349
  /**
1349
1350
  * Get all session data except the specified keys.
1350
1351
  *
1351
1352
  * @param keys
1352
1353
  */
1353
- except<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
1354
+ abstract except<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
1354
1355
  /**
1355
1356
  * Get and remove an item from the session.
1356
1357
  *
1357
1358
  * @param key
1358
1359
  * @param defaultValue
1359
1360
  */
1360
- pull<T = any>(key: string, defaultValue?: any): Promise<T> | T;
1361
+ abstract pull<T = any>(key: string, defaultValue?: any): Promise<T> | T;
1361
1362
  /**
1362
1363
  * Increment a numeric session value.
1363
1364
  *
1364
1365
  * @param key
1365
1366
  * @param amount
1366
1367
  */
1367
- increment(key: string, amount?: number): Promise<number> | number;
1368
+ abstract increment(key: string, amount?: number): Promise<number> | number;
1368
1369
  /**
1369
1370
  * Decrement a numeric session value.
1370
1371
  *
1371
1372
  * @param key
1372
1373
  * @param amount
1373
1374
  */
1374
- decrement(key: string, amount?: number): Promise<number> | number;
1375
+ abstract decrement(key: string, amount?: number): Promise<number> | number;
1375
1376
  /**
1376
1377
  * Flash a key/value pair for the next request only.
1377
1378
  *
1378
1379
  * @param key
1379
1380
  * @param value
1380
1381
  */
1381
- flash(key: string, value: any): Promise<void> | void;
1382
+ abstract flash(key: string, value: any): Promise<void> | void;
1382
1383
  /**
1383
1384
  * Reflash all current flash data for another request cycle.
1384
1385
  */
1385
- reflash(): Promise<void> | void;
1386
+ abstract reflash(): Promise<void> | void;
1386
1387
  /**
1387
1388
  * Keep only specific flash data for another request.
1388
1389
  *
1389
1390
  * @param keys
1390
1391
  */
1391
- keep(keys: string[]): Promise<void> | void;
1392
+ abstract keep(keys: string[]): Promise<void> | void;
1392
1393
  /**
1393
1394
  * Store data for the current request only (not persisted).
1394
1395
  *
1395
1396
  * @param key
1396
1397
  * @param value
1397
1398
  */
1398
- now(key: string, value: any): Promise<void> | void;
1399
+ abstract now(key: string, value: any): Promise<void> | void;
1399
1400
  /**
1400
1401
  * Regenerate the session ID and optionally persist the data.
1401
1402
  */
1402
- regenerate(): Promise<void> | void;
1403
+ abstract regenerate(): Promise<void> | void;
1403
1404
  /**
1404
1405
  * Invalidate the session completely and regenerate ID.
1405
1406
  */
1406
- invalidate(): Promise<void> | void;
1407
+ abstract invalidate(): Promise<void> | void;
1407
1408
  /**
1408
1409
  * Determine if an item is not present in the session.
1409
1410
  *
1410
1411
  * @param key
1411
1412
  */
1412
- missing(key: string): Promise<boolean> | boolean;
1413
+ abstract missing(key: string): Promise<boolean> | boolean;
1413
1414
  /**
1414
1415
  * Flush all session data
1415
1416
  */
1416
- flush(): Promise<void> | void;
1417
+ abstract flush(): Promise<void> | void;
1417
1418
  /**
1418
1419
  * Age flash data at the end of the request lifecycle.
1419
1420
  */
1420
- ageFlashData(): Promise<void> | void;
1421
+ abstract ageFlashData(): Promise<void> | void;
1421
1422
  }
1422
- interface DriverOption {
1423
- cwd?: string;
1424
- dir?: string;
1425
- table?: string;
1426
- prefix?: string;
1427
- client?: any;
1428
- sessionId?: string;
1429
- sessionDir?: string;
1430
- }
1431
- /**
1432
- * A builder function that returns a SessionDriver for a given sessionId.
1433
- *
1434
- * The builder receives the sessionId and a driver-specific options bag.
1435
- */
1436
- type DriverBuilder = (sessionId: string, options?: DriverOption) => SessionDriver;
1437
1423
  //#endregion
1438
1424
  //#region src/Session/ISessionManager.d.ts
1439
1425
  /**
@@ -1442,84 +1428,83 @@ type DriverBuilder = (sessionId: string, options?: DriverOption) => SessionDrive
1442
1428
  * Handles session initialization, ID generation, and encryption.
1443
1429
  * Each request gets a unique session namespace tied to its ID.
1444
1430
  */
1445
- declare class ISessionManager {
1431
+ declare abstract class ISessionManager {
1432
+ abstract flashBag: FlashBag;
1446
1433
  /**
1447
- * @param ctx - incoming request http context
1448
- * @param driverName - registered driver key ('file' | 'database' | 'memory' | 'redis')
1449
- * @param driverOptions - optional bag for driver-specific options
1434
+ * Access the current session ID.
1450
1435
  */
1451
- constructor(ctx: IHttpContext, driverName: 'file' | 'memory' | 'database' | 'redis', driverOptions: DriverOption);
1436
+ abstract id(): string;
1452
1437
  /**
1453
- * Access the current session ID.
1438
+ * Get the current session driver
1454
1439
  */
1455
- id(): string;
1440
+ abstract getDriver(): ISessionDriver;
1456
1441
  /**
1457
1442
  * Retrieve a value from the session
1458
1443
  *
1459
1444
  * @param key
1460
1445
  * @returns
1461
1446
  */
1462
- get(key: string, defaultValue?: any): Promise<any> | any;
1447
+ abstract get(key: string, defaultValue?: any): Promise<any> | any;
1463
1448
  /**
1464
1449
  * Store a value in the session
1465
1450
  *
1466
1451
  * @param key
1467
1452
  * @param value
1468
1453
  */
1469
- set(value: Record<string, any>): Promise<void> | void;
1454
+ abstract set(value: Record<string, any>): Promise<void> | void;
1470
1455
  /**
1471
1456
  * Store multiple key/value pairs
1472
1457
  *
1473
1458
  * @param values
1474
1459
  */
1475
- put(key: string, value: any): void | Promise<void>;
1460
+ abstract put(key: string, value: any): void | Promise<void>;
1476
1461
  /**
1477
1462
  * Append a value to an array key
1478
1463
  *
1479
1464
  * @param key
1480
1465
  * @param value
1481
1466
  */
1482
- push(key: string, value: any): void | Promise<void>;
1467
+ abstract push(key: string, value: any): void | Promise<void>;
1483
1468
  /**
1484
1469
  * Remove a key from the session
1485
1470
  *
1486
1471
  * @param key
1487
1472
  */
1488
- forget(key: string): void | Promise<void>;
1473
+ abstract forget(key: string): void | Promise<void>;
1489
1474
  /**
1490
1475
  * Retrieve all session data
1491
1476
  *
1492
1477
  * @returns
1493
1478
  */
1494
- all(): Record<string, any> | Promise<Record<string, any>>;
1479
+ abstract all(): Record<string, any> | Promise<Record<string, any>>;
1495
1480
  /**
1496
1481
  * Determine if a key exists (even if null).
1497
1482
  *
1498
1483
  * @param key
1499
1484
  * @returns
1500
1485
  */
1501
- exists(key: string): Promise<boolean> | boolean;
1486
+ abstract exists(key: string): Promise<boolean> | boolean;
1502
1487
  /**
1503
1488
  * Determine if a key has a non-null value.
1504
1489
  *
1505
1490
  * @param key
1506
1491
  * @returns
1507
1492
  */
1508
- has(key: string): Promise<boolean> | boolean;
1493
+ abstract has(key: string): Promise<boolean> | boolean;
1509
1494
  /**
1510
1495
  * Get only specific keys.
1511
1496
  *
1512
1497
  * @param keys
1513
1498
  * @returns
1514
1499
  */
1515
- only(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
1500
+ abstract only(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
1516
1501
  /**
1517
1502
  * Return all keys except the specified ones.
1518
1503
  *
1519
1504
  * @param keys
1520
1505
  * @returns
1521
1506
  */
1522
- except(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
1507
+ abstract except(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
1523
1508
  /**
1524
1509
  * Return and delete a key from the session.
1525
1510
  *
@@ -1527,7 +1512,7 @@ declare class ISessionManager {
1527
1512
  * @param defaultValue
1528
1513
  * @returns
1529
1514
  */
1530
- pull(key: string, defaultValue?: any): any;
1515
+ abstract pull(key: string, defaultValue?: any): any;
1531
1516
  /**
1532
1517
  * Increment a numeric value by amount (default 1).
1533
1518
  *
@@ -1535,7 +1520,7 @@ declare class ISessionManager {
1535
1520
  * @param amount
1536
1521
  * @returns
1537
1522
  */
1538
- increment(key: string, amount?: number): Promise<number> | number;
1523
+ abstract increment(key: string, amount?: number): Promise<number> | number;
1539
1524
  /**
1540
1525
  * Decrement a numeric value by amount (default 1).
1541
1526
  *
@@ -1543,55 +1528,55 @@ declare class ISessionManager {
1543
1528
  * @param amount
1544
1529
  * @returns
1545
1530
  */
1546
- decrement(key: string, amount?: number): number | Promise<number>;
1531
+ abstract decrement(key: string, amount?: number): number | Promise<number>;
1547
1532
  /**
1548
1533
  * Flash a value for next request only.
1549
1534
  *
1550
1535
  * @param key
1551
1536
  * @param value
1552
1537
  */
1553
- flash(key: string, value: any): void | Promise<void>;
1538
+ abstract flash(key: string, value: any): void | Promise<void>;
1554
1539
  /**
1555
1540
  * Reflash all flash data for one more cycle.
1556
1541
  *
1557
1542
  * @returns
1558
1543
  */
1559
- reflash(): void | Promise<void>;
1544
+ abstract reflash(): void | Promise<void>;
1560
1545
  /**
1561
1546
  * Keep only selected flash data.
1562
1547
  *
1563
1548
  * @param keys
1564
1549
  * @returns
1565
1550
  */
1566
- keep(keys: string[]): void | Promise<void>;
1551
+ abstract keep(keys: string[]): void | Promise<void>;
1567
1552
  /**
1568
1553
  * Store data only for current request cycle (not persisted).
1569
1554
  *
1570
1555
  * @param key
1571
1556
  * @param value
1572
1557
  */
1573
- now(key: string, value: any): void | Promise<void>;
1558
+ abstract now(key: string, value: any): void | Promise<void>;
1574
1559
  /**
1575
1560
  * Regenerate session ID and persist data under new ID.
1576
1561
  */
1577
- regenerate(): void | Promise<void>;
1562
+ abstract regenerate(): void | Promise<void>;
1578
1563
  /**
1579
1564
  * Determine if an item is not present in the session.
1580
1565
  *
1581
1566
  * @param key
1582
1567
  * @returns
1583
1568
  */
1584
- missing(key: string): Promise<boolean> | boolean;
1569
+ abstract missing(key: string): Promise<boolean> | boolean;
1585
1570
  /**
1586
1571
  * Flush all session data
1587
1572
  */
1588
- flush(): void | Promise<void>;
1573
+ abstract flush(): void | Promise<void>;
1589
1574
  /**
1590
1575
  * Age flash data at the end of the request lifecycle.
1591
1576
  *
1592
1577
  * @returns
1593
1578
  */
1594
- ageFlashData(): void | Promise<void>;
1579
+ abstract ageFlashData(): void | Promise<void>;
1595
1580
  }
1596
1581
  //#endregion
1597
1582
  //#region src/Http/IRequest.d.ts
@@ -1649,7 +1634,7 @@ declare abstract class IRequest<D extends Record<string, any> = Record<string, a
1649
1634
  * @param server The SERVER parameters
1650
1635
  * @param content The raw body data
1651
1636
  */
1652
- abstract initialize(): Promise<void>;
1637
+ abstract initialize(): void;
1653
1638
  /**
1654
1639
  * Retrieve all data from the instance (query + body).
1655
1640
  */
@@ -2381,6 +2366,10 @@ declare abstract class IResponse extends IHttpResponse {
2381
2366
  */
2382
2367
  abstract getEvent(): H3Event;
2383
2368
  abstract getEvent<K$1 extends DotNestedKeys$1<H3Event>>(key: K$1): DotNestedValue$1<H3Event, K$1>;
2369
+ /**
2370
+ * Reset the response class to it's defautl
2371
+ */
2372
+ abstract reset(): void;
2384
2373
  }
2385
2374
  declare abstract class IResponsable extends HTTPResponse {
2386
2375
  abstract toResponse(request: IRequest): IResponse;
@@ -2494,12 +2483,324 @@ declare abstract class IDispatcher {
2494
2483
  abstract getRawListeners(): Record<string, any[]>;
2495
2484
  }
2496
2485
  //#endregion
2486
+ //#region src/Hashing/IHashManagerContract.d.ts
2487
+ type HashAlgorithm = 'bcrypt' | 'argon' | 'argon2id';
2488
+ interface HashConfiguration {
2489
+ [key: string]: any;
2490
+ /**
2491
+ * Default Hash Driver
2492
+ * -------------------
2493
+ * This option controls the default hash driver that will be used to hash
2494
+ * passwords for your application. By default, the bcrypt algorithm is
2495
+ * used; however, you remain free to modify this option if you wish.
2496
+ */
2497
+ driver: HashAlgorithm;
2498
+ /**
2499
+ * Bcrypt Options
2500
+ * --------------
2501
+ * Here you may specify the configuration options that should be used when
2502
+ * passwords are hashed using the Bcrypt algorithm. This will allow you
2503
+ * to control the amount of time it takes to hash the given password.
2504
+ */
2505
+ bcrypt: {
2506
+ rounds: number;
2507
+ verify: boolean;
2508
+ limit: number | null;
2509
+ };
2510
+ /**
2511
+ * Argon Options
2512
+ * -------------
2513
+ * Here you may specify the configuration options that should be used when
2514
+ * passwords are hashed using the Argon algorithm. These will allow you
2515
+ * to control the amount of time it takes to hash the given password.
2516
+ */
2517
+ argon: {
2518
+ memory: number;
2519
+ threads: number;
2520
+ time: number;
2521
+ verify: boolean;
2522
+ };
2523
+ }
2524
+ type HashOptions = Partial<HashConfiguration['bcrypt'] & HashConfiguration['argon']>;
2525
+ interface BcryptOptions {
2526
+ cost: number;
2527
+ }
2528
+ interface Argon2Options {
2529
+ memoryCost: number;
2530
+ timeCost: number;
2531
+ threads: number;
2532
+ }
2533
+ interface UnknownHashOptions {
2534
+ [key: string]: any;
2535
+ }
2536
+ interface HashInfo {
2537
+ algo: number;
2538
+ algoName: HashAlgorithm;
2539
+ options: {
2540
+ cost?: number | undefined;
2541
+ memoryCost?: number | undefined;
2542
+ timeCost?: number | undefined;
2543
+ threads?: number | undefined;
2544
+ [key: string]: number | undefined;
2545
+ };
2546
+ }
2547
+ //#endregion
2548
+ //#region src/Hashing/IAbstractHasher.d.ts
2549
+ declare abstract class IAbstractHasher {
2550
+ /**
2551
+ * Get information about the given hashed value.
2552
+ *
2553
+ * @param hashedValue
2554
+ * @returns
2555
+ */
2556
+ abstract info(hashedValue: string): HashInfo;
2557
+ }
2558
+ //#endregion
2559
+ //#region src/Hashing/IArgon2idHasher.d.ts
2560
+ declare abstract class IArgon2idHasher extends IAbstractHasher {
2561
+ /**
2562
+ * Hash the given value using Argon2id.
2563
+ */
2564
+ abstract make(value: string, options?: HashConfiguration['argon']): Promise<string>;
2565
+ /**
2566
+ * Check the given plain value against a hash.
2567
+ */
2568
+ abstract check(value: string, hashedValue?: string | null, _options?: HashConfiguration['argon']): Promise<boolean>;
2569
+ /**
2570
+ * Get information about the given hashed value.
2571
+ */
2572
+ abstract info(hashedValue: string): HashInfo;
2573
+ /**
2574
+ * Check if the given hash needs to be rehashed based on current options.
2575
+ */
2576
+ abstract needsRehash(hashedValue: string, options?: HashConfiguration['argon']): boolean;
2577
+ /**
2578
+ * Verify that the hash configuration does not exceed the configured limits.
2579
+ */
2580
+ abstract verifyConfiguration(hashedValue: string): boolean;
2581
+ /**
2582
+ * Verify the hashed value's options.
2583
+ */
2584
+ protected abstract isUsingValidOptions(hashedValue: string): boolean;
2585
+ /**
2586
+ * Verify the hashed value's algorithm.
2587
+ */
2588
+ protected abstract isUsingCorrectAlgorithm(hashedValue: string): boolean;
2589
+ /**
2590
+ * Extract Argon parameters from the hash.
2591
+ */
2592
+ protected abstract parseInfo(hashedValue: string): Record<string, number | undefined>;
2593
+ }
2594
+ //#endregion
2595
+ //#region src/Hashing/IArgonHasher.d.ts
2596
+ declare abstract class IArgonHasher extends IAbstractHasher {
2597
+ /**
2598
+ * Hash the given value using Argon2i.
2599
+ */
2600
+ abstract make(value: string, options?: HashConfiguration['argon']): Promise<string>;
2601
+ /**
2602
+ * Check the given plain value against a hash.
2603
+ */
2604
+ abstract check(value: string, hashedValue?: string | null, _options?: HashConfiguration['argon']): Promise<boolean>;
2605
+ /**
2606
+ * Get information about the given hashed value.
2607
+ */
2608
+ abstract info(hashedValue: string): HashInfo;
2609
+ /**
2610
+ * Check if the given hash needs to be rehashed based on current options.
2611
+ */
2612
+ abstract needsRehash(hashedValue: string, options?: HashConfiguration['argon']): boolean;
2613
+ /**
2614
+ * Verify that the hash configuration does not exceed the configured limits.
2615
+ */
2616
+ abstract verifyConfiguration(hashedValue: string): boolean;
2617
+ /**
2618
+ * Verify the hashed value's options.
2619
+ */
2620
+ protected abstract isUsingValidOptions(hashedValue: string): boolean;
2621
+ /**
2622
+ * Verify the hashed value's algorithm.
2623
+ */
2624
+ protected abstract isUsingCorrectAlgorithm(hashedValue: string): boolean;
2625
+ /**
2626
+ * Extract Argon parameters from the hash.
2627
+ */
2628
+ protected abstract parseInfo(hashedValue: string): Record<string, number | undefined>;
2629
+ }
2630
+ //#endregion
2631
+ //#region src/Hashing/IBcryptHasher.d.ts
2632
+ declare abstract class IBcryptHasher extends IAbstractHasher {
2633
+ /**
2634
+ * Hash the given value.
2635
+ *
2636
+ * @param value
2637
+ * @param options
2638
+ */
2639
+ abstract make(value: string, options?: HashConfiguration['bcrypt']): Promise<string>;
2640
+ /**
2641
+ * Check the given plain value against a hash.
2642
+ *
2643
+ * @param value
2644
+ * @param hashedValue
2645
+ * @param options
2646
+ */
2647
+ abstract check(value: string, hashedValue?: string | null, _options?: HashConfiguration['bcrypt']): Promise<boolean>;
2648
+ /**
2649
+ * Get information about the given hashed value.
2650
+ *
2651
+ * @param hashedValue
2652
+ */
2653
+ abstract info(hashedValue: string): HashInfo;
2654
+ /**
2655
+ * Check if the given hash has been hashed using the given options.
2656
+ *
2657
+ * @param hashedValue
2658
+ * @param options
2659
+ */
2660
+ abstract needsRehash(hashedValue: string, options?: HashConfiguration['bcrypt']): boolean;
2661
+ /**
2662
+ * Verify the hashed value's options.
2663
+ *
2664
+ * @param hashedValue
2665
+ * @return
2666
+ */
2667
+ protected abstract isUsingValidOptions(hashedValue: string): boolean;
2668
+ /**
2669
+ * Verifies that the configuration is less than or equal to what is configured.
2670
+ *
2671
+ * @private
2672
+ */
2673
+ abstract verifyConfiguration(value: string): boolean;
2674
+ /**
2675
+ * Verify the hashed value's algorithm.
2676
+ *
2677
+ * @param hashedValue
2678
+ *
2679
+ * @returns
2680
+ */
2681
+ protected abstract isUsingCorrectAlgorithm(hashedValue: string): boolean;
2682
+ /**
2683
+ * Extract the cost value from the options object.
2684
+ *
2685
+ * @param options
2686
+ * @return int
2687
+ */
2688
+ protected abstract cost(options?: HashConfiguration['bcrypt']): number;
2689
+ }
2690
+ //#endregion
2691
+ //#region src/Hashing/IBaseHashManager.d.ts
2692
+ declare abstract class IBaseHashManager {
2693
+ abstract driver(): IBcryptHasher | IArgonHasher | IArgon2idHasher;
2694
+ abstract createBcryptDriver?(): IBcryptHasher;
2695
+ abstract createArgonDriver?(): IArgonHasher;
2696
+ abstract createArgon2idDriver?(): IArgon2idHasher;
2697
+ /**
2698
+ * Get the default driver name.
2699
+ *
2700
+ * @return string
2701
+ */
2702
+ abstract getDefaultDriver(): HashAlgorithm;
2703
+ protected abstract createDriver(driver: HashAlgorithm): IArgonHasher | IArgon2idHasher | IBcryptHasher;
2704
+ /**
2705
+ * Determine if a given string is already hashed.
2706
+ *
2707
+ * @param value
2708
+ * @returns
2709
+ */
2710
+ abstract isHashed(value: string): boolean;
2711
+ /**
2712
+ * Autoload config and initialize library
2713
+ *
2714
+ * @returns
2715
+ */
2716
+ abstract init(basePath?: string): Promise<this>;
2717
+ }
2718
+ //#endregion
2719
+ //#region src/Hashing/IHashManager.d.ts
2720
+ declare abstract class IHashManager extends IBaseHashManager {
2721
+ /**
2722
+ * Create an instance of the Bcrypt hash Driver.
2723
+ *
2724
+ * @return BcryptHasher
2725
+ */
2726
+ abstract createBcryptDriver(): IBcryptHasher;
2727
+ /**
2728
+ * Create an instance of the Argon hash Driver.
2729
+ *
2730
+ * @return ArgonHasher
2731
+ */
2732
+ abstract createArgonDriver(): IArgonHasher;
2733
+ /**
2734
+ * Create an instance of the Argon2id hash Driver.
2735
+ *
2736
+ * @return Argon2idHasher
2737
+ */
2738
+ abstract createArgon2idDriver(): IArgon2idHasher;
2739
+ /**
2740
+ * Hash the given value.
2741
+ *
2742
+ * @param value
2743
+ * @param options
2744
+ *
2745
+ * @returns
2746
+ */
2747
+ abstract make(value: string, options?: HashOptions): Promise<string>;
2748
+ /**
2749
+ * Get information about the given hashed value.
2750
+ *
2751
+ * @param hashedValue
2752
+ * @returns
2753
+ */
2754
+ abstract info(hashedValue: string): HashInfo;
2755
+ /**
2756
+ * Check the given plain value against a hash.
2757
+ *
2758
+ * @param value
2759
+ * @param hashedValue
2760
+ * @param options
2761
+ * @returns
2762
+ */
2763
+ abstract check(value: string, hashedValue?: string, options?: HashOptions): Promise<boolean>;
2764
+ /**
2765
+ * Check if the given hash has been hashed using the given options.
2766
+ *
2767
+ * @param hashedValue
2768
+ * @param options
2769
+ * @returns
2770
+ */
2771
+ abstract needsRehash(hashedValue: string, options?: HashOptions): boolean;
2772
+ /**
2773
+ * Determine if a given string is already hashed.
2774
+ *
2775
+ * @param string value
2776
+ * @returns
2777
+ */
2778
+ abstract isHashed(value: string): boolean;
2779
+ /**
2780
+ * Verifies that the configuration is less than or equal to what is configured.
2781
+ *
2782
+ * @param value
2783
+ *
2784
+ * @internal
2785
+ */
2786
+ abstract verifyConfiguration(value: string): boolean;
2787
+ /**
2788
+ * Get a driver instance.
2789
+ *
2790
+ * @param driver
2791
+ *
2792
+ * @throws {InvalidArgumentException}
2793
+ */
2794
+ abstract driver(driver?: HashAlgorithm): IArgonHasher | IArgon2idHasher | IBcryptHasher;
2795
+ }
2796
+ //#endregion
2497
2797
  //#region src/Routing/IAbstractRouteCollection.d.ts
2498
2798
  declare abstract class IAbstractRouteCollection {
2499
2799
  static verbs: RouteMethod[];
2500
2800
  abstract get(): IRoute[];
2501
2801
  abstract get(method: string): Record<string, IRoute>;
2502
2802
  abstract getRoutes(): IRoute[];
2803
+ abstract count(): number;
2503
2804
  }
2504
2805
  //#endregion
2505
2806
  //#region src/Routing/IRouteCollection.d.ts
@@ -3025,6 +3326,253 @@ declare abstract class IRouter {
3025
3326
  * @param callback
3026
3327
  */
3027
3328
  abstract substituteImplicitBindingsUsing(callback: CallableConstructor): this;
3329
+ /**
3330
+ * Count the number of items in the collection.
3331
+ */
3332
+ abstract count(): number;
3333
+ }
3334
+ //#endregion
3335
+ //#region src/Database/IModel.d.ts
3336
+ declare abstract class IModel<M = any> {
3337
+ /**
3338
+ * Retrieve the model for a bound value.
3339
+ *
3340
+ * @param value
3341
+ * @param field
3342
+ * @returns
3343
+ */
3344
+ abstract resolveRouteBinding(value: any, field?: undefined | string | null): Promise<M>;
3345
+ /**
3346
+ * Retrieve the model for a bound value.
3347
+ *
3348
+ * @param query
3349
+ * @param value
3350
+ * @param field
3351
+ */
3352
+ abstract resolveRouteBindingQuery(query: any, value: any, field?: undefined | string | null): any;
3353
+ /**
3354
+ * Get the value of the model's route key.
3355
+ */
3356
+ abstract getRouteKey(): any;
3357
+ /**
3358
+ * Get the route key for the model.
3359
+ */
3360
+ abstract getRouteKeyName(): string;
3361
+ }
3362
+ //#endregion
3363
+ //#region src/Routing/Traits/UrlRoutable.d.ts
3364
+ declare abstract class UrlRoutable {
3365
+ /**
3366
+ * Get the value of the model's route key.
3367
+ */
3368
+ abstract getRouteKey(): any;
3369
+ /**
3370
+ * Retrieve the model for a bound value.
3371
+ *
3372
+ * @param value
3373
+ * @param field
3374
+ */
3375
+ abstract resolveRouteBinding(value: any, field?: string): Promise<IModel<any>>;
3376
+ /**
3377
+ * Retrieve the child model for a bound value.
3378
+ *
3379
+ * @param childType
3380
+ * @param value
3381
+ * @param field
3382
+ */
3383
+ /**
3384
+ * Get the route key for the model.
3385
+ */
3386
+ abstract getRouteKeyName(): string;
3387
+ }
3388
+ //#endregion
3389
+ //#region src/Url/IUrlGenerator.d.ts
3390
+ declare abstract class IUrlGenerator {
3391
+ /**
3392
+ * The named parameter defaults.
3393
+ */
3394
+ abstract defaultParameters: GenericObject;
3395
+ /**
3396
+ * Get the full URL for the current request,
3397
+ * including the query string.
3398
+ *
3399
+ * Example:
3400
+ * https://example.com/users?page=2
3401
+ */
3402
+ abstract full(): string;
3403
+ /**
3404
+ * Get the URL for the current request path
3405
+ * without modifying the query string.
3406
+ */
3407
+ abstract current(): string;
3408
+ /**
3409
+ * Get the URL for the previous request.
3410
+ *
3411
+ * Resolution order:
3412
+ * 1. HTTP Referer header
3413
+ * 2. Session-stored previous URL
3414
+ * 3. Fallback (if provided)
3415
+ * 4. Root "/"
3416
+ *
3417
+ * @param fallback Optional fallback path or URL
3418
+ */
3419
+ abstract previous(fallback?: string | false): string;
3420
+ /**
3421
+ * Generate an absolute URL to the given path.
3422
+ *
3423
+ * - Accepts relative paths or full URLs
3424
+ * - Automatically prefixes scheme + host
3425
+ * - Encodes extra path parameters safely
3426
+ *
3427
+ * @param path Relative or absolute path
3428
+ * @param extra Additional path segments
3429
+ * @param secure Force HTTPS or HTTP
3430
+ */
3431
+ abstract to(path: string, extra?: (string | number)[], secure?: boolean | null): string;
3432
+ /**
3433
+ * Generate a secure (HTTPS) absolute URL.
3434
+ *
3435
+ * @param path
3436
+ * @param parameters
3437
+ * @returns
3438
+ */
3439
+ abstract secure(path: string, parameters?: any[]): string;
3440
+ /**
3441
+ * Generate a URL to a public asset.
3442
+ *
3443
+ * - Skips URL generation if path is already absolute
3444
+ * - Removes index.php from root if present
3445
+ *
3446
+ * @param path Asset path
3447
+ * @param secure Force HTTPS
3448
+ */
3449
+ abstract asset(path: string, secure?: boolean | null): string;
3450
+ /**
3451
+ * Generate a secure (HTTPS) asset URL.
3452
+ *
3453
+ * @param path
3454
+ * @returns
3455
+ */
3456
+ abstract secureAsset(path: string): string;
3457
+ /**
3458
+ * Resolve the URL scheme to use.
3459
+ *
3460
+ * Priority:
3461
+ * 1. Explicit `secure` flag
3462
+ * 2. Forced scheme
3463
+ * 3. Request scheme (cached)
3464
+ *
3465
+ * @param secure
3466
+ */
3467
+ abstract formatScheme(secure?: boolean | null): string;
3468
+ /**
3469
+ * Format the base root URL.
3470
+ *
3471
+ * - Applies forced root if present
3472
+ * - Replaces scheme while preserving host
3473
+ * - Result is cached per request
3474
+ *
3475
+ * @param scheme URL scheme
3476
+ * @param root Optional custom root
3477
+ */
3478
+ abstract formatRoot(scheme: string, root?: string): string;
3479
+ abstract signedRoute(name: string, parameters?: Record<string, any>, expiration?: number, absolute?: boolean): string;
3480
+ abstract hasValidSignature(request: IRequest): boolean;
3481
+ abstract route(name: string, parameters?: RouteParams, absolute?: boolean): string;
3482
+ /**
3483
+ * Get the URL for a given route instance.
3484
+ *
3485
+ * @param route
3486
+ * @param parameters
3487
+ * @param absolute
3488
+ */
3489
+ abstract toRoute(route: IRoute, parameters?: RouteParams, absolute?: boolean): string;
3490
+ /**
3491
+ * Combine root and path into a final URL.
3492
+ *
3493
+ * Allows optional host and path formatters
3494
+ * to modify the output dynamically.
3495
+ *
3496
+ * @param root
3497
+ * @param path
3498
+ * @param route
3499
+ * @returns
3500
+ */
3501
+ abstract format(root: string, path: string, route?: IRoute): string;
3502
+ /**
3503
+ * Format the array of URL parameters.
3504
+ *
3505
+ * @param parameters
3506
+ */
3507
+ abstract formatParameters(parameters: GenericObject<UrlRoutable> | RouteParams): GenericObject;
3508
+ /**
3509
+ * Determine whether a string is a valid URL.
3510
+ *
3511
+ * Supports:
3512
+ * - Absolute URLs
3513
+ * - Protocol-relative URLs
3514
+ * - Anchors and special schemes
3515
+ *
3516
+ * @param path
3517
+ * @returns
3518
+ */
3519
+ abstract isValidUrl(path: string): boolean;
3520
+ /**
3521
+ * Force HTTPS for all generated URLs.
3522
+ *
3523
+ * @param force
3524
+ */
3525
+ abstract forceHttps(force?: boolean): void;
3526
+ /**
3527
+ * Set the origin (scheme + host) for generated URLs.
3528
+ *
3529
+ * @param root
3530
+ */
3531
+ abstract useOrigin(root?: string): void;
3532
+ abstract useAssetOrigin(root?: string): void;
3533
+ abstract setKeyResolver(resolver: () => string | string[]): void;
3534
+ abstract resolveMissingNamedRoutesUsing(resolver: CallableConstructor): void;
3535
+ abstract formatHostUsing(callback: CallableConstructor): this;
3536
+ abstract formatPathUsing(callback: CallableConstructor): this;
3537
+ /**
3538
+ * Get the request instance.
3539
+ */
3540
+ abstract getRequest(): IRequest;
3541
+ /**
3542
+ * Set the current request instance.
3543
+ *
3544
+ * @param request
3545
+ */
3546
+ abstract setRequest(request: IRequest): void;
3547
+ /**
3548
+ * Set the route collection.
3549
+ *
3550
+ * @param routes
3551
+ */
3552
+ abstract setRoutes(routes: IRouteCollection): this;
3553
+ /**
3554
+ * Get the route collection.
3555
+ */
3556
+ abstract getRoutes(): IRouteCollection;
3557
+ /**
3558
+ * Set the session resolver for the generator.
3559
+ *
3560
+ * @param sessionResolver
3561
+ */
3562
+ abstract setSessionResolver(sessionResolver: CallableConstructor): this;
3563
+ /**
3564
+ * Clone a new instance of the URL generator with a different encryption key resolver.
3565
+ *
3566
+ * @param keyResolver
3567
+ */
3568
+ abstract withKeyResolver(keyResolver: () => string | string[]): void;
3569
+ /**
3570
+ * Set the default named parameters used by the URL generator.
3571
+ *
3572
+ * @param array $defaults
3573
+ * @return void
3574
+ */
3575
+ abstract defaults(defaults: GenericObject): void;
3028
3576
  }
3029
3577
  //#endregion
3030
3578
  //#region src/Utilities/PathLoader.d.ts
@@ -3046,6 +3594,12 @@ declare class PathLoader {
3046
3594
  * @param base - The base path to include to the path
3047
3595
  */
3048
3596
  setPath(name: IPathName, path: string, base?: string): void;
3597
+ /**
3598
+ *
3599
+ * @param path
3600
+ * @param skipExt
3601
+ */
3602
+ distPath(path: string, skipExt?: boolean): string;
3049
3603
  }
3050
3604
  //#endregion
3051
3605
  //#region src/Utilities/BindingsContract.d.ts
@@ -3057,25 +3611,31 @@ type Bindings = {
3057
3611
  db: any;
3058
3612
  env(): NodeJS.ProcessEnv;
3059
3613
  env<T extends string>(key: T, def?: any): any;
3614
+ url: IUrlGenerator;
3060
3615
  view(viewPath: string, params?: Record<string, any>): Promise<IResponsable>;
3061
3616
  edge: Edge;
3062
3617
  asset(key: string, def?: string): string;
3618
+ hash: IHashManager;
3063
3619
  router: IRouter;
3064
3620
  events: IDispatcher;
3621
+ routes: IRouteCollection;
3065
3622
  config: {
3066
3623
  get<X extends Record<string, any>>(): X;
3067
- get<X extends Record<string, any>, T extends Extract<keyof X, string>>(key: T, def?: any): X[T];
3624
+ get<X extends Record<string, any>, T extends Extract<keyof X, string>>(key?: T, def?: any): X[T];
3068
3625
  set<T extends string>(key: T, value: any): void;
3069
3626
  load?(): any;
3070
3627
  };
3628
+ session: ISessionManager;
3071
3629
  'app.events': IDispatcher;
3630
+ 'hash.driver': ReturnType<IHashManager['driver']>;
3072
3631
  'http.app': H3;
3073
- 'path.base': string;
3074
- 'load.paths': PathLoader;
3075
3632
  'http.serve': typeof serve;
3076
3633
  'http.context': IHttpContext;
3077
3634
  'http.request': IRequest;
3078
3635
  'http.response': IResponse;
3636
+ 'load.paths': PathLoader;
3637
+ 'path.base': string;
3638
+ 'session.store': ISessionDriver;
3079
3639
  };
3080
3640
  type UseKey<X extends Record<string, any> = Record<string, any>> = keyof RemoveIndexSignature<Bindings & X>;
3081
3641
  type IBinding = UseKey | (new (...args: any[]) => unknown);
@@ -3206,6 +3766,14 @@ declare abstract class IContainer {
3206
3766
  */
3207
3767
  abstract alias(key: [string | ClassConstructor, any][]): this;
3208
3768
  abstract alias(key: string | ClassConstructor, target: any): this;
3769
+ /**
3770
+ * Bind a new callback to an abstract's rebind event.
3771
+ *
3772
+ * @param abstract
3773
+ * @param callback
3774
+ */
3775
+ abstract rebinding<T extends UseKey>(key: T | (new (...args: any[]) => Bindings[T]), callback: (app: this, inst: Bindings[T]) => Bindings[T] | void): void;
3776
+ abstract rebinding<T extends UseKey>(key: T | (abstract new (...args: any[]) => Bindings[T]), callback: (app: this, inst: Bindings[T]) => Bindings[T] | void): void;
3209
3777
  /**
3210
3778
  * Determine if the given abstract type has been bound.
3211
3779
  *
@@ -3230,6 +3798,16 @@ declare abstract class IContainer {
3230
3798
  * @param abstract
3231
3799
  */
3232
3800
  abstract resolved(abstract: IBinding | string): boolean;
3801
+ /**
3802
+ * "Extend" an abstract type in the container.
3803
+ *
3804
+ * @param abstract
3805
+ * @param closure
3806
+ *
3807
+ * @throws {InvalidArgumentException}
3808
+ */
3809
+ abstract extend<T extends UseKey>(key: T | (new (...args: any[]) => Bindings[T]), closure: (inst: Bindings[T], app: this) => Bindings[T]): void;
3810
+ abstract extend<T extends UseKey>(key: T | (abstract new (...args: any[]) => Bindings[T]), closure: (inst: Bindings[T], app: this) => Bindings[T]): void;
3233
3811
  /**
3234
3812
  * Register an existing instance as shared in the container.
3235
3813
  *
@@ -3250,8 +3828,8 @@ declare abstract class IContainer {
3250
3828
  //#region src/Core/IApplication.d.ts
3251
3829
  declare abstract class IApplication extends IContainer {
3252
3830
  abstract paths: PathLoader;
3253
- context?: (event: H3Event) => Promise<IHttpContext>;
3254
- h3Event?: H3Event;
3831
+ abstract context?: (event: H3Event) => Promise<IHttpContext>;
3832
+ abstract h3Event?: H3Event;
3255
3833
  /**
3256
3834
  * List of registered console commands
3257
3835
  */
@@ -3322,12 +3900,33 @@ declare abstract class IApplication extends IContainer {
3322
3900
  * @param callback
3323
3901
  */
3324
3902
  abstract booted(callback: (app: this) => void): void;
3903
+ /**
3904
+ * Throw an HttpException with the given data.
3905
+ *
3906
+ * @param code
3907
+ * @param message
3908
+ * @param headers
3909
+ *
3910
+ * @throws {HttpException}
3911
+ * @throws {NotFoundHttpException}
3912
+ */
3913
+ abstract abort(code: number, message: string, headers: GenericObject): void;
3914
+ /**
3915
+ * Register a terminating callback with the application.
3916
+ *
3917
+ * @param callback
3918
+ */
3919
+ abstract terminating(callback: (app: this) => void): this;
3920
+ /**
3921
+ * Terminate the application.
3922
+ */
3923
+ abstract terminate(): void;
3325
3924
  /**
3326
3925
  * Handle the incoming HTTP request and send the response to the browser.
3327
3926
  *
3328
3927
  * @param request
3329
3928
  */
3330
- abstract handleRequest(event: H3Event): Promise<void>;
3929
+ abstract handleRequest(config?: EntryConfig): Promise<void>;
3331
3930
  /**
3332
3931
  * Get the URI resolver callback.
3333
3932
  */
@@ -3382,6 +3981,13 @@ declare abstract class IApplication extends IContainer {
3382
3981
  * Determine if the application has been bootstrapped before.
3383
3982
  */
3384
3983
  abstract hasBeenBootstrapped(): boolean;
3984
+ /**
3985
+ * Build the http context
3986
+ *
3987
+ * @param event
3988
+ * @param config
3989
+ */
3990
+ abstract buildContext(event: H3Event, config?: EntryConfig, fresh?: boolean): Promise<IHttpContext>;
3385
3991
  /**
3386
3992
  * Save the curretn H3 instance for possible future use.
3387
3993
  *
@@ -3399,6 +4005,16 @@ declare abstract class IApplication extends IContainer {
3399
4005
  * Get the HttpContext.
3400
4006
  */
3401
4007
  abstract getHttpContext(): IHttpContext | undefined;
4008
+ /**
4009
+ * @param key
4010
+ */
4011
+ abstract getHttpContext<K$1 extends keyof IHttpContext>(key: K$1): IHttpContext[K$1];
4012
+ /**
4013
+ * Get the application namespace.
4014
+ *
4015
+ * @throws {RuntimeException}
4016
+ */
4017
+ abstract getNamespace(): string;
3402
4018
  /**
3403
4019
  * Get the base path of the app
3404
4020
  *
@@ -3446,7 +4062,7 @@ declare abstract class IHttpContext {
3446
4062
  }
3447
4063
  //#endregion
3448
4064
  //#region src/Utilities/Utilities.d.ts
3449
- type IPathName = 'views' | 'routes' | 'assets' | 'base' | 'public' | 'storage' | 'config' | 'database' | 'commands';
4065
+ type IPathName = 'app' | 'src' | 'views' | 'routes' | 'assets' | 'base' | 'public' | 'storage' | 'config' | 'database' | 'commands';
3450
4066
  type RouterEnd = 'get' | 'delete' | 'put' | 'post' | 'patch' | 'apiResource' | 'group' | 'route' | 'any';
3451
4067
  type RouteMethod = 'GET' | 'HEAD' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS';
3452
4068
  type RequestMethod = 'HEAD' | 'GET' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PURGE' | 'POST' | 'CONNECT' | 'PATCH';
@@ -3586,34 +4202,6 @@ declare abstract class IRegisterer {
3586
4202
  abstract bootRegister(): void;
3587
4203
  }
3588
4204
  //#endregion
3589
- //#region src/Database/IModel.d.ts
3590
- declare abstract class IModel<M = any> {
3591
- /**
3592
- * Retrieve the model for a bound value.
3593
- *
3594
- * @param value
3595
- * @param field
3596
- * @returns
3597
- */
3598
- abstract resolveRouteBinding(value: any, field?: undefined | string | null): Promise<M>;
3599
- /**
3600
- * Retrieve the model for a bound value.
3601
- *
3602
- * @param query
3603
- * @param value
3604
- * @param field
3605
- */
3606
- abstract resolveRouteBindingQuery(query: any, value: any, field?: undefined | string | null): any;
3607
- /**
3608
- * Get the value of the model's route key.
3609
- */
3610
- abstract getRouteKey(): any;
3611
- /**
3612
- * Get the route key for the model.
3613
- */
3614
- abstract getRouteKeyName(): string;
3615
- }
3616
- //#endregion
3617
4205
  //#region src/Exceptions/IExceptionHandler.d.ts
3618
4206
  type ExceptionConstructor<T = any> = new (...args: any[]) => T;
3619
4207
  type ExceptionConditionCallback = (error: any) => boolean;
@@ -4080,7 +4668,16 @@ declare abstract class IJob {
4080
4668
  }
4081
4669
  //#endregion
4082
4670
  //#region src/Routing/ICallableDispatcher.d.ts
4083
- declare abstract class ICallableDispatcher {}
4671
+ declare abstract class ICallableDispatcher {
4672
+ /**
4673
+ * Dispatch a request to a given callback.
4674
+ *
4675
+ * @param route
4676
+ * @param handler
4677
+ * @param method
4678
+ */
4679
+ abstract dispatch(route: IRoute, handler: CallableConstructor): Promise<any>;
4680
+ }
4084
4681
  //#endregion
4085
4682
  //#region src/Routing/IControllerDispatcher.d.ts
4086
4683
  declare abstract class IControllerDispatcher {
@@ -4115,31 +4712,22 @@ declare abstract class IRouteRegistrar {
4115
4712
  abstract prefix(prefix: string): this;
4116
4713
  }
4117
4714
  //#endregion
4118
- //#region src/Routing/Traits/UrlRoutable.d.ts
4119
- declare abstract class UrlRoutable {
4120
- /**
4121
- * Get the value of the model's route key.
4122
- */
4123
- abstract getRouteKey(): any;
4124
- /**
4125
- * Retrieve the model for a bound value.
4126
- *
4127
- * @param value
4128
- * @param field
4129
- */
4130
- abstract resolveRouteBinding(value: any, field?: string): Promise<IModel<any>>;
4131
- /**
4132
- * Retrieve the child model for a bound value.
4133
- *
4134
- * @param childType
4135
- * @param value
4136
- * @param field
4137
- */
4138
- /**
4139
- * Get the route key for the model.
4140
- */
4141
- abstract getRouteKeyName(): string;
4715
+ //#region src/Session/SessionContract.d.ts
4716
+ interface SessionDriverOption {
4717
+ cwd?: string;
4718
+ dir?: string;
4719
+ table?: string;
4720
+ prefix?: string;
4721
+ client?: any;
4722
+ sessionId?: string;
4723
+ sessionDir?: string;
4142
4724
  }
4725
+ /**
4726
+ * A builder function that returns a SessionDriver for a given sessionId.
4727
+ *
4728
+ * The builder receives the sessionId and a driver-specific options bag.
4729
+ */
4730
+ type SessionDriverBuilder = (sessionId: string, options?: SessionDriverOption) => ISessionDriver;
4143
4731
  //#endregion
4144
4732
  //#region src/Url/IRequestAwareUrl.d.ts
4145
4733
  /**
@@ -4168,6 +4756,47 @@ declare abstract class IRequestAwareUrl {
4168
4756
  abstract query(): Record<string, any>;
4169
4757
  }
4170
4758
  //#endregion
4759
+ //#region src/Url/IRouteUrlGenerator.d.ts
4760
+ declare abstract class IRouteUrlGenerator {
4761
+ /**
4762
+ * The named parameter defaults.
4763
+ */
4764
+ abstract defaultParameters: RouteParams;
4765
+ /**
4766
+ * Characters that should not be URL encoded.
4767
+ */
4768
+ abstract dontEncode: {
4769
+ '%2F': string;
4770
+ '%40': string;
4771
+ '%3A': string;
4772
+ '%3B': string;
4773
+ '%2C': string;
4774
+ '%3D': string;
4775
+ '%2B': string;
4776
+ '%21': string;
4777
+ '%2A': string;
4778
+ '%7C': string;
4779
+ '%3F': string;
4780
+ '%26': string;
4781
+ '%23': string;
4782
+ '%25': string;
4783
+ };
4784
+ /**
4785
+ * Generate a URL for the given route.
4786
+ *
4787
+ * @param route
4788
+ * @param parameters
4789
+ * @param absolute
4790
+ */
4791
+ abstract to(route: IRoute, parameters?: RouteParams, absolute?: boolean): string;
4792
+ /**
4793
+ * Set the default named parameters used by the URL generator.
4794
+ *
4795
+ * @param $defaults
4796
+ */
4797
+ abstract defaults(defaults: RouteParams): void;
4798
+ }
4799
+ //#endregion
4171
4800
  //#region src/Url/IUrlHelpers.d.ts
4172
4801
  /**
4173
4802
  * The Url Helper Contract
@@ -4459,4 +5088,4 @@ declare class IValidator<D extends Record<string, any> = any, R extends RulesFor
4459
5088
  getRules(): R;
4460
5089
  }
4461
5090
  //#endregion
4462
- export { AServiceProvider, AbstractConstructor, ActionInput, AppEvent, AppListener, BaseValidationRuleClass, Bindings, CKernel, CacheOptions, CallableConstructor, ClassConstructor, ClassicRouteDefinition, ConcreteConstructor, CustomValidationRules, DotFlatten, DotNestedKeys, DotNestedValue, DotPaths, DriverBuilder, DriverOption, EventHandler, ExceptionConditionCallback, ExceptionConstructor, ExtractClassMethods, ExtractRules, FieldMessages, FlashBag, GenericObject, GenericWithNullableStringValues, IAbstractRouteCollection, IAppBuilder, IApplication, IBinding, IBootstraper, ICallableDispatcher, ICompiledRoute, IContainer, IController, IControllerDispatcher, IDispatcher, IExceptionHandler, IFileBag, IFileInput, IHeaderBag, IHttpContext, IHttpRequest, IHttpResponse, IJob, IKernel, IMessageBag, IMiddleware, IMiddlewareHandler, IModel, IParamBag, IPathName, IPendingResourceRegistration, IPendingSingletonResourceRegistration, IRegisterer, IRequest, IRequestAwareUrl, IResponsable, IResponse, IRoute, IRouteCollection, IRouteRegistrar, IRouter, IServerBag, IServiceProvider, ISessionManager, IUploadedFile, IUrl, IUrlHelpers, IValidationRule, IValidator, InputBag, JobPayload, LimitSpec, ListenerClassConstructor, MergedConstructor, MessagesForRules, MiddlewareIdentifier, MiddlewareList, MixinConstructor, NormalizedAction, OServiceProvider, ParamableValidationRuleName, PathLoader, PlainRuleName, RateLimiterAdapter, RedirectHandler, RenderExceptionCallback, ReportExceptionCallback, RequestMethod, RequestObject, ResourceMethod, ResourceOptions, ResponsableType, ResponseObject, RouteActions, RouteAttributes, RouteEventHandler, RouteMethod, RouteParams, RouterEnd, RulesForData, ServiceProviderConstructor, SessionDriver, TGeneric, ThrottleExceptionCallback, Unlimited, UrlRoutable, UseKey, ValidationMessageProvider, ValidationRuleCallable, ValidationRuleName, ValidationRuleSet };
5091
+ export { AServiceProvider, AbstractConstructor, ActionInput, AppEvent, AppListener, Argon2Options, BaseValidationRuleClass, BcryptOptions, Bindings, CKernel, CacheOptions, CallableConstructor, ClassConstructor, ClassicRouteDefinition, ConcreteConstructor, CustomValidationRules, DotFlatten, DotNestedKeys, DotNestedValue, DotPaths, EventHandler, ExceptionConditionCallback, ExceptionConstructor, ExtractClassMethods, ExtractRules, FieldMessages, FlashBag, GenericObject, GenericWithNullableStringValues, HashAlgorithm, HashConfiguration, HashInfo, HashOptions, IAbstractHasher, IAbstractRouteCollection, IAppBuilder, IApplication, IArgon2idHasher, IArgonHasher, IBaseHashManager, IBcryptHasher, IBinding, IBootstraper, ICallableDispatcher, ICompiledRoute, IContainer, IController, IControllerDispatcher, IDispatcher, IExceptionHandler, IFileBag, IFileInput, IHashManager, IHeaderBag, IHttpContext, IHttpRequest, IHttpResponse, IJob, IKernel, IMessageBag, IMiddleware, IMiddlewareHandler, IModel, IParamBag, IPathName, IPendingResourceRegistration, IPendingSingletonResourceRegistration, IRegisterer, IRequest, IRequestAwareUrl, IResponsable, IResponse, IRoute, IRouteCollection, IRouteRegistrar, IRouteUrlGenerator, IRouter, IServerBag, IServiceProvider, ISessionDriver, ISessionManager, IUploadedFile, IUrl, IUrlGenerator, IUrlHelpers, IValidationRule, IValidator, InputBag, JobPayload, LimitSpec, ListenerClassConstructor, MergedConstructor, MessagesForRules, MiddlewareIdentifier, MiddlewareList, MixinConstructor, NormalizedAction, OServiceProvider, ParamableValidationRuleName, PathLoader, PlainRuleName, RateLimiterAdapter, RedirectHandler, RenderExceptionCallback, ReportExceptionCallback, RequestMethod, RequestObject, ResourceMethod, ResourceOptions, ResponsableType, ResponseObject, RouteActions, RouteAttributes, RouteEventHandler, RouteMethod, RouteParams, RouterEnd, RulesForData, ServiceProviderConstructor, SessionDriverBuilder, SessionDriverOption, TGeneric, ThrottleExceptionCallback, UnknownHashOptions, Unlimited, UrlRoutable, UseKey, ValidationMessageProvider, ValidationRuleCallable, ValidationRuleName, ValidationRuleSet };