@criipto/verify-react 4.1.4 → 5.0.2
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/README.md +20 -13
- package/deploy-preview.sh +19 -0
- package/dist/index.css +223 -0
- package/dist/index.d.ts +267 -14
- package/dist/index.js +1948 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -33
- package/tsconfig.json +8 -99
- package/tsdown.config.ts +23 -0
- package/dist/__tests__/provider.test.d.ts +0 -1
- package/dist/__tests__/utils.test.d.ts +0 -1
- package/dist/components/AuthButtonGroup.d.ts +0 -10
- package/dist/components/AuthMethodButton/Logo.d.ts +0 -10
- package/dist/components/AuthMethodButton.d.ts +0 -45
- package/dist/components/AuthMethodSelector.d.ts +0 -17
- package/dist/components/Button.d.ts +0 -12
- package/dist/components/QRCode.d.ts +0 -29
- package/dist/components/SEBankIDQRCode/SEBankIDQRCode.test.d.ts +0 -1
- package/dist/components/SEBankIDQRCode.d.ts +0 -53
- package/dist/components/SEBankIDSameDeviceButton/Foreground.d.ts +0 -12
- package/dist/components/SEBankIDSameDeviceButton/Poll.d.ts +0 -12
- package/dist/components/SEBankIDSameDeviceButton/Reload.d.ts +0 -15
- package/dist/components/SEBankIDSameDeviceButton/__tests__/Foreground.test.d.ts +0 -1
- package/dist/components/SEBankIDSameDeviceButton/__tests__/Reload.test.d.ts +0 -1
- package/dist/components/SEBankIDSameDeviceButton/__tests__/strategy.test.d.ts +0 -1
- package/dist/components/SEBankIDSameDeviceButton/__tests__/usePoll.test.d.ts +0 -1
- package/dist/components/SEBankIDSameDeviceButton/shared.d.ts +0 -19
- package/dist/components/SEBankIDSameDeviceButton/usePoll.d.ts +0 -7
- package/dist/components/SEBankIDSameDeviceButton.d.ts +0 -21
- package/dist/context.d.ts +0 -61
- package/dist/criipto-verify-react.cjs.js +0 -2
- package/dist/criipto-verify-react.cjs.js.map +0 -1
- package/dist/criipto-verify-react.css +0 -298
- package/dist/criipto-verify-react.esm.js +0 -2
- package/dist/criipto-verify-react.esm.js.map +0 -1
- package/dist/device.d.ts +0 -7
- package/dist/hooks/useNow.d.ts +0 -1
- package/dist/hooks/usePageVisibility.d.ts +0 -2
- package/dist/i18n/da.d.ts +0 -19
- package/dist/i18n/de.d.ts +0 -19
- package/dist/i18n/en.d.ts +0 -19
- package/dist/i18n/fi.d.ts +0 -19
- package/dist/i18n/index.d.ts +0 -4
- package/dist/i18n/nb.d.ts +0 -19
- package/dist/i18n/nl.d.ts +0 -19
- package/dist/i18n/sv.d.ts +0 -19
- package/dist/memory-storage.d.ts +0 -1
- package/dist/provider.d.ts +0 -66
- package/dist/stories/StoryResponseRenderer.d.ts +0 -6
- package/dist/use-criipto-verify.d.ts +0 -30
- package/dist/utils.d.ts +0 -25
package/tsconfig.json
CHANGED
|
@@ -1,105 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
3
|
"outDir": "./dist",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
|
|
26
|
-
/* Modules */
|
|
27
|
-
"module": "esnext" /* Specify what module code is generated. */,
|
|
28
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
-
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
30
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
-
"typeRoots": [
|
|
34
|
-
"./node_modules/@types",
|
|
35
|
-
"./typings"
|
|
36
|
-
] /* Specify multiple folders that act like `./node_modules/@types`. */,
|
|
37
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
38
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
39
|
-
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
40
|
-
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
41
|
-
|
|
42
|
-
/* JavaScript Support */
|
|
43
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
44
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
45
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
46
|
-
|
|
47
|
-
/* Emit */
|
|
48
|
-
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
49
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
50
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
51
|
-
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
52
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
53
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
54
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
55
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
56
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
57
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
58
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
59
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
60
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
61
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
62
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
63
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
64
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
65
|
-
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
66
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
67
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
68
|
-
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
69
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
70
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
71
|
-
|
|
72
|
-
/* Interop Constraints */
|
|
73
|
-
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
|
74
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
75
|
-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
|
76
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
77
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
78
|
-
|
|
79
|
-
/* Type Checking */
|
|
80
|
-
"strict": true /* Enable all strict type-checking options. */,
|
|
81
|
-
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
|
|
82
|
-
"strictNullChecks": true /* When type checking, take into account `null` and `undefined`. */,
|
|
83
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
84
|
-
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
85
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
86
|
-
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
87
|
-
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
88
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
89
|
-
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
90
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
91
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
92
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
93
|
-
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
|
94
|
-
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
95
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
96
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
97
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
98
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
99
|
-
|
|
100
|
-
/* Completeness */
|
|
101
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
102
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
4
|
+
"target": "es6",
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"module": "es2015",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"skipLibCheck": true
|
|
103
12
|
},
|
|
104
13
|
"include": ["src"],
|
|
105
14
|
"exclude": ["src/**/*.stories.*"]
|
package/tsdown.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from 'tsdown';
|
|
2
|
+
|
|
3
|
+
export default defineConfig([
|
|
4
|
+
{
|
|
5
|
+
entry: ['src/index.ts'],
|
|
6
|
+
target: 'es6',
|
|
7
|
+
format: 'esm',
|
|
8
|
+
css: {
|
|
9
|
+
fileName: 'index.css',
|
|
10
|
+
},
|
|
11
|
+
sourcemap: true,
|
|
12
|
+
publint: true,
|
|
13
|
+
platform: 'browser',
|
|
14
|
+
deps: {
|
|
15
|
+
// Will error if we ever try to bundle dependencies (for example if we are importing a
|
|
16
|
+
// dependency that is not in package.json)
|
|
17
|
+
onlyBundle: [],
|
|
18
|
+
},
|
|
19
|
+
loader: {
|
|
20
|
+
'.png': 'dataurl',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface AuthButtonGroupContextInterface {
|
|
3
|
-
multiple: boolean;
|
|
4
|
-
acrValues: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare const AuthButtonGroupContext: React.Context<AuthButtonGroupContextInterface>;
|
|
7
|
-
export default function AuthButtonGroup(props: {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface AuthMethodButtonLogoProps {
|
|
3
|
-
acrValue: string;
|
|
4
|
-
/**
|
|
5
|
-
* base64 image string, e.x. data:image/png;base64,
|
|
6
|
-
* or a ReactElement
|
|
7
|
-
*/
|
|
8
|
-
logo?: React.ReactElement | string;
|
|
9
|
-
}
|
|
10
|
-
export default function AuthMethodButtonLogo(props: AuthMethodButtonLogoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './AuthMethodButton/AuthMethodButton.css';
|
|
3
|
-
import { Action } from '../context';
|
|
4
|
-
import { AuthMethodButtonLogoProps } from './AuthMethodButton/Logo';
|
|
5
|
-
import { type Language } from '../i18n';
|
|
6
|
-
export type PopupParams = {
|
|
7
|
-
acrValue: string;
|
|
8
|
-
onHide: () => void;
|
|
9
|
-
};
|
|
10
|
-
export type PopupOption = boolean | ((options: PopupParams) => boolean | React.ReactElement);
|
|
11
|
-
export interface AuthMethodButtonComponentProps {
|
|
12
|
-
acrValue: string;
|
|
13
|
-
href?: string;
|
|
14
|
-
onClick?: React.MouseEventHandler;
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
'data-testid'?: string;
|
|
17
|
-
className?: string;
|
|
18
|
-
/**
|
|
19
|
-
* base64 image string, e.x. data:image/png;base64,
|
|
20
|
-
* or a ReactElement
|
|
21
|
-
*/
|
|
22
|
-
logo?: AuthMethodButtonLogoProps['logo'];
|
|
23
|
-
/**
|
|
24
|
-
* Impacts the button text rendered if no text is provided via props.children
|
|
25
|
-
*/
|
|
26
|
-
language?: Language;
|
|
27
|
-
/**
|
|
28
|
-
* Impacts the button text rendered if no text is provided via props.children
|
|
29
|
-
*/
|
|
30
|
-
action?: Action;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Display only components, does no state management and triggers no login flows on it's own
|
|
34
|
-
*/
|
|
35
|
-
export declare function AuthMethodButtonComponent(props: AuthMethodButtonComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
export type AuthMethodButtonContainerProps = AuthMethodButtonComponentProps & {
|
|
37
|
-
redirectUri?: string;
|
|
38
|
-
popup?: PopupOption;
|
|
39
|
-
/**
|
|
40
|
-
* Will ammend the login_hint parameter with `message:{base64(message)}` which will set a login/aprove message where available (Danish MitID).
|
|
41
|
-
*/
|
|
42
|
-
message?: string;
|
|
43
|
-
userAgent?: string;
|
|
44
|
-
};
|
|
45
|
-
export declare function AuthMethodButtonContainer(props: AuthMethodButtonContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Language } from '../i18n';
|
|
2
|
-
import { AuthMethodButtonContainerProps } from './AuthMethodButton';
|
|
3
|
-
import './AuthMethodSelector/AuthMethodSelector.css';
|
|
4
|
-
interface AuthMethodSelectorProps {
|
|
5
|
-
acrValues?: string[];
|
|
6
|
-
language?: Language;
|
|
7
|
-
onSelect?: (acrValue: string) => void;
|
|
8
|
-
redirectUri?: string;
|
|
9
|
-
popup?: AuthMethodButtonContainerProps['popup'];
|
|
10
|
-
userAgent?: string;
|
|
11
|
-
}
|
|
12
|
-
export default function AuthMethodSelector(props: AuthMethodSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
type SwedenProps = Omit<AuthMethodSelectorProps, 'acrValues'> & {
|
|
14
|
-
acrValues: string[];
|
|
15
|
-
};
|
|
16
|
-
export declare function Sweden(props: SwedenProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ButtonProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
onClick?: React.MouseEventHandler;
|
|
6
|
-
}
|
|
7
|
-
export declare function AnchorButton(props: AnchorButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
interface AnchorButtonProps extends ButtonProps {
|
|
9
|
-
href: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { OAuth2Error } from '@criipto/auth-js';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const QRCode: React.FC<{
|
|
4
|
-
margin?: number;
|
|
5
|
-
className?: string;
|
|
6
|
-
acrValues?: string[];
|
|
7
|
-
children: (props: {
|
|
8
|
-
qrElement: React.ReactElement;
|
|
9
|
-
/**
|
|
10
|
-
* Will be true once the QR code has been scanned
|
|
11
|
-
*/
|
|
12
|
-
isAcknowledged: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Will be true if the user cancels the login on his mobile device
|
|
15
|
-
*/
|
|
16
|
-
isCancelled: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Whether or not QR codes are enabled for this Criipto Applicaiton
|
|
19
|
-
*/
|
|
20
|
-
isEnabled: boolean | undefined;
|
|
21
|
-
error: OAuth2Error | Error | null;
|
|
22
|
-
retry: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* A method for triggering a full screen redirect to authentication (useful if user is on mobile device already)
|
|
25
|
-
*/
|
|
26
|
-
redirect: () => Promise<void>;
|
|
27
|
-
}) => React.ReactElement;
|
|
28
|
-
}>;
|
|
29
|
-
export default QRCode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AuthorizeResponse, OAuth2Error } from '@criipto/auth-js';
|
|
3
|
-
import { type Language } from '../i18n';
|
|
4
|
-
import './SEBankIDQRCode/SEBankIDQRCode.css';
|
|
5
|
-
interface Props {
|
|
6
|
-
redirectUri?: string;
|
|
7
|
-
qrMargin?: number;
|
|
8
|
-
/**
|
|
9
|
-
* Impacts the help text
|
|
10
|
-
*/
|
|
11
|
-
language?: Language;
|
|
12
|
-
children?: (props: {
|
|
13
|
-
qrElement: React.ReactElement;
|
|
14
|
-
/**
|
|
15
|
-
* Can be rendered instead of `qrElement` if you only wish to render the qr code with no additional content.
|
|
16
|
-
* Combine with `qrMargin`.
|
|
17
|
-
*/
|
|
18
|
-
imageElement: React.ReactElement;
|
|
19
|
-
/**
|
|
20
|
-
* Will be true once the user has completed login in the app and the rest of the login flow is being processed
|
|
21
|
-
*/
|
|
22
|
-
isCompleting: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The user has clicked on the qr image element to trigger fullscreen view per https://developers.bankid.com/getting-started/qr-code#accessibility
|
|
25
|
-
*/
|
|
26
|
-
fullscreen: boolean;
|
|
27
|
-
error: OAuth2Error | Error | null;
|
|
28
|
-
retry: () => void;
|
|
29
|
-
}) => React.ReactElement;
|
|
30
|
-
/** Render fallback element while loading */
|
|
31
|
-
fallback?: React.ReactElement;
|
|
32
|
-
}
|
|
33
|
-
declare function SEBankIDQrCode(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
declare namespace SEBankIDQrCode {
|
|
35
|
-
var acr_values: string;
|
|
36
|
-
}
|
|
37
|
-
export default SEBankIDQrCode;
|
|
38
|
-
type UseDrawOptions = {
|
|
39
|
-
width?: number;
|
|
40
|
-
qrMargin?: number;
|
|
41
|
-
};
|
|
42
|
-
export declare function useDraw(qrCode: string | null, options: UseDrawOptions): string | null;
|
|
43
|
-
type UsePollOptions = {
|
|
44
|
-
enabled: boolean;
|
|
45
|
-
onQrCode: (code: string) => void;
|
|
46
|
-
onComplete: (url: string) => void;
|
|
47
|
-
onError: (error: string) => void;
|
|
48
|
-
};
|
|
49
|
-
export declare function usePoll(pollUrl: string | null, options: UsePollOptions): void;
|
|
50
|
-
export declare function parseCompleteUrl(completeUrl: string): Promise<{
|
|
51
|
-
location: string;
|
|
52
|
-
response: AuthorizeResponse;
|
|
53
|
-
} | Error>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Links } from './shared';
|
|
3
|
-
interface Props {
|
|
4
|
-
children: React.ReactElement;
|
|
5
|
-
links: Links;
|
|
6
|
-
onError: (error: string) => void;
|
|
7
|
-
onComplete: (completeUrl: string) => Promise<void>;
|
|
8
|
-
onInitiate: () => void;
|
|
9
|
-
onLog: (...statements: string[]) => void;
|
|
10
|
-
}
|
|
11
|
-
export default function SEBankIDSameDeviceForeground(props: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Links } from './shared';
|
|
3
|
-
interface Props {
|
|
4
|
-
children: React.ReactElement;
|
|
5
|
-
links: Links;
|
|
6
|
-
onError: (error: string) => void;
|
|
7
|
-
onComplete: (completeUrl: string) => Promise<void>;
|
|
8
|
-
onInitiate: () => void;
|
|
9
|
-
onLog: (...statements: string[]) => void;
|
|
10
|
-
}
|
|
11
|
-
export default function SEBankIDSameDevicePoll(props: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PKCE } from '@criipto/auth-js';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Links } from './shared';
|
|
4
|
-
interface Props {
|
|
5
|
-
children: React.ReactElement;
|
|
6
|
-
links: Links;
|
|
7
|
-
onError: (error: string) => void;
|
|
8
|
-
onComplete: (completeUrl: string) => Promise<void>;
|
|
9
|
-
onInitiate: () => void;
|
|
10
|
-
onLog: (...statements: string[]) => void;
|
|
11
|
-
pkce: PKCE | undefined;
|
|
12
|
-
redirectUri: string;
|
|
13
|
-
}
|
|
14
|
-
export default function SEBankIDSameDeviceReload(props: Props): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PKCE } from '@criipto/auth-js';
|
|
2
|
-
export interface Links {
|
|
3
|
-
cancelUrl: string;
|
|
4
|
-
completeUrl: string;
|
|
5
|
-
pollUrl: string;
|
|
6
|
-
launchLinks: {
|
|
7
|
-
customFileHandlerUrl: string;
|
|
8
|
-
universalLink: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface State {
|
|
12
|
-
pkce: PKCE | undefined;
|
|
13
|
-
redirectUri: string;
|
|
14
|
-
links: Links;
|
|
15
|
-
}
|
|
16
|
-
export declare function hydrateState(): State | undefined;
|
|
17
|
-
export declare const autoHydratedState: State | undefined;
|
|
18
|
-
export declare function clearState(): void;
|
|
19
|
-
export declare function saveState(input: State): void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
className: string;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
logo: React.ReactNode;
|
|
6
|
-
fallback: React.ReactElement;
|
|
7
|
-
redirectUri?: string;
|
|
8
|
-
userAgent?: string;
|
|
9
|
-
}
|
|
10
|
-
type Resume = 'Foreground' | 'Reload' | 'Poll';
|
|
11
|
-
type LinkType = 'universal' | 'scheme';
|
|
12
|
-
export declare function determineStrategy(input: string | undefined, loginHint?: string): {
|
|
13
|
-
resume: Resume;
|
|
14
|
-
linkType: LinkType;
|
|
15
|
-
redirect: boolean;
|
|
16
|
-
};
|
|
17
|
-
export declare class NotDoneError extends Error {
|
|
18
|
-
constructor(message: string);
|
|
19
|
-
}
|
|
20
|
-
export default function SEBankIDSameDeviceButton(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
package/dist/context.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import CriiptoAuth, { OpenIDConfiguration, AuthorizeUrlParamsOptional, PKCE, AuthorizeResponse, OAuth2Error, PKCEPublicPart } from '@criipto/auth-js';
|
|
3
|
-
import { PopupAuthorizeParams, RedirectAuthorizeParams } from '@criipto/auth-js/dist/types';
|
|
4
|
-
export type ResultSource = 'QRCode' | 'SEBankIDQrCode' | 'SEBankIDSameDeviceButton' | 'redirect' | 'popup';
|
|
5
|
-
export type Result = {
|
|
6
|
-
id_token: string;
|
|
7
|
-
state?: string;
|
|
8
|
-
source?: ResultSource;
|
|
9
|
-
} | {
|
|
10
|
-
code: string;
|
|
11
|
-
state?: string;
|
|
12
|
-
source?: ResultSource;
|
|
13
|
-
} | OAuth2Error | Error;
|
|
14
|
-
export declare const actions: readonly ["confirm", "accept", "approve", "sign", "login"];
|
|
15
|
-
export type Action = (typeof actions)[number];
|
|
16
|
-
export type Claims = {
|
|
17
|
-
iss: string;
|
|
18
|
-
aud: string;
|
|
19
|
-
identityscheme: string;
|
|
20
|
-
authenticationtype: string;
|
|
21
|
-
sub: string;
|
|
22
|
-
iat: number;
|
|
23
|
-
exp: number;
|
|
24
|
-
[key: string]: string | number;
|
|
25
|
-
};
|
|
26
|
-
export interface CriiptoVerifyContextInterface {
|
|
27
|
-
loginWithRedirect: (params?: RedirectAuthorizeParams) => Promise<void>;
|
|
28
|
-
loginWithPopup: (params?: PopupAuthorizeParams) => Promise<void>;
|
|
29
|
-
checkSession: () => Promise<void>;
|
|
30
|
-
logout: (params?: {
|
|
31
|
-
redirectUri?: string;
|
|
32
|
-
state?: string;
|
|
33
|
-
}) => Promise<void>;
|
|
34
|
-
fetchOpenIDConfiguration: () => Promise<OpenIDConfiguration>;
|
|
35
|
-
buildAuthorizeUrl: (options?: AuthorizeUrlParamsOptional) => Promise<string>;
|
|
36
|
-
generatePKCE: () => Promise<PKCE | undefined>;
|
|
37
|
-
buildOptions: (options?: AuthorizeUrlParamsOptional | RedirectAuthorizeParams) => AuthorizeUrlParamsOptional;
|
|
38
|
-
handleResponse: (response: AuthorizeResponse, params: {
|
|
39
|
-
pkce?: PKCE;
|
|
40
|
-
redirectUri?: string;
|
|
41
|
-
source?: ResultSource;
|
|
42
|
-
}) => Promise<void>;
|
|
43
|
-
responseType: 'token' | 'code';
|
|
44
|
-
completionStrategy: 'client' | 'openidprovider';
|
|
45
|
-
result: Result | null;
|
|
46
|
-
claims: Claims | null;
|
|
47
|
-
domain: string;
|
|
48
|
-
redirectUri?: string;
|
|
49
|
-
action: Action;
|
|
50
|
-
message?: string;
|
|
51
|
-
pkce?: PKCE | PKCEPublicPart;
|
|
52
|
-
store: Storage;
|
|
53
|
-
isLoading: boolean;
|
|
54
|
-
isInitializing: boolean;
|
|
55
|
-
acrValues?: string[];
|
|
56
|
-
uiLocales?: string;
|
|
57
|
-
client: CriiptoAuth;
|
|
58
|
-
loginHint?: string;
|
|
59
|
-
}
|
|
60
|
-
declare const CriiptoVerifyContext: import("react").Context<CriiptoVerifyContextInterface>;
|
|
61
|
-
export default CriiptoVerifyContext;
|