blinker-sdk 1.0.1 → 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.
Files changed (91) hide show
  1. package/README.md +226 -147
  2. package/dist/blinker.min.js +452 -1
  3. package/dist/capture/deduplication.d.ts +26 -0
  4. package/dist/capture/deduplication.d.ts.map +1 -0
  5. package/dist/capture/errorHandler.d.ts +5 -0
  6. package/dist/capture/errorHandler.d.ts.map +1 -0
  7. package/dist/capture/index.d.ts +4 -0
  8. package/dist/capture/index.d.ts.map +1 -0
  9. package/dist/capture/types.d.ts +13 -0
  10. package/dist/capture/types.d.ts.map +1 -0
  11. package/dist/context/SessionManager.d.ts +16 -0
  12. package/dist/context/SessionManager.d.ts.map +1 -0
  13. package/dist/context/UserContext.d.ts +19 -0
  14. package/dist/context/UserContext.d.ts.map +1 -0
  15. package/dist/context/index.d.ts +4 -0
  16. package/dist/context/index.d.ts.map +1 -0
  17. package/dist/context/types.d.ts +18 -0
  18. package/dist/context/types.d.ts.map +1 -0
  19. package/dist/core/Blinker.d.ts +42 -0
  20. package/dist/core/Blinker.d.ts.map +1 -0
  21. package/dist/core/config.d.ts +26 -0
  22. package/dist/core/config.d.ts.map +1 -0
  23. package/dist/core/index.d.ts +4 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/types.d.ts +50 -0
  26. package/dist/core/types.d.ts.map +1 -0
  27. package/dist/filters/FilterEngine.d.ts +9 -0
  28. package/dist/filters/FilterEngine.d.ts.map +1 -0
  29. package/dist/filters/defaults.d.ts +3 -0
  30. package/dist/filters/defaults.d.ts.map +1 -0
  31. package/dist/filters/index.d.ts +4 -0
  32. package/dist/filters/index.d.ts.map +1 -0
  33. package/dist/filters/types.d.ts +8 -0
  34. package/dist/filters/types.d.ts.map +1 -0
  35. package/dist/index.cjs.js +2154 -264
  36. package/dist/index.d.ts +7 -32
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.esm.js +2154 -264
  39. package/dist/queue/EventQueue.d.ts +21 -0
  40. package/dist/queue/EventQueue.d.ts.map +1 -0
  41. package/dist/queue/index.d.ts +4 -0
  42. package/dist/queue/index.d.ts.map +1 -0
  43. package/dist/queue/storage.d.ts +16 -0
  44. package/dist/queue/storage.d.ts.map +1 -0
  45. package/dist/queue/types.d.ts +19 -0
  46. package/dist/queue/types.d.ts.map +1 -0
  47. package/dist/sampling/RateLimiter.d.ts +12 -0
  48. package/dist/sampling/RateLimiter.d.ts.map +1 -0
  49. package/dist/sampling/Sampler.d.ts +16 -0
  50. package/dist/sampling/Sampler.d.ts.map +1 -0
  51. package/dist/sampling/index.d.ts +4 -0
  52. package/dist/sampling/index.d.ts.map +1 -0
  53. package/dist/sampling/types.d.ts +10 -0
  54. package/dist/sampling/types.d.ts.map +1 -0
  55. package/dist/transport/index.d.ts +3 -0
  56. package/dist/transport/index.d.ts.map +1 -0
  57. package/dist/transport/sender.d.ts +4 -0
  58. package/dist/transport/sender.d.ts.map +1 -0
  59. package/dist/transport/types.d.ts +12 -0
  60. package/dist/transport/types.d.ts.map +1 -0
  61. package/dist/utils/browser.d.ts +10 -0
  62. package/dist/utils/browser.d.ts.map +1 -0
  63. package/dist/utils/hash.d.ts +4 -0
  64. package/dist/utils/hash.d.ts.map +1 -0
  65. package/dist/utils/index.d.ts +4 -0
  66. package/dist/utils/index.d.ts.map +1 -0
  67. package/dist/utils/logger.d.ts +9 -0
  68. package/dist/utils/logger.d.ts.map +1 -0
  69. package/dist/widget/Avatar.d.ts +20 -0
  70. package/dist/widget/Avatar.d.ts.map +1 -0
  71. package/dist/widget/Dialog.d.ts +25 -0
  72. package/dist/widget/Dialog.d.ts.map +1 -0
  73. package/dist/widget/QuestionEngine.d.ts +7 -0
  74. package/dist/widget/QuestionEngine.d.ts.map +1 -0
  75. package/dist/widget/Widget.d.ts +28 -0
  76. package/dist/widget/Widget.d.ts.map +1 -0
  77. package/dist/widget/index.d.ts +8 -0
  78. package/dist/widget/index.d.ts.map +1 -0
  79. package/dist/widget/styles.d.ts +5 -0
  80. package/dist/widget/styles.d.ts.map +1 -0
  81. package/dist/widget/types.d.ts +46 -0
  82. package/dist/widget/types.d.ts.map +1 -0
  83. package/package.json +1 -1
  84. package/dist/Blinker.d.ts +0 -65
  85. package/dist/Blinker.d.ts.map +0 -1
  86. package/dist/errorHandler.d.ts +0 -19
  87. package/dist/errorHandler.d.ts.map +0 -1
  88. package/dist/sender.d.ts +0 -11
  89. package/dist/sender.d.ts.map +0 -1
  90. package/dist/types.d.ts +0 -92
  91. 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,4 @@
