@trackunit/iris-app-runtime-core-api 1.17.24-alpha-62031fc7c43.0 → 1.17.25

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 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/iris-app-runtime/core-api/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core-api",
3
- "version": "1.17.24-alpha-62031fc7c43.0",
3
+ "version": "1.17.25",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@graphql-typed-document-node/core": "^3.2.0",
11
- "@trackunit/shared-utils": "1.16.22-alpha-62031fc7c43.0",
12
- "@trackunit/geo-json-utils": "1.15.21-alpha-62031fc7c43.0"
11
+ "@trackunit/shared-utils": "1.16.22",
12
+ "@trackunit/geo-json-utils": "1.15.21"
13
13
  },
14
14
  "migrations": "./migrations.json",
15
15
  "module": "./index.esm.js",
@@ -6,6 +6,20 @@ export interface CurrentUserRole {
6
6
  name: string;
7
7
  };
8
8
  }
9
+ /**
10
+ * Names of the server-evaluated `Account.actions` checks the host resolves at startup.
11
+ *
12
+ * Each name matches a field on the GraphQL `AccountActions` type. Adding one here takes
13
+ * three more edits: select it in the host's `GetUserDetails` query, map it in
14
+ * `RehydrateUser`, and widen `User.accountActions` in `UserStoreProviderHost`. Miss the
15
+ * first two and the action silently resolves to `false`; miss the third and the value is
16
+ * present at runtime but invisible to anything reading it through `useUser()`.
17
+ *
18
+ * Each name costs a live OpenFGA check on a query that runs on every login and token
19
+ * renewal, so add one only once a gate is queued to read it — and drop it again if that
20
+ * gate does not follow.
21
+ */
22
+ export type AccountActionName = "manageUsers" | "approveAccountSupportAccess" | "requestUserSupportAccess" | "requestAccountSupportAccess";
9
23
  export interface CurrentUserState {
10
24
  clientSideUserId: string | undefined;
11
25
  tasUserId: string | undefined;
@@ -29,9 +43,7 @@ export interface CurrentUserState {
29
43
  isVerified: boolean | undefined;
30
44
  isAccountOwner: boolean | undefined;
31
45
  permissions: Array<string> | undefined;
32
- accountActions?: {
33
- manageUsers: boolean;
34
- };
46
+ accountActions?: Partial<Record<AccountActionName, boolean>>;
35
47
  }
36
48
  export interface CurrentUserRuntimeApi {
37
49
  getCurrentUserContext: () => Promise<CurrentUserState>;
@@ -106,8 +106,10 @@ export interface NavigationRuntimeApi {
106
106
  gotoAdmin: (url?: string) => Promise<boolean>;
107
107
  gotoAlerts: (url?: string) => Promise<boolean>;
108
108
  gotoMarketplace: (options?: MarketplaceOptions) => Promise<boolean>;
109
+ /** `redirectToRoot` makes the full reload land on the app root instead of the current URL. */
109
110
  reloadManager: (options?: {
110
111
  renewToken?: boolean;
112
+ redirectToRoot?: boolean;
111
113
  }) => Promise<boolean>;
112
114
  getAssetHomeUrl: (assetId: string, options?: IrisAppOptions | AssetHomeStandardOptions) => Promise<string | null>;
113
115
  getSiteHomeUrl: (siteId: string, options?: IrisAppOptions | SiteHomeStandardOptions) => Promise<string | null>;