@asgardeo/javascript 0.7.3 → 0.8.0
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/api/v2/getFlowMetaV2.d.ts +55 -0
- package/dist/cjs/index.js +71 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +69 -1
- package/dist/index.js.map +4 -4
- package/dist/models/config.d.ts +5 -0
- package/dist/models/v2/flow-meta-v2.d.ts +290 -0
- package/package.json +3 -3
package/dist/models/config.d.ts
CHANGED
|
@@ -262,6 +262,11 @@ export interface Preferences {
|
|
|
262
262
|
* Internationalization preferences for the Asgardeo UI components
|
|
263
263
|
*/
|
|
264
264
|
i18n?: I18nPreferences;
|
|
265
|
+
/**
|
|
266
|
+
* Whether to resolve the theme from the Flow Meta API (GET /flow/meta).
|
|
267
|
+
* @remarks This is only applicable when using platform `Asgardeo V2` (Thunder).
|
|
268
|
+
*/
|
|
269
|
+
resolveFromMeta?: boolean;
|
|
265
270
|
/**
|
|
266
271
|
* Theme preferences for the Asgardeo UI components
|
|
267
272
|
*/
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The type of entity to retrieve flow metadata for.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const config: GetFlowMetaRequestConfig = {
|
|
24
|
+
* baseUrl: 'https://localhost:8090',
|
|
25
|
+
* type: FlowMetaType.App,
|
|
26
|
+
* id: '60a9b38b-6eba-9f9e-55f9-267067de4680',
|
|
27
|
+
* };
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @experimental This API may change in future versions
|
|
31
|
+
*/
|
|
32
|
+
export declare enum FlowMetaType {
|
|
33
|
+
/** Retrieve metadata scoped to a specific application */
|
|
34
|
+
App = "APP",
|
|
35
|
+
/** Retrieve metadata scoped to a specific organization unit */
|
|
36
|
+
Ou = "OU"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Application metadata returned when `type=APP`.
|
|
40
|
+
*
|
|
41
|
+
* @experimental This API may change in future versions
|
|
42
|
+
*/
|
|
43
|
+
export interface ApplicationMetadata {
|
|
44
|
+
/** Application UUID */
|
|
45
|
+
id: string;
|
|
46
|
+
/** URL of the application logo */
|
|
47
|
+
logo_url?: string;
|
|
48
|
+
/** Human-readable application name */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Privacy Policy URI */
|
|
51
|
+
policy_uri?: string;
|
|
52
|
+
/** Terms of Service URI */
|
|
53
|
+
tos_uri?: string;
|
|
54
|
+
/** Application home URL */
|
|
55
|
+
url?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Organization unit metadata.
|
|
59
|
+
*
|
|
60
|
+
* Always present when `type=OU`. For `type=APP`, only included when the
|
|
61
|
+
* deployment has exactly one organization unit.
|
|
62
|
+
*
|
|
63
|
+
* @experimental This API may change in future versions
|
|
64
|
+
*/
|
|
65
|
+
export interface OUMetadata {
|
|
66
|
+
/** Cookie Policy URI */
|
|
67
|
+
cookie_policy_uri?: string;
|
|
68
|
+
/** Optional description of the organization unit */
|
|
69
|
+
description?: string;
|
|
70
|
+
/** Unique handle / slug for the organization unit */
|
|
71
|
+
handle: string;
|
|
72
|
+
/** Organization unit UUID */
|
|
73
|
+
id: string;
|
|
74
|
+
/** URL of the organization unit logo */
|
|
75
|
+
logo_url?: string;
|
|
76
|
+
/** Human-readable organization unit name */
|
|
77
|
+
name: string;
|
|
78
|
+
/** Privacy Policy URI */
|
|
79
|
+
policy_uri?: string;
|
|
80
|
+
/** Terms of Service URI */
|
|
81
|
+
tos_uri?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A single color entry in the v2 theme color scheme.
|
|
85
|
+
*
|
|
86
|
+
* @experimental This API may change in future versions
|
|
87
|
+
*/
|
|
88
|
+
export interface FlowMetaThemeColorSet {
|
|
89
|
+
/** Text color that contrasts against this color */
|
|
90
|
+
contrastText?: string;
|
|
91
|
+
/** The darker variant of the color */
|
|
92
|
+
dark?: string;
|
|
93
|
+
/** The main/primary variant of the color */
|
|
94
|
+
main: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Background colors in a v2 theme color scheme.
|
|
98
|
+
*
|
|
99
|
+
* @experimental This API may change in future versions
|
|
100
|
+
*/
|
|
101
|
+
export interface FlowMetaThemeBackground {
|
|
102
|
+
/** Default background color (maps to body background) */
|
|
103
|
+
default?: string;
|
|
104
|
+
/** Surface / paper background color */
|
|
105
|
+
paper?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Text colors in a v2 theme color scheme.
|
|
109
|
+
*
|
|
110
|
+
* @experimental This API may change in future versions
|
|
111
|
+
*/
|
|
112
|
+
export interface FlowMetaThemeTextColors {
|
|
113
|
+
/** Primary text color */
|
|
114
|
+
primary?: string;
|
|
115
|
+
/** Secondary / muted text color */
|
|
116
|
+
secondary?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* All colors defined for a single v2 theme color scheme (light or dark).
|
|
120
|
+
*
|
|
121
|
+
* @experimental This API may change in future versions
|
|
122
|
+
*/
|
|
123
|
+
export interface FlowMetaThemeColors {
|
|
124
|
+
/** Background colors for the theme (e.g., body, paper) */
|
|
125
|
+
background?: FlowMetaThemeBackground;
|
|
126
|
+
/** Primary color set for the theme */
|
|
127
|
+
primary?: FlowMetaThemeColorSet;
|
|
128
|
+
/** Secondary color set for the theme */
|
|
129
|
+
secondary?: FlowMetaThemeColorSet;
|
|
130
|
+
/** Text colors for the theme */
|
|
131
|
+
text?: FlowMetaThemeTextColors;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A single color scheme (light or dark) in the v2 theme.
|
|
135
|
+
*
|
|
136
|
+
* @experimental This API may change in future versions
|
|
137
|
+
*/
|
|
138
|
+
export interface FlowMetaThemeColorScheme {
|
|
139
|
+
/** All colors defined for this color scheme (light or dark) */
|
|
140
|
+
colors: FlowMetaThemeColors;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Shape / geometry configuration in the v2 theme.
|
|
144
|
+
*
|
|
145
|
+
* @experimental This API may change in future versions
|
|
146
|
+
*/
|
|
147
|
+
export interface FlowMetaThemeShape {
|
|
148
|
+
/** Border radius in pixels applied uniformly across components */
|
|
149
|
+
borderRadius?: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Typography configuration in the v2 theme.
|
|
153
|
+
*
|
|
154
|
+
* @experimental This API may change in future versions
|
|
155
|
+
*/
|
|
156
|
+
export interface FlowMetaThemeTypography {
|
|
157
|
+
/** CSS font-family string */
|
|
158
|
+
fontFamily?: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Resolved theme configuration returned inside the flow metadata response.
|
|
162
|
+
*
|
|
163
|
+
* Maps to the `design.theme` field of {@link FlowMetadataResponse}.
|
|
164
|
+
*
|
|
165
|
+
* @experimental This API may change in future versions
|
|
166
|
+
*/
|
|
167
|
+
export interface FlowMetaTheme {
|
|
168
|
+
/** Per-scheme color definitions (light and dark) */
|
|
169
|
+
colorSchemes?: {
|
|
170
|
+
/** Dark color scheme */
|
|
171
|
+
dark?: FlowMetaThemeColorScheme;
|
|
172
|
+
/** Light color scheme */
|
|
173
|
+
light?: FlowMetaThemeColorScheme;
|
|
174
|
+
};
|
|
175
|
+
/** The color scheme to apply by default */
|
|
176
|
+
defaultColorScheme?: 'light' | 'dark';
|
|
177
|
+
/** Text direction for the theme */
|
|
178
|
+
direction?: 'ltr' | 'rtl';
|
|
179
|
+
/** Shape/geometry configuration for the theme */
|
|
180
|
+
shape?: FlowMetaThemeShape;
|
|
181
|
+
/** Typography configuration for the theme */
|
|
182
|
+
typography?: FlowMetaThemeTypography;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Resolved design configuration (theme and layout) for the flow.
|
|
186
|
+
*
|
|
187
|
+
* @experimental This API may change in future versions
|
|
188
|
+
*/
|
|
189
|
+
export interface DesignMetadata {
|
|
190
|
+
/** Resolved layout configuration (shape is server-defined) */
|
|
191
|
+
layout: Record<string, unknown>;
|
|
192
|
+
/** Resolved theme configuration for the flow */
|
|
193
|
+
theme: FlowMetaTheme;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Internationalisation metadata for the flow.
|
|
197
|
+
*
|
|
198
|
+
* @experimental This API may change in future versions
|
|
199
|
+
*/
|
|
200
|
+
export interface I18nMetadata {
|
|
201
|
+
/** The language used for the returned translations (defaults to `en`) */
|
|
202
|
+
language: string;
|
|
203
|
+
/** List of all available language tags (BCP 47) for the entity */
|
|
204
|
+
languages: string[];
|
|
205
|
+
/** Total number of translation keys returned */
|
|
206
|
+
totalResults?: number;
|
|
207
|
+
/**
|
|
208
|
+
* Translations organised by namespace.
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```json
|
|
212
|
+
* {
|
|
213
|
+
* "auth": {
|
|
214
|
+
* "login.button": "Login",
|
|
215
|
+
* "login.title": "Welcome"
|
|
216
|
+
* }
|
|
217
|
+
* }
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
translations: Record<string, Record<string, string>>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Aggregated flow metadata response returned by `GET /flow/meta`.
|
|
224
|
+
*
|
|
225
|
+
* @experimental This API may change in future versions
|
|
226
|
+
*/
|
|
227
|
+
export interface FlowMetadataResponse {
|
|
228
|
+
/**
|
|
229
|
+
* Application metadata.
|
|
230
|
+
* Only present when `type=APP`.
|
|
231
|
+
*/
|
|
232
|
+
application?: ApplicationMetadata;
|
|
233
|
+
/** Resolved design configuration */
|
|
234
|
+
design: DesignMetadata;
|
|
235
|
+
/** Internationalisation metadata and translations */
|
|
236
|
+
i18n: I18nMetadata;
|
|
237
|
+
/** Indicates whether the registration flow is enabled for the entity */
|
|
238
|
+
is_registration_flow_enabled: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Organization unit metadata.
|
|
241
|
+
* Always present when `type=OU`.
|
|
242
|
+
* For `type=APP`, only present when the deployment has exactly one OU.
|
|
243
|
+
*/
|
|
244
|
+
ou?: OUMetadata;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Request configuration for `getFlowMetaV2`.
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* const config: GetFlowMetaRequestConfig = {
|
|
252
|
+
* baseUrl: 'https://localhost:8090',
|
|
253
|
+
* type: FlowMetaType.App,
|
|
254
|
+
* id: '60a9b38b-6eba-9f9e-55f9-267067de4680',
|
|
255
|
+
* language: 'en',
|
|
256
|
+
* namespace: 'auth',
|
|
257
|
+
* };
|
|
258
|
+
* ```
|
|
259
|
+
*
|
|
260
|
+
* @experimental This API may change in future versions
|
|
261
|
+
*/
|
|
262
|
+
export interface GetFlowMetaRequestConfig extends Omit<Partial<RequestInit>, 'method' | 'body'> {
|
|
263
|
+
/**
|
|
264
|
+
* Base URL of the Flow API server (e.g. `https://localhost:8090`).
|
|
265
|
+
* Either `baseUrl` or `url` must be provided.
|
|
266
|
+
*/
|
|
267
|
+
baseUrl?: string;
|
|
268
|
+
/** UUID of the entity (application ID or organization unit ID) */
|
|
269
|
+
id: string;
|
|
270
|
+
/**
|
|
271
|
+
* Language tag in BCP 47 format for i18n translations.
|
|
272
|
+
* Defaults to `en` on the server side when omitted.
|
|
273
|
+
*
|
|
274
|
+
* @example "en", "es", "fr-CA"
|
|
275
|
+
*/
|
|
276
|
+
language?: string;
|
|
277
|
+
/**
|
|
278
|
+
* Filter translations by a specific namespace.
|
|
279
|
+
*
|
|
280
|
+
* @example "auth", "errors", "common"
|
|
281
|
+
*/
|
|
282
|
+
namespace?: string;
|
|
283
|
+
/** The type of entity to retrieve metadata for */
|
|
284
|
+
type: FlowMetaType;
|
|
285
|
+
/**
|
|
286
|
+
* Fully qualified URL of the `/flow/meta` endpoint.
|
|
287
|
+
* When provided, `baseUrl` is ignored.
|
|
288
|
+
*/
|
|
289
|
+
url?: string;
|
|
290
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgardeo/javascript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Framework agnostic JavaScript SDK for Asgardeo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"asgardeo",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "22.15.30",
|
|
38
|
-
"@wso2/eslint-plugin": "git+https://github.com/brionmario/wso2-ui-configs.git#
|
|
39
|
-
"@wso2/prettier-config": "git+https://github.com/brionmario/wso2-ui-configs.git#
|
|
38
|
+
"@wso2/eslint-plugin": "git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/eslint-plugin",
|
|
39
|
+
"@wso2/prettier-config": "git+https://github.com/brionmario/wso2-ui-configs.git#d3041825a4f8f235c8f9fa36b55cf29d54e791c8&path:packages/prettier-config",
|
|
40
40
|
"esbuild": "0.25.9",
|
|
41
41
|
"eslint": "8.57.0",
|
|
42
42
|
"prettier": "2.6.2",
|