@criipto/verify-react 4.0.4 → 4.0.6

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/dist/index.d.ts CHANGED
@@ -8,6 +8,6 @@ import { default as useCriiptoVerify } from './use-criipto-verify';
8
8
  export { type Result, type Action, actions } from './context';
9
9
  export { type Language, filterAcrValues } from './utils';
10
10
  export { OAuth2Error } from '@criipto/auth-js';
11
- export { CriiptoVerifyProvider, AuthMethodSelector, AuthMethodSelectorSweden, useCriiptoVerify, QRCode, SEBankIDQRCode };
11
+ export { CriiptoVerifyProvider, AuthMethodSelector, AuthMethodSelectorSweden, useCriiptoVerify, QRCode, SEBankIDQRCode, };
12
12
  export { AuthMethodButton, AuthMethodButton as AuthButton, AuthButtonGroup };
13
13
  import './index.css';
@@ -8,7 +8,7 @@ export interface CriiptoVerifyProviderOptions {
8
8
  /**
9
9
  * @deprecated Development use only
10
10
  */
11
- protocol?: "https" | "http";
11
+ protocol?: 'https' | 'http';
12
12
  redirectUri?: string;
13
13
  children: React.ReactNode;
14
14
  pkce?: PKCEPublicPart;
@@ -38,7 +38,7 @@ export interface CriiptoVerifyProviderOptions {
38
38
  * Note: In most cases modifying this setting **is not needed**. Defaults will work with almost all React SPA cases.
39
39
  * By default @criipto/verify-react will do PKCE on your behalf and return a jwt token.
40
40
  * However if you wish you can disable this and get the raw `code` response by setting `response` to 'code'.
41
- */
41
+ */
42
42
  response?: 'token' | 'code';
43
43
  completionStrategy?: 'client' | 'openidprovider';
44
44
  /**
@@ -52,7 +52,7 @@ export interface CriiptoVerifyProviderOptions {
52
52
  /**
53
53
  * @deprecated Criipto internal use
54
54
  */
55
- responseMode?: "query" | "form_post" | "fragment" | "json" | "post_message";
55
+ responseMode?: 'query' | 'form_post' | 'fragment' | 'json' | 'post_message';
56
56
  }
57
57
  export declare const ACTION_SUPPORTING_ACR_VALUES: string[];
58
58
  export declare const MESSAGE_SUPPORTING_ACR_VALUES: string[];
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Action } from "./context";
1
+ import { Action } from './context';
2
2
  export declare const VERSION: string;
3
3
  export declare const DKMITID_PREFIX = "urn:grn:authn:dk:mitid";
4
4
  export declare const DKMITID_BUSINESS = "urn:grn:authn:dk:mitid:business";
