@asgardeo/javascript 0.1.9 → 0.1.11

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.
@@ -22,9 +22,7 @@ import { Organization } from './organization';
22
22
  import { User, UserProfile } from './user';
23
23
  import { TokenResponse } from './token';
24
24
  import { Storage } from './store';
25
- export type SignInOptions = Record<string, unknown>;
26
- export type SignOutOptions = Record<string, unknown>;
27
- export type SignUpOptions = Record<string, unknown>;
25
+ import { SignInOptions, SignOutOptions, SignUpOptions } from './config';
28
26
  /**
29
27
  * Interface defining the core functionality for Asgardeo authentication clients.
30
28
  *
@@ -18,6 +18,36 @@
18
18
  import { I18nBundle } from './i18n';
19
19
  import { RecursivePartial } from './utility-types';
20
20
  import { ThemeConfig, ThemeMode } from '../theme/types';
21
+ /**
22
+ * Interface representing the additional parameters to be sent in the sign-in request.
23
+ * This can include custom parameters that your authorization server supports.
24
+ * These parameters will be included in the authorization request sent to the server.
25
+ * If not provided, no additional parameters will be sent.
26
+ *
27
+ * @example
28
+ * signInOptions: { prompt: "login", fidp: "OrganizationSSO" }
29
+ */
30
+ export type SignInOptions = Record<string, any>;
31
+ /**
32
+ * Interface representing the additional parameters to be sent in the sign-out request.
33
+ * This can include custom parameters that your authorization server supports.
34
+ * These parameters will be included in the sign-out request sent to the server.
35
+ * If not provided, no additional parameters will be sent.
36
+ *
37
+ * @example
38
+ * signOutOptions: { idTokenHint: "your-id-token-hint" }
39
+ */
40
+ export type SignOutOptions = Record<string, unknown>;
41
+ /**
42
+ * Interface representing the additional parameters to be sent in the sign-up request.
43
+ * This can include custom parameters that your authorization server supports.
44
+ * These parameters will be included in the sign-up request sent to the server.
45
+ * If not provided, no additional parameters will be sent.
46
+ *
47
+ * @example
48
+ * signUpOptions: { appId: "your-app-id" }
49
+ */
50
+ export type SignUpOptions = Record<string, unknown>;
21
51
  export interface BaseConfig<T = unknown> extends WithPreferences {
22
52
  /**
23
53
  * Optional URL where the authorization server should redirect after authentication.
@@ -122,6 +152,21 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
122
152
  clockTolerance?: number;
123
153
  };
124
154
  };
155
+ /**
156
+ * Optional additional parameters to be sent in the authorize request.
157
+ * @see {@link SignInOptions} for more details.
158
+ */
159
+ signInOptions?: SignInOptions;
160
+ /**
161
+ * Optional additional parameters to be sent in the sign-out request.
162
+ * @see {@link SignOutOptions} for more details.
163
+ */
164
+ signOutOptions?: SignOutOptions;
165
+ /**
166
+ * Optional additional parameters to be sent in the sign-up request.
167
+ * @see {@link SignUpOptions} for more details.
168
+ */
169
+ signUpOptions?: SignUpOptions;
125
170
  }
126
171
  export interface WithPreferences {
127
172
  /**
@@ -98,6 +98,43 @@ export interface ThemeColors {
98
98
  dark?: string;
99
99
  };
100
100
  }
101
+ export interface ThemeComponentStyleOverrides {
102
+ /**
103
+ * Style overrides for the root element or slots.
104
+ * Example: { root: { borderRadius: '8px' } }
105
+ */
106
+ root?: Record<string, any>;
107
+ [slot: string]: Record<string, any> | undefined;
108
+ }
109
+ export interface ThemeComponents {
110
+ Button?: {
111
+ styleOverrides?: {
112
+ root?: {
113
+ borderRadius?: string;
114
+ [key: string]: any;
115
+ };
116
+ [slot: string]: Record<string, any> | undefined;
117
+ };
118
+ defaultProps?: Record<string, any>;
119
+ variants?: Array<Record<string, any>>;
120
+ };
121
+ Field?: {
122
+ styleOverrides?: {
123
+ root?: {
124
+ borderRadius?: string;
125
+ [key: string]: any;
126
+ };
127
+ [slot: string]: Record<string, any> | undefined;
128
+ };
129
+ defaultProps?: Record<string, any>;
130
+ variants?: Array<Record<string, any>>;
131
+ };
132
+ [componentName: string]: {
133
+ styleOverrides?: ThemeComponentStyleOverrides;
134
+ defaultProps?: Record<string, any>;
135
+ variants?: Array<Record<string, any>>;
136
+ } | undefined;
137
+ }
101
138
  export interface ThemeConfig {
102
139
  borderRadius: {
103
140
  large: string;
@@ -145,6 +182,29 @@ export interface ThemeConfig {
145
182
  * @default 'asgardeo' (from VendorConstants.VENDOR_PREFIX)
146
183
  */
147
184
  cssVarPrefix?: string;
185
+ /**
186
+ * Component style overrides
187
+ */
188
+ components?: ThemeComponents;
189
+ }
190
+ export interface ThemeComponentVars {
191
+ Button?: {
192
+ root?: {
193
+ borderRadius?: string;
194
+ [key: string]: any;
195
+ };
196
+ [slot: string]: Record<string, any> | undefined;
197
+ };
198
+ Field?: {
199
+ root?: {
200
+ borderRadius?: string;
201
+ [key: string]: any;
202
+ };
203
+ [slot: string]: Record<string, any> | undefined;
204
+ };
205
+ [componentName: string]: {
206
+ [slot: string]: Record<string, any> | undefined;
207
+ } | undefined;
148
208
  }
149
209
  export interface ThemeVars {
150
210
  colors: {
@@ -260,6 +320,10 @@ export interface ThemeVars {
260
320
  alt?: string;
261
321
  } | undefined;
262
322
  };
323
+ /**
324
+ * Component CSS variable references (e.g., for overrides)
325
+ */
326
+ components?: ThemeComponentVars;
263
327
  }
264
328
  export interface Theme extends ThemeConfig {
265
329
  cssVariables: Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/javascript",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Framework agnostic JavaScript SDK for Asgardeo.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -9,9 +9,9 @@
9
9
  "agnostic",
10
10
  "js"
11
11
  ],
12
- "homepage": "https://github.com/asgardeo/web-ui-sdks/tree/main/packages/javascript#readme",
12
+ "homepage": "https://github.com/asgardeo/javascript/tree/main/packages/javascript#readme",
13
13
  "bugs": {
14
- "url": "https://github.com/asgardeo/web-ui-sdks/issues"
14
+ "url": "https://github.com/asgardeo/javascript/issues"
15
15
  },
16
16
  "author": "WSO2",
17
17
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "types": "dist/index.d.ts",
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "https://github.com/asgardeo/web-ui-sdks",
33
+ "url": "https://github.com/asgardeo/javascript",
34
34
  "directory": "packages/javascript"
35
35
  },
36
36
  "devDependencies": {