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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotstaq",
3
- "version": "0.9.20",
3
+ "version": "0.9.21",
4
4
  "description": "A friendly web framework that fits nicely into devops and CI/CD pipelines.",
5
5
  "bin": {
6
6
  "hotstaq": "./bin/hotstaq"
@@ -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
@@ -238,7 +238,7 @@ export class HotStaq implements IHotStaq
238
238
  /**
239
239
  * The current version of HotStaq.
240
240
  */
241
- static version: string = "0.9.20";
241
+ static version: string = "0.9.21";
242
242
  /**
243
243
  * Indicates if this is a web build.
244
244
  */
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,