@equs-ai/dtk-embedded-ui 0.1.2 → 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 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.2
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.2 | SPDX-License-Identifier: BUSL-1.1 | See LICENSE */
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;
@@ -78,8 +86,18 @@ export declare interface InitEmbeddedUiOptions {
78
86
 
79
87
  declare type InternalWallet = Omit<KnownWallet, 'id' | 'offerEndpoint'>;
80
88
 
89
+ export declare const isDcApiSupported: (signedRequest?: boolean) => boolean;
90
+
81
91
  export declare const issueVC: (options: IssueVcOptions) => void;
82
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
+
83
101
  export declare const issueVCInInternalWallet: (options: IssueVcInInternalWalletOptions) => void | Window | null;
84
102
 
85
103
  export declare interface IssueVcInInternalWalletOptions {
@@ -88,17 +106,7 @@ export declare interface IssueVcInInternalWalletOptions {
88
106
  webWalletMode?: WebWalletMode;
89
107
  }
90
108
 
91
- export declare interface IssueVcOptions {
92
- getCredentialOfferUri: () => Promise<OfferUriParams>;
93
- onLoading?: (loading: boolean) => void;
94
- userInfo?: UserInfo;
95
- internalWallet?: InternalWallet;
96
- externalWallet?: ExternalWallet;
97
- webWalletMode?: WebWalletMode;
98
- manualTxCode?: boolean;
99
- contactInfoOptions?: ContactInfoOptions;
100
- deliverTxCode: (params: DeliverTxCodeParams) => Promise<DeliverTxCodeResponse>;
101
- }
109
+ export declare type IssueVcOptions = PreAuthorizedCodeIssueVcOptions | AuthorizationCodeIssueVcOptions;
102
110
 
103
111
  declare interface KnownWallet {
104
112
  id: string;
@@ -114,6 +122,14 @@ export declare interface OfferUriParams {
114
122
  uriId: string;
115
123
  }
116
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
+
117
133
  export declare interface PresentationResponse {
118
134
  authResponse: AuthResponse;
119
135
  txId: string;
@@ -148,6 +164,8 @@ export declare interface PresentVCsOptions {
148
164
  hidePresentationOverview?: boolean;
149
165
  vpPurposeText?: string;
150
166
  skipPreAuth?: boolean;
167
+ webWalletMode?: WebWalletMode;
168
+ dedicatedPage?: boolean;
151
169
  }
152
170
 
153
171
  export declare interface PreviewOptions {
@@ -181,6 +199,8 @@ export declare const signIntoWallet: (callbacks?: SignInCallbacks) => void;
181
199
 
182
200
  export declare const subscribeToAuthEvents: (cb: (state: WalletAuthState) => void) => () => void;
183
201
 
202
+ export declare const subscribeToEmbedUiEvents: (cb: (event: EmbedUiEvent, data?: unknown) => void) => () => void;
203
+
184
204
  export declare const subscribeToNotificationEvents: (cb: (event: NotificationsEvent, data?: unknown) => void) => () => void;
185
205
 
186
206
  export declare const updateNotifications: ({ iframe }: {