1
+ export * from './types';
2
+ export * from './storage';
3
+ export * from './EventQueue';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,4 @@
1
+ export * from './types';
2
+ export * from './RateLimiter';
3
+ export * from './Sampler';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,10 @@
1
+ export interface SamplingConfig {
2
+ sampleRate: number;
3
+ maxEventsPerMinute: number;
4
+ }
5
+ export interface RateLimiterState {
6
+ count: number;
7
+ windowStart: number;
8
+ dropped: number;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -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,3 @@
1
+ export * from './types';
2
+ export * from './sender';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,4 @@
1
+ export declare function simpleHash(str: string): string;
2
+ export declare function generateErrorFingerprint(message: string, stack?: string): string;
3
+ export declare function generateUniqueId(): string;
4
+ //# sourceMappingURL=hash.d.ts.map
@@ -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,4 @@
1
+ export * from './browser';
2
+ export * from './logger';
3
+ export * from './hash';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,5 @@
1
+ import type { WidgetTheme } from './types';
2
+ export declare function injectStyles(theme: WidgetTheme): void;
3
+ export declare function removeStyles(): void;
4
+ export declare function updateStyles(theme: WidgetTheme): void;
5
+ //# sourceMappingURL=styles.d.ts.map
@@ -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": "1.0.1",
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",
package/dist/Blinker.d.ts DELETED
@@ -1,65 +0,0 @@
1
- /**
2
- * Blinker SDK Main Class
3
- * Universal JavaScript SDK for error tracking and event capture
4
- */
5
- import type { BlinkerConfig, SendResult, FilterSettings } from './types';
6
- /**
7
- * Default filter settings
8
- * These are sensible defaults that ignore common non-bug errors
9
- */
10
- export declare const DEFAULT_FILTERS: Required<FilterSettings>;
11
- export declare class Blinker {
12
- private config;
13
- private initialized;
14
- private filters;
15
- /**
16
- * Initialize the Blinker SDK
17
- * @param config Configuration options
18
- */
19
- init(config: BlinkerConfig): void;
20
- /**
21
- * Check if an error should be captured based on filter settings
22
- * @param message Error message
23
- * @param errorType Optional JS error type (e.g., 'TypeError')
24
- * @param httpCode Optional HTTP status code
25
- * @returns true if the error should be captured, false if filtered out
26
- */
27
- private shouldCapture;
28
- /**
29
- * Track a custom event
30
- * @param type Event type (e.g., 'click', 'pageview', 'custom')
31
- * @param message Event message or description
32
- * @param payload Optional additional data
33
- */
34
- track(type: string, message: string, payload?: Record<string, unknown>): Promise<SendResult>;
35
- /**
36
- * Track an error manually
37
- * @param error Error object or message
38
- * @param additionalPayload Optional additional data (can include httpCode for filtering)
39
- */
40
- captureError(error: Error | string, additionalPayload?: Record<string, unknown>): Promise<SendResult>;
41
- /**
42
- * Track a page view
43
- * @param pageName Optional page name (defaults to current URL path)
44
- * @param additionalPayload Optional additional data
45
- */
46
- trackPageView(pageName?: string, additionalPayload?: Record<string, unknown>): Promise<SendResult>;
47
- /**
48
- * Check if SDK is initialized
49
- */
50
- isInitialized(): boolean;
51
- /**
52
- * Get current configuration (without token for security)
53
- */
54
- getConfig(): Omit<BlinkerConfig, 'token'> | null;
55
- /**
56
- * Destroy the SDK instance
57
- * Removes error handlers and resets state
58
- */
59
- destroy(): void;
60
- /**
61
- * Get current filter settings
62
- */
63
- getFilters(): FilterSettings;
64
- }
65
- //# sourceMappingURL=Blinker.d.ts.map
@@ -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,cAAc,EAAE,MAAM,SAAS,CAAC;AAU/F;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,cAAc,CAapD,CAAC;AAEF,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,OAAO,CAAoD;IAEnE;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IA2DjC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAwCrB;;;;;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;IAyBrG;;;;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;IAaf;;OAEG;IACH,UAAU,IAAI,cAAc;CAG7B"}
@@ -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
@@ -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,92 +0,0 @@
1
- /**
2
- * Blinker SDK Types
3
- */
4
- /**
5
- * Filter settings for controlling which errors are captured
6
- * All settings are optional and come with sensible defaults
7
- */
8
- export interface FilterSettings {
9
- /**
10
- * HTTP status codes to ignore (not capture)
11
- * Default: [401, 403] - Auth/permission errors are usually expected, not bugs
12
- */
13
- ignoreHttpCodes?: number[];
14
- /**
15
- * JavaScript error types to ignore (e.g., 'TypeError', 'SyntaxError')
16
- * Default: [] - All error types are captured by default
17
- */
18
- ignoreErrorTypes?: string[];
19
- /**
20
- * Message patterns to ignore (substring matching)
21
- * Default: ['ResizeObserver loop', 'Script error'] - Common benign browser errors
22
- */
23
- ignoreMessagePatterns?: string[];
24
- /**
25
- * When true, disables ALL filters and captures everything
26
- * Default: false
27
- */
28
- captureAll?: boolean;
29
- }
30
- /**
31
- * Configuration options for initializing the Blinker SDK
32
- */
33
- export interface BlinkerConfig {
34
- /** The authentication token for the Blinker API (REQUIRED) */
35
- token: string;
36
- /** Enable automatic error capture (default: true) */
37
- captureErrors?: boolean;
38
- /** Enable automatic unhandled rejection capture (default: true) */
39
- captureRejections?: boolean;
40
- /** Enable debug mode for logging (default: false) */
41
- debug?: boolean;
42
- /**
43
- * Filter settings for controlling which errors are captured
44
- * By default, ignores common non-bug errors like 401, 403, ResizeObserver, etc.
45
- */
46
- filters?: FilterSettings;
47
- }
48
- /**
49
- * Event payload to be sent to the Blinker API
50
- */
51
- export interface BlinkerEvent {
52
- /** Event type (e.g., 'error', 'click', 'pageview', custom types) */
53
- type: string;
54
- /** Event message or description */
55
- message: string;
56
- /** Additional event data */
57
- payload?: Record<string, unknown>;
58
- }
59
- /**
60
- * Internal event with metadata
61
- */
62
- export interface BlinkerEventInternal extends BlinkerEvent {
63
- /** Timestamp when the event was created */
64
- timestamp: string;
65
- /** URL where the event occurred */
66
- url?: string;
67
- /** User agent string */
68
- userAgent?: string;
69
- }
70
- /**
71
- * Error payload structure
72
- */
73
- export interface BlinkerErrorPayload extends Record<string, unknown> {
74
- /** Error stack trace */
75
- stack?: string;
76
- /** Source file where error occurred */
77
- source?: string;
78
- /** Line number */
79
- lineno?: number;
80
- /** Column number */
81
- colno?: number;
82
- /** Original error object type */
83
- errorType?: string;
84
- }
85
- /**
86
- * Send result status
87
- */
88
- export interface SendResult {
89
- success: boolean;
90
- error?: string;
91
- }
92
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;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"}