@equs-ai/dtk-embedded-ui 0.1.3 → 0.2.0-dev.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/CHANGELOG.md +18 -0
- package/LICENSE +1 -1
- package/README.md +12 -0
- package/embedded.d.ts +32 -14
- package/embedded.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@equs-ai/dtk-embedded-ui` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [0.2.0]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `issueVC` supports authorization code offers via `flow: 'authorization_code'`. The holder signs in with the issuer inside their mobile wallet, so `userInfo`, `manualTxCode`, `contactInfoOptions` and `deliverTxCode` are not passed.
|
|
10
|
+
- New types `PreAuthorizedCodeIssueVcOptions`, `AuthorizationCodeIssueVcOptions` and `DeliverTxCode`.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `issueVC` accepts `externalWallet` on its own; at least one of `internalWallet` or `externalWallet` must be supported.
|
|
15
|
+
- `IssueVcOptions` is now a union of `PreAuthorizedCodeIssueVcOptions` and `AuthorizationCodeIssueVcOptions`. Calls to `issueVC` are unaffected, but code that reads into the type must use the specific variant:
|
|
16
|
+
- `IssueVcOptions['deliverTxCode']` → `DeliverTxCode`
|
|
17
|
+
- `interface X extends IssueVcOptions` → `extends PreAuthorizedCodeIssueVcOptions`
|
|
18
|
+
- `DeliverTxCodeResponse.txCodeFetchUrl` and `txCodeResendUrl` may be `null`.
|
package/LICENSE
CHANGED
|
@@ -4,7 +4,7 @@ License text copyright (c) 2020 MariaDB Corporation Ab, All Rights Reserved.
|
|
|
4
4
|
Parameters
|
|
5
5
|
|
|
6
6
|
Licensor: EQUS, Inc.
|
|
7
|
-
Licensed Work: EQUS Embeddable UI v.0.1
|
|
7
|
+
Licensed Work: EQUS Embeddable UI v.0.2.0-dev.1
|
|
8
8
|
The Licensed Work is (c) 2026 EQUS, Inc.
|
|
9
9
|
|
|
10
10
|
Additional Use Grant: You may use the Licensed Work, including in
|
package/README.md
CHANGED
|
@@ -61,6 +61,18 @@ verifyButton.onclick = () =>
|
|
|
61
61
|
|
|
62
62
|
Replace every `<…>` value with your own. The endpoints are routes on **your** backend, which in turn call the EQUS Developer Toolkit APIs.
|
|
63
63
|
|
|
64
|
+
### Authorization code offers
|
|
65
|
+
|
|
66
|
+
When your backend creates an authorization code offer, the holder signs in with you inside their mobile wallet, so there is no user to pass and no transaction code to deliver:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
issueVC({
|
|
70
|
+
flow: 'authorization_code',
|
|
71
|
+
getCredentialOfferUri: () => fetch('<YOUR_BACKEND_CREATE_AUTH_CODE_OFFER_ENDPOINT>').then((r) => r.json()),
|
|
72
|
+
internalWallet: { platform: ['mobile'] },
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
64
76
|
When your app unmounts or the user signs out, call `cleanUpEmbeddedUi()`.
|
|
65
77
|
|
|
66
78
|
## Integration guide and API access
|
package/embedded.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/*! @equs-ai/dtk-embedded-ui v0.1
|
|
1
|
+
/*! @equs-ai/dtk-embedded-ui v0.2.0-dev.1 | SPDX-License-Identifier: BUSL-1.1 | See LICENSE */
|
|
2
|
+
export declare interface AuthorizationCodeIssueVcOptions extends IssueVcBaseOptions {
|
|
3
|
+
flow: 'authorization_code';
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
export declare const enum AuthorizationResponseType {
|
|
3
7
|
Plain = 0,
|
|
4
8
|
Jwe = 1
|
|
@@ -42,6 +46,8 @@ export declare interface DecryptPayloadOptions {
|
|
|
42
46
|
onError?: (data: unknown) => void;
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
export declare type DeliverTxCode = (params: DeliverTxCodeParams) => Promise<DeliverTxCodeResponse>;
|
|
50
|
+
|
|
45
51
|
export declare interface DeliverTxCodeParams {
|
|
46
52
|
offerId: string;
|
|
47
53
|
method: 'pull' | 'push' | 'email' | 'sms';
|
|
@@ -51,11 +57,13 @@ export declare interface DeliverTxCodeParams {
|
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
export declare interface DeliverTxCodeResponse {
|
|
54
|
-
txCodeFetchUrl: string;
|
|
55
|
-
txCodeResendUrl: string;
|
|
60
|
+
txCodeFetchUrl: string | null;
|
|
61
|
+
txCodeResendUrl: string | null;
|
|
56
62
|
txCodeResendCooldown: number;
|
|
57
63
|
}
|
|
58
64
|
|
|
65
|
+
export declare type EmbedUiEvent = 'openStandaloneIssueVc' | 'openStandalonePresentVc';
|
|
66
|
+
|
|
59
67
|
declare interface ExternalWallet {
|
|
60
68
|
supported: boolean;
|
|
61
69
|
name?: string;
|
|
@@ -82,6 +90,14 @@ export declare const isDcApiSupported: (signedRequest?: boolean) => boolean;
|
|
|
82
90
|
|
|
83
91
|
export declare const issueVC: (options: IssueVcOptions) => void;
|
|
84
92
|
|
|
93
|
+
declare interface IssueVcBaseOptions {
|
|
94
|
+
getCredentialOfferUri: () => Promise<OfferUriParams>;
|
|
95
|
+
onLoading?: (loading: boolean) => void;
|
|
96
|
+
internalWallet?: InternalWallet;
|
|
97
|
+
externalWallet?: ExternalWallet;
|
|
98
|
+
webWalletMode?: WebWalletMode;
|
|
99
|
+
}
|
|
100
|
+
|
|
85
101
|
export declare const issueVCInInternalWallet: (options: IssueVcInInternalWalletOptions) => void | Window | null;
|
|
86
102
|
|
|
87
103
|
export declare interface IssueVcInInternalWalletOptions {
|
|
@@ -90,17 +106,7 @@ export declare interface IssueVcInInternalWalletOptions {
|
|
|
90
106
|
webWalletMode?: WebWalletMode;
|
|
91
107
|
}
|
|
92
108
|
|
|
93
|
-
export declare
|
|
94
|
-
getCredentialOfferUri: () => Promise<OfferUriParams>;
|
|
95
|
-
onLoading?: (loading: boolean) => void;
|
|
96
|
-
userInfo?: UserInfo;
|
|
97
|
-
internalWallet?: InternalWallet;
|
|
98
|
-
externalWallet?: ExternalWallet;
|
|
99
|
-
webWalletMode?: WebWalletMode;
|
|
100
|
-
manualTxCode?: boolean;
|
|
101
|
-
contactInfoOptions?: ContactInfoOptions;
|
|
102
|
-
deliverTxCode: (params: DeliverTxCodeParams) => Promise<DeliverTxCodeResponse>;
|
|
103
|
-
}
|
|
109
|
+
export declare type IssueVcOptions = PreAuthorizedCodeIssueVcOptions | AuthorizationCodeIssueVcOptions;
|
|
104
110
|
|
|
105
111
|
declare interface KnownWallet {
|
|
106
112
|
id: string;
|
|
@@ -116,6 +122,14 @@ export declare interface OfferUriParams {
|
|
|
116
122
|
uriId: string;
|
|
117
123
|
}
|
|
118
124
|
|
|
125
|
+
export declare interface PreAuthorizedCodeIssueVcOptions extends IssueVcBaseOptions {
|
|
126
|
+
flow?: 'pre-authorized_code';
|
|
127
|
+
userInfo?: UserInfo;
|
|
128
|
+
manualTxCode?: boolean;
|
|
129
|
+
contactInfoOptions?: ContactInfoOptions;
|
|
130
|
+
deliverTxCode: DeliverTxCode;
|
|
131
|
+
}
|
|
132
|
+
|
|
119
133
|
export declare interface PresentationResponse {
|
|
120
134
|
authResponse: AuthResponse;
|
|
121
135
|
txId: string;
|
|
@@ -150,6 +164,8 @@ export declare interface PresentVCsOptions {
|
|
|
150
164
|
hidePresentationOverview?: boolean;
|
|
151
165
|
vpPurposeText?: string;
|
|
152
166
|
skipPreAuth?: boolean;
|
|
167
|
+
webWalletMode?: WebWalletMode;
|
|
168
|
+
dedicatedPage?: boolean;
|
|
153
169
|
}
|
|
154
170
|
|
|
155
171
|
export declare interface PreviewOptions {
|
|
@@ -183,6 +199,8 @@ export declare const signIntoWallet: (callbacks?: SignInCallbacks) => void;
|
|
|
183
199
|
|
|
184
200
|
export declare const subscribeToAuthEvents: (cb: (state: WalletAuthState) => void) => () => void;
|
|
185
201
|
|
|
202
|
+
export declare const subscribeToEmbedUiEvents: (cb: (event: EmbedUiEvent, data?: unknown) => void) => () => void;
|
|
203
|
+
|
|
186
204
|
export declare const subscribeToNotificationEvents: (cb: (event: NotificationsEvent, data?: unknown) => void) => () => void;
|
|
187
205
|
|
|
188
206
|
export declare const updateNotifications: ({ iframe }: {
|