equipped 4.0.0-alpha.7 → 4.0.0-alpha.9

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [4.0.0-alpha.9](https://github.com/kevinand11/equipped/compare/v4.0.0-alpha.8...v4.0.0-alpha.9) (2023-02-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * remove file type from validation ([5511b44](https://github.com/kevinand11/equipped/commit/5511b447a2d80af6cd65af7d222ea1b9126d3bc5))
11
+
12
+ ## [4.0.0-alpha.8](https://github.com/kevinand11/equipped/compare/v4.0.0-alpha.7...v4.0.0-alpha.8) (2023-02-14)
13
+
14
+
15
+ ### Features
16
+
17
+ * add isNotTruncated to file types ([4d013e1](https://github.com/kevinand11/equipped/commit/4d013e142301df7e98bbe96a8bf18d5fc3a10dc6))
18
+
5
19
  ## [4.0.0-alpha.7](https://github.com/kevinand11/equipped/compare/v4.0.0-alpha.6...v4.0.0-alpha.7) (2023-02-14)
6
20
 
7
21
 
@@ -101,10 +101,10 @@ export declare const Validation: {
101
101
  videoMimeTypes: string[];
102
102
  audioMimeTypes: string[];
103
103
  imageMimeTypes: string[];
104
- isImage: (error?: string | undefined) => Validate.Rule<Validate.File>;
105
- isAudio: (error?: string | undefined) => Validate.Rule<Validate.File>;
106
- isVideo: (error?: string | undefined) => Validate.Rule<Validate.File>;
107
- isFile: (error?: string | undefined) => Validate.Rule<Validate.File>;
104
+ isImage: (error?: string | undefined) => Validate.Rule<any>;
105
+ isAudio: (error?: string | undefined) => Validate.Rule<any>;
106
+ isVideo: (error?: string | undefined) => Validate.Rule<any>;
107
+ isFile: (error?: string | undefined) => Validate.Rule<any>;
108
108
  isTuple: <T_6 extends readonly ((v: any, idx: number) => boolean)[]>(comparer: readonly [...T_6], error?: string | undefined) => Validate.Rule<{ [K in keyof T_6]: T_6[K] extends (v: infer V, idx: number) => boolean ? V : never; }>;
109
109
  isRecord: <V_1>(com: (cur: V_1) => boolean, error?: string | undefined) => Validate.Rule<Record<string, V_1>>;
110
110
  isMap: <K_1, V_2>(kCom: (cur: K_1) => boolean, vCom: (cur: V_2) => boolean, error?: string | undefined) => Validate.Rule<Map<K_1, V_2>>;
@@ -144,8 +144,4 @@ export declare const Hash: {
144
144
  hash: (password: string) => Promise<string>;
145
145
  compare: (plainPassword: string, hashed: string) => Promise<boolean>;
146
146
  };
147
- declare module 'valleyed/lib/rules/files' {
148
- interface File extends StorageFile {
149
- }
150
- }
151
147
  export {};
@@ -47,6 +47,8 @@ const isValidPhone = (error) => Validate.makeRule((value) => {
47
47
  return Validate.isInvalid([error ?? 'invalid phone number'], phone);
48
48
  return Validate.isValid(phone);
49
49
  });
50
+ const file = Validate.v.file;
51
+ Validate.v.file = (...args) => file(...args).addRule(isNotTruncated());
50
52
  exports.Schema = Validate.v;
51
53
  exports.Validation = { ...Validate, isNotTruncated, isValidPhone };
52
54
  const validate = (data, rules) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "equipped",
3
- "version": "4.0.0-alpha.7",
3
+ "version": "4.0.0-alpha.9",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "lib/index.js",
@@ -57,7 +57,7 @@
57
57
  "pug": "^3.0.2",
58
58
  "redis": "^4.6.4",
59
59
  "socket.io": "4.6.0",
60
- "valleyed": "^4.0.4-alpha.1"
60
+ "valleyed": "^4.0.4-alpha.2"
61
61
  },
62
62
  "repository": {
63
63
  "url": "git://github.com/kevinand11/equipped.git"