@smart-factor/gem-ui-components 0.0.130 → 0.0.132

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,5 @@
1
+ import { AuthResult } from '../generated/api';
2
+ export type ApplyAuthResultOptions = {
3
+ applicationDomain?: string;
4
+ };
5
+ export declare function applyAuthResult(authResult: AuthResult): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function clearAuthOnTerminate(): void;
@@ -0,0 +1,2 @@
1
+ import { NormalizedUser } from './normalizeUser';
2
+ export declare function identifyUser(user: NormalizedUser): void;
@@ -0,0 +1,10 @@
1
+ export type { ApplyAuthResultOptions } from './applyAuthResult';
2
+ export { applyAuthResult } from './applyAuthResult';
3
+ export { clearAuthOnTerminate } from './clearAuthOnTerminate';
4
+ export { identifyUser } from './identifyUser';
5
+ export type { NormalizedUser } from './normalizeUser';
6
+ export { getProjection, normalizeUser } from './normalizeUser';
7
+ export type { AppDetailsResponse } from './queryAppInfo';
8
+ export { queryAppInfo } from './queryAppInfo';
9
+ export { setAuthCookies } from './setAuthCookies';
10
+ export { setAuthSession } from './setAuthSession';
@@ -0,0 +1,13 @@
1
+ import { AppUser } from '../generated/api';
2
+ export interface NormalizedUser {
3
+ login: string;
4
+ roles_list: string[];
5
+ consent: boolean | undefined;
6
+ consent_expiration_date: string | undefined;
7
+ projection: string | undefined;
8
+ first_name: string | undefined;
9
+ last_name: string | undefined;
10
+ email: string | undefined;
11
+ }
12
+ export declare function getProjection(value: string | undefined | null): string;
13
+ export declare function normalizeUser(user: AppUser | undefined | null): NormalizedUser | null;
@@ -0,0 +1,16 @@
1
+ export type AppDetailsResponse = {
2
+ features?: Array<{
3
+ name: string;
4
+ is_active: string;
5
+ }>;
6
+ applicationDomain?: string;
7
+ mapTeInformation?: {
8
+ url: string;
9
+ type: string;
10
+ };
11
+ name?: string;
12
+ description?: string;
13
+ version?: string;
14
+ [key: string]: unknown;
15
+ };
16
+ export declare function queryAppInfo(): Promise<AppDetailsResponse>;
@@ -0,0 +1,2 @@
1
+ import { NormalizedUser } from './normalizeUser';
2
+ export declare function setAuthCookies(applicationDomain: string, token: string, user: NormalizedUser): void;
@@ -0,0 +1,2 @@
1
+ import { NormalizedUser } from './normalizeUser';
2
+ export declare function setAuthSession(token: string, user: NormalizedUser): void;
@@ -1,6 +1,6 @@
1
- import { LoginWithPasswordParams } from '../../generated/api';
1
+ import { AuthResult, LoginWithPasswordParams } from '../../generated/api';
2
2
  export type LoginWithPasswordResult = {
3
3
  login: string;
4
4
  token: string;
5
5
  };
6
- export declare const loginWithPassword: (params: LoginWithPasswordParams) => Promise<LoginWithPasswordResult>;
6
+ export declare const loginWithPassword: (params: LoginWithPasswordParams) => Promise<AuthResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-factor/gem-ui-components",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "private": false,
5
5
  "description": "Gem UI Components",
6
6
  "type": "module",
@@ -69,6 +69,7 @@
69
69
  "@tanstack/react-query": "5.75.2",
70
70
  "@testing-library/react": "^16.2.0",
71
71
  "@testing-library/user-event": "^14.6.1",
72
+ "@types/js-cookie": "^3.0.6",
72
73
  "@types/lodash-es": "^4.17.12",
73
74
  "@types/node": "^22.13.13",
74
75
  "@types/qs": "^6.9.18",
@@ -112,6 +113,7 @@
112
113
  "http-proxy-middleware": "^3.0.3",
113
114
  "husky": "^9.1.7",
114
115
  "js-base64": "^3.7.7",
116
+ "js-cookie": "^3.0.5",
115
117
  "lint-staged": "^15.5.0",
116
118
  "lodash-es": "^4.17.21",
117
119
  "posthog-js": "^1.0.0",