supa-forge 0.1.1
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/README.md +65 -0
- package/bin/cli.js +116 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.js +79 -0
- package/dist/index.mjs +1364 -0
- package/dist/typeorm.d.ts +26 -0
- package/dist/typeorm.js +1 -0
- package/dist/typeorm.mjs +15 -0
- package/examples/Only CLS/package-lock.json +3140 -0
- package/examples/Only CLS/package.json +25 -0
- package/examples/Only CLS/src/employee.test.ts +109 -0
- package/examples/Only CLS/src/entities/Employee.entity.ts +27 -0
- package/examples/Only CLS/src/index.ts +45 -0
- package/examples/Only CLS/tsconfig.json +17 -0
- package/examples/Only CLS/vite.config.ts +8 -0
- package/examples/Only RLS/package-lock.json +3140 -0
- package/examples/Only RLS/package.json +25 -0
- package/examples/Only RLS/src/entities/Note.entity.ts +40 -0
- package/examples/Only RLS/src/entities/User.entity.ts +29 -0
- package/examples/Only RLS/src/index.ts +51 -0
- package/examples/Only RLS/src/notes.test.ts +123 -0
- package/examples/Only RLS/tsconfig.json +17 -0
- package/examples/Only RLS/vite.config.ts +8 -0
- package/examples/RBAC + CLS + RLS/package-lock.json +3140 -0
- package/examples/RBAC + CLS + RLS/package.json +21 -0
- package/examples/RBAC + CLS + RLS/src/entities/Project.entity.ts +47 -0
- package/examples/RBAC + CLS + RLS/src/entities/User.entity.ts +31 -0
- package/examples/RBAC + CLS + RLS/src/entities/UserRole.entity.ts +110 -0
- package/examples/RBAC + CLS + RLS/src/index.ts +42 -0
- package/examples/RBAC + CLS + RLS/src/project.test.ts +117 -0
- package/examples/RBAC + CLS + RLS/tsconfig.json +17 -0
- package/examples/RBAC + CLS + RLS/vite.config.ts +8 -0
- package/examples/Without Security/package-lock.json +3940 -0
- package/examples/Without Security/package.json +25 -0
- package/examples/Without Security/src/entities/Pharmacy.entity.ts +20 -0
- package/examples/Without Security/src/index.ts +52 -0
- package/examples/Without Security/src/pharmacy.test.ts +104 -0
- package/examples/Without Security/tsconfig.json +17 -0
- package/examples/Without Security/vite.config.ts +8 -0
- package/package.json +72 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced @Check decorator for TypeORM.
|
|
3
|
+
* Supports both class-level and property-level usage.
|
|
4
|
+
*
|
|
5
|
+
* If used on an entity property, it automatically converts it to an entity-level (class-level)
|
|
6
|
+
* check constraint behind the scenes, ensuring TypeORM registers it correctly.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Class level (original functionality)
|
|
10
|
+
* @Check(`"age" > 18`)
|
|
11
|
+
* export class User { ... }
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Property level (newly supported)
|
|
15
|
+
* export class User {
|
|
16
|
+
* @Check(`"age" > 18`)
|
|
17
|
+
* @Column()
|
|
18
|
+
* age: number;
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export declare function check(expressionOrName: string, expression?: string): any;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export * from "typeorm";
|
|
25
|
+
|
|
26
|
+
export { }
|
package/dist/typeorm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("typeorm");function l(e,r){const o=r?c.Check(e,r):c.Check(e);return(t,n)=>{if(n){const u=typeof t=="function"?t:t.constructor;return o(u)}else return o(t)}}exports.check=l;Object.keys(c).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>c[e]})});
|
package/dist/typeorm.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Check as n } from "typeorm";
|
|
2
|
+
export * from "typeorm";
|
|
3
|
+
function i(c, r) {
|
|
4
|
+
const t = r ? n(c, r) : n(c);
|
|
5
|
+
return (o, u) => {
|
|
6
|
+
if (u) {
|
|
7
|
+
const f = typeof o == "function" ? o : o.constructor;
|
|
8
|
+
return t(f);
|
|
9
|
+
} else
|
|
10
|
+
return t(o);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
i as check
|
|
15
|
+
};
|