@nibssplc/cams-sdk-react 0.0.1-beta.40 → 0.0.1-beta.8
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 +11 -14
- package/dist/components/CAMSMSALProvider.d.ts +0 -16
- package/dist/components/CAMSProvider.d.ts +0 -18
- package/dist/components/ClientOnly.d.ts +0 -6
- package/dist/components/ProtectedRoute.d.ts +0 -7
- package/dist/hooks/useCAMSAuth.d.ts +0 -17
- package/dist/hooks/useCAMSMSALAuth.d.ts +0 -21
- package/dist/index.cjs.js +0 -17481
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.esm.js +0 -17449
- package/dist/index.esm.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nibssplc/cams-sdk-react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.8",
|
|
4
4
|
"description": "React hooks and components for NIBSS CAMS SDK",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
7
|
-
"types": "
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"clean": "rm -rf dist || true",
|
|
18
|
-
"build": "
|
|
18
|
+
"build": "tsc --outDir dist --declaration",
|
|
19
19
|
"lint": "eslint src --ext .ts,.tsx",
|
|
20
20
|
"test": "npx jest --verbose"
|
|
21
21
|
},
|
|
@@ -44,16 +44,13 @@
|
|
|
44
44
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
45
45
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
46
46
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
47
|
-
"@testing-library/jest-dom": "^6.
|
|
48
|
-
"@testing-library/react": "^
|
|
49
|
-
"@types/react": "^
|
|
50
|
-
"@types/react-dom": "^
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"react": "^19.1.0",
|
|
54
|
-
"react-dom": "^19.1.0",
|
|
47
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
48
|
+
"@testing-library/react": "^14.0.0",
|
|
49
|
+
"@types/react": "^18.0.0",
|
|
50
|
+
"@types/react-dom": "^18.0.0",
|
|
51
|
+
"react": "^18.0.0",
|
|
52
|
+
"react-dom": "^18.0.0",
|
|
55
53
|
"rollup": "^4.21.1",
|
|
56
|
-
"ts-jest": "^29.4.4",
|
|
57
54
|
"typescript": "^5.4.5"
|
|
58
55
|
},
|
|
59
56
|
"files": [
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PublicClientApplication, Configuration } from "@azure/msal-browser";
|
|
3
|
-
import { Profile } from "@nibssplc/cams-sdk";
|
|
4
|
-
import { UseCAMSMSALAuthReturn, UseCAMSMSALAuthOptions } from "../hooks/useCAMSMSALAuth";
|
|
5
|
-
interface CAMSMSALContextValue extends UseCAMSMSALAuthReturn {
|
|
6
|
-
userProfile: Profile | null;
|
|
7
|
-
setUserProfile: (profile: Profile | null) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface CAMSMSALProviderProps extends UseCAMSMSALAuthOptions {
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
msalConfig: Configuration;
|
|
12
|
-
msalInstance?: PublicClientApplication;
|
|
13
|
-
}
|
|
14
|
-
export declare function CAMSMSALProvider(props: Readonly<CAMSMSALProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function useCAMSMSALContext(): CAMSMSALContextValue;
|
|
16
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CAMSConfig } from '@nibssplc/cams-sdk';
|
|
3
|
-
import { UseCAMSAuthReturn, UseCAMSAuthOptions } from '../hooks/useCAMSAuth';
|
|
4
|
-
import { UseCAMSMSALAuthOptions } from '../hooks/useCAMSMSALAuth';
|
|
5
|
-
interface CAMSContextValue extends UseCAMSAuthReturn {
|
|
6
|
-
defaultConfig?: Partial<CAMSConfig>;
|
|
7
|
-
isAuthenticated: boolean;
|
|
8
|
-
idToken: string | null;
|
|
9
|
-
accessToken: string | null;
|
|
10
|
-
}
|
|
11
|
-
export interface CAMSProviderProps extends UseCAMSAuthOptions {
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
defaultConfig?: Partial<CAMSConfig>;
|
|
14
|
-
msalOptions?: UseCAMSMSALAuthOptions;
|
|
15
|
-
}
|
|
16
|
-
export declare function CAMSProvider({ children, defaultConfig, msalOptions, ...authOptions }: CAMSProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function useCAMSContext(): CAMSContextValue;
|
|
18
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export interface ProtectedRouteProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
fallback?: ReactNode;
|
|
5
|
-
redirectTo?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function ProtectedRoute({ children, fallback, redirectTo }: ProtectedRouteProps): string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CAMSConfig, CAMSError, Profile } from '@nibssplc/cams-sdk';
|
|
2
|
-
export interface UseCAMSAuthOptions {
|
|
3
|
-
storageKey?: string;
|
|
4
|
-
onAuthSuccess?: (token: string) => void;
|
|
5
|
-
onAuthError?: (error: CAMSError) => void;
|
|
6
|
-
onTokenExpired?: () => void;
|
|
7
|
-
}
|
|
8
|
-
export interface UseCAMSAuthReturn {
|
|
9
|
-
login: (config: CAMSConfig) => Promise<void>;
|
|
10
|
-
logout: () => Promise<void>;
|
|
11
|
-
isAuthenticated: boolean;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
error: CAMSError | null;
|
|
14
|
-
token: string | null;
|
|
15
|
-
profile: Profile | null;
|
|
16
|
-
}
|
|
17
|
-
export declare function useCAMSAuth(options?: UseCAMSAuthOptions): UseCAMSAuthReturn;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CAMSError } from "@nibssplc/cams-sdk";
|
|
2
|
-
export interface UseCAMSMSALAuthOptions {
|
|
3
|
-
onAuthSuccess?: (token: string) => void;
|
|
4
|
-
onAuthError?: (error: CAMSError) => void;
|
|
5
|
-
onTokenExpired?: () => void;
|
|
6
|
-
scopes?: string[];
|
|
7
|
-
mfaUrl?: string;
|
|
8
|
-
prompt?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface UseCAMSMSALAuthReturn {
|
|
11
|
-
login: () => Promise<void>;
|
|
12
|
-
logout: () => Promise<void>;
|
|
13
|
-
storageKey: string;
|
|
14
|
-
isAuthenticated: boolean;
|
|
15
|
-
isLoading: boolean;
|
|
16
|
-
error: CAMSError | null;
|
|
17
|
-
token: string | null;
|
|
18
|
-
idToken: string | null;
|
|
19
|
-
accessToken: string | null;
|
|
20
|
-
}
|
|
21
|
-
export declare function useCAMSMSALAuth(options?: UseCAMSMSALAuthOptions): UseCAMSMSALAuthReturn;
|