blinker-sdk 1.0.0 → 2.0.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/README.md +287 -84
- package/dist/blinker.min.js +452 -1
- package/dist/capture/deduplication.d.ts +26 -0
- package/dist/capture/deduplication.d.ts.map +1 -0
- package/dist/capture/errorHandler.d.ts +5 -0
- package/dist/capture/errorHandler.d.ts.map +1 -0
- package/dist/capture/index.d.ts +4 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/types.d.ts +13 -0
- package/dist/capture/types.d.ts.map +1 -0
- package/dist/context/SessionManager.d.ts +16 -0
- package/dist/context/SessionManager.d.ts.map +1 -0
- package/dist/context/UserContext.d.ts +19 -0
- package/dist/context/UserContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/types.d.ts +18 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/core/Blinker.d.ts +42 -0
- package/dist/core/Blinker.d.ts.map +1 -0
- package/dist/core/config.d.ts +26 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/types.d.ts +50 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/filters/FilterEngine.d.ts +9 -0
- package/dist/filters/FilterEngine.d.ts.map +1 -0
- package/dist/filters/defaults.d.ts +3 -0
- package/dist/filters/defaults.d.ts.map +1 -0
- package/dist/filters/index.d.ts +4 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/types.d.ts +8 -0
- package/dist/filters/types.d.ts.map +1 -0
- package/dist/index.cjs.js +2098 -125
- package/dist/index.d.ts +7 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2098 -125
- package/dist/queue/EventQueue.d.ts +21 -0
- package/dist/queue/EventQueue.d.ts.map +1 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/storage.d.ts +16 -0
- package/dist/queue/storage.d.ts.map +1 -0
- package/dist/queue/types.d.ts +19 -0
- package/dist/queue/types.d.ts.map +1 -0
- package/dist/sampling/RateLimiter.d.ts +12 -0
- package/dist/sampling/RateLimiter.d.ts.map +1 -0
- package/dist/sampling/Sampler.d.ts +16 -0
- package/dist/sampling/Sampler.d.ts.map +1 -0
- package/dist/sampling/index.d.ts +4 -0
- package/dist/sampling/index.d.ts.map +1 -0
- package/dist/sampling/types.d.ts +10 -0
- package/dist/sampling/types.d.ts.map +1 -0
- package/dist/transport/index.d.ts +3 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/sender.d.ts +4 -0
- package/dist/transport/sender.d.ts.map +1 -0
- package/dist/transport/types.d.ts +12 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/utils/browser.d.ts +10 -0
- package/dist/utils/browser.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +4 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/widget/Avatar.d.ts +20 -0
- package/dist/widget/Avatar.d.ts.map +1 -0
- package/dist/widget/Dialog.d.ts +25 -0
- package/dist/widget/Dialog.d.ts.map +1 -0
- package/dist/widget/QuestionEngine.d.ts +7 -0
- package/dist/widget/QuestionEngine.d.ts.map +1 -0
- package/dist/widget/Widget.d.ts +28 -0
- package/dist/widget/Widget.d.ts.map +1 -0
- package/dist/widget/index.d.ts +8 -0
- package/dist/widget/index.d.ts.map +1 -0
- package/dist/widget/styles.d.ts +5 -0
- package/dist/widget/styles.d.ts.map +1 -0
- package/dist/widget/types.d.ts +46 -0
- package/dist/widget/types.d.ts.map +1 -0
- package/package.json +2 -3
- package/dist/Blinker.d.ts +0 -47
- package/dist/Blinker.d.ts.map +0 -1
- package/dist/errorHandler.d.ts +0 -19
- package/dist/errorHandler.d.ts.map +0 -1
- package/dist/sender.d.ts +0 -11
- package/dist/sender.d.ts.map +0 -1
- package/dist/types.d.ts +0 -63
- package/dist/types.d.ts.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BlinkerEventInternal, SendResult } from '../core/types';
|
|
2
|
+
import type { QueueConfig, QueueStats } from './types';
|
|
3
|
+
export declare class EventQueue {
|
|
4
|
+
private queue;
|
|
5
|
+
private storage;
|
|
6
|
+
private config;
|
|
7
|
+
private token;
|
|
8
|
+
private flushTimer;
|
|
9
|
+
private isFlushing;
|
|
10
|
+
constructor(token: string, config?: Partial<QueueConfig>);
|
|
11
|
+
add(event: BlinkerEventInternal): Promise<SendResult>;
|
|
12
|
+
flush(): Promise<SendResult>;
|
|
13
|
+
private sendImmediately;
|
|
14
|
+
getStats(): QueueStats;
|
|
15
|
+
size(): number;
|
|
16
|
+
private startFlushTimer;
|
|
17
|
+
private stopFlushTimer;
|
|
18
|
+
private handleOnline;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=EventQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventQueue.d.ts","sourceRoot":"","sources":["../../src/queue/EventQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAOvD,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,UAAU,CAAkB;gBAExB,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAwBlD,GAAG,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;IAiBrD,KAAK,IAAI,OAAO,CAAC,UAAU,CAAC;YAuCpB,eAAe;IAY7B,QAAQ,IAAI,UAAU;IAUtB,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY,CAIlB;IAEF,OAAO,IAAI,IAAI;CAehB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BlinkerEventInternal } from '../core/types';
|
|
2
|
+
import type { StoredEvent } from './types';
|
|
3
|
+
export declare class OfflineStorage {
|
|
4
|
+
private readonly storageKey;
|
|
5
|
+
private readonly maxEvents;
|
|
6
|
+
private available;
|
|
7
|
+
constructor(maxEvents?: number);
|
|
8
|
+
isAvailable(): boolean;
|
|
9
|
+
store(event: BlinkerEventInternal): boolean;
|
|
10
|
+
storeMany(eventsToStore: BlinkerEventInternal[]): number;
|
|
11
|
+
getAll(): StoredEvent[];
|
|
12
|
+
retrieveAll(): BlinkerEventInternal[];
|
|
13
|
+
count(): number;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/queue/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK3C,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,SAAS,CAAU;gBAEf,SAAS,GAAE,MAAY;IAKnC,WAAW,IAAI,OAAO;IAItB,KAAK,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IA6B3C,SAAS,CAAC,aAAa,EAAE,oBAAoB,EAAE,GAAG,MAAM;IAgCxD,MAAM,IAAI,WAAW,EAAE;IAYvB,WAAW,IAAI,oBAAoB,EAAE;IAmBrC,KAAK,IAAI,MAAM;IAIf,KAAK,IAAI,IAAI;CASd"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BlinkerEventInternal } from '../core/types';
|
|
2
|
+
export interface QueueConfig {
|
|
3
|
+
enableBatching: boolean;
|
|
4
|
+
batchSize: number;
|
|
5
|
+
flushInterval: number;
|
|
6
|
+
enableOfflineStorage: boolean;
|
|
7
|
+
maxStoredEvents: number;
|
|
8
|
+
}
|
|
9
|
+
export interface StoredEvent {
|
|
10
|
+
event: BlinkerEventInternal;
|
|
11
|
+
storedAt: string;
|
|
12
|
+
retries: number;
|
|
13
|
+
}
|
|
14
|
+
export interface QueueStats {
|
|
15
|
+
queueSize: number;
|
|
16
|
+
storedSize: number;
|
|
17
|
+
totalPending: number;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/queue/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RateLimiterState } from './types';
|
|
2
|
+
export declare class RateLimiter {
|
|
3
|
+
private maxPerMinute;
|
|
4
|
+
private state;
|
|
5
|
+
constructor(maxEventsPerMinute?: number);
|
|
6
|
+
allow(): boolean;
|
|
7
|
+
getState(): RateLimiterState;
|
|
8
|
+
getRemaining(): number;
|
|
9
|
+
reset(): void;
|
|
10
|
+
setLimit(maxEventsPerMinute: number): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=RateLimiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimiter.d.ts","sourceRoot":"","sources":["../../src/sampling/RateLimiter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,qBAAa,WAAW;IACtB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,KAAK,CAAmB;gBAEpB,kBAAkB,CAAC,EAAE,MAAM;IASvC,KAAK,IAAI,OAAO;IAkChB,QAAQ,IAAI,gBAAgB;IAI5B,YAAY,IAAI,MAAM;IAUtB,KAAK,IAAI,IAAI;IAQb,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI;CAG3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class Sampler {
|
|
2
|
+
private sampleRate;
|
|
3
|
+
private sampled;
|
|
4
|
+
private dropped;
|
|
5
|
+
constructor(sampleRate?: number);
|
|
6
|
+
shouldSample(isError?: boolean): boolean;
|
|
7
|
+
getStats(): {
|
|
8
|
+
sampled: number;
|
|
9
|
+
dropped: number;
|
|
10
|
+
rate: number;
|
|
11
|
+
};
|
|
12
|
+
setRate(rate: number): void;
|
|
13
|
+
getRate(): number;
|
|
14
|
+
resetStats(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Sampler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sampler.d.ts","sourceRoot":"","sources":["../../src/sampling/Sampler.ts"],"names":[],"mappings":"AAGA,qBAAa,OAAO;IAClB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAa;gBAEhB,UAAU,CAAC,EAAE,MAAM;IAI/B,YAAY,CAAC,OAAO,GAAE,OAAe,GAAG,OAAO;IA4B/C,QAAQ,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAQ9D,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,IAAI,MAAM;IAIjB,UAAU,IAAI,IAAI;CAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sampling/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sampling/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BlinkerEventInternal, SendResult } from '../core/types';
|
|
2
|
+
export declare function sendEvent(apiUrl: string, token: string, event: BlinkerEventInternal): Promise<SendResult>;
|
|
3
|
+
export declare function sendBatch(apiUrl: string, token: string, events: BlinkerEventInternal[]): Promise<SendResult>;
|
|
4
|
+
//# sourceMappingURL=sender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../../src/transport/sender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKtE,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAErB;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,oBAAoB,EAAE,GAC7B,OAAO,CAAC,UAAU,CAAC,CAoDrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BlinkerEventInternal, SendResult } from '../core/types';
|
|
2
|
+
export interface EventBatch {
|
|
3
|
+
events: BlinkerEventInternal[];
|
|
4
|
+
timestamp: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TransportConfig {
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
token: string;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export type TransportResult = SendResult;
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/transport/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function isBrowser(): boolean;
|
|
2
|
+
export declare function isNode(): boolean;
|
|
3
|
+
export declare function isLocalStorageAvailable(): boolean;
|
|
4
|
+
export declare function isSessionStorageAvailable(): boolean;
|
|
5
|
+
export declare function isOnline(): boolean;
|
|
6
|
+
export declare function getCurrentUrl(): string | undefined;
|
|
7
|
+
export declare function getCurrentPath(): string;
|
|
8
|
+
export declare function getUserAgent(): string | undefined;
|
|
9
|
+
export declare function getReferrer(): string | undefined;
|
|
10
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/utils/browser.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,MAAM,IAAI,OAAO,CAGhC;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAWjD;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAWnD;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,CAGlD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAGjD;AAED,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAGhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAYhF;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
log: (...args: unknown[]) => void;
|
|
3
|
+
warn: (...args: unknown[]) => void;
|
|
4
|
+
error: (...args: unknown[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createLogger(debug: boolean): Logger;
|
|
7
|
+
export declare function setGlobalLogger(debug: boolean): void;
|
|
8
|
+
export declare function getLogger(): Logger;
|
|
9
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAClC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgBnD;AAID,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEpD;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AvatarState, WidgetTheme } from './types';
|
|
2
|
+
export declare class Avatar {
|
|
3
|
+
private element;
|
|
4
|
+
private theme;
|
|
5
|
+
private onClick;
|
|
6
|
+
private pupilLeft;
|
|
7
|
+
private pupilRight;
|
|
8
|
+
private mouseTrackingEnabled;
|
|
9
|
+
constructor(theme: WidgetTheme, onClick: () => void);
|
|
10
|
+
create(): SVGElement;
|
|
11
|
+
private getSVGContent;
|
|
12
|
+
private handleMouseMove;
|
|
13
|
+
setState(state: AvatarState): void;
|
|
14
|
+
setMinimized(minimized: boolean): void;
|
|
15
|
+
updateTheme(theme: WidgetTheme): void;
|
|
16
|
+
private adjustColor;
|
|
17
|
+
getElement(): SVGElement | null;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/widget/Avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExD,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,oBAAoB,CAAQ;gBAExB,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI;IAMnD,MAAM,IAAI,UAAU;IAmBpB,OAAO,CAAC,aAAa;IA2DrB,OAAO,CAAC,eAAe;IAkBvB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAOlC,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAYtC,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IASrC,OAAO,CAAC,WAAW;IAQnB,UAAU,IAAI,UAAU,GAAG,IAAI;IAI/B,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { WidgetConfig, WidgetQuestion, WidgetFeedback } from './types';
|
|
2
|
+
export declare class Dialog {
|
|
3
|
+
private overlay;
|
|
4
|
+
private dialog;
|
|
5
|
+
private config;
|
|
6
|
+
private questions;
|
|
7
|
+
private answers;
|
|
8
|
+
private errorId;
|
|
9
|
+
private state;
|
|
10
|
+
private onSubmit;
|
|
11
|
+
private onClose;
|
|
12
|
+
constructor(config: WidgetConfig, onSubmit: (feedback: WidgetFeedback) => void, onClose: () => void);
|
|
13
|
+
open(errorId: string, questions: WidgetQuestion[]): void;
|
|
14
|
+
close(): void;
|
|
15
|
+
private render;
|
|
16
|
+
private getQuestionsHTML;
|
|
17
|
+
private getQuestionHTML;
|
|
18
|
+
private getThankYouHTML;
|
|
19
|
+
private attachEventListeners;
|
|
20
|
+
private handleSubmit;
|
|
21
|
+
updateConfig(config: WidgetConfig): void;
|
|
22
|
+
private adjustColor;
|
|
23
|
+
isOpen(): boolean;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/widget/Dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI5E,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,OAAO,CAAa;gBAG1B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAC5C,OAAO,EAAE,MAAM,IAAI;IAOrB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI;IAQxD,KAAK,IAAI,IAAI;IAYb,OAAO,CAAC,MAAM;IAmBd,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,eAAe;IA2CvB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,oBAAoB;IAoD5B,OAAO,CAAC,YAAY;IAsCpB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAIxC,OAAO,CAAC,WAAW;IAQnB,MAAM,IAAI,OAAO;CAGlB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WidgetQuestion } from './types';
|
|
2
|
+
import type { BlinkerErrorPayload } from '../core/types';
|
|
3
|
+
export declare class QuestionEngine {
|
|
4
|
+
inferQuestions(message: string, payload?: BlinkerErrorPayload): WidgetQuestion[];
|
|
5
|
+
shouldShowWidget(message: string, payload?: BlinkerErrorPayload, backendDecision?: boolean): boolean;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=QuestionEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuestionEngine.d.ts","sourceRoot":"","sources":["../../src/widget/QuestionEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAqMzD,qBAAa,cAAc;IACzB,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,mBAAmB,GAC5B,cAAc,EAAE;IAqCnB,gBAAgB,CACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,mBAAmB,EAC7B,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO;CAyBX"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { WidgetConfig, WidgetFeedback } from './types';
|
|
2
|
+
import type { BlinkerErrorPayload } from '../core/types';
|
|
3
|
+
export declare class Widget {
|
|
4
|
+
private config;
|
|
5
|
+
private state;
|
|
6
|
+
private container;
|
|
7
|
+
private avatar;
|
|
8
|
+
private dialog;
|
|
9
|
+
private questionEngine;
|
|
10
|
+
private onFeedbackSubmit;
|
|
11
|
+
constructor(config?: Partial<WidgetConfig>);
|
|
12
|
+
init(onFeedbackSubmit?: (feedback: WidgetFeedback) => void): void;
|
|
13
|
+
private createContainer;
|
|
14
|
+
show(errorId: string, message: string, payload?: BlinkerErrorPayload, backendDecision?: boolean): void;
|
|
15
|
+
hide(): void;
|
|
16
|
+
private handleAvatarClick;
|
|
17
|
+
private handleFeedbackSubmit;
|
|
18
|
+
private handleDialogClose;
|
|
19
|
+
private canShowWidget;
|
|
20
|
+
private loadState;
|
|
21
|
+
private saveState;
|
|
22
|
+
updateConfig(config: Partial<WidgetConfig>): void;
|
|
23
|
+
getConfig(): WidgetConfig;
|
|
24
|
+
isVisible(): boolean;
|
|
25
|
+
isDialogOpen(): boolean;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../../src/widget/Widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAe,cAAc,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AASzD,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,gBAAgB,CAAqD;gBAEjE,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAM1C,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IASjE,OAAO,CAAC,eAAe;IAoBvB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAsBtG,IAAI,IAAI,IAAI;IAQZ,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,SAAS;IA8BjB,OAAO,CAAC,SAAS;IAajB,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAWjD,SAAS,IAAI,YAAY;IAIzB,SAAS,IAAI,OAAO;IAIpB,YAAY,IAAI,OAAO;IAIvB,OAAO,IAAI,IAAI;CAahB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Widget } from './Widget';
|
|
2
|
+
export { Avatar } from './Avatar';
|
|
3
|
+
export { Dialog } from './Dialog';
|
|
4
|
+
export { QuestionEngine } from './QuestionEngine';
|
|
5
|
+
export { injectStyles, removeStyles, updateStyles } from './styles';
|
|
6
|
+
export type { WidgetConfig, WidgetTheme, WidgetMessages, WidgetQuestion, WidgetFeedback, WidgetState, AvatarState, } from './types';
|
|
7
|
+
export { DEFAULT_WIDGET_CONFIG } from './types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widget/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACpE,YAAY,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/widget/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAOrD;AAED,wBAAgB,YAAY,IAAI,IAAI,CAGnC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAKrD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface WidgetTheme {
|
|
2
|
+
primary: string;
|
|
3
|
+
background: string;
|
|
4
|
+
text: string;
|
|
5
|
+
accent: string;
|
|
6
|
+
}
|
|
7
|
+
export interface WidgetMessages {
|
|
8
|
+
greeting: string;
|
|
9
|
+
subtext: string;
|
|
10
|
+
thankYou: string;
|
|
11
|
+
buttonSend: string;
|
|
12
|
+
buttonSkip: string;
|
|
13
|
+
}
|
|
14
|
+
export interface WidgetConfig {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
theme: WidgetTheme;
|
|
17
|
+
messages: WidgetMessages;
|
|
18
|
+
position: 'bottom-right' | 'bottom-left';
|
|
19
|
+
delay: number;
|
|
20
|
+
maxShowsPerSession: number;
|
|
21
|
+
cooldownMinutes: number;
|
|
22
|
+
}
|
|
23
|
+
export interface WidgetQuestion {
|
|
24
|
+
id: string;
|
|
25
|
+
text: string;
|
|
26
|
+
type: 'text' | 'select' | 'boolean';
|
|
27
|
+
options?: string[];
|
|
28
|
+
required?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface WidgetFeedback {
|
|
31
|
+
errorId: string;
|
|
32
|
+
answers: Record<string, string | boolean>;
|
|
33
|
+
submittedAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface WidgetState {
|
|
36
|
+
isVisible: boolean;
|
|
37
|
+
isMinimized: boolean;
|
|
38
|
+
isDialogOpen: boolean;
|
|
39
|
+
currentErrorId: string | null;
|
|
40
|
+
questions: WidgetQuestion[];
|
|
41
|
+
showCount: number;
|
|
42
|
+
lastShowTime: number | null;
|
|
43
|
+
}
|
|
44
|
+
export type AvatarState = 'idle' | 'hover' | 'minimized' | 'talking';
|
|
45
|
+
export declare const DEFAULT_WIDGET_CONFIG: WidgetConfig;
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widget/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,cAAc,GAAG,aAAa,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAErE,eAAO,MAAM,qBAAqB,EAAE,YAmBnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blinker-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Universal JavaScript SDK for error tracking and event capture - works with any framework",
|
|
5
5
|
"author": "Blinker",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,11 +63,10 @@
|
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|
|
66
|
-
"url": "https://github.com/blinker/blinker-sdk.git"
|
|
66
|
+
"url": "git+https://github.com/blinker/blinker-sdk.git"
|
|
67
67
|
},
|
|
68
68
|
"bugs": {
|
|
69
69
|
"url": "https://github.com/blinker/blinker-sdk/issues"
|
|
70
70
|
},
|
|
71
71
|
"homepage": "https://github.com/blinker/blinker-sdk#readme"
|
|
72
72
|
}
|
|
73
|
-
|
package/dist/Blinker.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blinker SDK Main Class
|
|
3
|
-
* Universal JavaScript SDK for error tracking and event capture
|
|
4
|
-
*/
|
|
5
|
-
import type { BlinkerConfig, SendResult } from './types';
|
|
6
|
-
export declare class Blinker {
|
|
7
|
-
private config;
|
|
8
|
-
private initialized;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize the Blinker SDK
|
|
11
|
-
* @param config Configuration options
|
|
12
|
-
*/
|
|
13
|
-
init(config: BlinkerConfig): void;
|
|
14
|
-
/**
|
|
15
|
-
* Track a custom event
|
|
16
|
-
* @param type Event type (e.g., 'click', 'pageview', 'custom')
|
|
17
|
-
* @param message Event message or description
|
|
18
|
-
* @param payload Optional additional data
|
|
19
|
-
*/
|
|
20
|
-
track(type: string, message: string, payload?: Record<string, unknown>): Promise<SendResult>;
|
|
21
|
-
/**
|
|
22
|
-
* Track an error manually
|
|
23
|
-
* @param error Error object or message
|
|
24
|
-
* @param additionalPayload Optional additional data
|
|
25
|
-
*/
|
|
26
|
-
captureError(error: Error | string, additionalPayload?: Record<string, unknown>): Promise<SendResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Track a page view
|
|
29
|
-
* @param pageName Optional page name (defaults to current URL path)
|
|
30
|
-
* @param additionalPayload Optional additional data
|
|
31
|
-
*/
|
|
32
|
-
trackPageView(pageName?: string, additionalPayload?: Record<string, unknown>): Promise<SendResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Check if SDK is initialized
|
|
35
|
-
*/
|
|
36
|
-
isInitialized(): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Get current configuration (without token for security)
|
|
39
|
-
*/
|
|
40
|
-
getConfig(): Omit<BlinkerConfig, 'token'> | null;
|
|
41
|
-
/**
|
|
42
|
-
* Destroy the SDK instance
|
|
43
|
-
* Removes error handlers and resets state
|
|
44
|
-
*/
|
|
45
|
-
destroy(): void;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=Blinker.d.ts.map
|
package/dist/Blinker.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Blinker.d.ts","sourceRoot":"","sources":["../src/Blinker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAwB,UAAU,EAAE,MAAM,SAAS,CAAC;AAI/E,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,WAAW,CAAkB;IAErC;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IA6CjC;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAoB5F;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAcrG;;;;OAIG;IACH,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IASlG;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,SAAS,IAAI,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,IAAI;IAOhD;;;OAGG;IACH,OAAO,IAAI,IAAI;CAWhB"}
|
package/dist/errorHandler.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global error handler module
|
|
3
|
-
* Captures window.onerror and unhandledrejection events
|
|
4
|
-
*/
|
|
5
|
-
import type { BlinkerErrorPayload } from './types';
|
|
6
|
-
export type ErrorCallback = (type: string, message: string, payload: BlinkerErrorPayload) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Sets up global error handlers
|
|
9
|
-
*/
|
|
10
|
-
export declare function setupErrorHandlers(callback: ErrorCallback, options?: {
|
|
11
|
-
captureErrors?: boolean;
|
|
12
|
-
captureRejections?: boolean;
|
|
13
|
-
debug?: boolean;
|
|
14
|
-
}): void;
|
|
15
|
-
/**
|
|
16
|
-
* Removes global error handlers and restores originals
|
|
17
|
-
*/
|
|
18
|
-
export declare function teardownErrorHandlers(): void;
|
|
19
|
-
//# sourceMappingURL=errorHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../src/errorHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,KACzB,IAAI,CAAC;AAOV;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACtF,IAAI,CA6FN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAgB5C"}
|
package/dist/sender.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event sender module
|
|
3
|
-
* Handles sending events to the Blinker API
|
|
4
|
-
*/
|
|
5
|
-
import type { BlinkerEventInternal, SendResult } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Sends an event to the Blinker API
|
|
8
|
-
* Attempts to send once, with a simple retry if offline
|
|
9
|
-
*/
|
|
10
|
-
export declare function sendEvent(api: string, token: string, event: BlinkerEventInternal, debug?: boolean): Promise<SendResult>;
|
|
11
|
-
//# sourceMappingURL=sender.d.ts.map
|
package/dist/sender.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../src/sender.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhE;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,oBAAoB,EAC3B,KAAK,GAAE,OAAe,GACrB,OAAO,CAAC,UAAU,CAAC,CAiFrB"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blinker SDK Types
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Configuration options for initializing the Blinker SDK
|
|
6
|
-
*/
|
|
7
|
-
export interface BlinkerConfig {
|
|
8
|
-
/** The authentication token for the Blinker API */
|
|
9
|
-
token: string;
|
|
10
|
-
/** The base URL of the Blinker API endpoint */
|
|
11
|
-
api: string;
|
|
12
|
-
/** Enable automatic error capture (default: true) */
|
|
13
|
-
captureErrors?: boolean;
|
|
14
|
-
/** Enable automatic unhandled rejection capture (default: true) */
|
|
15
|
-
captureRejections?: boolean;
|
|
16
|
-
/** Enable debug mode for logging (default: false) */
|
|
17
|
-
debug?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Event payload to be sent to the Blinker API
|
|
21
|
-
*/
|
|
22
|
-
export interface BlinkerEvent {
|
|
23
|
-
/** Event type (e.g., 'error', 'click', 'pageview', custom types) */
|
|
24
|
-
type: string;
|
|
25
|
-
/** Event message or description */
|
|
26
|
-
message: string;
|
|
27
|
-
/** Additional event data */
|
|
28
|
-
payload?: Record<string, unknown>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Internal event with metadata
|
|
32
|
-
*/
|
|
33
|
-
export interface BlinkerEventInternal extends BlinkerEvent {
|
|
34
|
-
/** Timestamp when the event was created */
|
|
35
|
-
timestamp: string;
|
|
36
|
-
/** URL where the event occurred */
|
|
37
|
-
url?: string;
|
|
38
|
-
/** User agent string */
|
|
39
|
-
userAgent?: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Error payload structure
|
|
43
|
-
*/
|
|
44
|
-
export interface BlinkerErrorPayload extends Record<string, unknown> {
|
|
45
|
-
/** Error stack trace */
|
|
46
|
-
stack?: string;
|
|
47
|
-
/** Source file where error occurred */
|
|
48
|
-
source?: string;
|
|
49
|
-
/** Line number */
|
|
50
|
-
lineno?: number;
|
|
51
|
-
/** Column number */
|
|
52
|
-
colno?: number;
|
|
53
|
-
/** Original error object type */
|
|
54
|
-
errorType?: string;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Send result status
|
|
58
|
-
*/
|
|
59
|
-
export interface SendResult {
|
|
60
|
-
success: boolean;
|
|
61
|
-
error?: string;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClE,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|