@h3ravel/contracts 0.28.0 → 0.28.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.cjs +69 -6
- package/dist/index.d.ts +776 -149
- package/dist/index.js +59 -7
- package/package.json +3 -5
- package/tsconfig.json +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
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";
|
|
6
|
-
import { Builder, Model } from "@h3ravel/arquebus";
|
|
7
|
-
import { IQueryBuilder } from "@h3ravel/arquebus/types";
|
|
8
7
|
import { Command, Kernel } from "@h3ravel/musket";
|
|
9
8
|
import In from "simple-body-validator/lib/cjs/rules/in";
|
|
10
9
|
import NotIn from "simple-body-validator/lib/cjs/rules/notIn";
|
|
@@ -442,7 +441,7 @@ declare abstract class IServerBag extends IParamBag {
|
|
|
442
441
|
}
|
|
443
442
|
//#endregion
|
|
444
443
|
//#region src/Url/Utils.d.ts
|
|
445
|
-
type RouteParams<N =
|
|
444
|
+
type RouteParams<N = string | number> = Record<string, N> | N[] | N;
|
|
446
445
|
//#endregion
|
|
447
446
|
//#region src/Url/IUrl.d.ts
|
|
448
447
|
declare abstract class IUrl {
|
|
@@ -693,7 +692,7 @@ declare abstract class IHttpRequest {
|
|
|
693
692
|
* @param server The SERVER parameters
|
|
694
693
|
* @param content The raw body data
|
|
695
694
|
*/
|
|
696
|
-
abstract initialize():
|
|
695
|
+
abstract initialize(): void;
|
|
697
696
|
/**
|
|
698
697
|
* Gets a list of content types acceptable by the client browser in preferable order.
|
|
699
698
|
* @returns {string[]}
|
|
@@ -1204,31 +1203,31 @@ declare abstract class IRoute {
|
|
|
1204
1203
|
}
|
|
1205
1204
|
//#endregion
|
|
1206
1205
|
//#region src/Session/FlashBag.d.ts
|
|
1207
|
-
declare class FlashBag {
|
|
1206
|
+
declare abstract class FlashBag {
|
|
1208
1207
|
/**
|
|
1209
1208
|
* Flash a value for the next request
|
|
1210
1209
|
*
|
|
1211
1210
|
* @param key Key to store in flash
|
|
1212
1211
|
* @param value Value to be flashed
|
|
1213
1212
|
*/
|
|
1214
|
-
flash(key: string, value: any): void;
|
|
1213
|
+
abstract flash(key: string, value: any): void;
|
|
1215
1214
|
/**
|
|
1216
1215
|
* Store a temporary value for the current request only
|
|
1217
1216
|
*
|
|
1218
1217
|
* @param key Key to store
|
|
1219
1218
|
* @param value Value to store
|
|
1220
1219
|
*/
|
|
1221
|
-
now(key: string, value: any): void;
|
|
1220
|
+
abstract now(key: string, value: any): void;
|
|
1222
1221
|
/**
|
|
1223
1222
|
* Reflash all current flash data for another request cycle
|
|
1224
1223
|
*/
|
|
1225
|
-
reflash(): void;
|
|
1224
|
+
abstract reflash(): void;
|
|
1226
1225
|
/**
|
|
1227
1226
|
* Keep only specific flash keys for the next request
|
|
1228
1227
|
*
|
|
1229
1228
|
* @param keys Keys to keep
|
|
1230
1229
|
*/
|
|
1231
|
-
keep(keys: string[]): void;
|
|
1230
|
+
abstract keep(keys: string[]): void;
|
|
1232
1231
|
/**
|
|
1233
1232
|
* Age flash data at the end of the request
|
|
1234
1233
|
*
|
|
@@ -1236,7 +1235,7 @@ declare class FlashBag {
|
|
|
1236
1235
|
* - Moves new flash data to old
|
|
1237
1236
|
* - Clears new flash data
|
|
1238
1237
|
*/
|
|
1239
|
-
ageFlashData(): void;
|
|
1238
|
+
abstract ageFlashData(): void;
|
|
1240
1239
|
/**
|
|
1241
1240
|
* Get a flash value
|
|
1242
1241
|
*
|
|
@@ -1244,198 +1243,183 @@ declare class FlashBag {
|
|
|
1244
1243
|
* @param defaultValue Default value if key doesn't exist
|
|
1245
1244
|
* @returns Flash value or default
|
|
1246
1245
|
*/
|
|
1247
|
-
get(key: string, defaultValue?: any): any;
|
|
1246
|
+
abstract get(key: string, defaultValue?: any): any;
|
|
1248
1247
|
/**
|
|
1249
1248
|
* Check if a flash key exists
|
|
1250
1249
|
*
|
|
1251
1250
|
* @param key Key to check
|
|
1252
1251
|
* @returns Boolean indicating existence
|
|
1253
1252
|
*/
|
|
1254
|
-
has(key: string): boolean;
|
|
1253
|
+
abstract has(key: string): boolean;
|
|
1255
1254
|
/**
|
|
1256
1255
|
* Get all flash data
|
|
1257
1256
|
*
|
|
1258
1257
|
* @returns Combined flash data
|
|
1259
1258
|
*/
|
|
1260
|
-
all(): Record<string, any>;
|
|
1259
|
+
abstract all(): Record<string, any>;
|
|
1261
1260
|
/**
|
|
1262
1261
|
* Get all flash data keys
|
|
1263
1262
|
*
|
|
1264
1263
|
* @returns Combined flash data
|
|
1265
1264
|
*/
|
|
1266
|
-
keys(): string[];
|
|
1265
|
+
abstract keys(): string[];
|
|
1267
1266
|
/**
|
|
1268
1267
|
* Get the raww flash data
|
|
1269
1268
|
*
|
|
1270
1269
|
* @returns raw flash data
|
|
1271
1270
|
*/
|
|
1272
|
-
raw(): Record<string, any>;
|
|
1271
|
+
abstract raw(): Record<string, any>;
|
|
1273
1272
|
/**
|
|
1274
1273
|
* Clear all flash data
|
|
1275
1274
|
*/
|
|
1276
|
-
clear(): void;
|
|
1275
|
+
abstract clear(): void;
|
|
1277
1276
|
}
|
|
1278
1277
|
//#endregion
|
|
1279
|
-
//#region src/Session/
|
|
1278
|
+
//#region src/Session/ISessionDriver.d.ts
|
|
1280
1279
|
/**
|
|
1281
1280
|
* SessionDriver Interface
|
|
1282
1281
|
*
|
|
1283
1282
|
* All session drivers must implement these methods to ensure
|
|
1284
1283
|
* consistency across different storage mechanisms (memory, files, database, redis).
|
|
1285
1284
|
*/
|
|
1286
|
-
|
|
1287
|
-
flashBag: FlashBag;
|
|
1285
|
+
declare abstract class ISessionDriver {
|
|
1286
|
+
abstract flashBag: FlashBag;
|
|
1288
1287
|
/**
|
|
1289
1288
|
* Retrieve a value from the session by key.
|
|
1290
1289
|
*
|
|
1291
1290
|
* @param key
|
|
1292
1291
|
* @param defaultValue
|
|
1293
1292
|
*/
|
|
1294
|
-
get<T = any>(key: string, defaultValue?: any): T | Promise<T>;
|
|
1293
|
+
abstract get<T = any>(key: string, defaultValue?: any): T | Promise<T>;
|
|
1295
1294
|
/**
|
|
1296
1295
|
* Store multiple values in the session.
|
|
1297
1296
|
*
|
|
1298
1297
|
* @param key
|
|
1299
1298
|
* @param defaultValue
|
|
1300
1299
|
*/
|
|
1301
|
-
set(value: Record<string, any>): void | Promise<void>;
|
|
1300
|
+
abstract set(value: Record<string, any>): void | Promise<void>;
|
|
1302
1301
|
/**
|
|
1303
1302
|
* Retrieve all data from the session including flash
|
|
1304
1303
|
*
|
|
1305
1304
|
* @returns
|
|
1306
1305
|
*/
|
|
1307
|
-
getAll<T extends Record<string, any>>(): Promise<T> | T;
|
|
1306
|
+
abstract getAll<T extends Record<string, any>>(): Promise<T> | T;
|
|
1308
1307
|
/**
|
|
1309
1308
|
* Store a value in the session.
|
|
1310
1309
|
*
|
|
1311
1310
|
* @param key
|
|
1312
1311
|
* @param value
|
|
1313
1312
|
*/
|
|
1314
|
-
put(key: string, value: any): void | Promise<void>;
|
|
1313
|
+
abstract put(key: string, value: any): void | Promise<void>;
|
|
1315
1314
|
/**
|
|
1316
1315
|
* Append a value to an array key
|
|
1317
1316
|
*
|
|
1318
1317
|
* @param key
|
|
1319
1318
|
* @param value
|
|
1320
|
-
|
|
1321
|
-
push(key: string, value: any): Promise<void> | void;
|
|
1319
|
+
*/
|
|
1320
|
+
abstract push(key: string, value: any): Promise<void> | void;
|
|
1322
1321
|
/**
|
|
1323
1322
|
* Remove a key from the session.
|
|
1324
1323
|
*
|
|
1325
1324
|
* @param key
|
|
1326
1325
|
*/
|
|
1327
|
-
forget(key: string): Promise<void> | void;
|
|
1326
|
+
abstract forget(key: string): Promise<void> | void;
|
|
1328
1327
|
/**
|
|
1329
1328
|
* Determine if a key is present in the session.
|
|
1330
1329
|
*
|
|
1331
1330
|
* @param key
|
|
1332
|
-
|
|
1333
|
-
has(key: string): Promise<boolean> | boolean;
|
|
1331
|
+
*/
|
|
1332
|
+
abstract has(key: string): Promise<boolean> | boolean;
|
|
1334
1333
|
/**
|
|
1335
1334
|
* Determine if a key exists in the session (even if null).
|
|
1336
1335
|
*
|
|
1337
1336
|
* @param key
|
|
1338
1337
|
*/
|
|
1339
|
-
exists(key: string): Promise<boolean> | boolean;
|
|
1338
|
+
abstract exists(key: string): Promise<boolean> | boolean;
|
|
1340
1339
|
/**
|
|
1341
1340
|
* Get all data from the session.
|
|
1342
1341
|
*/
|
|
1343
|
-
all<T extends Record<string, any>>(): Promise<T> | T;
|
|
1342
|
+
abstract all<T extends Record<string, any>>(): Promise<T> | T;
|
|
1344
1343
|
/**
|
|
1345
1344
|
* Get only a subset of session keys.
|
|
1346
1345
|
*
|
|
1347
1346
|
* @param keys
|
|
1348
1347
|
*/
|
|
1349
|
-
only<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
|
|
1348
|
+
abstract only<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
|
|
1350
1349
|
/**
|
|
1351
1350
|
* Get all session data except the specified keys.
|
|
1352
1351
|
*
|
|
1353
1352
|
* @param keys
|
|
1354
1353
|
*/
|
|
1355
|
-
except<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
|
|
1354
|
+
abstract except<T extends Record<string, any>>(keys: string[]): Promise<T> | T;
|
|
1356
1355
|
/**
|
|
1357
1356
|
* Get and remove an item from the session.
|
|
1358
1357
|
*
|
|
1359
1358
|
* @param key
|
|
1360
1359
|
* @param defaultValue
|
|
1361
1360
|
*/
|
|
1362
|
-
pull<T = any>(key: string, defaultValue?: any): Promise<T> | T;
|
|
1361
|
+
abstract pull<T = any>(key: string, defaultValue?: any): Promise<T> | T;
|
|
1363
1362
|
/**
|
|
1364
1363
|
* Increment a numeric session value.
|
|
1365
1364
|
*
|
|
1366
1365
|
* @param key
|
|
1367
1366
|
* @param amount
|
|
1368
1367
|
*/
|
|
1369
|
-
increment(key: string, amount?: number): Promise<number> | number;
|
|
1368
|
+
abstract increment(key: string, amount?: number): Promise<number> | number;
|
|
1370
1369
|
/**
|
|
1371
1370
|
* Decrement a numeric session value.
|
|
1372
1371
|
*
|
|
1373
1372
|
* @param key
|
|
1374
1373
|
* @param amount
|
|
1375
1374
|
*/
|
|
1376
|
-
decrement(key: string, amount?: number): Promise<number> | number;
|
|
1375
|
+
abstract decrement(key: string, amount?: number): Promise<number> | number;
|
|
1377
1376
|
/**
|
|
1378
1377
|
* Flash a key/value pair for the next request only.
|
|
1379
1378
|
*
|
|
1380
1379
|
* @param key
|
|
1381
1380
|
* @param value
|
|
1382
1381
|
*/
|
|
1383
|
-
flash(key: string, value: any): Promise<void> | void;
|
|
1382
|
+
abstract flash(key: string, value: any): Promise<void> | void;
|
|
1384
1383
|
/**
|
|
1385
1384
|
* Reflash all current flash data for another request cycle.
|
|
1386
1385
|
*/
|
|
1387
|
-
reflash(): Promise<void> | void;
|
|
1386
|
+
abstract reflash(): Promise<void> | void;
|
|
1388
1387
|
/**
|
|
1389
1388
|
* Keep only specific flash data for another request.
|
|
1390
1389
|
*
|
|
1391
1390
|
* @param keys
|
|
1392
1391
|
*/
|
|
1393
|
-
keep(keys: string[]): Promise<void> | void;
|
|
1392
|
+
abstract keep(keys: string[]): Promise<void> | void;
|
|
1394
1393
|
/**
|
|
1395
1394
|
* Store data for the current request only (not persisted).
|
|
1396
1395
|
*
|
|
1397
1396
|
* @param key
|
|
1398
1397
|
* @param value
|
|
1399
1398
|
*/
|
|
1400
|
-
now(key: string, value: any): Promise<void> | void;
|
|
1399
|
+
abstract now(key: string, value: any): Promise<void> | void;
|
|
1401
1400
|
/**
|
|
1402
1401
|
* Regenerate the session ID and optionally persist the data.
|
|
1403
1402
|
*/
|
|
1404
|
-
regenerate(): Promise<void> | void;
|
|
1403
|
+
abstract regenerate(): Promise<void> | void;
|
|
1405
1404
|
/**
|
|
1406
1405
|
* Invalidate the session completely and regenerate ID.
|
|
1407
1406
|
*/
|
|
1408
|
-
invalidate(): Promise<void> | void;
|
|
1407
|
+
abstract invalidate(): Promise<void> | void;
|
|
1409
1408
|
/**
|
|
1410
1409
|
* Determine if an item is not present in the session.
|
|
1411
1410
|
*
|
|
1412
1411
|
* @param key
|
|
1413
1412
|
*/
|
|
1414
|
-
missing(key: string): Promise<boolean> | boolean;
|
|
1413
|
+
abstract missing(key: string): Promise<boolean> | boolean;
|
|
1415
1414
|
/**
|
|
1416
1415
|
* Flush all session data
|
|
1417
1416
|
*/
|
|
1418
|
-
flush(): Promise<void> | void;
|
|
1417
|
+
abstract flush(): Promise<void> | void;
|
|
1419
1418
|
/**
|
|
1420
1419
|
* Age flash data at the end of the request lifecycle.
|
|
1421
1420
|
*/
|
|
1422
|
-
ageFlashData(): Promise<void> | void;
|
|
1423
|
-
}
|
|
1424
|
-
interface DriverOption {
|
|
1425
|
-
cwd?: string;
|
|
1426
|
-
dir?: string;
|
|
1427
|
-
table?: string;
|
|
1428
|
-
prefix?: string;
|
|
1429
|
-
client?: any;
|
|
1430
|
-
sessionId?: string;
|
|
1431
|
-
sessionDir?: string;
|
|
1421
|
+
abstract ageFlashData(): Promise<void> | void;
|
|
1432
1422
|
}
|
|
1433
|
-
/**
|
|
1434
|
-
* A builder function that returns a SessionDriver for a given sessionId.
|
|
1435
|
-
*
|
|
1436
|
-
* The builder receives the sessionId and a driver-specific options bag.
|
|
1437
|
-
*/
|
|
1438
|
-
type DriverBuilder = (sessionId: string, options?: DriverOption) => SessionDriver;
|
|
1439
1423
|
//#endregion
|
|
1440
1424
|
//#region src/Session/ISessionManager.d.ts
|
|
1441
1425
|
/**
|
|
@@ -1444,84 +1428,83 @@ type DriverBuilder = (sessionId: string, options?: DriverOption) => SessionDrive
|
|
|
1444
1428
|
* Handles session initialization, ID generation, and encryption.
|
|
1445
1429
|
* Each request gets a unique session namespace tied to its ID.
|
|
1446
1430
|
*/
|
|
1447
|
-
declare class ISessionManager {
|
|
1431
|
+
declare abstract class ISessionManager {
|
|
1432
|
+
abstract flashBag: FlashBag;
|
|
1448
1433
|
/**
|
|
1449
|
-
*
|
|
1450
|
-
* @param driverName - registered driver key ('file' | 'database' | 'memory' | 'redis')
|
|
1451
|
-
* @param driverOptions - optional bag for driver-specific options
|
|
1434
|
+
* Access the current session ID.
|
|
1452
1435
|
*/
|
|
1453
|
-
|
|
1436
|
+
abstract id(): string;
|
|
1454
1437
|
/**
|
|
1455
|
-
*
|
|
1438
|
+
* Get the current session driver
|
|
1456
1439
|
*/
|
|
1457
|
-
|
|
1440
|
+
abstract getDriver(): ISessionDriver;
|
|
1458
1441
|
/**
|
|
1459
1442
|
* Retrieve a value from the session
|
|
1460
1443
|
*
|
|
1461
1444
|
* @param key
|
|
1462
1445
|
* @returns
|
|
1463
1446
|
*/
|
|
1464
|
-
get(key: string, defaultValue?: any): Promise<any> | any;
|
|
1447
|
+
abstract get(key: string, defaultValue?: any): Promise<any> | any;
|
|
1465
1448
|
/**
|
|
1466
1449
|
* Store a value in the session
|
|
1467
1450
|
*
|
|
1468
1451
|
* @param key
|
|
1469
1452
|
* @param value
|
|
1470
1453
|
*/
|
|
1471
|
-
set(value: Record<string, any>): Promise<void> | void;
|
|
1454
|
+
abstract set(value: Record<string, any>): Promise<void> | void;
|
|
1472
1455
|
/**
|
|
1473
1456
|
* Store multiple key/value pairs
|
|
1474
1457
|
*
|
|
1475
1458
|
* @param values
|
|
1476
1459
|
*/
|
|
1477
|
-
put(key: string, value: any): void | Promise<void>;
|
|
1460
|
+
abstract put(key: string, value: any): void | Promise<void>;
|
|
1478
1461
|
/**
|
|
1479
1462
|
* Append a value to an array key
|
|
1480
1463
|
*
|
|
1481
1464
|
* @param key
|
|
1482
1465
|
* @param value
|
|
1483
1466
|
*/
|
|
1484
|
-
push(key: string, value: any): void | Promise<void>;
|
|
1467
|
+
abstract push(key: string, value: any): void | Promise<void>;
|
|
1485
1468
|
/**
|
|
1486
1469
|
* Remove a key from the session
|
|
1487
1470
|
*
|
|
1488
1471
|
* @param key
|
|
1489
1472
|
*/
|
|
1490
|
-
forget(key: string): void | Promise<void>;
|
|
1473
|
+
abstract forget(key: string): void | Promise<void>;
|
|
1491
1474
|
/**
|
|
1492
1475
|
* Retrieve all session data
|
|
1493
1476
|
*
|
|
1494
1477
|
* @returns
|
|
1495
1478
|
*/
|
|
1496
|
-
all(): Record<string, any> | Promise<Record<string, any>>;
|
|
1479
|
+
abstract all(): Record<string, any> | Promise<Record<string, any>>;
|
|
1497
1480
|
/**
|
|
1498
1481
|
* Determine if a key exists (even if null).
|
|
1499
1482
|
*
|
|
1500
1483
|
* @param key
|
|
1501
1484
|
* @returns
|
|
1502
1485
|
*/
|
|
1503
|
-
exists(key: string): Promise<boolean> | boolean;
|
|
1486
|
+
abstract exists(key: string): Promise<boolean> | boolean;
|
|
1504
1487
|
/**
|
|
1505
1488
|
* Determine if a key has a non-null value.
|
|
1506
1489
|
*
|
|
1507
1490
|
* @param key
|
|
1508
1491
|
* @returns
|
|
1509
1492
|
*/
|
|
1510
|
-
has(key: string): Promise<boolean> | boolean;
|
|
1493
|
+
abstract has(key: string): Promise<boolean> | boolean;
|
|
1511
1494
|
/**
|
|
1512
1495
|
* Get only specific keys.
|
|
1513
1496
|
*
|
|
1514
1497
|
* @param keys
|
|
1515
1498
|
* @returns
|
|
1516
1499
|
*/
|
|
1517
|
-
only(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
|
|
1500
|
+
abstract only(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
|
|
1518
1501
|
/**
|
|
1519
1502
|
* Return all keys except the specified ones.
|
|
1520
1503
|
*
|
|
1521
1504
|
* @param keys
|
|
1522
1505
|
* @returns
|
|
1523
1506
|
*/
|
|
1524
|
-
except(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
|
|
1507
|
+
abstract except(keys: string[]): Record<string, any> | Promise<Record<string, any>>;
|
|
1525
1508
|
/**
|
|
1526
1509
|
* Return and delete a key from the session.
|
|
1527
1510
|
*
|
|
@@ -1529,7 +1512,7 @@ declare class ISessionManager {
|
|
|
1529
1512
|
* @param defaultValue
|
|
1530
1513
|
* @returns
|
|
1531
1514
|
*/
|
|
1532
|
-
pull(key: string, defaultValue?: any): any;
|
|
1515
|
+
abstract pull(key: string, defaultValue?: any): any;
|
|
1533
1516
|
/**
|
|
1534
1517
|
* Increment a numeric value by amount (default 1).
|
|
1535
1518
|
*
|
|
@@ -1537,7 +1520,7 @@ declare class ISessionManager {
|
|
|
1537
1520
|
* @param amount
|
|
1538
1521
|
* @returns
|
|
1539
1522
|
*/
|
|
1540
|
-
increment(key: string, amount?: number): Promise<number> | number;
|
|
1523
|
+
abstract increment(key: string, amount?: number): Promise<number> | number;
|
|
1541
1524
|
/**
|
|
1542
1525
|
* Decrement a numeric value by amount (default 1).
|
|
1543
1526
|
*
|
|
@@ -1545,55 +1528,55 @@ declare class ISessionManager {
|
|
|
1545
1528
|
* @param amount
|
|
1546
1529
|
* @returns
|
|
1547
1530
|
*/
|
|
1548
|
-
decrement(key: string, amount?: number): number | Promise<number>;
|
|
1531
|
+
abstract decrement(key: string, amount?: number): number | Promise<number>;
|
|
1549
1532
|
/**
|
|
1550
1533
|
* Flash a value for next request only.
|
|
1551
1534
|
*
|
|
1552
1535
|
* @param key
|
|
1553
1536
|
* @param value
|
|
1554
1537
|
*/
|
|
1555
|
-
flash(key: string, value: any): void | Promise<void>;
|
|
1538
|
+
abstract flash(key: string, value: any): void | Promise<void>;
|
|
1556
1539
|
/**
|
|
1557
1540
|
* Reflash all flash data for one more cycle.
|
|
1558
1541
|
*
|
|
1559
1542
|
* @returns
|
|
1560
1543
|
*/
|
|
1561
|
-
reflash(): void | Promise<void>;
|
|
1544
|
+
abstract reflash(): void | Promise<void>;
|
|
1562
1545
|
/**
|
|
1563
1546
|
* Keep only selected flash data.
|
|
1564
1547
|
*
|
|
1565
1548
|
* @param keys
|
|
1566
1549
|
* @returns
|
|
1567
1550
|
*/
|
|
1568
|
-
keep(keys: string[]): void | Promise<void>;
|
|
1551
|
+
abstract keep(keys: string[]): void | Promise<void>;
|
|
1569
1552
|
/**
|
|
1570
1553
|
* Store data only for current request cycle (not persisted).
|
|
1571
1554
|
*
|
|
1572
1555
|
* @param key
|
|
1573
1556
|
* @param value
|
|
1574
1557
|
*/
|
|
1575
|
-
now(key: string, value: any): void | Promise<void>;
|
|
1558
|
+
abstract now(key: string, value: any): void | Promise<void>;
|
|
1576
1559
|
/**
|
|
1577
1560
|
* Regenerate session ID and persist data under new ID.
|
|
1578
1561
|
*/
|
|
1579
|
-
regenerate(): void | Promise<void>;
|
|
1562
|
+
abstract regenerate(): void | Promise<void>;
|
|
1580
1563
|
/**
|
|
1581
1564
|
* Determine if an item is not present in the session.
|
|
1582
1565
|
*
|
|
1583
1566
|
* @param key
|
|
1584
1567
|
* @returns
|
|
1585
1568
|
*/
|
|
1586
|
-
missing(key: string): Promise<boolean> | boolean;
|
|
1569
|
+
abstract missing(key: string): Promise<boolean> | boolean;
|
|
1587
1570
|
/**
|
|
1588
1571
|
* Flush all session data
|
|
1589
1572
|
*/
|
|
1590
|
-
flush(): void | Promise<void>;
|
|
1573
|
+
abstract flush(): void | Promise<void>;
|
|
1591
1574
|
/**
|
|
1592
1575
|
* Age flash data at the end of the request lifecycle.
|
|
1593
1576
|
*
|
|
1594
1577
|
* @returns
|
|
1595
1578
|
*/
|
|
1596
|
-
ageFlashData(): void | Promise<void>;
|
|
1579
|
+
abstract ageFlashData(): void | Promise<void>;
|
|
1597
1580
|
}
|
|
1598
1581
|
//#endregion
|
|
1599
1582
|
//#region src/Http/IRequest.d.ts
|
|
@@ -1651,7 +1634,7 @@ declare abstract class IRequest<D extends Record<string, any> = Record<string, a
|
|
|
1651
1634
|
* @param server The SERVER parameters
|
|
1652
1635
|
* @param content The raw body data
|
|
1653
1636
|
*/
|
|
1654
|
-
abstract initialize():
|
|
1637
|
+
abstract initialize(): void;
|
|
1655
1638
|
/**
|
|
1656
1639
|
* Retrieve all data from the instance (query + body).
|
|
1657
1640
|
*/
|
|
@@ -2383,6 +2366,10 @@ declare abstract class IResponse extends IHttpResponse {
|
|
|
2383
2366
|
*/
|
|
2384
2367
|
abstract getEvent(): H3Event;
|
|
2385
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;
|
|
2386
2373
|
}
|
|
2387
2374
|
declare abstract class IResponsable extends HTTPResponse {
|
|
2388
2375
|
abstract toResponse(request: IRequest): IResponse;
|
|
@@ -2496,12 +2483,324 @@ declare abstract class IDispatcher {
|
|
|
2496
2483
|
abstract getRawListeners(): Record<string, any[]>;
|
|
2497
2484
|
}
|
|
2498
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
|
|
2499
2797
|
//#region src/Routing/IAbstractRouteCollection.d.ts
|
|
2500
2798
|
declare abstract class IAbstractRouteCollection {
|
|
2501
2799
|
static verbs: RouteMethod[];
|
|
2502
2800
|
abstract get(): IRoute[];
|
|
2503
2801
|
abstract get(method: string): Record<string, IRoute>;
|
|
2504
2802
|
abstract getRoutes(): IRoute[];
|
|
2803
|
+
abstract count(): number;
|
|
2505
2804
|
}
|
|
2506
2805
|
//#endregion
|
|
2507
2806
|
//#region src/Routing/IRouteCollection.d.ts
|
|
@@ -3027,6 +3326,253 @@ declare abstract class IRouter {
|
|
|
3027
3326
|
* @param callback
|
|
3028
3327
|
*/
|
|
3029
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;
|
|
3030
3576
|
}
|
|
3031
3577
|
//#endregion
|
|
3032
3578
|
//#region src/Utilities/PathLoader.d.ts
|
|
@@ -3048,6 +3594,12 @@ declare class PathLoader {
|
|
|
3048
3594
|
* @param base - The base path to include to the path
|
|
3049
3595
|
*/
|
|
3050
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;
|
|
3051
3603
|
}
|
|
3052
3604
|
//#endregion
|
|
3053
3605
|
//#region src/Utilities/BindingsContract.d.ts
|
|
@@ -3059,25 +3611,31 @@ type Bindings = {
|
|
|
3059
3611
|
db: any;
|
|
3060
3612
|
env(): NodeJS.ProcessEnv;
|
|
3061
3613
|
env<T extends string>(key: T, def?: any): any;
|
|
3614
|
+
url: IUrlGenerator;
|
|
3062
3615
|
view(viewPath: string, params?: Record<string, any>): Promise<IResponsable>;
|
|
3063
3616
|
edge: Edge;
|
|
3064
3617
|
asset(key: string, def?: string): string;
|
|
3618
|
+
hash: IHashManager;
|
|
3065
3619
|
router: IRouter;
|
|
3066
3620
|
events: IDispatcher;
|
|
3621
|
+
routes: IRouteCollection;
|
|
3067
3622
|
config: {
|
|
3068
3623
|
get<X extends Record<string, any>>(): X;
|
|
3069
|
-
get<X extends Record<string, any>, T extends Extract<keyof X, string>>(key
|
|
3624
|
+
get<X extends Record<string, any>, T extends Extract<keyof X, string>>(key?: T, def?: any): X[T];
|
|
3070
3625
|
set<T extends string>(key: T, value: any): void;
|
|
3071
3626
|
load?(): any;
|
|
3072
3627
|
};
|
|
3628
|
+
session: ISessionManager;
|
|
3073
3629
|
'app.events': IDispatcher;
|
|
3630
|
+
'hash.driver': ReturnType<IHashManager['driver']>;
|
|
3074
3631
|
'http.app': H3;
|
|
3075
|
-
'path.base': string;
|
|
3076
|
-
'load.paths': PathLoader;
|
|
3077
3632
|
'http.serve': typeof serve;
|
|
3078
3633
|
'http.context': IHttpContext;
|
|
3079
3634
|
'http.request': IRequest;
|
|
3080
3635
|
'http.response': IResponse;
|
|
3636
|
+
'load.paths': PathLoader;
|
|
3637
|
+
'path.base': string;
|
|
3638
|
+
'session.store': ISessionDriver;
|
|
3081
3639
|
};
|
|
3082
3640
|
type UseKey<X extends Record<string, any> = Record<string, any>> = keyof RemoveIndexSignature<Bindings & X>;
|
|
3083
3641
|
type IBinding = UseKey | (new (...args: any[]) => unknown);
|
|
@@ -3208,6 +3766,14 @@ declare abstract class IContainer {
|
|
|
3208
3766
|
*/
|
|
3209
3767
|
abstract alias(key: [string | ClassConstructor, any][]): this;
|
|
3210
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;
|
|
3211
3777
|
/**
|
|
3212
3778
|
* Determine if the given abstract type has been bound.
|
|
3213
3779
|
*
|
|
@@ -3232,6 +3798,16 @@ declare abstract class IContainer {
|
|
|
3232
3798
|
* @param abstract
|
|
3233
3799
|
*/
|
|
3234
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;
|
|
3235
3811
|
/**
|
|
3236
3812
|
* Register an existing instance as shared in the container.
|
|
3237
3813
|
*
|
|
@@ -3252,8 +3828,8 @@ declare abstract class IContainer {
|
|
|
3252
3828
|
//#region src/Core/IApplication.d.ts
|
|
3253
3829
|
declare abstract class IApplication extends IContainer {
|
|
3254
3830
|
abstract paths: PathLoader;
|
|
3255
|
-
context?: (event: H3Event) => Promise<IHttpContext>;
|
|
3256
|
-
h3Event?: H3Event;
|
|
3831
|
+
abstract context?: (event: H3Event) => Promise<IHttpContext>;
|
|
3832
|
+
abstract h3Event?: H3Event;
|
|
3257
3833
|
/**
|
|
3258
3834
|
* List of registered console commands
|
|
3259
3835
|
*/
|
|
@@ -3324,12 +3900,33 @@ declare abstract class IApplication extends IContainer {
|
|
|
3324
3900
|
* @param callback
|
|
3325
3901
|
*/
|
|
3326
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;
|
|
3327
3924
|
/**
|
|
3328
3925
|
* Handle the incoming HTTP request and send the response to the browser.
|
|
3329
3926
|
*
|
|
3330
3927
|
* @param request
|
|
3331
3928
|
*/
|
|
3332
|
-
abstract handleRequest(
|
|
3929
|
+
abstract handleRequest(config?: EntryConfig): Promise<void>;
|
|
3333
3930
|
/**
|
|
3334
3931
|
* Get the URI resolver callback.
|
|
3335
3932
|
*/
|
|
@@ -3384,6 +3981,13 @@ declare abstract class IApplication extends IContainer {
|
|
|
3384
3981
|
* Determine if the application has been bootstrapped before.
|
|
3385
3982
|
*/
|
|
3386
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>;
|
|
3387
3991
|
/**
|
|
3388
3992
|
* Save the curretn H3 instance for possible future use.
|
|
3389
3993
|
*
|
|
@@ -3401,6 +4005,16 @@ declare abstract class IApplication extends IContainer {
|
|
|
3401
4005
|
* Get the HttpContext.
|
|
3402
4006
|
*/
|
|
3403
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;
|
|
3404
4018
|
/**
|
|
3405
4019
|
* Get the base path of the app
|
|
3406
4020
|
*
|
|
@@ -3448,7 +4062,7 @@ declare abstract class IHttpContext {
|
|
|
3448
4062
|
}
|
|
3449
4063
|
//#endregion
|
|
3450
4064
|
//#region src/Utilities/Utilities.d.ts
|
|
3451
|
-
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';
|
|
3452
4066
|
type RouterEnd = 'get' | 'delete' | 'put' | 'post' | 'patch' | 'apiResource' | 'group' | 'route' | 'any';
|
|
3453
4067
|
type RouteMethod = 'GET' | 'HEAD' | 'PUT' | 'PATCH' | 'POST' | 'DELETE' | 'OPTIONS';
|
|
3454
4068
|
type RequestMethod = 'HEAD' | 'GET' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'PURGE' | 'POST' | 'CONNECT' | 'PATCH';
|
|
@@ -3588,34 +4202,6 @@ declare abstract class IRegisterer {
|
|
|
3588
4202
|
abstract bootRegister(): void;
|
|
3589
4203
|
}
|
|
3590
4204
|
//#endregion
|
|
3591
|
-
//#region src/Database/IModel.d.ts
|
|
3592
|
-
declare abstract class IModel<M extends Model = any> extends Model {
|
|
3593
|
-
/**
|
|
3594
|
-
* Retrieve the model for a bound value.
|
|
3595
|
-
*
|
|
3596
|
-
* @param value
|
|
3597
|
-
* @param field
|
|
3598
|
-
* @returns
|
|
3599
|
-
*/
|
|
3600
|
-
abstract resolveRouteBinding(value: any, field?: undefined | string | null): Promise<M>;
|
|
3601
|
-
/**
|
|
3602
|
-
* Retrieve the model for a bound value.
|
|
3603
|
-
*
|
|
3604
|
-
* @param query
|
|
3605
|
-
* @param value
|
|
3606
|
-
* @param field
|
|
3607
|
-
*/
|
|
3608
|
-
abstract resolveRouteBindingQuery(query: Builder, value: any, field?: undefined | string | null): IQueryBuilder<M>;
|
|
3609
|
-
/**
|
|
3610
|
-
* Get the value of the model's route key.
|
|
3611
|
-
*/
|
|
3612
|
-
abstract getRouteKey(): any;
|
|
3613
|
-
/**
|
|
3614
|
-
* Get the route key for the model.
|
|
3615
|
-
*/
|
|
3616
|
-
abstract getRouteKeyName(): string;
|
|
3617
|
-
}
|
|
3618
|
-
//#endregion
|
|
3619
4205
|
//#region src/Exceptions/IExceptionHandler.d.ts
|
|
3620
4206
|
type ExceptionConstructor<T = any> = new (...args: any[]) => T;
|
|
3621
4207
|
type ExceptionConditionCallback = (error: any) => boolean;
|
|
@@ -4082,7 +4668,16 @@ declare abstract class IJob {
|
|
|
4082
4668
|
}
|
|
4083
4669
|
//#endregion
|
|
4084
4670
|
//#region src/Routing/ICallableDispatcher.d.ts
|
|
4085
|
-
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
|
+
}
|
|
4086
4681
|
//#endregion
|
|
4087
4682
|
//#region src/Routing/IControllerDispatcher.d.ts
|
|
4088
4683
|
declare abstract class IControllerDispatcher {
|
|
@@ -4117,31 +4712,22 @@ declare abstract class IRouteRegistrar {
|
|
|
4117
4712
|
abstract prefix(prefix: string): this;
|
|
4118
4713
|
}
|
|
4119
4714
|
//#endregion
|
|
4120
|
-
//#region src/
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
* @param value
|
|
4130
|
-
* @param field
|
|
4131
|
-
*/
|
|
4132
|
-
abstract resolveRouteBinding(value: any, field?: string): Promise<IModel<any>>;
|
|
4133
|
-
/**
|
|
4134
|
-
* Retrieve the child model for a bound value.
|
|
4135
|
-
*
|
|
4136
|
-
* @param childType
|
|
4137
|
-
* @param value
|
|
4138
|
-
* @param field
|
|
4139
|
-
*/
|
|
4140
|
-
/**
|
|
4141
|
-
* Get the route key for the model.
|
|
4142
|
-
*/
|
|
4143
|
-
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;
|
|
4144
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;
|
|
4145
4731
|
//#endregion
|
|
4146
4732
|
//#region src/Url/IRequestAwareUrl.d.ts
|
|
4147
4733
|
/**
|
|
@@ -4170,6 +4756,47 @@ declare abstract class IRequestAwareUrl {
|
|
|
4170
4756
|
abstract query(): Record<string, any>;
|
|
4171
4757
|
}
|
|
4172
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
|
|
4173
4800
|
//#region src/Url/IUrlHelpers.d.ts
|
|
4174
4801
|
/**
|
|
4175
4802
|
* The Url Helper Contract
|
|
@@ -4461,4 +5088,4 @@ declare class IValidator<D extends Record<string, any> = any, R extends RulesFor
|
|
|
4461
5088
|
getRules(): R;
|
|
4462
5089
|
}
|
|
4463
5090
|
//#endregion
|
|
4464
|
-
export { AServiceProvider, AbstractConstructor, ActionInput, AppEvent, AppListener, BaseValidationRuleClass, Bindings, CKernel, CacheOptions, CallableConstructor, ClassConstructor, ClassicRouteDefinition, ConcreteConstructor, CustomValidationRules, DotFlatten, DotNestedKeys, DotNestedValue, DotPaths,
|
|
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 };
|