lucia-sdk 0.9.1 → 0.9.3
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/__tests__/auto-init.test.d.ts +5 -5
- package/dist/__tests__/base/index.test.d.ts +1 -1
- package/dist/__tests__/core/index.test.d.ts +1 -1
- package/dist/__tests__/integration/auto-init-integration.test.d.ts +9 -9
- package/dist/__tests__/integration/auto-track-integration.test.d.ts +4 -4
- package/dist/__tests__/integration/sdk-integration.test.d.ts +1 -1
- package/dist/__tests__/utils/click-tracker.test.d.ts +4 -4
- package/dist/__tests__/utils/data.test.d.ts +7 -7
- package/dist/__tests__/utils/evm.test.d.ts +1 -1
- package/dist/__tests__/utils/http-client.test.d.ts +1 -1
- package/dist/__tests__/utils/privacy.test.d.ts +4 -4
- package/dist/__tests__/utils/session.test.d.ts +1 -1
- package/dist/__tests__/utils/solana.test.d.ts +1 -1
- package/dist/__tests__/utils/store.test.d.ts +1 -1
- package/dist/base/index.d.ts +12 -12
- package/dist/constants.d.ts +2 -2
- package/dist/core/index.d.ts +65 -64
- package/dist/index.d.ts +5 -6
- package/dist/index.es.js +1 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -18
- package/dist/index.js.map +1 -1
- package/dist/package.json +41 -47
- package/dist/types.d.ts +100 -99
- package/dist/umd/lucia-sdk-0.9.3.min.js +1 -0
- package/dist/umd/lucia-sdk-latest.min.js +1 -18
- package/dist/utils/click-tracker.d.ts +100 -100
- package/dist/utils/data.d.ts +98 -99
- package/dist/utils/evm.d.ts +69 -75
- package/dist/utils/http-client.d.ts +17 -17
- package/dist/utils/logger.d.ts +7 -7
- package/dist/utils/privacy.d.ts +33 -33
- package/dist/utils/session.d.ts +51 -51
- package/dist/utils/solana.d.ts +50 -50
- package/dist/utils/store.d.ts +14 -14
- package/dist/version.d.ts +1 -1
- package/package.json +41 -47
- package/CHANGELOG.md +0 -189
- package/dist/umd/lucia-sdk-0.9.1.min.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-initialization tests for Lucia SDK
|
|
3
|
-
* Tests the data-api-key attribute detection and automatic initialization
|
|
4
|
-
*/
|
|
5
|
-
import '@testing-library/jest-dom';
|
|
1
|
+
/**
|
|
2
|
+
* Auto-initialization tests for Lucia SDK
|
|
3
|
+
* Tests the data-api-key attribute detection and automatic initialization
|
|
4
|
+
*/
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration tests for auto-initialization with hybrid CDN + npm usage
|
|
3
|
-
*
|
|
4
|
-
* NOTE: These tests focus on the conceptual aspects of auto-init that can be tested
|
|
5
|
-
* in a Jest environment. Full CDN auto-init behavior (script tag detection,
|
|
6
|
-
* DOMContentLoaded, automatic initialization) must be tested manually using:
|
|
7
|
-
* demo/auto-init-demo.html in a real browser environment.
|
|
8
|
-
*/
|
|
9
|
-
import '@testing-library/jest-dom';
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for auto-initialization with hybrid CDN + npm usage
|
|
3
|
+
*
|
|
4
|
+
* NOTE: These tests focus on the conceptual aspects of auto-init that can be tested
|
|
5
|
+
* in a Jest environment. Full CDN auto-init behavior (script tag detection,
|
|
6
|
+
* DOMContentLoaded, automatic initialization) must be tested manually using:
|
|
7
|
+
* demo/auto-init-demo.html in a real browser environment.
|
|
8
|
+
*/
|
|
9
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
ApplePaySession?: any;
|
|
4
|
-
openDatabase?: any;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export {};
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
ApplePaySession?: any;
|
|
4
|
+
openDatabase?: any;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/base/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Config } from '../types';
|
|
2
|
-
import HttpClient from '../utils/http-client';
|
|
3
|
-
import Logger from '../utils/logger';
|
|
4
|
-
import Store from '../utils/store';
|
|
5
|
-
declare class BaseClass {
|
|
6
|
-
store: typeof Store.store;
|
|
7
|
-
dispatch: typeof Store.dispatch;
|
|
8
|
-
httpClient: HttpClient;
|
|
9
|
-
logger: Logger;
|
|
10
|
-
constructor(config: Config);
|
|
11
|
-
}
|
|
12
|
-
export default BaseClass;
|
|
1
|
+
import { Config } from '../types';
|
|
2
|
+
import HttpClient from '../utils/http-client';
|
|
3
|
+
import Logger from '../utils/logger';
|
|
4
|
+
import Store from '../utils/store';
|
|
5
|
+
declare class BaseClass {
|
|
6
|
+
store: typeof Store.store;
|
|
7
|
+
dispatch: typeof Store.dispatch;
|
|
8
|
+
httpClient: HttpClient;
|
|
9
|
+
logger: Logger;
|
|
10
|
+
constructor(config: Config);
|
|
11
|
+
}
|
|
12
|
+
export default BaseClass;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SERVER_URL = "https://api.clickinsights.xyz";
|
|
2
|
-
export declare const TEST_SERVER_URL = "http://52.22.177.60/fk";
|
|
1
|
+
export declare const SERVER_URL = "https://api.clickinsights.xyz";
|
|
2
|
+
export declare const TEST_SERVER_URL = "http://52.22.177.60/fk";
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import BaseClass from '../base';
|
|
2
|
-
import { ClickEventMetadata } from '../types';
|
|
3
|
-
declare class LuciaSDK extends BaseClass {
|
|
4
|
-
private clickTracker;
|
|
5
|
-
authenticate(): void;
|
|
6
|
-
/**
|
|
7
|
-
* Initializes the SDK with the provided configuration
|
|
8
|
-
*/
|
|
9
|
-
init(): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Initialize automated click tracking if enabled
|
|
12
|
-
*/
|
|
13
|
-
private initAutoTracking;
|
|
14
|
-
/**
|
|
15
|
-
* Handle automatically tracked click events
|
|
16
|
-
*/
|
|
17
|
-
private handleAutoTrackedClick;
|
|
18
|
-
/**
|
|
19
|
-
* Sends user information to the server
|
|
20
|
-
* @param userId The user's ID, e.g. email, wallet address, etc.
|
|
21
|
-
* @param userInfo Additional user information, e.g. name, contact details, etc.
|
|
22
|
-
*/
|
|
23
|
-
userInfo(userId: string, userInfo: object): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Sends page view information to the server
|
|
26
|
-
* @param page The page that the user is currently on
|
|
27
|
-
*/
|
|
28
|
-
pageView(page: string): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Sends conversion information to the server
|
|
31
|
-
* @param eventTag The tag of the event that was triggered, e.g. 'purchase', 'signup', etc.
|
|
32
|
-
* @param amount The amount of the conversion, e.g. purchase amount, etc.
|
|
33
|
-
* @param eventDetails Additional details about the event, e.g. product details, etc.
|
|
34
|
-
*/
|
|
35
|
-
trackConversion(eventTag: string, amount: number, eventDetails: object): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Sends button click information to the server
|
|
38
|
-
* @param button The button identifier that was clicked
|
|
39
|
-
* @param metadata Optional metadata about the click event (elementType, text, href, meta)
|
|
40
|
-
*/
|
|
41
|
-
buttonClick(button: string, metadata?: ClickEventMetadata): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Sends wallet information to the server
|
|
44
|
-
* @param walletAddress The wallet address of the user
|
|
45
|
-
* @param chainId The chain ID of the wallet
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*
|
|
51
|
-
* @param
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
import BaseClass from '../base';
|
|
2
|
+
import { ClickEventMetadata } from '../types';
|
|
3
|
+
declare class LuciaSDK extends BaseClass {
|
|
4
|
+
private clickTracker;
|
|
5
|
+
authenticate(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the SDK with the provided configuration
|
|
8
|
+
*/
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Initialize automated click tracking if enabled
|
|
12
|
+
*/
|
|
13
|
+
private initAutoTracking;
|
|
14
|
+
/**
|
|
15
|
+
* Handle automatically tracked click events
|
|
16
|
+
*/
|
|
17
|
+
private handleAutoTrackedClick;
|
|
18
|
+
/**
|
|
19
|
+
* Sends user information to the server
|
|
20
|
+
* @param userId The user's ID, e.g. email, wallet address, etc.
|
|
21
|
+
* @param userInfo Additional user information, e.g. name, contact details, etc.
|
|
22
|
+
*/
|
|
23
|
+
userInfo(userId: string, userInfo: object): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Sends page view information to the server
|
|
26
|
+
* @param page The page that the user is currently on
|
|
27
|
+
*/
|
|
28
|
+
pageView(page: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Sends conversion information to the server
|
|
31
|
+
* @param eventTag The tag of the event that was triggered, e.g. 'purchase', 'signup', etc.
|
|
32
|
+
* @param amount The amount of the conversion, e.g. purchase amount, etc.
|
|
33
|
+
* @param eventDetails Additional details about the event, e.g. product details, etc.
|
|
34
|
+
*/
|
|
35
|
+
trackConversion(eventTag: string, amount: number, eventDetails: object): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Sends button click information to the server
|
|
38
|
+
* @param button The button identifier that was clicked
|
|
39
|
+
* @param metadata Optional metadata about the click event (elementType, text, href, meta)
|
|
40
|
+
*/
|
|
41
|
+
buttonClick(button: string, metadata?: ClickEventMetadata): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Sends wallet information to the server
|
|
44
|
+
* @param walletAddress The wallet address of the user
|
|
45
|
+
* @param chainId The chain ID of the wallet
|
|
46
|
+
* @param walletName
|
|
47
|
+
*/
|
|
48
|
+
sendWalletInfo(walletAddress: string, chainId: number | string, walletName?: 'Phantom' | 'Metamask'): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Track a user acquisition event when a user signs up or logs in
|
|
51
|
+
* @param userId - Unique identifier for the user
|
|
52
|
+
* @param acquisitionData - Optional additional data about the acquisition
|
|
53
|
+
*/
|
|
54
|
+
trackUserAcquisition(userId: string, acquisitionData?: object): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if MetaMask is installed and connected
|
|
57
|
+
* @returns true if MetaMask is connected, false otherwise
|
|
58
|
+
*/
|
|
59
|
+
checkMetaMaskConnection(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Clean up SDK resources (mainly for testing)
|
|
62
|
+
*/
|
|
63
|
+
destroy(): void;
|
|
64
|
+
}
|
|
65
|
+
export default LuciaSDK;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { SDK } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const __resetInstance: () => void;
|
|
4
|
-
declare const LuciaSDK: SDK;
|
|
5
|
-
export default LuciaSDK;
|
|
6
|
-
export { getBrowserData, getWalletData, getUtmParams, safeAccess, filterObject, getCanvasFingerprint, isTouchEnabled, getApplePayAvailable, getContrastPreference, getColorGamut, };
|
|
1
|
+
import { SDK } from './types';
|
|
2
|
+
export { getBrowserData, getWalletData, getUtmParams, safeAccess, filterObject, getCanvasFingerprint, isTouchEnabled, getApplePayAvailable, getContrastPreference, getColorGamut, } from './utils/data';
|
|
3
|
+
export declare const __resetInstance: () => void;
|
|
4
|
+
declare const LuciaSDK: SDK;
|
|
5
|
+
export default LuciaSDK;
|