@monterosa/sdk-identify-kit 2.0.0-rc.3 → 2.0.0-rc.5
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.d.ts +212 -257
- package/dist/bridge.d.ts +12 -3
- package/dist/credentials_store.d.ts +31 -0
- package/dist/identify.d.ts +4 -10
- package/dist/identify_options.d.ts +28 -0
- package/dist/identify_url.d.ts +25 -0
- package/dist/identity_options.d.ts +31 -0
- package/dist/index.cjs +458 -440
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +458 -440
- package/dist/index.js.map +1 -1
- package/dist/login_policy_store.d.ts +28 -0
- package/dist/sdk-identify-kit.d.ts +500 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types.d.ts +16 -43
- package/package.json +8 -8
package/dist/bridge.d.ts
CHANGED
|
@@ -6,12 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
8
|
*/
|
|
9
|
-
import { Experience } from '@monterosa/sdk-launcher-kit';
|
|
10
|
-
import { IdentifyKit } from './types';
|
|
9
|
+
import { Experience, ExperienceState, Message } from '@monterosa/sdk-launcher-kit';
|
|
11
10
|
/**
|
|
11
|
+
* Process an incoming `Login` / `Logout` broadcast from the parent
|
|
12
|
+
* application. Updates the local current credentials, enqueues login/logout
|
|
13
|
+
* for every existing identify, and forwards the broadcast downstream to
|
|
14
|
+
* this level's own embedded experiences — the mechanism that cascades a
|
|
15
|
+
* root-level `setCredentials` through every nested experience.
|
|
16
|
+
*
|
|
12
17
|
* @internal
|
|
13
18
|
*/
|
|
14
|
-
export declare function
|
|
19
|
+
export declare function handleParentMessage(message: Message): void;
|
|
15
20
|
/**
|
|
16
21
|
* @internal
|
|
17
22
|
*/
|
|
@@ -20,3 +25,7 @@ export declare function handleExperienceEmbedded(experience: Experience): void;
|
|
|
20
25
|
* @internal
|
|
21
26
|
*/
|
|
22
27
|
export declare function handleExperienceUnmounted(experience: Experience): void;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function handleExperienceStateChange(experience: Experience, state: ExperienceState): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @monterosa/sdk-identify-kit
|
|
4
|
+
*
|
|
5
|
+
* Copyright © 2026 Monterosa Productions Limited. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
|
+
*/
|
|
9
|
+
import { Emitter, Unsubscribe } from '@monterosa/sdk-util';
|
|
10
|
+
import { Credentials } from './types';
|
|
11
|
+
/**
|
|
12
|
+
* Root-owned credentials store.
|
|
13
|
+
*
|
|
14
|
+
* Single source of truth at the root of an integration; an internal
|
|
15
|
+
* mirror at every other level, kept in sync via `Login` / `Logout`
|
|
16
|
+
* broadcasts. Not exposed publicly — public access flows through
|
|
17
|
+
* `setCredentials` / `getCredentials` / `clearCredentials` and
|
|
18
|
+
* `onCredentialsUpdated`.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare class CredentialsStore extends Emitter {
|
|
23
|
+
private static instance;
|
|
24
|
+
private _credentials;
|
|
25
|
+
private constructor();
|
|
26
|
+
static getInstance(): CredentialsStore;
|
|
27
|
+
get credentials(): Credentials | null;
|
|
28
|
+
set credentials(next: Credentials | null);
|
|
29
|
+
subscribe(handler: (value: Credentials | null) => void): Unsubscribe;
|
|
30
|
+
reset(): void;
|
|
31
|
+
}
|
package/dist/identify.d.ts
CHANGED
|
@@ -8,30 +8,24 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { MonterosaSdk } from '@monterosa/sdk-core';
|
|
10
10
|
import { Emitter } from '@monterosa/sdk-util';
|
|
11
|
-
import { IdentifyKit, IdentifyOptions, LoginState,
|
|
12
|
-
export
|
|
11
|
+
import { IdentifyKit, IdentifyOptions, LoginState, Signature, UserData } from './types';
|
|
12
|
+
export declare class Identify extends Emitter implements IdentifyKit {
|
|
13
13
|
sdk: MonterosaSdk;
|
|
14
|
-
|
|
14
|
+
wasLoggedIn: boolean;
|
|
15
15
|
private host?;
|
|
16
16
|
private readonly _options;
|
|
17
|
-
private _credentials;
|
|
18
17
|
private _signature;
|
|
19
18
|
private _userData;
|
|
20
19
|
private signatureExpireTimeout;
|
|
21
|
-
private userDataExpireTimeout;
|
|
22
20
|
_state: LoginState;
|
|
23
|
-
constructor(sdk: MonterosaSdk, options?: IdentifyOptions);
|
|
21
|
+
constructor(sdk: MonterosaSdk, options?: Partial<IdentifyOptions>);
|
|
24
22
|
private static fetchIdentifyHost;
|
|
25
23
|
get state(): LoginState;
|
|
26
24
|
set state(state: LoginState);
|
|
27
25
|
get options(): IdentifyOptions;
|
|
28
26
|
set signature(signature: Signature | null);
|
|
29
27
|
get signature(): Signature | null;
|
|
30
|
-
set credentials(credentials: Credentials | null);
|
|
31
|
-
get credentials(): Credentials | null;
|
|
32
28
|
set userData(data: UserData | null);
|
|
33
29
|
get userData(): UserData | null;
|
|
34
|
-
get shouldLoginOnReconnect(): boolean;
|
|
35
|
-
reset(): void;
|
|
36
30
|
getUrl(path?: string): Promise<string>;
|
|
37
31
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @monterosa/sdk-identify-kit
|
|
4
|
+
*
|
|
5
|
+
* Copyright © 2026 Monterosa Productions Limited. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
|
+
*/
|
|
9
|
+
import { IdentifyOptions } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Resolves partial identify options against defaults.
|
|
12
|
+
*
|
|
13
|
+
* Used by `getIdentify` (app-side) to ensure identify keys never diverge
|
|
14
|
+
* for the same logical inputs.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveIdentifyOptions(options?: Partial<IdentifyOptions>): IdentifyOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Deterministic identify key for memoisation.
|
|
21
|
+
*
|
|
22
|
+
* Includes the full identity tuple: `(host, projectId, strategy,
|
|
23
|
+
* provider, version)`. `loginPolicy` is intentionally excluded —
|
|
24
|
+
* behaviour is not identity-defining.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function identifyKey(host: string, projectId: string, options: IdentifyOptions): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @monterosa/sdk-identify-kit
|
|
4
|
+
*
|
|
5
|
+
* Copyright © 2026 Monterosa Productions Limited. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
|
+
*/
|
|
9
|
+
import { IdentifyContext } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the identify backend host for `(host, projectId)`, cached so
|
|
12
|
+
* repeated requests don't re-fetch listings.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchIdentifyHost(host: string, projectId: string): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Build an identify backend URL from a wire context — no `Identify`
|
|
19
|
+
* instance required. Used by bridge handlers at intermediate levels that
|
|
20
|
+
* relay requests on behalf of a child without materialising a local
|
|
21
|
+
* identify.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildIdentifyUrl(context: IdentifyContext, path?: string): Promise<string>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* @monterosa/sdk-identify-kit
|
|
4
|
+
*
|
|
5
|
+
* Copyright © 2026 Monterosa Productions Limited. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* More details on the license can be found at https://www.monterosa.co/sdk/license
|
|
8
|
+
*/
|
|
9
|
+
import { IdentifyOptions, ResolvedIdentityOptions } from './types';
|
|
10
|
+
export type { ResolvedIdentityOptions };
|
|
11
|
+
/**
|
|
12
|
+
* Resolves partial identify options against defaults.
|
|
13
|
+
*
|
|
14
|
+
* Used by both `getIdentify` (app-side) and the bridge handler
|
|
15
|
+
* (parent-side, when reacting to request context) to ensure
|
|
16
|
+
* identity keys never diverge for the same logical inputs.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveIdentityOptions(options?: IdentifyOptions): ResolvedIdentityOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Deterministic identity key for memoisation.
|
|
23
|
+
*
|
|
24
|
+
* Includes only the auth-related fields that define an "identity":
|
|
25
|
+
* `(projectId, strategy, provider, version)`. `deviceId` and
|
|
26
|
+
* `loginPolicy` are intentionally excluded — they are session-level
|
|
27
|
+
* and behaviour-level respectively, not identity-defining.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function identityKey(projectId: string, options: ResolvedIdentityOptions): string;
|