@etohq/rbac 1.5.1-alpha.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +63 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +13 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/loaders/initial-data.d.ts +4 -0
  7. package/dist/loaders/initial-data.d.ts.map +1 -0
  8. package/dist/loaders/initial-data.js +27 -0
  9. package/dist/loaders/initial-data.js.map +1 -0
  10. package/dist/migrations/Migration20251219163509.d.ts +5 -0
  11. package/dist/migrations/Migration20251219163509.d.ts.map +1 -0
  12. package/dist/migrations/Migration20251219163509.js +36 -0
  13. package/dist/migrations/Migration20251219163509.js.map +1 -0
  14. package/dist/models/index.d.ts +5 -0
  15. package/dist/models/index.d.ts.map +1 -0
  16. package/dist/models/index.js +15 -0
  17. package/dist/models/index.js.map +1 -0
  18. package/dist/models/rbac-policy.d.ts +11 -0
  19. package/dist/models/rbac-policy.d.ts.map +1 -0
  20. package/dist/models/rbac-policy.js +30 -0
  21. package/dist/models/rbac-policy.js.map +1 -0
  22. package/dist/models/rbac-role-inheritance.d.ts +58 -0
  23. package/dist/models/rbac-role-inheritance.d.ts.map +1 -0
  24. package/dist/models/rbac-role-inheritance.js +33 -0
  25. package/dist/models/rbac-role-inheritance.js.map +1 -0
  26. package/dist/models/rbac-role-parent.d.ts +48 -0
  27. package/dist/models/rbac-role-parent.d.ts.map +1 -0
  28. package/dist/models/rbac-role-parent.js +31 -0
  29. package/dist/models/rbac-role-parent.js.map +1 -0
  30. package/dist/models/rbac-role-policy.d.ts +28 -0
  31. package/dist/models/rbac-role-policy.d.ts.map +1 -0
  32. package/dist/models/rbac-role-policy.js +32 -0
  33. package/dist/models/rbac-role-policy.js.map +1 -0
  34. package/dist/models/rbac-role.d.ts +28 -0
  35. package/dist/models/rbac-role.d.ts.map +1 -0
  36. package/dist/models/rbac-role.js +30 -0
  37. package/dist/models/rbac-role.js.map +1 -0
  38. package/dist/repositories/index.d.ts +2 -0
  39. package/dist/repositories/index.d.ts.map +1 -0
  40. package/dist/repositories/index.js +18 -0
  41. package/dist/repositories/index.js.map +1 -0
  42. package/dist/repositories/rbac.d.ts +9 -0
  43. package/dist/repositories/rbac.d.ts.map +1 -0
  44. package/dist/repositories/rbac.js +101 -0
  45. package/dist/repositories/rbac.js.map +1 -0
  46. package/dist/services/index.d.ts +2 -0
  47. package/dist/services/index.d.ts.map +1 -0
  48. package/dist/services/index.js +9 -0
  49. package/dist/services/index.js.map +1 -0
  50. package/dist/services/rbac-module-service.d.ts +142 -0
  51. package/dist/services/rbac-module-service.d.ts.map +1 -0
  52. package/dist/services/rbac-module-service.js +201 -0
  53. package/dist/services/rbac-module-service.js.map +1 -0
  54. package/dist/tsconfig.tsbuildinfo +1 -0
  55. package/dist/types/index.d.ts +2 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/index.js +3 -0
  58. package/dist/types/index.js.map +1 -0
  59. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Etohq
