@airoom/nextmin-node 0.1.3 → 0.1.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.
- package/LICENSE +18 -46
- package/dist/api/apiRouter.d.ts +8 -24
- package/dist/api/apiRouter.js +126 -1251
- package/dist/api/router/ctx.d.ts +25 -0
- package/dist/api/router/ctx.js +2 -0
- package/dist/api/router/mountCrudRoutes.d.ts +2 -0
- package/dist/api/router/mountCrudRoutes.js +754 -0
- package/dist/api/router/mountFindRoutes.d.ts +2 -0
- package/dist/api/router/mountFindRoutes.js +205 -0
- package/dist/api/router/setupAuthRoutes.d.ts +2 -0
- package/dist/api/router/setupAuthRoutes.js +247 -0
- package/dist/api/router/setupFileRoutes.d.ts +2 -0
- package/dist/api/router/setupFileRoutes.js +85 -0
- package/dist/api/router/utils.d.ts +63 -0
- package/dist/api/router/utils.js +247 -0
- package/dist/database/MongoAdapter.d.ts +1 -1
- package/dist/database/MongoAdapter.js +33 -32
- package/dist/schemas/Roles.json +7 -2
- package/dist/utils/DefaultDataInitializer.js +3 -0
- package/dist/utils/SchemaLoader.js +55 -11
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,49 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2025 GSCodes
|
|
4
|
-
All rights reserved.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
4. Ownership
|
|
25
|
-
The Software is licensed, not sold. Licensor retains all right, title, and interest in and to the Software, including all intellectual property rights and all copies.
|
|
26
|
-
|
|
27
|
-
5. Confidentiality
|
|
28
|
-
The Software and any non-public information provided by Licensor shall be treated as confidential and not disclosed to any third party without Licensor’s prior written consent, except as required by law.
|
|
29
|
-
|
|
30
|
-
6. Term and Termination
|
|
31
|
-
This License is effective until terminated. Licensor may terminate this License immediately upon notice if Licensee breaches any term. Upon termination, Licensee must cease all use and destroy all copies of the Software. Sections 3–10 survive termination.
|
|
32
|
-
|
|
33
|
-
7. Updates; No Support Obligation
|
|
34
|
-
Licensor may, but is not obligated to, provide updates, bug fixes, or support. Any updates are governed by this License unless accompanied by a different license.
|
|
35
|
-
|
|
36
|
-
8. No Warranty
|
|
37
|
-
THE SOFTWARE IS PROVIDED “AS IS” AND “AS AVAILABLE,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. USE IS AT LICENSEE’S SOLE RISK.
|
|
38
|
-
|
|
39
|
-
9. Limitation of Liability
|
|
40
|
-
TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL, OR BUSINESS INTERRUPTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LICENSOR’S TOTAL LIABILITY FOR ALL CLAIMS SHALL NOT EXCEED THE AMOUNT PAID BY LICENSEE FOR THE SOFTWARE (IF ANY) IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM.
|
|
41
|
-
|
|
42
|
-
10. Governing Law; Venue
|
|
43
|
-
This License is governed by the laws of State of California, USA, without regard to its conflict of laws principles. The parties submit to the exclusive jurisdiction and venue of the courts located in San Francisco County, California, USA.
|
|
44
|
-
|
|
45
|
-
11. Commercial Licensing
|
|
46
|
-
For commercial use, redistribution, or other rights not expressly granted, contact: tareqaziz0065@gmail.com.
|
|
47
|
-
|
|
48
|
-
12. Entire Agreement
|
|
49
|
-
This License constitutes the entire agreement with respect to the Software and supersedes all prior or contemporaneous agreements or understandings on the subject matter.
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/api/apiRouter.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import express from
|
|
2
|
-
import type { Server as HttpServer } from
|
|
3
|
-
import { DatabaseAdapter } from
|
|
4
|
-
import type { FileStorageAdapter } from
|
|
1
|
+
import express from "express";
|
|
2
|
+
import type { Server as HttpServer } from "http";
|
|
3
|
+
import { DatabaseAdapter } from "../database/DatabaseAdapter";
|
|
4
|
+
import type { FileStorageAdapter } from "../files/FileStorageAdapter";
|
|
5
5
|
export interface APIRouterOptions {
|
|
6
6
|
dbAdapter: DatabaseAdapter;
|
|
7
7
|
server?: HttpServer;
|
|
@@ -31,35 +31,19 @@ export declare class APIRouter {
|
|
|
31
31
|
private rebuildModels;
|
|
32
32
|
private mountSchemasEndpointOnce;
|
|
33
33
|
private mountRoutes;
|
|
34
|
+
private mountFindRoutes;
|
|
35
|
+
private createCtx;
|
|
34
36
|
private getSchema;
|
|
35
37
|
private getModel;
|
|
36
|
-
private setupRoutes;
|
|
37
|
-
private mountFindRoutes;
|
|
38
|
-
private fileAuthMiddleware;
|
|
39
|
-
/** Mount generic file endpoints under this router */
|
|
40
|
-
private setupFileRoutes;
|
|
41
|
-
/** uploads/YYYY/MM/DD */
|
|
42
|
-
private shortFolder;
|
|
43
|
-
/** small, URL-safe uid */
|
|
44
|
-
private shortUid;
|
|
45
|
-
private normalizeAttrType;
|
|
46
38
|
private optionalAuthMiddleware;
|
|
47
39
|
private pickAuthFor;
|
|
48
40
|
private getUserRoleFromReq;
|
|
49
41
|
private normalizeRoleName;
|
|
50
|
-
private
|
|
51
|
-
|
|
52
|
-
* Validate required fields.
|
|
53
|
-
* - create: field must exist and be non-empty (not null/undefined/'').
|
|
54
|
-
* - update: only validate fields that are explicitly present in the payload;
|
|
55
|
-
* absence means "unchanged".
|
|
56
|
-
*/
|
|
42
|
+
private apiKeyMiddleware;
|
|
43
|
+
private authenticateMiddleware;
|
|
57
44
|
private validateRequiredFields;
|
|
58
45
|
private handleWriteError;
|
|
59
46
|
private setupNotFoundMiddleware;
|
|
60
47
|
private ensureNotFoundLast;
|
|
61
|
-
private apiKeyMiddleware;
|
|
62
|
-
private validateRoleValue;
|
|
63
|
-
private authenticateMiddleware;
|
|
64
48
|
private checkUniqueFields;
|
|
65
49
|
}
|