@aooth/arbac-moost 0.1.7 → 0.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/arbac-moost",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Moost RBAC integration for aoothjs (migrated from @moostjs/arbac)",
5
5
  "keywords": [
6
6
  "abac",
@@ -42,8 +42,14 @@
42
42
  "types": "./dist/atscript/index.d.mts",
43
43
  "import": "./dist/atscript/index.mjs"
44
44
  },
45
- "./atscript/models": "./src/atscript/models/user.as",
46
- "./atscript/models.as": "./src/atscript/models/user.as",
45
+ "./atscript/models": {
46
+ "types": "./src/atscript/models/user.as.d.ts",
47
+ "default": "./src/atscript/models/user.as"
48
+ },
49
+ "./atscript/models.as": {
50
+ "types": "./src/atscript/models/user.as.d.ts",
51
+ "default": "./src/atscript/models/user.as"
52
+ },
47
53
  "./plugin": {
48
54
  "types": "./dist/plugin.d.mts",
49
55
  "import": "./dist/plugin.mjs"
@@ -54,31 +60,31 @@
54
60
  "access": "public"
55
61
  },
56
62
  "dependencies": {
57
- "@aooth/arbac-core": "0.1.7",
58
- "@aooth/arbac": "0.1.7",
59
- "@aooth/user": "0.1.7"
63
+ "@aooth/arbac": "0.1.9",
64
+ "@aooth/arbac-core": "0.1.9",
65
+ "@aooth/user": "0.1.9"
60
66
  },
61
67
  "devDependencies": {
62
- "@atscript/core": "^0.1.64",
63
- "@atscript/db": "^0.1.91",
64
- "@atscript/db-sql-tools": "^0.1.91",
65
- "@atscript/db-sqlite": "^0.1.91",
66
- "@atscript/moost-db": "^0.1.91",
67
- "@atscript/typescript": "^0.1.64",
68
- "@moostjs/event-http": "^0.6.17",
68
+ "@atscript/core": "^0.1.70",
69
+ "@atscript/db": "^0.1.97",
70
+ "@atscript/db-sql-tools": "^0.1.97",
71
+ "@atscript/db-sqlite": "^0.1.97",
72
+ "@atscript/moost-db": "^0.1.97",
73
+ "@atscript/typescript": "^0.1.70",
74
+ "@moostjs/event-http": "^0.6.23",
69
75
  "@types/better-sqlite3": "^7.6.13",
70
76
  "@uniqu/core": "^0.1.6",
71
77
  "better-sqlite3": "^12.6.2",
72
- "unplugin-atscript": "^0.1.64"
78
+ "unplugin-atscript": "^0.1.70"
73
79
  },
74
80
  "peerDependencies": {
75
- "@atscript/db": ">=0.1.79",
76
- "@atscript/moost-db": ">=0.1.79",
77
- "@atscript/typescript": ">=0.1.56",
78
- "@moostjs/event-http": ">=0.6.10",
79
- "@wooksjs/event-core": ">=0.7.12",
80
- "@wooksjs/event-http": ">=0.7.12",
81
- "moost": ">=0.6.10"
81
+ "@atscript/db": "^0.1.97",
82
+ "@atscript/moost-db": "^0.1.97",
83
+ "@atscript/typescript": "^0.1.70",
84
+ "@moostjs/event-http": "^0.6.23",
85
+ "@wooksjs/event-core": "^0.7.17",
86
+ "@wooksjs/event-http": "^0.7.17",
87
+ "moost": "^0.6.23"
82
88
  },
