@medusajs/rbac 2.12.5-preview-20260108144952
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/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/Migration20251219163509.d.ts +5 -0
- package/dist/migrations/Migration20251219163509.d.ts.map +1 -0
- package/dist/migrations/Migration20251219163509.js +36 -0
- package/dist/migrations/Migration20251219163509.js.map +1 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +15 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/rbac-policy.d.ts +11 -0
- package/dist/models/rbac-policy.d.ts.map +1 -0
- package/dist/models/rbac-policy.js +30 -0
- package/dist/models/rbac-policy.js.map +1 -0
- package/dist/models/rbac-role-inheritance.d.ts +58 -0
- package/dist/models/rbac-role-inheritance.d.ts.map +1 -0
- package/dist/models/rbac-role-inheritance.js +33 -0
- package/dist/models/rbac-role-inheritance.js.map +1 -0
- package/dist/models/rbac-role-parent.d.ts +48 -0
- package/dist/models/rbac-role-parent.d.ts.map +1 -0
- package/dist/models/rbac-role-parent.js +31 -0
- package/dist/models/rbac-role-parent.js.map +1 -0
- package/dist/models/rbac-role-policy.d.ts +28 -0
- package/dist/models/rbac-role-policy.d.ts.map +1 -0
- package/dist/models/rbac-role-policy.js +32 -0
- package/dist/models/rbac-role-policy.js.map +1 -0
- package/dist/models/rbac-role.d.ts +28 -0
- package/dist/models/rbac-role.d.ts.map +1 -0
- package/dist/models/rbac-role.js +30 -0
- package/dist/models/rbac-role.js.map +1 -0
- package/dist/repositories/index.d.ts +2 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +18 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/rbac.d.ts +9 -0
- package/dist/repositories/rbac.d.ts.map +1 -0
- package/dist/repositories/rbac.js +101 -0
- package/dist/repositories/rbac.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +9 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/rbac-module-service.d.ts +131 -0
- package/dist/services/rbac-module-service.d.ts.map +1 -0
- package/dist/services/rbac-module-service.js +207 -0
- package/dist/services/rbac-module-service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RbacModuleService } from "./services";
|
|
2
|
+
declare const _default: import("@medusajs/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7C,wBAEE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
4
|
+
const _services_1 = require("./services");
|
|
5
|
+
exports.default = (0, utils_1.Module)(utils_1.Modules.RBAC, {
|
|
6
|
+
service: _services_1.RbacModuleService,
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,qDAA2D;AAC3D,yCAA6C;AAE7C,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,IAAI,EAAE;IAClC,OAAO,EAAE,6BAAiB;CAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Migration20251219163509.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251219163509.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAkCnC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20251219163509 = void 0;
|
|
4
|
+
const migrations_1 = require("@medusajs/framework/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,yEAAqE;AAErE,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAC;QAC/H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAC;QAC/H,IAAI,CAAC,MAAM,CAAC,sFAAsF,CAAC,CAAC;QACpG,IAAI,CAAC,MAAM,CAAC,yFAAyF,CAAC,CAAC;QACvG,IAAI,CAAC,MAAM,CAAC,+XAA+X,CAAC,CAAC;QAC7Y,IAAI,CAAC,MAAM,CAAC,mHAAmH,CAAC,CAAC;QACjI,IAAI,CAAC,MAAM,CAAC,mHAAmH,CAAC,CAAC;QACjI,IAAI,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAC;QAC7H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAC;QAE/H,IAAI,CAAC,MAAM,CAAC,qTAAqT,CAAC,CAAC;QACnU,IAAI,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAC;QAC7H,IAAI,CAAC,MAAM,CAAC,iHAAiH,CAAC,CAAC;QAE/H,IAAI,CAAC,MAAM,CAAC,wUAAwU,CAAC,CAAC;QACtV,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAC;QACrI,IAAI,CAAC,MAAM,CAAC,2HAA2H,CAAC,CAAC;QACzI,IAAI,CAAC,MAAM,CAAC,6HAA6H,CAAC,CAAC;QAC3I,IAAI,CAAC,MAAM,CAAC,4JAA4J,CAAC,CAAC;QAE1K,IAAI,CAAC,MAAM,CAAC,wUAAwU,CAAC,CAAC;QACtV,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAC;QACrI,IAAI,CAAC,MAAM,CAAC,2HAA2H,CAAC,CAAC;QACzI,IAAI,CAAC,MAAM,CAAC,6HAA6H,CAAC,CAAC;QAC3I,IAAI,CAAC,MAAM,CAAC,4JAA4J,CAAC,CAAC;QAE1K,IAAI,CAAC,MAAM,CAAC,qKAAqK,CAAC,CAAC;QACnL,IAAI,CAAC,MAAM,CAAC,yKAAyK,CAAC,CAAC;QAEvL,IAAI,CAAC,MAAM,CAAC,qKAAqK,CAAC,CAAC;QACnL,IAAI,CAAC,MAAM,CAAC,2KAA2K,CAAC,CAAC;IAC3L,CAAC;CAEF;AApCD,0DAoCC"}
|
|
@@ -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("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
5
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
8
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/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("@medusajs/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,qDAAiD;AAEjD,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("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
4
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
5
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
8
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
9
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
10
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
11
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
12
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
13
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
14
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
15
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
16
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
17
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
18
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
19
|
+
}>, "rbac_policy">, undefined>;
|
|
20
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
21
|
+
}>, "rbac_role_policy">>;
|
|
22
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
23
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
24
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
25
|
+
parent: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
26
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
27
|
+
}>, "rbac_role_parent">>;
|
|
28
|
+
}>, "rbac_role">, undefined>;
|
|
29
|
+
inherited_role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
30
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
31
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
32
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
33
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
34
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
35
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
36
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
37
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
38
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
39
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
40
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
41
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
42
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
43
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
44
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
45
|
+
}>, "rbac_policy">, undefined>;
|
|
46
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
47
|
+
}>, "rbac_role_policy">>;
|
|
48
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
49
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
50
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
51
|
+
parent: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
52
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
53
|
+
}>, "rbac_role_parent">>;
|
|
54
|
+
}>, "rbac_role">, undefined>;
|
|
55
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/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("@medusajs/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,qDAAiD;AACjD,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("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
4
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
5
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
8
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
9
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
10
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
11
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
12
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
13
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
14
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
15
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
16
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
17
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
18
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
19
|
+
}>, "rbac_policy">, undefined>;
|
|
20
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
21
|
+
}>, "rbac_role_policy">>;
|
|
22
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_parent">>;
|
|
23
|
+
}>, "rbac_role">, undefined>;
|
|
24
|
+
parent: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
25
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
26
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
27
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
28
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
29
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
30
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
31
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
32
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
33
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
34
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
35
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
36
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
37
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
38
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
39
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
40
|
+
}>, "rbac_policy">, undefined>;
|
|
41
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
42
|
+
}>, "rbac_role_policy">>;
|
|
43
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_parent">>;
|
|
44
|
+
}>, "rbac_role">, undefined>;
|
|
45
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/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("@medusajs/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,qDAAiD;AACjD,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("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
4
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
5
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
8
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role_policy">>;
|
|
9
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
10
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
11
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
12
|
+
parent: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
13
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
14
|
+
}>, "rbac_role_parent">>;
|
|
15
|
+
}>, "rbac_role">, undefined>;
|
|
16
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
17
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
18
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
19
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
20
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
21
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
22
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
23
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
24
|
+
}>, "rbac_policy">, undefined>;
|
|
25
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/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("@medusajs/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,qDAAiD;AACjD,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("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
5
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
6
|
+
policies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
7
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
8
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
9
|
+
policy: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
10
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
11
|
+
key: import("@medusajs/framework/utils").TextProperty;
|
|
12
|
+
resource: import("@medusajs/framework/utils").TextProperty;
|
|
13
|
+
operation: import("@medusajs/framework/utils").TextProperty;
|
|
14
|
+
name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
15
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
16
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
17
|
+
}>, "rbac_policy">, undefined>;
|
|
18
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
19
|
+
}>, "rbac_role_policy">>;
|
|
20
|
+
parents: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
21
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
22
|
+
role: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
23
|
+
parent: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "rbac_role">, undefined>;
|
|
24
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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("@medusajs/framework/utils");
|
|
7
|
+
const rbac_role_parent_1 = __importDefault(require("./rbac-role-parent"));
|
|
8
|
+
const rbac_role_policy_1 = __importDefault(require("./rbac-role-policy"));
|
|
9
|
+
const RbacRole = utils_1.model
|
|
10
|
+
.define("rbac_role", {
|
|
11
|
+
id: utils_1.model.id({ prefix: "role" }).primaryKey(),
|
|
12
|
+
name: utils_1.model.text().searchable(),
|
|
13
|
+
description: utils_1.model.text().nullable(),
|
|
14
|
+
metadata: utils_1.model.json().nullable(),
|
|
15
|
+
policies: utils_1.model.hasMany(() => rbac_role_policy_1.default, {
|
|
16
|
+
mappedBy: "role",
|
|
17
|
+
}),
|
|
18
|
+
parents: utils_1.model.hasMany(() => rbac_role_parent_1.default, {
|
|
19
|
+
mappedBy: "role",
|
|
20
|
+
}),
|
|
21
|
+
})
|
|
22
|
+
.indexes([
|
|
23
|
+
{
|
|
24
|
+
on: ["name"],
|
|
25
|
+
unique: true,
|
|
26
|
+
where: "deleted_at IS NULL",
|
|
27
|
+
},
|
|
28
|
+
]);
|
|
29
|
+
exports.default = RbacRole;
|
|
30
|
+
//# sourceMappingURL=rbac-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rbac-role.js","sourceRoot":"","sources":["../../src/models/rbac-role.ts"],"names":[],"mappings":";;;;;AAAA,qDAAiD;AACjD,0EAA+C;AAC/C,0EAA+C;AAE/C,MAAM,QAAQ,GAAG,aAAK;KACnB,MAAM,CAAC,WAAW,EAAE;IACnB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE;IAC7C,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IAC/B,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,aAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,0BAAc,EAAE;QAC5C,QAAQ,EAAE,MAAM;KACjB,CAAC;IACF,OAAO,EAAE,aAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,0BAAc,EAAE;QAC3C,QAAQ,EAAE,MAAM;KACjB,CAAC;CACH,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;CACF,CAAC,CAAA;AAEJ,kBAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./rbac"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
|