@mosip/react-inji-verify-sdk 0.14.0-beta.1 → 0.14.0-beta.3
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/components/Button/Button.d.ts +10 -0
- package/dist/components/openid4vp-verification/OpenID4VPVerification.d.ts +1 -1
- package/dist/components/openid4vp-verification/OpenID4VPVerification.types.d.ts +22 -2
- package/dist/components/openid4vp-verification/WalletSelectionModal.d.ts +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/utils/api.d.ts +2 -1
- package/dist/utils/themeUtils.d.ts +4 -0
- package/package.json +10 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement, ButtonHTMLAttributes } from "react";
|
|
2
|
+
type ButtonVariant = "fill" | "outline" | "clear";
|
|
3
|
+
type ButtonProps = HTMLAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
title: string;
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Button: ({ title, icon, variant, disabled, className, id, ...rest }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
|
|
3
3
|
declare const OpenID4VPVerification: React.FC<OpenID4VPVerificationProps>;
|
|
4
4
|
export default OpenID4VPVerification;
|
|
@@ -21,7 +21,7 @@ export type VerificationResults = VerificationResult[];
|
|
|
21
21
|
export interface QrData {
|
|
22
22
|
transactionId: string;
|
|
23
23
|
requestId: string;
|
|
24
|
-
authorizationDetails
|
|
24
|
+
authorizationDetails?: {
|
|
25
25
|
responseType: string;
|
|
26
26
|
clientId: string;
|
|
27
27
|
presentationDefinition: Record<string, unknown>;
|
|
@@ -31,6 +31,7 @@ export interface QrData {
|
|
|
31
31
|
iat: number;
|
|
32
32
|
};
|
|
33
33
|
expiresAt: number;
|
|
34
|
+
requestUri?: string;
|
|
34
35
|
}
|
|
35
36
|
export interface VPRequestBody {
|
|
36
37
|
clientId: string;
|
|
@@ -39,6 +40,11 @@ export interface VPRequestBody {
|
|
|
39
40
|
presentationDefinitionId?: string;
|
|
40
41
|
presentationDefinition?: PresentationDefinition;
|
|
41
42
|
}
|
|
43
|
+
export interface Wallet {
|
|
44
|
+
name: string;
|
|
45
|
+
scheme: string;
|
|
46
|
+
icon: string;
|
|
47
|
+
}
|
|
42
48
|
type ExclusivePresentationDefinition =
|
|
43
49
|
/**
|
|
44
50
|
* ID of the presentation definition used for verification.
|
|
@@ -73,6 +79,14 @@ type ExclusiveCallbacks =
|
|
|
73
79
|
onVPProcessed: (VPResult: VerificationResults) => void;
|
|
74
80
|
onVPReceived?: never;
|
|
75
81
|
};
|
|
82
|
+
type SameDeviceFlowEnabledProps = {
|
|
83
|
+
isEnableSameDeviceFlow: true;
|
|
84
|
+
supportedWallets: Wallet[];
|
|
85
|
+
};
|
|
86
|
+
type SameDeviceFlowDisabledProps = {
|
|
87
|
+
isEnableSameDeviceFlow?: false | undefined;
|
|
88
|
+
supportedWallets?: Wallet[];
|
|
89
|
+
};
|
|
76
90
|
interface InputDescriptor {
|
|
77
91
|
id: string;
|
|
78
92
|
format?: {
|
|
@@ -92,7 +106,7 @@ export interface PresentationDefinition {
|
|
|
92
106
|
};
|
|
93
107
|
input_descriptors: InputDescriptor[];
|
|
94
108
|
}
|
|
95
|
-
|
|
109
|
+
type BaseProps = ExclusivePresentationDefinition & ExclusiveCallbacks & {
|
|
96
110
|
/**
|
|
97
111
|
|
|
98
112
|
React element that triggers the verification process (e.g., a button).
|
|
@@ -107,6 +121,11 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
|
|
|
107
121
|
verifyServiceUrl: string;
|
|
108
122
|
/**
|
|
109
123
|
|
|
124
|
+
The client identifier for relaying party.
|
|
125
|
+
*/
|
|
126
|
+
clientId: string;
|
|
127
|
+
/**
|
|
128
|
+
|
|
110
129
|
The protocol being used for verification (e.g., OpenID4VP).
|
|
111
130
|
*/
|
|
112
131
|
protocol?: string;
|
|
@@ -137,4 +156,5 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
|
|
|
137
156
|
*/
|
|
138
157
|
onError: (error: Error) => void;
|
|
139
158
|
};
|
|
159
|
+
export type OpenID4VPVerificationProps = (BaseProps & SameDeviceFlowEnabledProps) | (BaseProps & SameDeviceFlowDisabledProps);
|
|
140
160
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Wallet } from "./OpenID4VPVerification.types";
|
|
3
|
+
interface WalletSelectionModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
wallets: Wallet[];
|
|
6
|
+
selectedWallet: Wallet | null;
|
|
7
|
+
onSelect: (wallet: Wallet | null) => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
onProceed: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const WalletSelectionModal: React.FC<WalletSelectionModalProps>;
|
|
12
|
+
export default WalletSelectionModal;
|
package/dist/index.d.ts
CHANGED