@trii/types 2.10.815 → 2.10.816

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.
@@ -0,0 +1,42 @@
1
+ interface ActorIdentity {
2
+ /** Stable identifier within the actor's identity provider. */
3
+ readonly id: string;
4
+ }
5
+ export interface UserActor extends ActorIdentity {
6
+ readonly type: 'user';
7
+ readonly authenticationMethod: 'cognito';
8
+ readonly attributes: {
9
+ /** Verified issuer. The actor ID is the Cognito subject within this issuer. */
10
+ readonly issuer: string;
11
+ readonly userTriiId: string;
12
+ };
13
+ }
14
+ export interface ServiceActor extends ActorIdentity {
15
+ readonly type: 'service';
16
+ readonly authenticationMethod: 'entra';
17
+ readonly attributes: {
18
+ /** Verified Entra tenant ID. The actor ID is the calling application's client ID. */
19
+ readonly entraTenantId: string;
20
+ readonly roles: readonly string[];
21
+ };
22
+ }
23
+ export interface ApiKeyActor extends ActorIdentity {
24
+ readonly type: 'apiKey';
25
+ readonly authenticationMethod: 'apiKey';
26
+ readonly attributes: {
27
+ /** Owning space resolved from the verified key's stored record. */
28
+ readonly grantedSpaceId: string;
29
+ readonly scopes: readonly string[];
30
+ };
31
+ }
32
+ /** Identity established by trusted authentication middleware. */
33
+ export type AuthenticatedActor = UserActor | ServiceActor | ApiKeyActor;
34
+ /** Trusted actor context for a single request, before endpoint authorization. */
35
+ export interface RequestActorContext {
36
+ readonly caller: AuthenticatedActor;
37
+ /** Target CRM space, when the operation has one. This is not a grant. */
38
+ readonly spaceId?: string | null;
39
+ /** Originating actor established through verified delegation, when available. */
40
+ readonly originActor?: AuthenticatedActor | null;
41
+ }
42
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from './Security';
2
+ export * from './AuthenticatedActor';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Security"), exports);
18
+ __exportStar(require("./AuthenticatedActor"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.815",
3
+ "version": "2.10.816",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",