hotstaq 0.9.20 → 0.9.21
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/build/src/HotRouteMethod.d.ts +34 -1
- package/build/src/HotRouteMethod.d.ts.map +1 -1
- package/build/src/HotRouteMethod.js +35 -1
- package/build/src/HotRouteMethod.js.map +1 -1
- package/build/src/HotStaq.js +1 -1
- package/build/src/api.d.ts +2 -2
- package/build/src/api.d.ts.map +1 -1
- package/build/src/api.js +3 -2
- package/build/src/api.js.map +1 -1
- package/build-web/HotStaq.js +2 -2
- package/build-web/HotStaq.min.js +363 -363
- package/package.json +1 -1
- package/src/HotRouteMethod.ts +36 -1
- package/src/HotStaq.ts +1 -1
- package/src/api.ts +4 -4
package/package.json
CHANGED
package/src/HotRouteMethod.ts
CHANGED
|
@@ -342,6 +342,41 @@ export interface TestCaseObject
|
|
|
342
342
|
func: TestCaseFunction;
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Backwards-compat alias for the validator-name string. Re-introduced
|
|
347
|
+
* after 725eab8 removed it — `@hotstaq/userroute` and `@hotstaq/dataroute`
|
|
348
|
+
* still ship .d.ts files that import this name, so removing it breaks
|
|
349
|
+
* the TS build of every downstream package even when only the type
|
|
350
|
+
* surface changed and the runtime kept working.
|
|
351
|
+
*
|
|
352
|
+
* The enum values mirror the keys registered in HotStaq.valids[…]; any
|
|
353
|
+
* additional validator type can also be passed as a plain string.
|
|
354
|
+
*/
|
|
355
|
+
export enum HotValidationType
|
|
356
|
+
{
|
|
357
|
+
UUID = "UUID",
|
|
358
|
+
Boolean = "boolean",
|
|
359
|
+
Number = "number",
|
|
360
|
+
Integer = "Integer",
|
|
361
|
+
Float = "Float",
|
|
362
|
+
Text = "Text",
|
|
363
|
+
Email = "Email",
|
|
364
|
+
Phone = "Phone",
|
|
365
|
+
URL = "URL",
|
|
366
|
+
IPv4 = "IPv4",
|
|
367
|
+
IP = "IP",
|
|
368
|
+
IPv6 = "IPv6",
|
|
369
|
+
Date = "Date",
|
|
370
|
+
Object = "Object",
|
|
371
|
+
Array = "Array",
|
|
372
|
+
Map = "Map",
|
|
373
|
+
Enum = "Enum",
|
|
374
|
+
JSON = "JSON",
|
|
375
|
+
JS = "JS",
|
|
376
|
+
Undefined = "undefined",
|
|
377
|
+
Null = "null"
|
|
378
|
+
}
|
|
379
|
+
|
|
345
380
|
/**
|
|
346
381
|
* Is chained together to create a validation chain.
|
|
347
382
|
*/
|
|
@@ -351,7 +386,7 @@ export interface HotValidation
|
|
|
351
386
|
* The type of validation to perform.
|
|
352
387
|
* @default Text
|
|
353
388
|
*/
|
|
354
|
-
type?: string;
|
|
389
|
+
type?: string | HotValidationType;
|
|
355
390
|
/**
|
|
356
391
|
* The default value to set if the incoming input is null or undefined.
|
|
357
392
|
*/
|
package/src/HotStaq.ts
CHANGED
package/src/api.ts
CHANGED
|
@@ -14,9 +14,9 @@ import { ValidationError, FalsyOptions, ValidationOptions } from "./HotProcessIn
|
|
|
14
14
|
// Server stuff
|
|
15
15
|
import { HotAPI, EventExecutionType, APItoLoad } from "./HotAPI";
|
|
16
16
|
import { HotRoute } from "./HotRoute";
|
|
17
|
-
import { HotRouteMethod, IHotRouteMethod, HotEventMethod, HotRouteMethodParameter,
|
|
18
|
-
ServerAuthorizationFunction, ServerExecutionFunction, PassType,
|
|
19
|
-
ServerRequest, IServerRequest, HotValidation } from "./HotRouteMethod";
|
|
17
|
+
import { HotRouteMethod, IHotRouteMethod, HotEventMethod, HotRouteMethodParameter,
|
|
18
|
+
ServerAuthorizationFunction, ServerExecutionFunction, PassType,
|
|
19
|
+
ServerRequest, IServerRequest, HotValidation, HotValidationType } from "./HotRouteMethod";
|
|
20
20
|
import { HotServer, HotServerType } from "./HotServer";
|
|
21
21
|
import { StaticRoute, HTTPHeader, ServableFileExtension, HotHTTPServer } from "./HotHTTPServer";
|
|
22
22
|
import { HotMCPServer } from "./HotMCPServer";
|
|
@@ -95,7 +95,7 @@ export {
|
|
|
95
95
|
HotEventMethod, HotRouteMethodParameter, PassType,
|
|
96
96
|
ServerAuthorizationFunction,
|
|
97
97
|
ServerExecutionFunction,
|
|
98
|
-
IServerRequest, HotValidation,
|
|
98
|
+
IServerRequest, HotValidation, HotValidationType,
|
|
99
99
|
ServerRequest,
|
|
100
100
|
HotServer,
|
|
101
101
|
HotServerType,
|