fds-vue-core 8.10.0 → 8.11.1
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/components.d.ts +8 -0
- package/dist/components/BankId/FdsBankIdQr/FdsBankIdQr.vue.d.ts +28 -0
- package/dist/components/BankId/FdsBankIdQr/types.d.ts +11 -0
- package/dist/components/BankId/FdsBankIdSameDevice/FdsBankIdSameDevice.vue.d.ts +13 -0
- package/dist/components/BankId/FdsBankIdSameDevice/types.d.ts +8 -0
- package/dist/components/BankId/FdsBankIdStatusAlert/FdsBankIdStatusAlert.vue.d.ts +13 -0
- package/dist/components/BankId/FdsBankIdStatusAlert/types.d.ts +9 -0
- package/dist/components/Form/FdsLoginEmailForm/FdsLoginEmailForm.vue.d.ts +20 -0
- package/dist/components/Form/FdsLoginEmailForm/types.d.ts +20 -0
- package/dist/composables/useBankIdDeviceIdentifier.d.ts +8 -0
- package/dist/composables/useBankIdMessages.d.ts +8 -0
- package/dist/composables/useBankIdSameDevice.d.ts +32 -0
- package/dist/composables/useBankIdSession.d.ts +55 -0
- package/dist/fds-vue-core.cjs.js +3182 -451
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.css +1 -1
- package/dist/fds-vue-core.es.js +3174 -454
- package/dist/fds-vue-core.es.js.map +1 -1
- package/dist/helpers/bankId/autostart.d.ts +7 -0
- package/dist/helpers/bankId/constants.d.ts +18 -0
- package/dist/helpers/bankId/device.d.ts +2 -0
- package/dist/helpers/bankId/deviceIdentifier.d.ts +6 -0
- package/dist/helpers/bankId/hintCode.d.ts +13 -0
- package/dist/helpers/bankId/index.d.ts +30 -0
- package/dist/helpers/bankId/pollError.d.ts +2 -0
- package/dist/helpers/bankId/sameDevice.d.ts +46 -0
- package/dist/helpers/bankId/types.d.ts +83 -0
- package/dist/helpers/validateLoginEmail.d.ts +3 -0
- package/dist/index.d.ts +21 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/components/BankId/FdsBankIdQr/FdsBankIdQr.stories.ts +33 -0
- package/src/components/BankId/FdsBankIdQr/FdsBankIdQr.vue +89 -0
- package/src/components/BankId/FdsBankIdQr/types.ts +12 -0
- package/src/components/BankId/FdsBankIdSameDevice/FdsBankIdSameDevice.stories.ts +23 -0
- package/src/components/BankId/FdsBankIdSameDevice/FdsBankIdSameDevice.vue +48 -0
- package/src/components/BankId/FdsBankIdSameDevice/types.ts +9 -0
- package/src/components/BankId/FdsBankIdStatusAlert/FdsBankIdStatusAlert.stories.ts +19 -0
- package/src/components/BankId/FdsBankIdStatusAlert/FdsBankIdStatusAlert.vue +28 -0
- package/src/components/BankId/FdsBankIdStatusAlert/types.ts +10 -0
- package/src/components/Form/FdsLoginEmailForm/FdsLoginEmailForm.stories.ts +23 -0
- package/src/components/Form/FdsLoginEmailForm/FdsLoginEmailForm.vue +126 -0
- package/src/components/Form/FdsLoginEmailForm/types.ts +22 -0
- package/src/composables/useBankIdDeviceIdentifier.ts +15 -0
- package/src/composables/useBankIdMessages.ts +83 -0
- package/src/composables/useBankIdSameDevice.ts +161 -0
- package/src/composables/useBankIdSession.spec.ts +817 -0
- package/src/composables/useBankIdSession.ts +587 -0
- package/src/helpers/bankId/autostart.spec.ts +11 -0
- package/src/helpers/bankId/autostart.ts +32 -0
- package/src/helpers/bankId/constants.ts +18 -0
- package/src/helpers/bankId/device.ts +7 -0
- package/src/helpers/bankId/deviceIdentifier.ts +52 -0
- package/src/helpers/bankId/hintCode.spec.ts +31 -0
- package/src/helpers/bankId/hintCode.ts +62 -0
- package/src/helpers/bankId/index.ts +34 -0
- package/src/helpers/bankId/pollError.ts +44 -0
- package/src/helpers/bankId/sameDevice.spec.ts +126 -0
- package/src/helpers/bankId/sameDevice.ts +242 -0
- package/src/helpers/bankId/types.ts +91 -0
- package/src/helpers/validateLoginEmail.spec.ts +25 -0
- package/src/helpers/validateLoginEmail.ts +26 -0
- package/src/index.ts +60 -0
- package/src/lang/en.json +61 -0
- package/src/lang/sv.json +61 -0
package/components.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ import type { FdsRadioProps } from './dist/components/Form/FdsRadio/types'
|
|
|
35
35
|
import type { FdsSelectProps } from './dist/components/Form/FdsSelect/types'
|
|
36
36
|
import type { FdsPhonenumberProps } from './dist/components/Form/FdsPhonenumber/types'
|
|
37
37
|
import type { FdsSsnProps } from './dist/components/Form/FdsSsn/types'
|
|
38
|
+
import type { FdsLoginEmailFormProps } from './dist/components/Form/FdsLoginEmailForm/types'
|
|
39
|
+
import type { FdsBankIdQrProps } from './dist/components/BankId/FdsBankIdQr/types'
|
|
40
|
+
import type { FdsBankIdSameDeviceProps } from './dist/components/BankId/FdsBankIdSameDevice/types'
|
|
41
|
+
import type { FdsBankIdStatusAlertProps } from './dist/components/BankId/FdsBankIdStatusAlert/types'
|
|
38
42
|
import type { FdsTextareaProps } from './dist/components/Form/FdsTextarea/types'
|
|
39
43
|
import type { FdsTableProps } from './dist/components/Table/FdsTable/types'
|
|
40
44
|
import type { FdsTableHeadProps } from './dist/components/Table/FdsTableHead/types'
|
|
@@ -70,6 +74,10 @@ declare module 'vue' {
|
|
|
70
74
|
FdsTextarea: DefineComponent<FdsTextareaProps>
|
|
71
75
|
FdsPhonenumber: DefineComponent<FdsPhonenumberProps>
|
|
72
76
|
FdsSsn: DefineComponent<FdsSsnProps>
|
|
77
|
+
FdsLoginEmailForm: DefineComponent<FdsLoginEmailFormProps>
|
|
78
|
+
FdsBankIdQr: DefineComponent<FdsBankIdQrProps>
|
|
79
|
+
FdsBankIdSameDevice: DefineComponent<FdsBankIdSameDeviceProps>
|
|
80
|
+
FdsBankIdStatusAlert: DefineComponent<FdsBankIdStatusAlertProps>
|
|
73
81
|
FdsSelect: DefineComponent<FdsSelectProps>
|
|
74
82
|
FdsTable: DefineComponent<FdsTableProps>
|
|
75
83
|
FdsTableHead: DefineComponent<FdsTableHeadProps>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FdsBankIdQrProps } from './types';
|
|
2
|
+
declare var __VLS_14: {
|
|
3
|
+
qrCode: string | null;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
qr?: (props: typeof __VLS_14) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<FdsBankIdQrProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
cancel: () => any;
|
|
10
|
+
showQr: () => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<FdsBankIdQrProps> & Readonly<{
|
|
12
|
+
onCancel?: (() => any) | undefined;
|
|
13
|
+
onShowQr?: (() => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
dataTestid: string;
|
|
16
|
+
qrCode: string | null;
|
|
17
|
+
activePolling: boolean;
|
|
18
|
+
ongoingLogin: boolean;
|
|
19
|
+
rfa: string | null;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FdsBankIdSameDeviceProps } from './types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<FdsBankIdSameDeviceProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
start: () => any;
|
|
4
|
+
cancel: () => any;
|
|
5
|
+
}, string, import('vue').PublicProps, Readonly<FdsBankIdSameDeviceProps> & Readonly<{
|
|
6
|
+
onStart?: (() => any) | undefined;
|
|
7
|
+
onCancel?: (() => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
dataTestid: string;
|
|
10
|
+
ongoingLogin: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FdsBankIdStatusAlertProps } from './types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<FdsBankIdStatusAlertProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
close: () => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<FdsBankIdStatusAlertProps> & Readonly<{
|
|
5
|
+
onClose?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
title: string | null;
|
|
8
|
+
dataTestid: string;
|
|
9
|
+
body: string | null;
|
|
10
|
+
closeable: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FdsLoginEmailFormProps } from './types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<FdsLoginEmailFormProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
submit: (payload: import('./types').FdsLoginEmailSubmitPayload) => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<FdsLoginEmailFormProps> & Readonly<{
|
|
5
|
+
onSubmit?: ((payload: import('./types').FdsLoginEmailSubmitPayload) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
emailLabel: string;
|
|
9
|
+
passwordLabel: string;
|
|
10
|
+
submitLabel: string;
|
|
11
|
+
submittingLabel: string;
|
|
12
|
+
emailInvalidMessage: string;
|
|
13
|
+
emailRequiredMessage: string;
|
|
14
|
+
passwordRequiredMessage: string;
|
|
15
|
+
emailTestid: string;
|
|
16
|
+
passwordTestid: string;
|
|
17
|
+
submitTestid: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FdsLoginEmailFormProps {
|
|
2
|
+
loading?: boolean;
|
|
3
|
+
emailLabel?: string;
|
|
4
|
+
passwordLabel?: string;
|
|
5
|
+
submitLabel?: string;
|
|
6
|
+
submittingLabel?: string;
|
|
7
|
+
emailInvalidMessage?: string;
|
|
8
|
+
emailRequiredMessage?: string;
|
|
9
|
+
passwordRequiredMessage?: string;
|
|
10
|
+
emailTestid?: string;
|
|
11
|
+
passwordTestid?: string;
|
|
12
|
+
submitTestid?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FdsLoginEmailSubmitPayload {
|
|
15
|
+
email: string;
|
|
16
|
+
password: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FdsLoginEmailFormEmits {
|
|
19
|
+
submit: [payload: FdsLoginEmailSubmitPayload];
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UseBankIdDeviceIdentifierOptions {
|
|
2
|
+
storageKey?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBankIdDeviceIdentifier(options?: UseBankIdDeviceIdentifierOptions): {
|
|
5
|
+
getBankIdDeviceIdentifier: ({ hash }?: {
|
|
6
|
+
hash?: boolean | undefined;
|
|
7
|
+
}) => Promise<string>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UseBankIdMessagesOptions {
|
|
2
|
+
titles?: Partial<Record<string, string>>;
|
|
3
|
+
bodies?: Partial<Record<string, string>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function useBankIdMessages(options?: UseBankIdMessagesOptions): {
|
|
6
|
+
mapTitle: (code: string) => string;
|
|
7
|
+
mapBody: (code: string) => string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { generateBankIdNonce } from '../helpers/bankId/sameDevice';
|
|
2
|
+
import { BankIdNonceMetadata } from '../helpers/bankId/types';
|
|
3
|
+
export interface UseBankIdSameDeviceOptions {
|
|
4
|
+
storageKey: string;
|
|
5
|
+
getCurrentPath?: () => string;
|
|
6
|
+
navigateTo?: (path: string) => void | Promise<unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface HandleBankIdClientReturnOptions {
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
onError?: (errorMessage: string) => void;
|
|
11
|
+
/** Order this mounted session is already polling. Its stored nonce is kept past the 3 minute limit. */
|
|
12
|
+
activeOrderRef?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface BankIdClientReturnResult {
|
|
15
|
+
status: 'ignored' | 'matched' | 'resumed' | 'mismatch';
|
|
16
|
+
nonce?: string;
|
|
17
|
+
orderRef?: string;
|
|
18
|
+
/** Set when the return landed on another route. The caller navigates and must not cancel the order. */
|
|
19
|
+
redirectTo?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const useBankIdSameDevice: (options: UseBankIdSameDeviceOptions) => {
|
|
22
|
+
generateNonce: typeof generateBankIdNonce;
|
|
23
|
+
createReturnUrl: (nonce: string) => string | null;
|
|
24
|
+
persistNonceMetadata: (nonce: string, orderRef?: string) => void;
|
|
25
|
+
navigateTo: (path: string) => void | Promise<unknown>;
|
|
26
|
+
getStoredNonceMetadata: () => BankIdNonceMetadata | null;
|
|
27
|
+
clearStoredNonceMetadata: () => void;
|
|
28
|
+
extractNonceFromHash: (hash?: string) => string | null;
|
|
29
|
+
stripNonceFromLocation: () => void;
|
|
30
|
+
handleBankIdClientReturn: (returnOptions?: HandleBankIdClientReturnOptions) => BankIdClientReturnResult;
|
|
31
|
+
validateStoredNonce: (expectedNonce: string | null) => boolean;
|
|
32
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { BankIdCreateOrderPayload, BankIdDeviceType, BankIdOrderResponse, BankIdPollPayload, BankIdPollResponse } from '../helpers/bankId/types';
|
|
3
|
+
import { UseBankIdMessagesOptions } from './useBankIdMessages';
|
|
4
|
+
import { BankIdClientReturnResult, HandleBankIdClientReturnOptions, UseBankIdSameDeviceOptions } from './useBankIdSameDevice';
|
|
5
|
+
export interface UseBankIdSessionOptions extends Pick<UseBankIdSameDeviceOptions, 'storageKey' | 'getCurrentPath' | 'navigateTo'>, UseBankIdMessagesOptions {
|
|
6
|
+
createOrder: (payload: BankIdCreateOrderPayload) => Promise<BankIdOrderResponse>;
|
|
7
|
+
poll: (payload: BankIdPollPayload) => Promise<BankIdPollResponse>;
|
|
8
|
+
cancel: (orderRef: string) => Promise<unknown>;
|
|
9
|
+
deviceIdentifierStorageKey?: string;
|
|
10
|
+
onSuccess?: (response: BankIdPollResponse) => void | Promise<void>;
|
|
11
|
+
onActivation?: (response: BankIdPollResponse) => void;
|
|
12
|
+
onPoll?: (response: BankIdPollResponse) => void;
|
|
13
|
+
onNonceMismatch?: () => void;
|
|
14
|
+
mapPollError?: (error: unknown) => string | null | undefined;
|
|
15
|
+
pollIntervalMs?: number;
|
|
16
|
+
/** How often an unscanned QR order is replaced. */
|
|
17
|
+
qrRefreshMs?: number;
|
|
18
|
+
maxPolls?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare const useBankIdSession: (options: UseBankIdSessionOptions) => {
|
|
21
|
+
bankId: {
|
|
22
|
+
activePolling: boolean;
|
|
23
|
+
title: string | null;
|
|
24
|
+
body: string | null;
|
|
25
|
+
messageType: "info" | "warning";
|
|
26
|
+
messageCloseable: boolean;
|
|
27
|
+
transactionToken: {
|
|
28
|
+
orderRef: string;
|
|
29
|
+
} | null;
|
|
30
|
+
qrCode: string | null;
|
|
31
|
+
autoStartToken: string | null;
|
|
32
|
+
ongoingLogin: boolean;
|
|
33
|
+
sameDevice: boolean;
|
|
34
|
+
hintCode: string | null;
|
|
35
|
+
rfa: string | null;
|
|
36
|
+
nonce: string | null;
|
|
37
|
+
messageCode: string | null;
|
|
38
|
+
};
|
|
39
|
+
device: Ref<BankIdDeviceType | null, BankIdDeviceType | null>;
|
|
40
|
+
loading: Ref<boolean, boolean>;
|
|
41
|
+
initiateBankId: () => Promise<BankIdOrderResponse | undefined>;
|
|
42
|
+
openBankId: () => Promise<void>;
|
|
43
|
+
onCancel: () => Promise<void>;
|
|
44
|
+
clearError: () => void;
|
|
45
|
+
clearBankid: (msg: string) => void;
|
|
46
|
+
getDevice: () => void;
|
|
47
|
+
handleBankIdClientReturn: (returnOptions?: HandleBankIdClientReturnOptions) => BankIdClientReturnResult;
|
|
48
|
+
generateNonce: typeof import('../helpers/bankId/sameDevice').generateBankIdNonce;
|
|
49
|
+
createReturnUrl: (nonce: string) => string | null;
|
|
50
|
+
persistNonceMetadata: (nonce: string, orderRef?: string) => void;
|
|
51
|
+
clearStoredNonceMetadata: () => void;
|
|
52
|
+
validateStoredNonce: (expectedNonce: string | null) => boolean;
|
|
53
|
+
mapTitle: (code: string) => string;
|
|
54
|
+
mapBody: (code: string) => string;
|
|
55
|
+
};
|