4
+
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.
@@ -0,0 +1,63 @@
1
+ import { RbacModuleService } from "./services";
2
+ declare const _default: import("@etohq/types").ModuleExports<typeof RbacModuleService> & {
3
+ linkable: {
4
+ readonly rbacRole: {
5
+ id: {
6
+ serviceName: "rbac";
7
+ field: "rbacRole";
8
+ linkable: "rbac_role_id";
9
+ primaryKey: "id";
10
+ };
11
+ toJSON: () => {
12
+ serviceName: "rbac";
13
+ field: "rbacRole";
14
+ linkable: "rbac_role_id";
15
+ primaryKey: "id";
16
+ };
17
+ };
18
+ readonly rbacPolicy: {
19
+ id: {
20
+ serviceName: "rbac";
21
+ field: "rbacPolicy";
22
+ linkable: "rbac_policy_id";
23
+ primaryKey: "id";
24
+ };
25
+ toJSON: () => {
26
+ serviceName: "rbac";
27
+ field: "rbacPolicy";
28
+ linkable: "rbac_policy_id";
29
+ primaryKey: "id";
30
+ };
31
+ };
32
+ readonly rbacRoleParent: {
33
+ id: {
34
+ serviceName: "rbac";
35
+ field: "rbacRoleParent";
36
+ linkable: "rbac_role_parent_id";
37
+ primaryKey: "id";
38
+ };
39
+ toJSON: () => {
40
+ serviceName: "rbac";
41
+ field: "rbacRoleParent";
42
+ linkable: "rbac_role_parent_id";
43
+ primaryKey: "id";
44
+ };
45
+ };
46
+ readonly rbacRolePolicy: {
47
+ id: {
48
+ serviceName: "rbac";
49
+ field: "rbacRolePolicy";
50
+ linkable: "rbac_role_policy_id";
51
+ primaryKey: "id";
52
+ };
53
+ toJSON: () => {
54
+ serviceName: "rbac";
55
+ field: "rbacRolePolicy";
56
+ linkable: "rbac_role_policy_id";
57
+ primaryKey: "id";
58
+ };
59
+ };
60
+ };
61
+ };
62
+ export default _default;
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG7C,wBAGE"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@etohq/framework/utils");
7
+ const _services_1 = require("./services");
8
+ const initial_data_1 = __importDefault(require("./loaders/initial-data"));
9
+ exports.default = (0, utils_1.Module)(utils_1.Modules.RBAC, {
10
+ service: _services_1.RbacModuleService,
11
+ loaders: [initial_data_1.default],
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAAwD;AACxD,yCAA6C;AAC7C,0EAAsD;AAEtD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,IAAI,EAAE;IAClC,OAAO,EAAE,6BAAiB;IAC1B,OAAO,EAAE,CAAC,sBAAiB,CAAC;CAC7B,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { LoaderOptions, ModulesSdkTypes } from "@etohq/framework/types";
2
+ declare const _default: ({ container, options, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=initial-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initial-data.d.ts","sourceRoot":"","sources":["../../src/loaders/initial-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,eAAe,EAChB,MAAM,wBAAwB,CAAA;yBAGT,yBAGnB,aAAa,CACZ,eAAe,CAAC,8BAA8B,GAC9C,eAAe,CAAC,6CAA6C,CAChE,KAAG,OAAO,CAAC,IAAI,CAAC;AANjB,wBA8CC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = async ({ container, options, }) => {
4
+ const rbacRoleService = container.resolve("rbacRoleService");
5
+ const rbacPolicyService = container.resolve("rbacPolicyService");
6
+ const rbacRolePolicyService = container.resolve("rbacRolePolicyService");
7
+ // Create super admin role
8
+ const role = await rbacRoleService.upsert({
9
+ id: "role_super_admin",
10
+ name: "Super Admin",
11
+ description: "Super admin role with full access to all resources and operations",
12
+ });
13
+ const policy = await rbacPolicyService.upsert({
14
+ id: "rpol_super_admin",
15
+ key: "*:*",
16
+ resource: "*",
17
+ operation: "*",
18
+ name: "Super Admin",
19
+ description: "Super admin policy with full access to all resources and operations",
20
+ });
21
+ await rbacRolePolicyService.upsert({
22
+ id: "rlpl_super_admin",
23
+ role_id: role.id,
24
+ policy_id: policy.id,
25
+ });
26
+ };
27
+ //# sourceMappingURL=initial-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initial-data.js","sourceRoot":"","sources":["../../src/loaders/initial-data.ts"],"names":[],"mappings":";;AAOA,kBAAe,KAAK,EAAE,EACpB,SAAS,EACT,OAAO,GAIR,EAAiB,EAAE;IAClB,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CACvC,iBAAiB,CACuD,CAAA;IAE1E,MAAM,iBAAiB,GAAG,SAAS,CAAC,OAAO,CACzC,mBAAmB,CAGpB,CAAA;IAED,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAC7C,uBAAuB,CAGxB,CAAA;IAED,0BAA0B;IAC1B,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC;QACxC,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,mEAAmE;KACtE,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC;QAC5C,EAAE,EAAE,kBAAkB;QACtB,GAAG,EAAE,KAAK;QACV,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,qEAAqE;KACxE,CAAC,CAAA;IAEF,MAAM,qBAAqB,CAAC,MAAM,CAAC;QACjC,EAAE,EAAE,kBAAkB;QACtB,OAAO,EAAE,IAAI,CAAC,EAAE;QAChB,SAAS,EAAE,MAAM,CAAC,EAAE;KACrB,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ export declare class Migration20251219163509 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20251219163509.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251219163509.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251219163509.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC1B"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20251219163509 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20251219163509 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`alter table if exists "rbac_role_policy" drop constraint if exists "rbac_role_policy_role_id_policy_id_unique";`);
8
+ this.addSql(`alter table if exists "rbac_role_parent" drop constraint if exists "rbac_role_parent_role_id_parent_id_unique";`);
9
+ this.addSql(`alter table if exists "rbac_role" drop constraint if exists "rbac_role_name_unique";`);
10
+ this.addSql(`alter table if exists "rbac_policy" drop constraint if exists "rbac_policy_key_unique";`);
11
+ this.addSql(`create table if not exists "rbac_policy" ("id" text not null, "key" text not null, "resource" text not null, "operation" text not null, "name" text null, "description" text null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "rbac_policy_pkey" primary key ("id"));`);
12
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_policy_deleted_at" ON "rbac_policy" ("deleted_at") WHERE deleted_at IS NULL;`);
13
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_rbac_policy_key_unique" ON "rbac_policy" ("key") WHERE deleted_at IS NULL;`);
14
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_policy_resource" ON "rbac_policy" ("resource") WHERE deleted_at IS NULL;`);
15
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_policy_operation" ON "rbac_policy" ("operation") WHERE deleted_at IS NULL;`);
16
+ this.addSql(`create table if not exists "rbac_role" ("id" text not null, "name" text not null, "description" text null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "rbac_role_pkey" primary key ("id"));`);
17
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_deleted_at" ON "rbac_role" ("deleted_at") WHERE deleted_at IS NULL;`);
18
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_rbac_role_name_unique" ON "rbac_role" ("name") WHERE deleted_at IS NULL;`);
19
+ this.addSql(`create table if not exists "rbac_role_parent" ("id" text not null, "role_id" text not null, "parent_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "rbac_role_parent_pkey" primary key ("id"));`);
20
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_parent_role_id" ON "rbac_role_parent" ("role_id") WHERE deleted_at IS NULL;`);
21
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_parent_parent_id" ON "rbac_role_parent" ("parent_id") WHERE deleted_at IS NULL;`);
22
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_parent_deleted_at" ON "rbac_role_parent" ("deleted_at") WHERE deleted_at IS NULL;`);
23
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_rbac_role_parent_role_id_parent_id_unique" ON "rbac_role_parent" ("role_id", "parent_id") WHERE deleted_at IS NULL;`);
24
+ this.addSql(`create table if not exists "rbac_role_policy" ("id" text not null, "role_id" text not null, "policy_id" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "rbac_role_policy_pkey" primary key ("id"));`);
25
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_policy_role_id" ON "rbac_role_policy" ("role_id") WHERE deleted_at IS NULL;`);
26
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_policy_policy_id" ON "rbac_role_policy" ("policy_id") WHERE deleted_at IS NULL;`);
27
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_rbac_role_policy_deleted_at" ON "rbac_role_policy" ("deleted_at") WHERE deleted_at IS NULL;`);
28
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_rbac_role_policy_role_id_policy_id_unique" ON "rbac_role_policy" ("role_id", "policy_id") WHERE deleted_at IS NULL;`);
29
+ this.addSql(`alter table if exists "rbac_role_parent" add constraint "rbac_role_parent_role_id_foreign" foreign key ("role_id") references "rbac_role" ("id") on update cascade;`);
30
+ this.addSql(`alter table if exists "rbac_role_parent" add constraint "rbac_role_parent_parent_id_foreign" foreign key ("parent_id") references "rbac_role" ("id") on update cascade;`);
31
+ this.addSql(`alter table if exists "rbac_role_policy" add constraint "rbac_role_policy_role_id_foreign" foreign key ("role_id") references "rbac_role" ("id") on update cascade;`);
32
+ this.addSql(`alter table if exists "rbac_role_policy" add constraint "rbac_role_policy_policy_id_foreign" foreign key ("policy_id") references "rbac_policy" ("id") on update cascade;`);
33
+ }
34
+ }
35
+ exports.Migration20251219163509 = Migration20251219163509;
36
+ //# sourceMappingURL=Migration20251219163509.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251219163509.js","sourceRoot":"","sources":["../../src/migrations/Migration20251219163509.ts"],"names":[],"mappings":";;;AAAA,sDAAiD;AAEjD,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAA;QAC9H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAA;QAC9H,IAAI,CAAC,MAAM,CAAC,sFAAsF,CAAC,CAAA;QACnG,IAAI,CAAC,MAAM,CAAC,yFAAyF,CAAC,CAAA;QACtG,IAAI,CAAC,MAAM,CAAC,+XAA+X,CAAC,CAAA;QAC5Y,IAAI,CAAC,MAAM,CAAC,mHAAmH,CAAC,CAAA;QAChI,IAAI,CAAC,MAAM,CAAC,mHAAmH,CAAC,CAAA;QAChI,IAAI,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAA;QAC5H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAA;QAE9H,IAAI,CAAC,MAAM,CAAC,qTAAqT,CAAC,CAAA;QAClU,IAAI,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAA;QAC5H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAA;QAE9H,IAAI,CAAC,MAAM,CAAC,wUAAwU,CAAC,CAAA;QACrV,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAA;QACpI,IAAI,CAAC,MAAM,CAAC,2HAA2H,CAAC,CAAA;QACxI,IAAI,CAAC,MAAM,CAAC,6HAA6H,CAAC,CAAA;QAC1I,IAAI,CAAC,MAAM,CAAC,4JAA4J,CAAC,CAAA;QAEzK,IAAI,CAAC,MAAM,CAAC,wUAAwU,CAAC,CAAA;QACrV,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAA;QACpI,IAAI,CAAC,MAAM,CAAC,2HAA2H,CAAC,CAAA;QACxI,IAAI,CAAC,MAAM,CAAC,6HAA6H,CAAC,CAAA;QAC1I,IAAI,CAAC,MAAM,CAAC,4JAA4J,CAAC,CAAA;QAEzK,IAAI,CAAC,MAAM,CAAC,qKAAqK,CAAC,CAAA;QAClL,IAAI,CAAC,MAAM,CAAC,yKAAyK,CAAC,CAAA;QAEtL,IAAI,CAAC,MAAM,CAAC,qKAAqK,CAAC,CAAA;QAClL,IAAI,CAAC,MAAM,CAAC,2KAA2K,CAAC,CAAA;IAC1L,CAAC;CACF;AAlCD,0DAkCC"}
@@ -0,0 +1,5 @@
1
+ export { default as RbacPolicy } from "./rbac-policy";
2
+ export { default as RbacRole } from "./rbac-role";
3
+ export { default as RbacRoleParent } from "./rbac-role-parent";
4
+ export { default as RbacRolePolicy } from "./rbac-role-policy";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RbacRolePolicy = exports.RbacRoleParent = exports.RbacRole = exports.RbacPolicy = void 0;
7
+ var rbac_policy_1 = require("./rbac-policy");
8
+ Object.defineProperty(exports, "RbacPolicy", { enumerable: true, get: function () { return __importDefault(rbac_policy_1).default; } });
9
+ var rbac_role_1 = require("./rbac-role");
10
+ Object.defineProperty(exports, "RbacRole", { enumerable: true, get: function () { return __importDefault(rbac_role_1).default; } });
11
+ var rbac_role_parent_1 = require("./rbac-role-parent");
12
+ Object.defineProperty(exports, "RbacRoleParent", { enumerable: true, get: function () { return __importDefault(rbac_role_parent_1).default; } });
13
+ var rbac_role_policy_1 = require("./rbac-role-policy");
14
+ Object.defineProperty(exports, "RbacRolePolicy", { enumerable: true, get: function () { return __importDefault(rbac_role_policy_1).default; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAqD;AAA5C,0HAAA,OAAO,OAAc;AAC9B,yCAAiD;AAAxC,sHAAA,OAAO,OAAY;AAC5B,uDAA8D;AAArD,mIAAA,OAAO,OAAkB;AAClC,uDAA8D;AAArD,mIAAA,OAAO,OAAkB"}
@@ -0,0 +1,11 @@
1
+ declare const RbacPolicy: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ key: import("@etohq/framework/utils").TextProperty;
4
+ resource: import("@etohq/framework/utils").TextProperty;
5
+ operation: import("@etohq/framework/utils").TextProperty;
6
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
7
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
8
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
9
+ }>, "rbac_policy">;
10
+ export default RbacPolicy;
11
+ //# sourceMappingURL=rbac-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-policy.d.ts","sourceRoot":"","sources":["../../src/models/rbac-policy.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,UAAU;;;;;;;;kBAwBZ,CAAA;AAEJ,eAAe,UAAU,CAAA"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@etohq/framework/utils");
4
+ const RbacPolicy = utils_1.model
5
+ .define("rbac_policy", {
6
+ id: utils_1.model.id({ prefix: "rpol" }).primaryKey(),
7
+ key: utils_1.model.text().searchable(),
8
+ resource: utils_1.model.text().searchable(),
9
+ operation: utils_1.model.text().searchable(),
10
+ name: utils_1.model.text().searchable().nullable(),
11
+ description: utils_1.model.text().nullable(),
12
+ metadata: utils_1.model.json().nullable(),
13
+ })
14
+ .indexes([
15
+ {
16
+ on: ["key"],
17
+ unique: true,
18
+ where: "deleted_at IS NULL",
19
+ },
20
+ {
21
+ on: ["resource"],
22
+ where: "deleted_at IS NULL",
23
+ },
24
+ {
25
+ on: ["operation"],
26
+ where: "deleted_at IS NULL",
27
+ },
28
+ ]);
29
+ exports.default = RbacPolicy;
30
+ //# sourceMappingURL=rbac-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-policy.js","sourceRoot":"","sources":["../../src/models/rbac-policy.ts"],"names":[],"mappings":";;AAAA,kDAA8C;AAE9C,MAAM,UAAU,GAAG,aAAK;KACrB,MAAM,CAAC,aAAa,EAAE;IACrB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;IAC7C,GAAG,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IAC9B,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACnC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACpC,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE;IAC1C,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,KAAK,CAAC;QACX,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,UAAU,CAAC;QAChB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,WAAW,CAAC;QACjB,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,UAAU,CAAA"}
@@ -0,0 +1,58 @@
1
+ declare const RbacRoleInheritance: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
4
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
5
+ name: import("@etohq/framework/utils").TextProperty;
6
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
7
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
8
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
9
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
10
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
11
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
12
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
13
+ key: import("@etohq/framework/utils").TextProperty;
14
+ resource: import("@etohq/framework/utils").TextProperty;
15
+ operation: import("@etohq/framework/utils").TextProperty;
16
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
17
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
18
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
19
+ }>, "rbac_policy">, undefined>;
20
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
21
+ }>, "rbac_role_policy">>;
22
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
23
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
24
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
25
+ parent: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
26
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
27
+ }>, "rbac_role_parent">>;
28
+ }>, "rbac_role">, undefined>;
29
+ inherited_role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
30
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
31
+ name: import("@etohq/framework/utils").TextProperty;
32
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
33
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
34
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
35
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
36
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
37
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
38
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
39
+ key: import("@etohq/framework/utils").TextProperty;
40
+ resource: import("@etohq/framework/utils").TextProperty;
41
+ operation: import("@etohq/framework/utils").TextProperty;
42
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
43
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
44
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
45
+ }>, "rbac_policy">, undefined>;
46
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
47
+ }>, "rbac_role_policy">>;
48
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
49
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
50
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
51
+ parent: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
52
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
53
+ }>, "rbac_role_parent">>;
54
+ }>, "rbac_role">, undefined>;
55
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
56
+ }>, "rbac_role_inheritance">;
57
+ export default RbacRoleInheritance;
58
+ //# sourceMappingURL=rbac-role-inheritance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-inheritance.d.ts","sourceRoot":"","sources":["../../src/models/rbac-role-inheritance.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAuBrB,CAAA;AAEJ,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@etohq/framework/utils");
7
+ const rbac_role_1 = __importDefault(require("./rbac-role"));
8
+ const RbacRoleInheritance = utils_1.model
9
+ .define("rbac_role_inheritance", {
10
+ id: utils_1.model.id({ prefix: "rlin" }).primaryKey(),
11
+ role: utils_1.model.belongsTo(() => rbac_role_1.default, { mappedBy: "inherited_roles" }),
12
+ inherited_role: utils_1.model.belongsTo(() => rbac_role_1.default, {
13
+ mappedBy: "inheritedBy",
14
+ }),
15
+ metadata: utils_1.model.json().nullable(),
16
+ })
17
+ .indexes([
18
+ {
19
+ on: ["role_id"],
20
+ where: "deleted_at IS NULL",
21
+ },
22
+ {
23
+ on: ["inherited_role_id"],
24
+ where: "deleted_at IS NULL",
25
+ },
26
+ {
27
+ on: ["role_id", "inherited_role_id"],
28
+ unique: true,
29
+ where: "deleted_at IS NULL",
30
+ },
31
+ ]);
32
+ exports.default = RbacRoleInheritance;
33
+ //# sourceMappingURL=rbac-role-inheritance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-inheritance.js","sourceRoot":"","sources":["../../src/models/rbac-role-inheritance.ts"],"names":[],"mappings":";;;;;AAAA,kDAA8C;AAC9C,4DAAkC;AAElC,MAAM,mBAAmB,GAAG,aAAK;KAC9B,MAAM,CAAC,uBAAuB,EAAE;IAC/B,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;IAC7C,IAAI,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IACtE,cAAc,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE;QAC9C,QAAQ,EAAE,aAAa;KACxB,CAAC;IACF,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,SAAS,CAAC;QACf,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,mBAAmB,CAAC;QACzB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,SAAS,EAAE,mBAAmB,CAAC;QACpC,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,mBAAmB,CAAA"}
@@ -0,0 +1,48 @@
1
+ declare const RbacRoleParent: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
4
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
5
+ name: import("@etohq/framework/utils").TextProperty;
6
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
7
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
8
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
9
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
10
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
11
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
12
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
13
+ key: import("@etohq/framework/utils").TextProperty;
14
+ resource: import("@etohq/framework/utils").TextProperty;
15
+ operation: import("@etohq/framework/utils").TextProperty;
16
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
17
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
18
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
19
+ }>, "rbac_policy">, undefined>;
20
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
21
+ }>, "rbac_role_policy">>;
22
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_parent">>;
23
+ }>, "rbac_role">, undefined>;
24
+ parent: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
25
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
26
+ name: import("@etohq/framework/utils").TextProperty;
27
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
28
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
29
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
30
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
31
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
32
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
33
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
34
+ key: import("@etohq/framework/utils").TextProperty;
35
+ resource: import("@etohq/framework/utils").TextProperty;
36
+ operation: import("@etohq/framework/utils").TextProperty;
37
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
38
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
39
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
40
+ }>, "rbac_policy">, undefined>;
41
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
42
+ }>, "rbac_role_policy">>;
43
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_parent">>;
44
+ }>, "rbac_role">, undefined>;
45
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
46
+ }>, "rbac_role_parent">;
47
+ export default RbacRoleParent;
48
+ //# sourceMappingURL=rbac-role-parent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-parent.d.ts","sourceRoot":"","sources":["../../src/models/rbac-role-parent.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAqBhB,CAAA;AAEJ,eAAe,cAAc,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@etohq/framework/utils");
7
+ const rbac_role_1 = __importDefault(require("./rbac-role"));
8
+ const RbacRoleParent = utils_1.model
9
+ .define("rbac_role_parent", {
10
+ id: utils_1.model.id({ prefix: "rlin" }).primaryKey(),
11
+ role: utils_1.model.belongsTo(() => rbac_role_1.default, { mappedBy: "parents" }),
12
+ parent: utils_1.model.belongsTo(() => rbac_role_1.default),
13
+ metadata: utils_1.model.json().nullable(),
14
+ })
15
+ .indexes([
16
+ {
17
+ on: ["role_id"],
18
+ where: "deleted_at IS NULL",
19
+ },
20
+ {
21
+ on: ["parent_id"],
22
+ where: "deleted_at IS NULL",
23
+ },
24
+ {
25
+ on: ["role_id", "parent_id"],
26
+ unique: true,
27
+ where: "deleted_at IS NULL",
28
+ },
29
+ ]);
30
+ exports.default = RbacRoleParent;
31
+ //# sourceMappingURL=rbac-role-parent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-parent.js","sourceRoot":"","sources":["../../src/models/rbac-role-parent.ts"],"names":[],"mappings":";;;;;AAAA,kDAA8C;AAC9C,4DAAkC;AAElC,MAAM,cAAc,GAAG,aAAK;KACzB,MAAM,CAAC,kBAAkB,EAAE;IAC1B,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;IAC7C,IAAI,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9D,MAAM,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,CAAC;IACvC,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,SAAS,CAAC;QACf,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,WAAW,CAAC;QACjB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAC5B,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,28 @@
1
+ declare const RbacRolePolicy: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
4
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
5
+ name: import("@etohq/framework/utils").TextProperty;
6
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
7
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
8
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_policy">>;
9
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
10
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
11
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
12
+ parent: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
13
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
14
+ }>, "rbac_role_parent">>;
15
+ }>, "rbac_role">, undefined>;
16
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
17
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
18
+ key: import("@etohq/framework/utils").TextProperty;
19
+ resource: import("@etohq/framework/utils").TextProperty;
20
+ operation: import("@etohq/framework/utils").TextProperty;
21
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
22
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
23
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
24
+ }>, "rbac_policy">, undefined>;
25
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
26
+ }>, "rbac_role_policy">;
27
+ export default RbacRolePolicy;
28
+ //# sourceMappingURL=rbac-role-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-policy.d.ts","sourceRoot":"","sources":["../../src/models/rbac-role-policy.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;uBAqBhB,CAAA;AAEJ,eAAe,cAAc,CAAA"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("@etohq/framework/utils");
7
+ const rbac_policy_1 = __importDefault(require("./rbac-policy"));
8
+ const rbac_role_1 = __importDefault(require("./rbac-role"));
9
+ const RbacRolePolicy = utils_1.model
10
+ .define("rbac_role_policy", {
11
+ id: utils_1.model.id({ prefix: "rlpl" }).primaryKey(),
12
+ role: utils_1.model.belongsTo(() => rbac_role_1.default),
13
+ policy: utils_1.model.belongsTo(() => rbac_policy_1.default),
14
+ metadata: utils_1.model.json().nullable(),
15
+ })
16
+ .indexes([
17
+ {
18
+ on: ["role_id"],
19
+ where: "deleted_at IS NULL",
20
+ },
21
+ {
22
+ on: ["policy_id"],
23
+ where: "deleted_at IS NULL",
24
+ },
25
+ {
26
+ on: ["role_id", "policy_id"],
27
+ unique: true,
28
+ where: "deleted_at IS NULL",
29
+ },
30
+ ]);
31
+ exports.default = RbacRolePolicy;
32
+ //# sourceMappingURL=rbac-role-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role-policy.js","sourceRoot":"","sources":["../../src/models/rbac-role-policy.ts"],"names":[],"mappings":";;;;;AAAA,kDAA8C;AAC9C,gEAAsC;AACtC,4DAAkC;AAElC,MAAM,cAAc,GAAG,aAAK;KACzB,MAAM,CAAC,kBAAkB,EAAE;IAC1B,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;IAC7C,IAAI,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,CAAC;IACrC,MAAM,EAAE,aAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,qBAAU,CAAC;IACzC,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,SAAS,CAAC;QACf,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,WAAW,CAAC;QACjB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;QAC5B,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,28 @@
1
+ declare const RbacRole: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ name: import("@etohq/framework/utils").TextProperty;
4
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
5
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
6
+ policies: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
7
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
8
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
9
+ policy: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
10
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
11
+ key: import("@etohq/framework/utils").TextProperty;
12
+ resource: import("@etohq/framework/utils").TextProperty;
13
+ operation: import("@etohq/framework/utils").TextProperty;
14
+ name: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
15
+ description: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
16
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
17
+ }>, "rbac_policy">, undefined>;
18
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
19
+ }>, "rbac_role_policy">>;
20
+ parents: import("@etohq/framework/utils").HasMany<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
21
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
22
+ role: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
23
+ parent: import("@etohq/framework/utils").BelongsTo<() => import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
24
+ metadata: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
25
+ }>, "rbac_role_parent">>;
26
+ }>, "rbac_role">;
27
+ export default RbacRole;
28
+ //# sourceMappingURL=rbac-role.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbac-role.d.ts","sourceRoot":"","sources":["../../src/models/rbac-role.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;gBAmBV,CAAA;AAEJ,eAAe,QAAQ,CAAA"}