@bodhiapp/bodhi-js 0.0.2 → 0.0.4
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/bodhi-js-sdk/core/src/build-info.d.ts +1 -0
- package/dist/bodhi-js-sdk/core/src/facade-client-base.d.ts +1 -1
- package/dist/bodhi-js-sdk/core/src/index.d.ts +1 -0
- package/dist/bodhi-js-sdk/core/src/storage.d.ts +12 -0
- package/dist/bodhi-js-sdk/web/src/build-info.d.ts +1 -0
- package/dist/bodhi-js-sdk/web/src/constants.d.ts +15 -4
- package/dist/bodhi-js-sdk/web/src/direct-client.d.ts +1 -0
- package/dist/bodhi-js-sdk/web/src/ext-client.d.ts +2 -1
- package/dist/bodhi-js-sdk/web/src/facade-client.d.ts +2 -0
- package/dist/bodhi-js-sdk/web/src/index.d.ts +1 -0
- package/dist/bodhi-web.cjs.js +1 -749
- package/dist/bodhi-web.esm.js +277 -393
- package/package.json +2 -2
- package/dist/bodhi-web.cjs.js.map +0 -1
- package/dist/bodhi-web.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BUILD_MODE: string;
|
|
@@ -20,7 +20,7 @@ export declare abstract class BaseFacadeClient<TConfig, TExtClient extends IConn
|
|
|
20
20
|
protected authClientId: string;
|
|
21
21
|
protected config: TConfig;
|
|
22
22
|
protected onStateChange: StateChangeCallback;
|
|
23
|
-
constructor(authClientId: string, config: TConfig, onStateChange?: StateChangeCallback, storagePrefix?: string);
|
|
23
|
+
constructor(authClientId: string, config: TConfig, onStateChange?: StateChangeCallback, storagePrefix?: string, basePath?: string);
|
|
24
24
|
/**
|
|
25
25
|
* Create logger instance
|
|
26
26
|
* Subclasses extract logLevel from their specific config type
|
|
@@ -27,6 +27,18 @@ export declare const STORAGE_PREFIXES: {
|
|
|
27
27
|
readonly WEB: "bodhi:web";
|
|
28
28
|
readonly EXT: "bodhi:ext";
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Create storage prefix with basePath for path isolation
|
|
32
|
+
*
|
|
33
|
+
* @param basePath - Base path of app (e.g., '/', '/app1/')
|
|
34
|
+
* @param prefix - Storage prefix (e.g., 'bodhi:web', 'bodhijs:')
|
|
35
|
+
* @returns Combined prefix with basePath isolation
|
|
36
|
+
*
|
|
37
|
+
* Examples:
|
|
38
|
+
* - createStoragePrefixWithBasePath('/', 'bodhi:web') => '/:bodhi:web'
|
|
39
|
+
* - createStoragePrefixWithBasePath('/app1/', 'bodhi:web') => '/app1/:bodhi:web'
|
|
40
|
+
*/
|
|
41
|
+
export declare function createStoragePrefixWithBasePath(basePath: string, prefix: string): string;
|
|
30
42
|
/**
|
|
31
43
|
* User Preferences Storage Manager
|
|
32
44
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BUILD_MODE: string;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
1
|
+
import { StorageKeys } from '../../core/src/index.ts';
|
|
2
|
+
|
|
4
3
|
export declare const POLL_INTERVAL = 500;
|
|
5
4
|
export declare const POLL_TIMEOUT = 5000;
|
|
6
5
|
/**
|
|
7
6
|
* LocalStorage keys for OAuth tokens and PKCE flow (namespaced with 'bodhi:web' prefix)
|
|
7
|
+
* @deprecated Use createWebStorageKeys(basePath) instead for basePath-aware keys
|
|
8
|
+
*/
|
|
9
|
+
export declare const STORAGE_KEYS: StorageKeys;
|
|
10
|
+
/**
|
|
11
|
+
* Create storage keys for web mode with optional basePath isolation
|
|
12
|
+
*
|
|
13
|
+
* @param basePath - Base path of app (e.g., '/', '/app1/'), defaults to '/'
|
|
14
|
+
* @returns Storage keys with basePath-aware prefix
|
|
15
|
+
*
|
|
16
|
+
* Examples:
|
|
17
|
+
* - createWebStorageKeys('/') => keys with 'bodhi:web:' prefix
|
|
18
|
+
* - createWebStorageKeys('/app1/') => keys with '/app1/:bodhi:web:' prefix
|
|
8
19
|
*/
|
|
9
|
-
export declare
|
|
20
|
+
export declare function createWebStorageKeys(basePath?: string): StorageKeys;
|
|
@@ -5,6 +5,7 @@ import { DirectClientBase, AuthLoggedIn, AuthLoggedOut, DirectClientBaseConfig,
|
|
|
5
5
|
*/
|
|
6
6
|
export interface DirectWebClientConfig extends DirectClientBaseConfig {
|
|
7
7
|
redirectUri: string;
|
|
8
|
+
basePath?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* DirectWebClient - Web mode implementation using browser redirect OAuth
|
|
@@ -23,7 +23,8 @@ export declare class WindowBodhiextClient implements IExtensionClient {
|
|
|
23
23
|
private authEndpoints;
|
|
24
24
|
private onStateChange;
|
|
25
25
|
private refreshPromise;
|
|
26
|
-
|
|
26
|
+
private storageKeys;
|
|
27
|
+
constructor(authClientId: string, config: WebClientConfig, onStateChange?: StateChangeCallback, basePath?: string);
|
|
27
28
|
/**
|
|
28
29
|
* Set client state and notify callback
|
|
29
30
|
*/
|
|
@@ -9,6 +9,7 @@ export interface WebClientConfig {
|
|
|
9
9
|
authServerUrl: string;
|
|
10
10
|
redirectUri: string;
|
|
11
11
|
userScope: UserScope;
|
|
12
|
+
basePath?: string;
|
|
12
13
|
logLevel: LogLevel;
|
|
13
14
|
initParams?: {
|
|
14
15
|
extension?: {
|
|
@@ -28,6 +29,7 @@ export declare class WebUIClient extends BaseFacadeClient<WebClientConfig, Windo
|
|
|
28
29
|
redirectUri: string;
|
|
29
30
|
authServerUrl?: string;
|
|
30
31
|
userScope?: UserScope;
|
|
32
|
+
basePath?: string;
|
|
31
33
|
logLevel?: LogLevel;
|
|
32
34
|
initParams?: {
|
|
33
35
|
extension?: {
|