83
89
  "peerDependenciesMeta": {
84
90
  "@atscript/db": {
@@ -1,15 +0,0 @@
1
- import { defineAnnotatedType, throwFeatureDisabled } from "@atscript/typescript/utils";
2
- import "@aooth/user/atscript-db/model.as";
3
- //#region src/atscript/models/user.as
4
- var AoothArbacUserCredentials = class {
5
- static __is_atscript_annotated_type = true;
6
- static type = {};
7
- static metadata = /* @__PURE__ */ new Map();
8
- static id = "AoothArbacUserCredentials";
9
- static toJsonSchema() {
10
- throwFeatureDisabled("JSON Schema", "jsonSchema", "emit.jsonSchema");
11
- }
12
- };
13
- defineAnnotatedType("object", AoothArbacUserCredentials).prop("username", defineAnnotatedType().designType("string").tags("string").annotate("db.index.unique", "username_idx", true).$type).prop("version", defineAnnotatedType().designType("number").tags("int", "number").annotate("db.column.version", true).annotate("expect.int", true).$type).prop("password", defineAnnotatedType("object").prop("hash", defineAnnotatedType().designType("string").tags("string").$type).prop("history", defineAnnotatedType("array").of(defineAnnotatedType().designType("string").tags("string").$type).$type).prop("lastChanged", defineAnnotatedType().designType("number").tags("timestamp", "number").annotate("expect.int", true).$type).prop("isInitial", defineAnnotatedType().designType("boolean").tags("boolean").$type).annotate("db.patch.strategy", "merge").$type).prop("account", defineAnnotatedType("object").prop("active", defineAnnotatedType().designType("boolean").tags("boolean").$type).prop("locked", defineAnnotatedType().designType("boolean").tags("boolean").$type).prop("lockReason", defineAnnotatedType().designType("string").tags("string").$type).prop("lockEnds", defineAnnotatedType().designType("number").tags("timestamp", "number").annotate("expect.int", true).$type).prop("failedLoginAttempts", defineAnnotatedType().designType("number").tags("number").$type).prop("lastLogin", defineAnnotatedType().designType("number").tags("timestamp", "number").annotate("expect.int", true).$type).prop("pendingInvitation", defineAnnotatedType().designType("boolean").tags("boolean").optional().$type).annotate("db.patch.strategy", "merge").$type).prop("mfa", defineAnnotatedType("object").prop("methods", defineAnnotatedType("array").of(defineAnnotatedType("object").prop("name", defineAnnotatedType().designType("string").tags("string").$type).prop("confirmed", defineAnnotatedType().designType("boolean").tags("boolean").$type).prop("value", defineAnnotatedType().designType("string").tags("string").$type).prop("lastUsedWindow", defineAnnotatedType().designType("number").tags("int", "number").annotate("expect.int", true).optional().$type).$type).$type).prop("defaultMethod", defineAnnotatedType().designType("string").tags("string").$type).prop("autoSend", defineAnnotatedType().designType("boolean").tags("boolean").$type).annotate("db.patch.strategy", "merge").$type).prop("trustedDevices", defineAnnotatedType("array").of(defineAnnotatedType("object").prop("token", defineAnnotatedType().designType("string").tags("string").$type).prop("ip", defineAnnotatedType().designType("string").tags("string").optional().$type).prop("issuedAt", defineAnnotatedType().designType("number").tags("timestamp", "number").annotate("expect.int", true).$type).prop("expiresAt", defineAnnotatedType().designType("number").tags("timestamp", "number").annotate("expect.int", true).$type).prop("name", defineAnnotatedType().designType("string").tags("string").optional().$type).$type).annotate("db.patch.strategy", "merge").optional().$type).prop("backupCodes", defineAnnotatedType("array").of(defineAnnotatedType().designType("string").tags("string").$type).optional().$type).prop("roles", defineAnnotatedType("array").of(defineAnnotatedType().designType("string").tags("string").$type).annotate("arbac.role", true).$type);
14
- //#endregion
15
- export { AoothArbacUserCredentials as t };
@@ -1,42 +0,0 @@
1
- import { TClassConstructor } from "moost";
2
-
3
- //#region src/user.provider.d.ts
4
- /**
5
- * Abstract base class for providing user data required for ARBAC evaluations.
6
- *
7
- * Consumers must extend this class and implement the three abstract methods
8
- * to plug their own authentication/identity layer into the ARBAC authorize
9
- * interceptor. The subclass must re-apply `@Injectable()` (moost does not
10
- * inherit decorator metadata) and be registered via Moost's
11
- * `setReplaceRegistry` (or `@Replace`) so DI resolves the concrete provider.
12
- *
13
- * @template TUserAttrs - The type representing user attributes relevant to access control.
14
- */
15
- declare abstract class ArbacUserProvider<TUserAttrs extends object = object> {
16
- /**
17
- * Retrieves the unique identifier of the current user.
18
- */
19
- abstract getUserId(): string | Promise<string>;
20
- /**
21
- * Retrieves the roles assigned to a user based on their ID.
22
- *
23
- * @param id - The user ID.
24
- */
25
- abstract getRoles(id: string): string[] | Promise<string[]>;
26
- /**
27
- * Retrieves the attributes associated with a user based on their ID.
28
- *
29
- * @param id - The user ID.
30
- */
31
- abstract getAttrs(id: string): TUserAttrs | Promise<TUserAttrs>;
32
- }
33
- /**
34
- * DI token form of {@link ArbacUserProvider}. The class itself is `abstract`,
35
- * so it does not satisfy moost's `TClassConstructor` (`new (...) => T`)
36
- * structurally; this re-typed alias is the supported way to pass the base
37
- * class to `cc.instantiate(...)`, `createReplaceRegistry(...)`, `@Replace(...)`,
38
- * etc. Runtime resolves to the concrete subclass registered via DI.
39
- */
40
- declare const ArbacUserProviderToken: TClassConstructor<ArbacUserProvider>;
41
- //#endregion
42
- export { ArbacUserProviderToken as n, ArbacUserProvider as t };