package/jest.config.ts CHANGED
@@ -24,7 +24,7 @@ export default {
24
24
  // collectCoverageFrom: undefined,
25
25
 
26
26
  // The directory where Jest should output its coverage files
27
- coverageDirectory: "coverage",
27
+ coverageDirectory: 'coverage',
28
28
 
29
29
  // An array of regexp pattern strings used to skip coverage collection
30
30
  // coveragePathIgnorePatterns: [
@@ -32,7 +32,7 @@ export default {
32
32
  // ],
33
33
 
34
34
  // Indicates which provider should be used to instrument code for coverage
35
- coverageProvider: "v8",
35
+ coverageProvider: 'v8',
36
36
 
37
37
  // A list of reporter names that Jest uses when writing coverage reports
38
38
  // coverageReporters: [
@@ -132,9 +132,7 @@ export default {
132
132
  // runner: "jest-runner",
133
133
 
134
134
  // The paths to modules that run some code to configure or set up the testing environment before each test
135
- setupFiles: [
136
- './jest.setup.ts'
137
- ],
135
+ setupFiles: ['./jest.setup.ts'],
138
136
 
139
137
  // A list of paths to modules that run some code to configure or set up the testing framework before each test
140
138
  // setupFilesAfterEnv: [],
@@ -161,10 +159,7 @@ export default {
161
159
  // ],
162
160
 
163
161
  // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
164
- testPathIgnorePatterns: [
165
- "/node_modules/",
166
- "./dist/"
167
- ],
162
+ testPathIgnorePatterns: ['/node_modules/', './dist/'],
168
163
 
169
164
  // The regexp pattern or array of patterns that Jest uses to detect test files
170
165
  // testRegex: [],
@@ -177,7 +172,7 @@ export default {
177
172
 
178
173
  // A map from regular expressions to paths to transformers
179
174
  transform: {
180
- ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$": "jest-transform-stub",
175
+ '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$': 'jest-transform-stub',
181
176
  },
182
177
 
183
178
  // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
package/jest.setup.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import webcrypto from 'node:crypto';
2
2
 
3
- Object.defineProperty(globalThis, "crypto", {
4
- value: webcrypto
3
+ Object.defineProperty(globalThis, 'crypto', {
4
+ value: webcrypto,
5
5
  });
6
6
 
7
- if (!("getRandomValues" in webcrypto)) {
7
+ if (!('getRandomValues' in webcrypto)) {
8
8
  (webcrypto as any).getRandomValues = (arr: Uint8Array) => {
9
- const bytes = require('crypto').randomBytes(arr.length)
9
+ const bytes = require('crypto').randomBytes(arr.length);
10
10
  arr.fill(bytes);
11
- }
11
+ };
12
12
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@criipto/verify-react",
3
3
  "private": false,
4
- "version": "4.0.4",
4
+ "version": "4.0.6",
5
5
  "description": "Verify SDK for React Single Page Applications",
6
6
  "main": "dist/criipto-verify-react.cjs.js",
7
7
  "types": "dist/index.d.ts",
@@ -13,7 +13,8 @@
13
13
  "check": "tsc --noEmit",
14
14
  "storybook": "storybook dev -p 6006",
15
15
  "build-storybook": "storybook build",
16
- "prepublishOnly": "npm run check && npm run clean && npm run build"
16
+ "prepublishOnly": "npm run check && npm run clean && npm run build",
17
+ "prepare": "husky"
17
18
  },
18
19
  "peerDependencies": {
19
20
  "react": "^16.11.0 || ^17 || ^18 || ^19",
@@ -42,9 +43,12 @@
42
43
  "@types/ua-parser-js": "^0.7.36",
43
44
  "babel-loader": "^8.2.5",
44
45
  "css-loader": "^6.7.1",
46
+ "husky": "^9.1.7",
45
47
  "jest": "^29.0.3",
46
48
  "jest-transform-stub": "^2.0.0",
49
+ "lint-staged": "^16.2.6",
47
50
  "mini-css-extract-plugin": "^2.6.1",
51
+ "prettier": "^3.6.2",
48
52
  "react": "^19.0.0",
49
53
  "react-dom": "^19.0.0",
50
54
  "react-test-renderer": "^19.0.0",
@@ -79,5 +83,8 @@
79
83
  "@criipto/auth-js": "^3.7.2",
80
84
  "jwt-decode": "^3.1.2",
81
85
  "ua-parser-js": "^1.0.37"
86
+ },
87
+ "lint-staged": {
88
+ "*": "prettier --ignore-unknown --write"
82
89
  }
83
90
  }
package/tsconfig.json CHANGED
@@ -11,9 +11,9 @@
11
11
  // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
12
 
13
13
  /* Language and Environment */
14
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
14
+ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
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. */
16
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
17
17
  // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
18
  // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
19
  // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
@@ -24,16 +24,16 @@
24
24
  // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
25
 
26
26
  /* Modules */
27
- "module": "esnext", /* Specify what module code is generated. */
27
+ "module": "esnext" /* Specify what module code is generated. */,
28
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. */
29
+ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
30
30
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31
31
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
32
32
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
33
33
  "typeRoots": [
34
34
  "./node_modules/@types",
35
35
  "./typings"
36
- ], /* Specify multiple folders that act like `./node_modules/@types`. */
36
+ ] /* Specify multiple folders that act like `./node_modules/@types`. */,
37
37
  // "types": [], /* Specify type package names to be included without being referenced in a source file. */
38
38
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
39
39
  // "resolveJsonModule": true, /* Enable importing .json files */
@@ -45,10 +45,10 @@
45
45
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
46
46
 
47
47
  /* Emit */
48
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
49
49
  // "declarationMap": true, /* Create sourcemaps for d.ts files. */
50
50
  // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
51
- "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
+ "sourceMap": true /* Create source map files for emitted JavaScript files. */,
52
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
53
  // "outDir": "./", /* Specify an output folder for all emitted files. */
54
54
  // "removeComments": true, /* Disable emitting comments. */
@@ -70,16 +70,16 @@
70
70
  // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
71
71
 
72
72
  /* Interop Constraints */
73
- "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
+ "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
74
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. */
75
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
76
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. */
77
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
78
78
 
79
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`. */
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
83
  // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
84
84
  // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
85
85
  // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
@@ -90,7 +90,7 @@
90
90
  // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
91
91
  // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
92
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. */
93
+ "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
94
94
  // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
95
95
  // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
96
96
  // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
@@ -99,12 +99,8 @@
99
99
 
100
100
  /* Completeness */
101
101
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
102
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
103
103
  },
104
- "include": [
105
- "src"
106
- ],
107
- "exclude": [
108
- "src/**/*.stories.*"
109
- ]
110
- }
104
+ "include": ["src"],
105
+ "exclude": ["src/**/*.stories.*"]
106
+ }
@@ -1,13 +0,0 @@
1
- 🩺 The doctor is checking the health of your Storybook..
2
- ╭ Package storybook not found ───────────────────────────────────────────────────────────╮
3
- │ │
4
- │ The storybook package was not found in your package.json. │
5
- │ Installing storybook as a direct dev dependency in your package.json is required. │
6
- │ │
7
- ╰────────────────────────────────────────────────────────────────────────────────────────╯
8
-
9
- You can always recheck the health of your project by running:
10
- npx storybook doctor
11
-
12
- Full logs are available in /home/mick/dev/criipto-verify-react/doctor-storybook.log
13
-