speedly 1.3.0 → 2.0.5

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.
Files changed (67) hide show
  1. package/dist/cjs/auth/auth2.d.ts +18 -0
  2. package/dist/cjs/auth/auth2.js +93 -0
  3. package/dist/cjs/config/init.d.ts +15 -0
  4. package/dist/cjs/config/init.js +58 -0
  5. package/dist/cjs/db/db.d.ts +65 -67
  6. package/dist/cjs/db/db.js +15 -30
  7. package/dist/cjs/document/index.d.ts +2 -0
  8. package/dist/cjs/document/index.js +7 -0
  9. package/dist/cjs/index.d.ts +3 -53
  10. package/dist/cjs/index.js +7 -22
  11. package/dist/cjs/kit/auth/auth.d.ts +3 -0
  12. package/dist/cjs/kit/auth/auth.js +38 -0
  13. package/dist/cjs/kit/auth/types.d.ts +19 -0
  14. package/dist/cjs/kit/auth/types.js +2 -0
  15. package/dist/cjs/kit/db/db.d.ts +182 -0
  16. package/dist/cjs/kit/db/db.js +594 -0
  17. package/dist/cjs/kit/db/utils.d.ts +3 -0
  18. package/dist/cjs/kit/db/utils.js +15 -0
  19. package/dist/cjs/kit/index.d.ts +5 -0
  20. package/dist/cjs/kit/index.js +14 -0
  21. package/dist/cjs/kit/uploader/uploader.d.ts +24 -0
  22. package/dist/cjs/kit/uploader/uploader.js +148 -0
  23. package/dist/cjs/kit/validator/validator.d.ts +9 -0
  24. package/dist/cjs/kit/validator/validator.js +36 -0
  25. package/dist/cjs/model/index.d.ts +2 -0
  26. package/dist/cjs/model/index.js +8 -0
  27. package/dist/cjs/model/translation.d.ts +24 -6
  28. package/dist/cjs/modules/index.d.ts +2 -0
  29. package/dist/cjs/modules/index.js +8 -0
  30. package/dist/cjs/modules/translation/translation.routes.js +12 -8
  31. package/dist/cjs/util/index.d.ts +2 -0
  32. package/dist/cjs/util/index.js +8 -0
  33. package/dist/cjs/util/makeOptional.js +17 -7
  34. package/dist/cjs/yup.config.d.ts +2 -0
  35. package/dist/cjs/yup.config.js +24 -0
  36. package/dist/esm/config/init.d.ts +15 -0
  37. package/dist/esm/config/init.js +58 -0
  38. package/dist/esm/db/db.d.ts +65 -67
  39. package/dist/esm/db/db.js +15 -30
  40. package/dist/esm/document/index.d.ts +2 -0
  41. package/dist/esm/document/index.js +7 -0
  42. package/dist/esm/index.d.ts +3 -53
  43. package/dist/esm/index.js +7 -22
  44. package/dist/esm/kit/auth/auth.d.ts +3 -0
  45. package/dist/esm/kit/auth/auth.js +38 -0
  46. package/dist/esm/kit/auth/types.d.ts +19 -0
  47. package/dist/esm/kit/auth/types.js +2 -0
  48. package/dist/esm/kit/db/db.d.ts +182 -0
  49. package/dist/esm/kit/db/db.js +594 -0
  50. package/dist/esm/kit/db/utils.d.ts +3 -0
  51. package/dist/esm/kit/db/utils.js +15 -0
  52. package/dist/esm/kit/index.d.ts +5 -0
  53. package/dist/esm/kit/index.js +14 -0
  54. package/dist/esm/kit/uploader/uploader.d.ts +24 -0
  55. package/dist/esm/kit/uploader/uploader.js +148 -0
  56. package/dist/esm/kit/validator/validator.d.ts +9 -0
  57. package/dist/esm/kit/validator/validator.js +36 -0
  58. package/dist/esm/model/index.d.ts +2 -0
  59. package/dist/esm/model/index.js +8 -0
  60. package/dist/esm/model/translation.d.ts +24 -6
  61. package/dist/esm/modules/index.d.ts +2 -0
  62. package/dist/esm/modules/index.js +8 -0
  63. package/dist/esm/modules/translation/translation.routes.js +12 -8
  64. package/dist/esm/util/index.d.ts +2 -0
  65. package/dist/esm/util/index.js +8 -0
  66. package/dist/esm/util/makeOptional.js +17 -7
  67. package/package.json +1 -1
