pangea-server 3.3.121 → 3.3.123

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.
@@ -9,8 +9,8 @@ function ColDatetime(options) {
9
9
  return (0, column_1.Column)('DATE', options);
10
10
  }
11
11
  function ColDate(options) {
12
- return (0, string_columns_1.ColStr)({ ...options, minLength: 10, maxLength: 10 });
12
+ return (0, string_columns_1.ColStr)({ ...options, maxLength: 10, regex: /^\d{4}-\d{2}-\d{2}$/ }); // yyyy-mm-dd
13
13
  }
14
14
  function ColTime(options) {
15
- return (0, string_columns_1.ColStr)({ ...options, minLength: 5, maxLength: 5 });
15
+ return (0, string_columns_1.ColStr)({ ...options, maxLength: 5, regex: /^\d{2}:\d{2}$/ }); // hh:mm
16
16
  }
@@ -17,6 +17,9 @@ declare global {
17
17
  file?: MulterFile;
18
18
  files?: MulterFile[];
19
19
  }
20
+ type Datetime = Date;
21
+ type DateStr = string;
22
+ type TimeStr = string;
20
23
  type MulterFile = Express.Multer.File;
21
24
  type UploadableImage = string | MulterFile;
22
25
  }
@@ -16,8 +16,8 @@ export declare namespace Val {
16
16
  type LessThan<T extends number = 0> = Val.Num & tags.ExclusiveMaximum<T>;
17
17
  type Bool = boolean;
18
18
  type Datetime = globalThis.Date;
19
- type Date = string & tags.Format<'date'>;
20
- type Time = string & tags.Format<'time'>;
19
+ type Date = Val.Regex<'^\\d{4}-\\d{2}-\\d{2}$'>;
20
+ type Time = Val.Regex<'^\\d{2}:\\d{2}$'>;
21
21
  type Id = Val.Int & Val.GreaterEqual<1>;
22
22
  type IdOptional = Val.Id | 0;
23
23
  type Ids = Val.Id[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.121",
4
+ "version": "3.3.123",
5
5
  "files": [
6
6
  "dist"
7
7
  ],