@ruiapp/rapid-core 0.1.2 → 0.1.4
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/dist/bootstrapApplicationConfig.d.ts +289 -2
- package/dist/core/http/formDataParser.d.ts +22 -0
- package/dist/core/providers/runtimeProvider.d.ts +4 -0
- package/dist/core/routeContext.d.ts +0 -1
- package/dist/deno-std/encoding/base64.d.ts +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +492 -147
- package/dist/plugins/authManager/routes/getMyProfile.d.ts +11 -2
- package/dist/plugins/authManager/routes/index.d.ts +21 -1
- package/dist/plugins/authManager/routes/signin.d.ts +11 -2
- package/dist/plugins/authManager/routes/signout.d.ts +11 -2
- package/dist/plugins/fileManager/httpHandlers/downloadDocument.d.ts +4 -0
- package/dist/plugins/fileManager/httpHandlers/downloadFile.d.ts +4 -0
- package/dist/plugins/fileManager/httpHandlers/uploadFile.d.ts +4 -0
- package/dist/plugins/fileManager/mod.d.ts +15 -0
- package/dist/types.d.ts +2 -2
- package/dist/utilities/fsUtility.d.ts +6 -0
- package/dist/utilities/jwtUtility.d.ts +5 -8
- package/package.json +5 -3
- package/src/bootstrapApplicationConfig.ts +5 -5
- package/src/core/http/formDataParser.ts +101 -0
- package/src/core/pluginManager.ts +2 -0
- package/src/core/providers/runtimeProvider.ts +5 -0
- package/src/core/request.ts +2 -1
- package/src/core/routeContext.ts +0 -1
- package/src/core/routesBuilder.ts +3 -15
- package/src/deno-std/encoding/base64.ts +145 -0
- package/src/index.ts +2 -0
- package/src/plugins/authManager/httpHandlers/createSession.ts +4 -3
- package/src/plugins/authManager/routes/getMyProfile.ts +2 -2
- package/src/plugins/authManager/routes/signin.ts +2 -2
- package/src/plugins/authManager/routes/signout.ts +2 -2
- package/src/plugins/dataManager/httpHandlers/addEntityRelations.ts +0 -2
- package/src/plugins/dataManager/mod.ts +9 -9
- package/src/plugins/fileManager/httpHandlers/downloadDocument.ts +40 -0
- package/src/plugins/fileManager/httpHandlers/downloadFile.ts +32 -0
- package/src/plugins/fileManager/httpHandlers/uploadFile.ts +37 -0
- package/src/plugins/fileManager/mod.ts +48 -0
- package/src/server.ts +0 -1
- package/src/types.ts +2 -2
- package/src/utilities/fsUtility.ts +62 -0
- package/src/utilities/jwtUtility.ts +22 -8
|
@@ -1,3 +1,290 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const _default: {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
models: ({
|
|
5
|
+
maintainedBy: string;
|
|
6
|
+
namespace: string;
|
|
7
|
+
name: string;
|
|
8
|
+
singularCode: string;
|
|
9
|
+
pluralCode: string;
|
|
10
|
+
schema: string;
|
|
11
|
+
tableName: string;
|
|
12
|
+
properties: ({
|
|
13
|
+
name: string;
|
|
14
|
+
code: string;
|
|
15
|
+
columnName: string;
|
|
16
|
+
type: "integer";
|
|
17
|
+
required: true;
|
|
18
|
+
autoIncrement: true;
|
|
19
|
+
relation?: undefined;
|
|
20
|
+
targetSingularCode?: undefined;
|
|
21
|
+
targetIdColumnName?: undefined;
|
|
22
|
+
defaultValue?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
code: string;
|
|
26
|
+
type: "relation";
|
|
27
|
+
required: true;
|
|
28
|
+
relation: "one";
|
|
29
|
+
targetSingularCode: string;
|
|
30
|
+
targetIdColumnName: string;
|
|
31
|
+
columnName?: undefined;
|
|
32
|
+
autoIncrement?: undefined;
|
|
33
|
+
defaultValue?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
name: string;
|
|
36
|
+
code: string;
|
|
37
|
+
columnName: string;
|
|
38
|
+
type: "text";
|
|
39
|
+
required: true;
|
|
40
|
+
autoIncrement?: undefined;
|
|
41
|
+
relation?: undefined;
|
|
42
|
+
targetSingularCode?: undefined;
|
|
43
|
+
targetIdColumnName?: undefined;
|
|
44
|
+
defaultValue?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
name: string;
|
|
47
|
+
code: string;
|
|
48
|
+
columnName: string;
|
|
49
|
+
type: "text";
|
|
50
|
+
required: false;
|
|
51
|
+
autoIncrement?: undefined;
|
|
52
|
+
relation?: undefined;
|
|
53
|
+
targetSingularCode?: undefined;
|
|
54
|
+
targetIdColumnName?: undefined;
|
|
55
|
+
defaultValue?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
name: string;
|
|
58
|
+
code: string;
|
|
59
|
+
columnName: string;
|
|
60
|
+
type: "boolean";
|
|
61
|
+
required: true;
|
|
62
|
+
defaultValue: string;
|
|
63
|
+
autoIncrement?: undefined;
|
|
64
|
+
relation?: undefined;
|
|
65
|
+
targetSingularCode?: undefined;
|
|
66
|
+
targetIdColumnName?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
code: string;
|
|
70
|
+
columnName: string;
|
|
71
|
+
type: "json";
|
|
72
|
+
required: false;
|
|
73
|
+
autoIncrement?: undefined;
|
|
74
|
+
relation?: undefined;
|
|
75
|
+
targetSingularCode?: undefined;
|
|
76
|
+
targetIdColumnName?: undefined;
|
|
77
|
+
defaultValue?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
code: string;
|
|
81
|
+
columnName: string;
|
|
82
|
+
type: "integer";
|
|
83
|
+
required: false;
|
|
84
|
+
autoIncrement?: undefined;
|
|
85
|
+
relation?: undefined;
|
|
86
|
+
targetSingularCode?: undefined;
|
|
87
|
+
targetIdColumnName?: undefined;
|
|
88
|
+
defaultValue?: undefined;
|
|
89
|
+
})[];
|
|
90
|
+
} | {
|
|
91
|
+
maintainedBy: string;
|
|
92
|
+
namespace: string;
|
|
93
|
+
name: string;
|
|
94
|
+
singularCode: string;
|
|
95
|
+
pluralCode: string;
|
|
96
|
+
schema: string;
|
|
97
|
+
tableName: string;
|
|
98
|
+
properties: ({
|
|
99
|
+
name: string;
|
|
100
|
+
code: string;
|
|
101
|
+
columnName: string;
|
|
102
|
+
type: "integer";
|
|
103
|
+
required: true;
|
|
104
|
+
autoIncrement: true;
|
|
105
|
+
defaultValue?: undefined;
|
|
106
|
+
relation?: undefined;
|
|
107
|
+
targetSingularCode?: undefined;
|
|
108
|
+
selfIdColumnName?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
name: string;
|
|
111
|
+
code: string;
|
|
112
|
+
columnName: string;
|
|
113
|
+
type: "text";
|
|
114
|
+
required: true;
|
|
115
|
+
autoIncrement?: undefined;
|
|
116
|
+
defaultValue?: undefined;
|
|
117
|
+
relation?: undefined;
|
|
118
|
+
targetSingularCode?: undefined;
|
|
119
|
+
selfIdColumnName?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
name: string;
|
|
122
|
+
code: string;
|
|
123
|
+
columnName: string;
|
|
124
|
+
type: "text";
|
|
125
|
+
required: false;
|
|
126
|
+
defaultValue: string;
|
|
127
|
+
autoIncrement?: undefined;
|
|
128
|
+
relation?: undefined;
|
|
129
|
+
targetSingularCode?: undefined;
|
|
130
|
+
selfIdColumnName?: undefined;
|
|
131
|
+
} | {
|
|
132
|
+
name: string;
|
|
133
|
+
code: string;
|
|
134
|
+
columnName: string;
|
|
135
|
+
type: "text";
|
|
136
|
+
required: false;
|
|
137
|
+
autoIncrement?: undefined;
|
|
138
|
+
defaultValue?: undefined;
|
|
139
|
+
relation?: undefined;
|
|
140
|
+
targetSingularCode?: undefined;
|
|
141
|
+
selfIdColumnName?: undefined;
|
|
142
|
+
} | {
|
|
143
|
+
name: string;
|
|
144
|
+
code: string;
|
|
145
|
+
columnName: string;
|
|
146
|
+
type: "json";
|
|
147
|
+
required: false;
|
|
148
|
+
autoIncrement?: undefined;
|
|
149
|
+
defaultValue?: undefined;
|
|
150
|
+
relation?: undefined;
|
|
151
|
+
targetSingularCode?: undefined;
|
|
152
|
+
selfIdColumnName?: undefined;
|
|
153
|
+
} | {
|
|
154
|
+
name: string;
|
|
155
|
+
code: string;
|
|
156
|
+
type: "relation[]";
|
|
157
|
+
relation: "many";
|
|
158
|
+
targetSingularCode: string;
|
|
159
|
+
selfIdColumnName: string;
|
|
160
|
+
columnName?: undefined;
|
|
161
|
+
required?: undefined;
|
|
162
|
+
autoIncrement?: undefined;
|
|
163
|
+
defaultValue?: undefined;
|
|
164
|
+
})[];
|
|
165
|
+
} | {
|
|
166
|
+
maintainedBy: string;
|
|
167
|
+
namespace: string;
|
|
168
|
+
name: string;
|
|
169
|
+
singularCode: string;
|
|
170
|
+
pluralCode: string;
|
|
171
|
+
schema: string;
|
|
172
|
+
tableName: string;
|
|
173
|
+
properties: ({
|
|
174
|
+
name: string;
|
|
175
|
+
code: string;
|
|
176
|
+
columnName: string;
|
|
177
|
+
type: "integer";
|
|
178
|
+
required: true;
|
|
179
|
+
autoIncrement: true;
|
|
180
|
+
relation?: undefined;
|
|
181
|
+
targetSingularCode?: undefined;
|
|
182
|
+
targetIdColumnName?: undefined;
|
|
183
|
+
defaultValue?: undefined;
|
|
184
|
+
} | {
|
|
185
|
+
name: string;
|
|
186
|
+
code: string;
|
|
187
|
+
type: "relation";
|
|
188
|
+
relation: "one";
|
|
189
|
+
targetSingularCode: string;
|
|
190
|
+
targetIdColumnName: string;
|
|
191
|
+
columnName?: undefined;
|
|
192
|
+
required?: undefined;
|
|
193
|
+
autoIncrement?: undefined;
|
|
194
|
+
defaultValue?: undefined;
|
|
195
|
+
} | {
|
|
196
|
+
name: string;
|
|
197
|
+
code: string;
|
|
198
|
+
columnName: string;
|
|
199
|
+
type: "integer";
|
|
200
|
+
required: true;
|
|
201
|
+
defaultValue: string;
|
|
202
|
+
autoIncrement?: undefined;
|
|
203
|
+
relation?: undefined;
|
|
204
|
+
targetSingularCode?: undefined;
|
|
205
|
+
targetIdColumnName?: undefined;
|
|
206
|
+
} | {
|
|
207
|
+
name: string;
|
|
208
|
+
code: string;
|
|
209
|
+
columnName: string;
|
|
210
|
+
type: "text";
|
|
211
|
+
required: true;
|
|
212
|
+
autoIncrement?: undefined;
|
|
213
|
+
relation?: undefined;
|
|
214
|
+
targetSingularCode?: undefined;
|
|
215
|
+
targetIdColumnName?: undefined;
|
|
216
|
+
defaultValue?: undefined;
|
|
217
|
+
} | {
|
|
218
|
+
name: string;
|
|
219
|
+
code: string;
|
|
220
|
+
columnName: string;
|
|
221
|
+
type: "text";
|
|
222
|
+
required: false;
|
|
223
|
+
autoIncrement?: undefined;
|
|
224
|
+
relation?: undefined;
|
|
225
|
+
targetSingularCode?: undefined;
|
|
226
|
+
targetIdColumnName?: undefined;
|
|
227
|
+
defaultValue?: undefined;
|
|
228
|
+
} | {
|
|
229
|
+
name: string;
|
|
230
|
+
code: string;
|
|
231
|
+
columnName: string;
|
|
232
|
+
type: "boolean";
|
|
233
|
+
required: false;
|
|
234
|
+
autoIncrement?: undefined;
|
|
235
|
+
relation?: undefined;
|
|
236
|
+
targetSingularCode?: undefined;
|
|
237
|
+
targetIdColumnName?: undefined;
|
|
238
|
+
defaultValue?: undefined;
|
|
239
|
+
})[];
|
|
240
|
+
} | {
|
|
241
|
+
maintainedBy: string;
|
|
242
|
+
namespace: string;
|
|
243
|
+
name: string;
|
|
244
|
+
singularCode: string;
|
|
245
|
+
pluralCode: string;
|
|
246
|
+
schema: string;
|
|
247
|
+
tableName: string;
|
|
248
|
+
properties: ({
|
|
249
|
+
name: string;
|
|
250
|
+
code: string;
|
|
251
|
+
columnName: string;
|
|
252
|
+
type: "integer";
|
|
253
|
+
required: true;
|
|
254
|
+
autoIncrement: true;
|
|
255
|
+
} | {
|
|
256
|
+
name: string;
|
|
257
|
+
code: string;
|
|
258
|
+
columnName: string;
|
|
259
|
+
type: "text";
|
|
260
|
+
required: true;
|
|
261
|
+
autoIncrement?: undefined;
|
|
262
|
+
} | {
|
|
263
|
+
name: string;
|
|
264
|
+
code: string;
|
|
265
|
+
columnName: string;
|
|
266
|
+
type: "text";
|
|
267
|
+
required: false;
|
|
268
|
+
autoIncrement?: undefined;
|
|
269
|
+
} | {
|
|
270
|
+
name: string;
|
|
271
|
+
code: string;
|
|
272
|
+
columnName: string;
|
|
273
|
+
type: "json";
|
|
274
|
+
required: true;
|
|
275
|
+
autoIncrement?: undefined;
|
|
276
|
+
})[];
|
|
277
|
+
})[];
|
|
278
|
+
routes: {
|
|
279
|
+
namespace: string;
|
|
280
|
+
name: string;
|
|
281
|
+
code: string;
|
|
282
|
+
type: "RESTful";
|
|
283
|
+
method: "GET";
|
|
284
|
+
endpoint: string;
|
|
285
|
+
handlers: {
|
|
286
|
+
code: string;
|
|
287
|
+
}[];
|
|
288
|
+
}[];
|
|
289
|
+
};
|
|
3
290
|
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type BodyData = Record<string, string | File | (string | File)[]>;
|
|
2
|
+
export type ParseBodyOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Parse all fields with multiple values should be parsed as an array.
|
|
5
|
+
* @default false
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const data = new FormData()
|
|
9
|
+
* data.append('file', 'aaa')
|
|
10
|
+
* data.append('file', 'bbb')
|
|
11
|
+
* data.append('message', 'hello')
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* If `all` is `false`:
|
|
15
|
+
* parseBody should return `{ file: 'bbb', message: 'hello' }`
|
|
16
|
+
*
|
|
17
|
+
* If `all` is `true`:
|
|
18
|
+
* parseBody should return `{ file: ['aaa', 'bbb'], message: 'hello' }`
|
|
19
|
+
*/
|
|
20
|
+
all?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const parseFormDataBody: <T extends BodyData = BodyData>(request: Request, options?: ParseBodyOptions) => Promise<T>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
3
|
+
* Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function encode(data: ArrayBuffer | string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Decodes a given RFC4648 base64 encoded string
|
|
9
|
+
* @param b64
|
|
10
|
+
*/
|
|
11
|
+
export declare function decode(b64: string): Uint8Array;
|
package/dist/index.d.ts
CHANGED