@@ -0,0 +1,182 @@
1
+ import { Request, Response, NextFunction } from "express";
2
+ declare module "express-serve-static-core" {
3
+ interface Request {
4
+ document?: any;
5
+ user?: any;
6
+ }
7
+ interface Response {
8
+ logger?: (message: string, details?: any) => void;
9
+ success?: (statusCode: number, body: any) => void;
10
+ }
11
+ }
12
+ type ConfigsType = {
13
+ dbType?: string;
14
+ path?: string;
15
+ dbEnv?: string;
16
+ type: "internal" | "external";
17
+ pagination?: {
18
+ quantity?: number;
19
+ detailed?: boolean;
20
+ [key: string]: unknown;
21
+ };
22
+ [key: string]: unknown;
23
+ };
24
+ declare const db: (collectionName: string, config?: ConfigsType) => {
25
+ find: (match?: {}) => {
26
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
27
+ select(value: string | {
28
+ [key: string]: -1 | 1;
29
+ }): /*elided*/ any;
30
+ sort(value: string | {
31
+ [key: string]: -1 | 1;
32
+ }): /*elided*/ any;
33
+ skip(value: number): /*elided*/ any;
34
+ limit(value: number): /*elided*/ any;
35
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
36
+ };
37
+ create: (body?: {}) => {
38
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
39
+ select(value: string | {
40
+ [key: string]: -1 | 1;
41
+ }): /*elided*/ any;
42
+ sort(value: string | {
43
+ [key: string]: -1 | 1;
44
+ }): /*elided*/ any;
45
+ skip(value: number): /*elided*/ any;
46
+ limit(value: number): /*elided*/ any;
47
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
48
+ };
49
+ updateOne: (match?: {}, body?: {}) => {
50
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
51
+ select(value: string | {
52
+ [key: string]: -1 | 1;
53
+ }): /*elided*/ any;
54
+ sort(value: string | {
55
+ [key: string]: -1 | 1;
56
+ }): /*elided*/ any;
57
+ skip(value: number): /*elided*/ any;
58
+ limit(value: number): /*elided*/ any;
59
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
60
+ };
61
+ updateMany: (match?: {}, body?: {}) => {
62
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
63
+ select(value: string | {
64
+ [key: string]: -1 | 1;
65
+ }): /*elided*/ any;
66
+ sort(value: string | {
67
+ [key: string]: -1 | 1;
68
+ }): /*elided*/ any;
69
+ skip(value: number): /*elided*/ any;
70
+ limit(value: number): /*elided*/ any;
71
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
72
+ };
73
+ deleteOne: (match?: {}) => {
74
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
75
+ select(value: string | {
76
+ [key: string]: -1 | 1;
77
+ }): /*elided*/ any;
78
+ sort(value: string | {
79
+ [key: string]: -1 | 1;
80
+ }): /*elided*/ any;
81
+ skip(value: number): /*elided*/ any;
82
+ limit(value: number): /*elided*/ any;
83
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
84
+ };
85
+ deleteMany: (match?: {}) => {
86
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
87
+ select(value: string | {
88
+ [key: string]: -1 | 1;
89
+ }): /*elided*/ any;
90
+ sort(value: string | {
91
+ [key: string]: -1 | 1;
92
+ }): /*elided*/ any;
93
+ skip(value: number): /*elided*/ any;
94
+ limit(value: number): /*elided*/ any;
95
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
96
+ };
97
+ findOne: (match?: {}) => {
98
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
99
+ select(value: string | {
100
+ [key: string]: -1 | 1;
101
+ }): /*elided*/ any;
102
+ sort(value: string | {
103
+ [key: string]: -1 | 1;
104
+ }): /*elided*/ any;
105
+ skip(value: number): /*elided*/ any;
106
+ limit(value: number): /*elided*/ any;
107
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
108
+ };
109
+ findOneAndUpdate: (match?: {}, body?: {}) => {
110
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
111
+ select(value: string | {
112
+ [key: string]: -1 | 1;
113
+ }): /*elided*/ any;
114
+ sort(value: string | {
115
+ [key: string]: -1 | 1;
116
+ }): /*elided*/ any;
117
+ skip(value: number): /*elided*/ any;
118
+ limit(value: number): /*elided*/ any;
119
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
120
+ };
121
+ aggregate: (pipeline?: never[]) => {
122
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
123
+ select(value: string | {
124
+ [key: string]: -1 | 1;
125
+ }): /*elided*/ any;
126
+ sort(value: string | {
127
+ [key: string]: -1 | 1;
128
+ }): /*elided*/ any;
129
+ skip(value: number): /*elided*/ any;
130
+ limit(value: number): /*elided*/ any;
131
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
132
+ };
133
+ findOneAndDelete: (match?: {}) => {
134
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
135
+ select(value: string | {
136
+ [key: string]: -1 | 1;
137
+ }): /*elided*/ any;
138
+ sort(value: string | {
139
+ [key: string]: -1 | 1;
140
+ }): /*elided*/ any;
141
+ skip(value: number): /*elided*/ any;
142
+ limit(value: number): /*elided*/ any;
143
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
144
+ };
145
+ findById: (id?: string) => {
146
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
147
+ select(value: string | {
148
+ [key: string]: -1 | 1;
149
+ }): /*elided*/ any;
150
+ sort(value: string | {
151
+ [key: string]: -1 | 1;
152
+ }): /*elided*/ any;
153
+ skip(value: number): /*elided*/ any;
154
+ limit(value: number): /*elided*/ any;
155
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
156
+ };
157
+ findByIdAndUpdate: (id?: string, body?: {}) => {
158
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
159
+ select(value: string | {
160
+ [key: string]: -1 | 1;
161
+ }): /*elided*/ any;
162
+ sort(value: string | {
163
+ [key: string]: -1 | 1;
164
+ }): /*elided*/ any;
165
+ skip(value: number): /*elided*/ any;
166
+ limit(value: number): /*elided*/ any;
167
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
168
+ };
169
+ findByIdAndDelete: (id?: string) => {
170
+ (req: Request, res: Response, next: NextFunction): Promise<void>;
171
+ select(value: string | {
172
+ [key: string]: -1 | 1;
173
+ }): /*elided*/ any;
174
+ sort(value: string | {
175
+ [key: string]: -1 | 1;
176
+ }): /*elided*/ any;
177
+ skip(value: number): /*elided*/ any;
178
+ limit(value: number): /*elided*/ any;
179
+ populate(value: string | object | (string | object)[]): /*elided*/ any;
180
+ };
181
+ } | undefined;
182
+ export default db;