@fabrika/iam-contract 0.9.0-dev.37 → 0.9.0-dev.39

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": "@fabrika/iam-contract",
3
- "version": "0.9.0-dev.37",
3
+ "version": "0.9.0-dev.39",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "test": "bun test"
28
28
  },
29
29
  "dependencies": {
30
- "@fabrika/app": "0.9.0-dev.37",
31
- "@fabrika/auth-core": "0.9.0-dev.37",
32
- "@fabrika/proxy-core": "0.9.0-dev.37"
30
+ "@fabrika/app": "0.9.0-dev.39",
31
+ "@fabrika/auth-core": "0.9.0-dev.39",
32
+ "@fabrika/proxy-core": "0.9.0-dev.39"
33
33
  }
34
34
  }
package/src/index.ts CHANGED
@@ -16,6 +16,7 @@ import type {
16
16
  AppMemberItem,
17
17
  AppSchema,
18
18
  AppScopeDef,
19
+ DimensionValue,
19
20
  Locale,
20
21
  PermissionEntry,
21
22
  PermissionSource,
@@ -558,6 +559,28 @@ export interface AppInput {
558
559
  app: string
559
560
  }
560
561
 
562
+ // ── Live scope values (ADR-0085 §4) ────────────────────────────────────────────
563
+
564
+ export interface ListScopeValuesInput {
565
+ /** The application id, `<app>@<env>`. */
566
+ app: string
567
+ /** The dimension whose values the console offers. */
568
+ scopeType: string
569
+ }
570
+
571
+ /**
572
+ * Why the application's own list is not there, so the console falls back to the listed values or free text:
573
+ * `no_source` (the dimension names no procedure), `not_held` (the administrator holds the procedure's action nowhere at
574
+ * the application), `no_origin` (IAM knows no address of it), `refused` (its proxy or the application answered
575
+ * 401/403/404), `timeout`, `unreachable` (any other failure to answer) or `malformed` (an answer that is no list).
576
+ */
577
+ export type ScopeValuesUnavailable = 'no_source' | 'not_held' | 'no_origin' | 'refused' | 'timeout' | 'unreachable' | 'malformed'
578
+
579
+ /** What the application answered as the administrator, or why it could not be asked. Information, never a check. */
580
+ export type ScopeValuesResult =
581
+ | { source: 'application'; values: DimensionValue[] }
582
+ | { source: 'unavailable'; reason: ScopeValuesUnavailable }
583
+
561
584
  /**
562
585
  * The public origins IAM will hand this app a session at (ADR-0022). Declarative: the whole set is
563
586
  * stated, so removing one is the same call as adding one and a stale entry cannot survive a deploy.
@@ -865,6 +888,10 @@ export interface IamAdminRpcContract {
865
888
  list: RpcProcedure<ListSessionsInput, CursorList<UserConnectionDto>>
866
889
  revoke: RpcProcedure<GrantIdInput, OkResponse>
867
890
  }
891
+ /** A dimension's values, asked of the application as the signed-in administrator (ADR-0085 §4). */
892
+ scopeValues: {
893
+ list: RpcProcedure<ListScopeValuesInput, ScopeValuesResult>
894
+ }
868
895
  apps: {
869
896
  list: RpcProcedure<void, ListResponse<AppDto>>
870
897
  getSchema: RpcProcedure<AppInput, AppSchemaDto>
@@ -975,7 +1002,18 @@ export interface UserConnectionDto {
975
1002
  status: 'active' | 'revoked' | 'expired' | 'unavailable'
976
1003
  }
977
1004
 
978
- export type { AppActionDef, AppMemberItem, AppSchema, AppScopeDef, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef }
1005
+ export type {
1006
+ AppActionDef,
1007
+ AppMemberItem,
1008
+ AppSchema,
1009
+ AppScopeDef,
1010
+ DimensionValue,
1011
+ PermissionEntry,
1012
+ PermissionSource,
1013
+ PrincipalAffiliation,
1014
+ PrincipalType,
1015
+ RoleDef,
1016
+ }
979
1017
  export * from './access'
980
1018
  export * from './oauth'
981
1019
  export * from './password-policy'
@@ -1,5 +1,5 @@
1
1
  import type { RpcProcedureContract } from '@fabrika/app';
2
- import type { AppActionDef, AppDelegationDef, AppLinkMountDef, AppMemberItem, AppSchema, AppScopeDef, Locale, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef, WorkloadKind } from '@fabrika/auth-core';
2
+ import type { AppActionDef, AppDelegationDef, AppLinkMountDef, AppMemberItem, AppSchema, AppScopeDef, DimensionValue, Locale, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef, WorkloadKind } from '@fabrika/auth-core';
3
3
  import type { InstallationBrand } from '@fabrika/proxy-core/brand';
4
4
  import type { PasswordPolicyDto, SetPasswordPolicyRequest } from './password-policy';
5
5
  /** A plain list response. */
@@ -481,6 +481,27 @@ export interface GrantIdInput {
481
481
  export interface AppInput {
482
482
  app: string;
483
483
  }
484
+ export interface ListScopeValuesInput {
485
+ /** The application id, `<app>@<env>`. */
486
+ app: string;
487
+ /** The dimension whose values the console offers. */
488
+ scopeType: string;
489
+ }
490
+ /**
491
+ * Why the application's own list is not there, so the console falls back to the listed values or free text:
492
+ * `no_source` (the dimension names no procedure), `not_held` (the administrator holds the procedure's action nowhere at
493
+ * the application), `no_origin` (IAM knows no address of it), `refused` (its proxy or the application answered
494
+ * 401/403/404), `timeout`, `unreachable` (any other failure to answer) or `malformed` (an answer that is no list).
495
+ */
496
+ export type ScopeValuesUnavailable = 'no_source' | 'not_held' | 'no_origin' | 'refused' | 'timeout' | 'unreachable' | 'malformed';
497
+ /** What the application answered as the administrator, or why it could not be asked. Information, never a check. */
498
+ export type ScopeValuesResult = {
499
+ source: 'application';
500
+ values: DimensionValue[];
501
+ } | {
502
+ source: 'unavailable';
503
+ reason: ScopeValuesUnavailable;
504
+ };
484
505
  /**
485
506
  * The public origins IAM will hand this app a session at (ADR-0022). Declarative: the whole set is
486
507
  * stated, so removing one is the same call as adding one and a stale entry cannot survive a deploy.
@@ -753,6 +774,10 @@ export interface IamAdminRpcContract {
753
774
  list: RpcProcedure<ListSessionsInput, CursorList<UserConnectionDto>>;
754
775
  revoke: RpcProcedure<GrantIdInput, OkResponse>;
755
776
  };
777
+ /** A dimension's values, asked of the application as the signed-in administrator (ADR-0085 §4). */
778
+ scopeValues: {
779
+ list: RpcProcedure<ListScopeValuesInput, ScopeValuesResult>;
780
+ };
756
781
  apps: {
757
782
  list: RpcProcedure<void, ListResponse<AppDto>>;
758
783
  getSchema: RpcProcedure<AppInput, AppSchemaDto>;
@@ -859,7 +884,7 @@ export interface UserConnectionDto {
859
884
  expiresAt: number;
860
885
  status: 'active' | 'revoked' | 'expired' | 'unavailable';
861
886
  }
862
- export type { AppActionDef, AppMemberItem, AppSchema, AppScopeDef, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef };
887
+ export type { AppActionDef, AppMemberItem, AppSchema, AppScopeDef, DimensionValue, PermissionEntry, PermissionSource, PrincipalAffiliation, PrincipalType, RoleDef, };
863
888
  export * from './access';
864
889
  export * from './oauth';
865
890
  export * from './password-policy';