@active-reach/web-sdk 1.41.0 → 1.43.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/package.json +1 -1
- package/dist/aegis-push.min.js +0 -2
- package/dist/aegis-push.min.js.map +0 -1
- package/dist/aegis-sw.js +0 -1
- package/dist/aegis.min.js +0 -2
- package/dist/aegis.min.js.map +0 -1
- package/dist/analytics-C-Go3Pm5.mjs +0 -3509
- package/dist/analytics-C-Go3Pm5.mjs.map +0 -1
- package/dist/cdn.d.ts +0 -26
- package/dist/cdn.d.ts.map +0 -1
- package/dist/chat/AegisChat.d.ts +0 -169
- package/dist/chat/AegisChat.d.ts.map +0 -1
- package/dist/chat/index.d.ts +0 -3
- package/dist/chat/index.d.ts.map +0 -1
- package/dist/core/analytics.d.ts +0 -320
- package/dist/core/analytics.d.ts.map +0 -1
- package/dist/core/bootstrap.d.ts +0 -96
- package/dist/core/bootstrap.d.ts.map +0 -1
- package/dist/core/prefetch-bundle-client.d.ts +0 -175
- package/dist/core/prefetch-bundle-client.d.ts.map +0 -1
- package/dist/core/queue.d.ts +0 -35
- package/dist/core/queue.d.ts.map +0 -1
- package/dist/core/rate-limiter.d.ts +0 -45
- package/dist/core/rate-limiter.d.ts.map +0 -1
- package/dist/core/sdk-config-poller.d.ts +0 -59
- package/dist/core/sdk-config-poller.d.ts.map +0 -1
- package/dist/core/session.d.ts +0 -52
- package/dist/core/session.d.ts.map +0 -1
- package/dist/core/transport.d.ts +0 -50
- package/dist/core/transport.d.ts.map +0 -1
- package/dist/core/user-namespace.d.ts +0 -48
- package/dist/core/user-namespace.d.ts.map +0 -1
- package/dist/ecommerce/index.d.ts +0 -94
- package/dist/ecommerce/index.d.ts.map +0 -1
- package/dist/ecommerce/types.d.ts +0 -81
- package/dist/ecommerce/types.d.ts.map +0 -1
- package/dist/governance/bloom-filter.d.ts +0 -47
- package/dist/governance/bloom-filter.d.ts.map +0 -1
- package/dist/governance/index.d.ts +0 -8
- package/dist/governance/index.d.ts.map +0 -1
- package/dist/governance/murmur3.d.ts +0 -43
- package/dist/governance/murmur3.d.ts.map +0 -1
- package/dist/governance/name-governor.d.ts +0 -98
- package/dist/governance/name-governor.d.ts.map +0 -1
- package/dist/governance/trait-governor.d.ts +0 -63
- package/dist/governance/trait-governor.d.ts.map +0 -1
- package/dist/inapp/AegisInAppManager.d.ts +0 -877
- package/dist/inapp/AegisInAppManager.d.ts.map +0 -1
- package/dist/inapp/actions.d.ts +0 -91
- package/dist/inapp/actions.d.ts.map +0 -1
- package/dist/inapp/devicePairing.d.ts +0 -70
- package/dist/inapp/devicePairing.d.ts.map +0 -1
- package/dist/inapp/eval-throttle.d.ts +0 -33
- package/dist/inapp/eval-throttle.d.ts.map +0 -1
- package/dist/inapp/font.d.ts +0 -16
- package/dist/inapp/font.d.ts.map +0 -1
- package/dist/inapp/index.d.ts +0 -8
- package/dist/inapp/index.d.ts.map +0 -1
- package/dist/inapp/lucide-svg.d.ts +0 -46
- package/dist/inapp/lucide-svg.d.ts.map +0 -1
- package/dist/inapp/renderPreview.d.ts +0 -40
- package/dist/inapp/renderPreview.d.ts.map +0 -1
- package/dist/inapp/renderers/active-web-chat.d.ts +0 -45
- package/dist/inapp/renderers/active-web-chat.d.ts.map +0 -1
- package/dist/inapp/renderers/card-style.d.ts +0 -31
- package/dist/inapp/renderers/card-style.d.ts.map +0 -1
- package/dist/inapp/renderers/card-template.d.ts +0 -233
- package/dist/inapp/renderers/card-template.d.ts.map +0 -1
- package/dist/inapp/renderers/carousel-cards.d.ts +0 -15
- package/dist/inapp/renderers/carousel-cards.d.ts.map +0 -1
- package/dist/inapp/renderers/coachmark-tour.d.ts +0 -24
- package/dist/inapp/renderers/coachmark-tour.d.ts.map +0 -1
- package/dist/inapp/renderers/games.d.ts +0 -27
- package/dist/inapp/renderers/games.d.ts.map +0 -1
- package/dist/inapp/renderers/hero.d.ts +0 -23
- package/dist/inapp/renderers/hero.d.ts.map +0 -1
- package/dist/inapp/renderers/index.d.ts +0 -22
- package/dist/inapp/renderers/index.d.ts.map +0 -1
- package/dist/inapp/renderers/interactive-contract.d.ts +0 -48
- package/dist/inapp/renderers/interactive-contract.d.ts.map +0 -1
- package/dist/inapp/renderers/product-recommendation.d.ts +0 -37
- package/dist/inapp/renderers/product-recommendation.d.ts.map +0 -1
- package/dist/inapp/renderers/progress-bar.d.ts +0 -38
- package/dist/inapp/renderers/progress-bar.d.ts.map +0 -1
- package/dist/inapp/renderers/progress-core.d.ts +0 -80
- package/dist/inapp/renderers/progress-core.d.ts.map +0 -1
- package/dist/inapp/renderers/reviews.d.ts +0 -38
- package/dist/inapp/renderers/reviews.d.ts.map +0 -1
- package/dist/inapp/renderers/sticky-bar.d.ts +0 -14
- package/dist/inapp/renderers/sticky-bar.d.ts.map +0 -1
- package/dist/inapp/renderers/stories.d.ts +0 -31
- package/dist/inapp/renderers/stories.d.ts.map +0 -1
- package/dist/inapp/renderers/types.d.ts +0 -147
- package/dist/inapp/renderers/types.d.ts.map +0 -1
- package/dist/inapp/renderers/video.d.ts +0 -20
- package/dist/inapp/renderers/video.d.ts.map +0 -1
- package/dist/inbox/AegisInbox.d.ts +0 -106
- package/dist/inbox/AegisInbox.d.ts.map +0 -1
- package/dist/inbox/index.d.ts +0 -3
- package/dist/inbox/index.d.ts.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -15127
- package/dist/index.js.map +0 -1
- package/dist/integrations/react.d.ts +0 -19
- package/dist/integrations/react.d.ts.map +0 -1
- package/dist/loyalty/AegisLoyaltyManager.d.ts +0 -120
- package/dist/loyalty/AegisLoyaltyManager.d.ts.map +0 -1
- package/dist/loyalty/index.d.ts +0 -3
- package/dist/loyalty/index.d.ts.map +0 -1
- package/dist/plugins/registry.d.ts +0 -13
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/push/AegisWebPush.d.ts +0 -199
- package/dist/push/AegisWebPush.d.ts.map +0 -1
- package/dist/push/AegisWebPush.js +0 -542
- package/dist/push/AegisWebPush.js.map +0 -1
- package/dist/push/cdn-push.d.ts +0 -21
- package/dist/push/cdn-push.d.ts.map +0 -1
- package/dist/react.js +0 -70
- package/dist/react.js.map +0 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +0 -274
- package/dist/runtime/AegisMessageRuntime.d.ts.map +0 -1
- package/dist/runtime/index.d.ts +0 -3
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/snippet.min.js +0 -1
- package/dist/state/intent_ledger.d.ts +0 -136
- package/dist/state/intent_ledger.d.ts.map +0 -1
- package/dist/triggers/ContactScoresFetcher.d.ts +0 -113
- package/dist/triggers/ContactScoresFetcher.d.ts.map +0 -1
- package/dist/triggers/IntentRuleEvaluator.d.ts +0 -213
- package/dist/triggers/IntentRuleEvaluator.d.ts.map +0 -1
- package/dist/triggers/IntentSnapshotCollector.d.ts +0 -83
- package/dist/triggers/IntentSnapshotCollector.d.ts.map +0 -1
- package/dist/triggers/SelectorBinder.d.ts +0 -118
- package/dist/triggers/SelectorBinder.d.ts.map +0 -1
- package/dist/triggers/TriggerEngine.d.ts +0 -296
- package/dist/triggers/TriggerEngine.d.ts.map +0 -1
- package/dist/triggers/behaviouralTriggers.d.ts +0 -41
- package/dist/triggers/behaviouralTriggers.d.ts.map +0 -1
- package/dist/triggers/index.d.ts +0 -11
- package/dist/triggers/index.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -77
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/events.d.ts +0 -147
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/plugin.d.ts +0 -21
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/type-safe-events.d.ts +0 -14
- package/dist/types/type-safe-events.d.ts.map +0 -1
- package/dist/utils/canonical-identity.d.ts +0 -29
- package/dist/utils/canonical-identity.d.ts.map +0 -1
- package/dist/utils/consent.d.ts +0 -40
- package/dist/utils/consent.d.ts.map +0 -1
- package/dist/utils/debounce.d.ts +0 -3
- package/dist/utils/debounce.d.ts.map +0 -1
- package/dist/utils/device.d.ts +0 -6
- package/dist/utils/device.d.ts.map +0 -1
- package/dist/utils/identity.d.ts +0 -27
- package/dist/utils/identity.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -15
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/meta-cookies.d.ts +0 -65
- package/dist/utils/meta-cookies.d.ts.map +0 -1
- package/dist/utils/redact-url.d.ts +0 -56
- package/dist/utils/redact-url.d.ts.map +0 -1
- package/dist/utils/storage.d.ts +0 -20
- package/dist/utils/storage.d.ts.map +0 -1
- package/dist/utils/url-parser.d.ts +0 -61
- package/dist/utils/url-parser.d.ts.map +0 -1
- package/dist/utils/uuid.d.ts +0 -4
- package/dist/utils/uuid.d.ts.map +0 -1
- package/dist/utils/visitor.d.ts +0 -43
- package/dist/utils/visitor.d.ts.map +0 -1
- package/dist/widgets/AegisWidgetManager.d.ts +0 -209
- package/dist/widgets/AegisWidgetManager.d.ts.map +0 -1
- package/dist/widgets/index.d.ts +0 -3
- package/dist/widgets/index.d.ts.map +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface CanonicalIdentity {
|
|
2
|
-
status: 'identified' | 'anonymous' | 'pseudonymous';
|
|
3
|
-
has_pii: boolean;
|
|
4
|
-
classification_reason: 'producer_pii' | 'producer_anonymous' | 'fallback';
|
|
5
|
-
evidence: {
|
|
6
|
-
email?: string;
|
|
7
|
-
phone?: string;
|
|
8
|
-
user_id?: string;
|
|
9
|
-
customer_id?: string;
|
|
10
|
-
};
|
|
11
|
-
anonymous_ids: {
|
|
12
|
-
cookie_id?: string;
|
|
13
|
-
session_id?: string;
|
|
14
|
-
device_id?: string;
|
|
15
|
-
fingerprint_id?: string;
|
|
16
|
-
};
|
|
17
|
-
resolution_source: 'producer';
|
|
18
|
-
}
|
|
19
|
-
export declare function buildCanonicalIdentity(params: {
|
|
20
|
-
email?: string;
|
|
21
|
-
phone?: string;
|
|
22
|
-
user_id?: string;
|
|
23
|
-
customer_id?: string;
|
|
24
|
-
cookie_id?: string;
|
|
25
|
-
session_id?: string;
|
|
26
|
-
device_id?: string;
|
|
27
|
-
fingerprint_id?: string;
|
|
28
|
-
}): CanonicalIdentity;
|
|
29
|
-
//# sourceMappingURL=canonical-identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-identity.d.ts","sourceRoot":"","sources":["../../src/utils/canonical-identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,CAAC;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,qBAAqB,EAAE,cAAc,GAAG,oBAAoB,GAAG,UAAU,CAAC;IAC1E,QAAQ,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,aAAa,EAAE;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,iBAAiB,CAiDpB"}
|
package/dist/utils/consent.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Storage } from './storage';
|
|
2
|
-
export type ConsentCategory = 'analytics' | 'marketing' | 'functional' | 'necessary';
|
|
3
|
-
export interface ConsentPreferences {
|
|
4
|
-
analytics: boolean;
|
|
5
|
-
marketing: boolean;
|
|
6
|
-
functional: boolean;
|
|
7
|
-
necessary: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type ConsentStatus = 'granted' | 'denied' | 'pending';
|
|
10
|
-
export interface ConsentManagerConfig {
|
|
11
|
-
defaultConsent?: Partial<ConsentPreferences>;
|
|
12
|
-
waitForConsent?: boolean;
|
|
13
|
-
consentStorageKey?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class ConsentManager {
|
|
16
|
-
private storage;
|
|
17
|
-
private config;
|
|
18
|
-
private preferences;
|
|
19
|
-
private listeners;
|
|
20
|
-
constructor(storage: Storage, config?: ConsentManagerConfig);
|
|
21
|
-
private loadPreferences;
|
|
22
|
-
private getDefaultPreferences;
|
|
23
|
-
private mergeWithDefaults;
|
|
24
|
-
private savePreferences;
|
|
25
|
-
setConsent(preferences: Partial<ConsentPreferences>): void;
|
|
26
|
-
grantAll(): void;
|
|
27
|
-
denyAll(): void;
|
|
28
|
-
hasConsent(category: ConsentCategory): boolean;
|
|
29
|
-
getPreferences(): ConsentPreferences;
|
|
30
|
-
getStatus(category: ConsentCategory): ConsentStatus;
|
|
31
|
-
isAnalyticsEnabled(): boolean;
|
|
32
|
-
isMarketingEnabled(): boolean;
|
|
33
|
-
onChange(callback: (preferences: ConsentPreferences) => void): () => void;
|
|
34
|
-
private notifyListeners;
|
|
35
|
-
reset(): void;
|
|
36
|
-
integrateOneTrust(): void;
|
|
37
|
-
integrateCookiebot(): void;
|
|
38
|
-
integrateGoogleConsentMode(): void;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=consent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../src/utils/consent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,WAAW,CAAC;AAEhB,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,SAAS,CAAwD;gBAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,oBAAyB;IAW/D,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,eAAe;IAavB,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI;IAW1D,QAAQ,IAAI,IAAI;IAShB,OAAO,IAAI,IAAI;IASf,UAAU,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO;IAI9C,cAAc,IAAI,kBAAkB;IAIpC,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,aAAa;IAanD,kBAAkB,IAAI,OAAO;IAI7B,kBAAkB,IAAI,OAAO;IAI7B,QAAQ,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,kBAAkB,KAAK,IAAI,GAAG,MAAM,IAAI;IAWzE,OAAO,CAAC,eAAe;IAUvB,KAAK,IAAI,IAAI;IAOb,iBAAiB,IAAI,IAAI;IAmCzB,kBAAkB,IAAI,IAAI;IA8B1B,0BAA0B,IAAI,IAAI;CA2CnC"}
|
package/dist/utils/debounce.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
2
|
-
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
3
|
-
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACX,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAalC;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAYlC"}
|
package/dist/utils/device.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EventContext } from '../types/events';
|
|
2
|
-
import { AegisConfigInternal } from '../types/config';
|
|
3
|
-
import type { SessionManager } from '../core/session';
|
|
4
|
-
export declare function buildContext(config: AegisConfigInternal, session?: SessionManager): EventContext;
|
|
5
|
-
export declare function isBot(): boolean;
|
|
6
|
-
//# sourceMappingURL=device.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/utils/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,wBAAgB,YAAY,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,YAAY,CAwDhG;AAwGD,wBAAgB,KAAK,IAAI,OAAO,CAyB/B"}
|
package/dist/utils/identity.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Storage } from './storage';
|
|
2
|
-
export interface IdentityState {
|
|
3
|
-
anonymousId: string;
|
|
4
|
-
userId: string | null;
|
|
5
|
-
traits: Record<string, any>;
|
|
6
|
-
}
|
|
7
|
-
export declare class Identity {
|
|
8
|
-
private storage;
|
|
9
|
-
private anonymousId;
|
|
10
|
-
private userId;
|
|
11
|
-
private traits;
|
|
12
|
-
constructor(storage: Storage);
|
|
13
|
-
private getOrCreateAnonymousId;
|
|
14
|
-
private loadUserIdentity;
|
|
15
|
-
getAnonymousId(): string;
|
|
16
|
-
setUserId(userId: string, traits?: Record<string, any>): void;
|
|
17
|
-
getUserId(): string | null;
|
|
18
|
-
setTraits(traits: Record<string, any>): void;
|
|
19
|
-
getTraits(): Record<string, any>;
|
|
20
|
-
reset(): void;
|
|
21
|
-
alias(newUserId: string): {
|
|
22
|
-
previousId: string;
|
|
23
|
-
newUserId: string;
|
|
24
|
-
};
|
|
25
|
-
getState(): IdentityState;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/utils/identity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAA2B;gBAE7B,OAAO,EAAE,OAAO;IAM5B,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,gBAAgB;IAoBxB,cAAc,IAAI,MAAM;IAIxB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAU7D,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAM5C,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAIhC,KAAK,IAAI,IAAI;IAYb,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;IAUnE,QAAQ,IAAI,aAAa;CAO1B"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
-
declare class Logger {
|
|
3
|
-
private enabled;
|
|
4
|
-
private prefix;
|
|
5
|
-
enable(): void;
|
|
6
|
-
disable(): void;
|
|
7
|
-
isEnabled(): boolean;
|
|
8
|
-
debug(message: string, ...args: any[]): void;
|
|
9
|
-
info(message: string, ...args: any[]): void;
|
|
10
|
-
warn(message: string, ...args: any[]): void;
|
|
11
|
-
error(message: string, ...args: any[]): void;
|
|
12
|
-
}
|
|
13
|
-
export declare const logger: Logger;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,cAAM,MAAM;IACV,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,MAAM,CAAgC;IAE9C,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,IAAI;IAIf,SAAS,IAAI,OAAO;IAIpB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAK5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAK3C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI3C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAG7C;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Meta Pixel companion cookies (_fbp, _fbc) — B1.2 of META_CAPI_PHASE1_TRACKER.
|
|
3
|
-
*
|
|
4
|
-
* We do NOT fire `fbq()` browser-side. We write the cookies Meta uses to
|
|
5
|
-
* identify the same browser so server-side CAPI events (forwarded from
|
|
6
|
-
* `meta_conversions_api_service.py`) carry the high-EMQ match keys
|
|
7
|
-
* (fbp + fbc) without the cost of running a full Meta Pixel.
|
|
8
|
-
*
|
|
9
|
-
* Cookie spec (Meta docs, verified May 2026):
|
|
10
|
-
* _fbp = fb.<subdomain_index>.<creation_ms>.<random>
|
|
11
|
-
* _fbc = fb.<subdomain_index>.<click_ms>.<fbclid>
|
|
12
|
-
* subdomain_index = number of dots in cookie domain
|
|
13
|
-
* (example.com → 1, sub.example.com → 2)
|
|
14
|
-
* random = 10-digit random integer
|
|
15
|
-
* Lifetime: 90 days (Meta's default; longer doesn't increase EMQ)
|
|
16
|
-
*
|
|
17
|
-
* Reasoning for raw document.cookie writes (instead of utils/storage.ts):
|
|
18
|
-
* The Storage helper prefixes every key with `aegis_` so writes go to
|
|
19
|
-
* `aegis__fbp` / `aegis__fbc`. Meta only honors the exact names
|
|
20
|
-
* `_fbp` and `_fbc`. We bypass the helper and write directly.
|
|
21
|
-
*
|
|
22
|
-
* Domain scope: written to the eTLD+1 (root domain) so a tenant who
|
|
23
|
-
* later wires their own Meta Pixel via GTM sees the same cookies a
|
|
24
|
-
* subdomain-rooted set would not.
|
|
25
|
-
*
|
|
26
|
-
* SSR-safe: every helper is no-op when `document` / `window` are
|
|
27
|
-
* undefined. Callers don't need to guard.
|
|
28
|
-
*/
|
|
29
|
-
export interface MetaCookies {
|
|
30
|
-
fbp: string | null;
|
|
31
|
-
fbc: string | null;
|
|
32
|
-
fbclid: string | null;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Read `_fbp` from cookies, write a fresh one if absent.
|
|
36
|
-
* Returns the resulting `_fbp` value or null if cookies unavailable.
|
|
37
|
-
*/
|
|
38
|
-
export declare function ensureFbp(): string | null;
|
|
39
|
-
/**
|
|
40
|
-
* Read `_fbc` from cookies. If absent and the URL carries `fbclid`, write
|
|
41
|
-
* a fresh `_fbc` per Meta's spec. Returns the resulting value or null.
|
|
42
|
-
*
|
|
43
|
-
* Note: `_fbc` has no value to write without an `fbclid` source — unlike
|
|
44
|
-
* `_fbp` which is browser-identity-only and can be self-generated.
|
|
45
|
-
*/
|
|
46
|
-
export declare function ensureFbc(): string | null;
|
|
47
|
-
/** Pull `fbclid` from `?fbclid=...` query string. Null if absent or SSR. */
|
|
48
|
-
export declare function readFbclidFromUrl(): string | null;
|
|
49
|
-
/**
|
|
50
|
-
* Single call that returns `{fbp, fbc, fbclid}` for injection into every
|
|
51
|
-
* event's `properties` (which lands in ClickHouse `in_app_events.metadata`,
|
|
52
|
-
* which the cell-side CAPI service reads directly).
|
|
53
|
-
*
|
|
54
|
-
* Side effects: ensures both cookies are present before returning. Idempotent
|
|
55
|
-
* — safe to call on every event capture.
|
|
56
|
-
*/
|
|
57
|
-
export declare function captureMetaCookies(): MetaCookies;
|
|
58
|
-
/**
|
|
59
|
-
* A copy of `event` safe to hand to a logger: `properties.fbc` / `properties.fbp`
|
|
60
|
-
* masked. They are Meta cookie values — match keys for CAPI only, and must
|
|
61
|
-
* stay out of every log line (ACS tracking tracker §V.3). The event itself is
|
|
62
|
-
* never mutated; only the logged copy is.
|
|
63
|
-
*/
|
|
64
|
-
export declare function redactMetaCookies<T>(event: T): T;
|
|
65
|
-
//# sourceMappingURL=meta-cookies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta-cookies.d.ts","sourceRoot":"","sources":["../../src/utils/meta-cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AA8ED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAMzC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAQzC;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAOjD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAMhD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAOhD"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* URL credential redaction — the browser-SDK layer (Aman 2026-09-13).
|
|
3
|
-
*
|
|
4
|
-
* A landing URL can carry a credential: `k` (one order's view key), `t` (the
|
|
5
|
-
* server-verified landing token), `code` / `session_code` (claim codes),
|
|
6
|
-
* `aegis_pair` (a device-pairing code) and `u` (a contact token). The SDK must
|
|
7
|
-
* never SEND one of those values — not in a page object, an event property, a
|
|
8
|
-
* beacon or a query string to our own API. What it sends instead is the key
|
|
9
|
-
* with its value replaced by `REDACTED`, so the shape of the URL (and the fact
|
|
10
|
-
* that a credential was present) survives while the secret does not.
|
|
11
|
-
*
|
|
12
|
-
* The server twin is `libs/data-governance/data_governance/credential_params.py`
|
|
13
|
-
* (`CREDENTIAL_URL_PARAMS`, `REDACTED`). The two lists MUST stay identical; a
|
|
14
|
-
* parity guard compares them. Change both in the same commit or neither.
|
|
15
|
-
*
|
|
16
|
-
* Deliberately NOT in the list: `aegis_code`. It is the attribution join key
|
|
17
|
-
* (the short link's own code), not a credential — redacting it would sever
|
|
18
|
-
* the link from the order it brought in.
|
|
19
|
-
*
|
|
20
|
-
* Reading is untouched. The SDK's own inbound param readers (`aegis_code`,
|
|
21
|
-
* gclid / fbclid, utm, `aegis_pair` for pairing) still read `location.search`
|
|
22
|
-
* directly; only what leaves the browser is redacted.
|
|
23
|
-
*
|
|
24
|
-
* Why a targeted regex and not `new URL()`: a URL round-trip re-encodes and
|
|
25
|
-
* reorders the rest of the string, so the value we send would no longer be
|
|
26
|
-
* the page the visitor was on. The regex touches only the credential values.
|
|
27
|
-
*
|
|
28
|
-
* What it does not see: a percent-encoded key (`%6B=` for `k`), a `;`
|
|
29
|
-
* separator, or a key whose case differs (`K=`). The server list has the same
|
|
30
|
-
* shape, so both layers agree on what counts as a match.
|
|
31
|
-
*/
|
|
32
|
-
export declare const CREDENTIAL_URL_PARAMS: readonly ["t", "k", "code", "session_code", "aegis_pair", "u", "carrier_token"];
|
|
33
|
-
export declare const REDACTED = "REDACTED";
|
|
34
|
-
/**
|
|
35
|
-
* Replace the value of every credential query param with `REDACTED`.
|
|
36
|
-
* Idempotent, fragment-preserving, and it never throws: input it cannot
|
|
37
|
-
* handle is returned unchanged.
|
|
38
|
-
*/
|
|
39
|
-
export declare function redactUrl(value: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* Walk plain objects / arrays and apply `redactUrl` to every string — the TS
|
|
42
|
-
* twin of the server's `redact_credentials_deep` (same depth cap, 12).
|
|
43
|
-
*
|
|
44
|
-
* Added for the SERVER consumers of `channel.delivery.status_{cell}` (BK-87,
|
|
45
|
-
* 2026-09-13): that topic is a dual-route that never passes the governance
|
|
46
|
-
* engine, and its click/receipt payloads carry URLs (`metadata.original_url`,
|
|
47
|
-
* `referrer`, provider echoes). analytics-consumer and event-ingress's
|
|
48
|
-
* delivery-status bridge import THIS module by relative path, so there is one
|
|
49
|
-
* TS rule, not a copy. Redacting per string value (before serialisation) keeps
|
|
50
|
-
* JSON valid even when a value itself holds escaped JSON.
|
|
51
|
-
*
|
|
52
|
-
* Only plain objects and arrays are walked; anything else (Date, Buffer, class
|
|
53
|
-
* instances) is returned as is.
|
|
54
|
-
*/
|
|
55
|
-
export declare function redactCredentialsDeep<T>(value: T, depth?: number): T;
|
|
56
|
-
//# sourceMappingURL=redact-url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redact-url.d.ts","sourceRoot":"","sources":["../../src/utils/redact-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,iFAWxB,CAAC;AAEX,eAAO,MAAM,QAAQ,aAAa,CAAC;AAenC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,SAAI,GAAG,CAAC,CAc/D"}
|
package/dist/utils/storage.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface StorageOptions {
|
|
2
|
-
cookieDomain?: string | null;
|
|
3
|
-
secureCookie?: boolean;
|
|
4
|
-
crossDomain?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare class Storage {
|
|
7
|
-
private useLocalStorage;
|
|
8
|
-
private options;
|
|
9
|
-
constructor(options?: StorageOptions);
|
|
10
|
-
private isLocalStorageAvailable;
|
|
11
|
-
set(key: string, value: string, expiryDays?: number): void;
|
|
12
|
-
get(key: string): string | null;
|
|
13
|
-
remove(key: string): void;
|
|
14
|
-
clear(): void;
|
|
15
|
-
private setCookie;
|
|
16
|
-
private getCookie;
|
|
17
|
-
private deleteCookie;
|
|
18
|
-
private getRootDomain;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,OAAO;IAClB,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,GAAE,cAAmB;IAKxC,OAAO,CAAC,uBAAuB;IAW/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAY,GAAG,IAAI;IAkB/D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAsB/B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAczB,KAAK,IAAI,IAAI;IAuBb,OAAO,CAAC,SAAS;IA6BjB,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,aAAa;CAwBtB"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export interface UTMParams {
|
|
2
|
-
source?: string;
|
|
3
|
-
medium?: string;
|
|
4
|
-
campaign?: string;
|
|
5
|
-
term?: string;
|
|
6
|
-
content?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function parseUTMParameters(url?: string): UTMParams;
|
|
10
|
-
export declare function parseQueryParameters(url?: string): Record<string, string>;
|
|
11
|
-
/**
|
|
12
|
-
* The page's URL for REPORTING — so it is credential-redacted (`redactUrl`),
|
|
13
|
-
* the canonical `<link>` included. No caller in the SDK today; redacted so a
|
|
14
|
-
* future one cannot send a raw `?k=` / `?t=` by reaching for this helper.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getCanonicalURL(): string;
|
|
17
|
-
export declare function stripQueryParameters(url: string): string;
|
|
18
|
-
export interface AdClickIDs {
|
|
19
|
-
gclid?: string;
|
|
20
|
-
/** Google click id for iOS app→web traffic (Apple ATT). NOT a gclid. */
|
|
21
|
-
gbraid?: string;
|
|
22
|
-
/** Google click id for iOS web→app traffic (Apple ATT). NOT a gclid. */
|
|
23
|
-
wbraid?: string;
|
|
24
|
-
fbclid?: string;
|
|
25
|
-
msclkid?: string;
|
|
26
|
-
ctwa_clid?: string;
|
|
27
|
-
ttclid?: string;
|
|
28
|
-
li_fat_id?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare function parseAdClickIDs(url?: string): AdClickIDs;
|
|
31
|
-
export declare function hasAdClickIDs(adClickIDs: AdClickIDs): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Which Aegis send brought the visitor — the `aegis_*` params the short-link
|
|
34
|
-
* redirect stamps from the LINK row (`link_shortener` `aegis_params`).
|
|
35
|
-
*
|
|
36
|
-
* `aegis_code` is the join key (the short link's own code); the send is then
|
|
37
|
-
* `aegis_campaign` (campaign sends only) OR `aegis_journey` (journey sends —
|
|
38
|
-
* order confirmation, delivery, win-back). Present only when the link row has
|
|
39
|
-
* a value, so never assume `aegis_campaign` exists.
|
|
40
|
-
*
|
|
41
|
-
* Deliberately NOT read here:
|
|
42
|
-
* - `utm_*` — the tenant's own / third-party analytics; never identifies an
|
|
43
|
-
* Aegis send (a tenant-set utm can sit on our own link).
|
|
44
|
-
* - `k` — a credential for ONE order. Never read, copied or logged.
|
|
45
|
-
* - `t` — server-verified landing token; never parsed client-side.
|
|
46
|
-
* - `u` — consumed at the redirect, never forwarded.
|
|
47
|
-
*/
|
|
48
|
-
export interface LinkAttribution {
|
|
49
|
-
aegis_code?: string;
|
|
50
|
-
aegis_campaign?: string;
|
|
51
|
-
aegis_journey?: string;
|
|
52
|
-
aegis_playbook?: string;
|
|
53
|
-
aegis_button?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Parse the landing URL's Aegis link attribution. Returns `{}` unless
|
|
57
|
-
* `aegis_code` is present — the rest of the set only means something as the
|
|
58
|
-
* attributes OF that code.
|
|
59
|
-
*/
|
|
60
|
-
export declare function parseLinkAttribution(url?: string): LinkAttribution;
|
|
61
|
-
//# sourceMappingURL=url-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-parser.d.ts","sourceRoot":"","sources":["../../src/utils/url-parser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CA6B1D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBzE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAYxC;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQxD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CA+BxD;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAE7D;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,eAAe,CAoBlE"}
|
package/dist/utils/uuid.d.ts
DELETED
package/dist/utils/uuid.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/utils/uuid.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,IAAI,MAAM,CAUrC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
|
package/dist/utils/visitor.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* New-visitor verdict — the ONE reader and writer of the returning-visitor
|
|
3
|
-
* marker (2026-09-13).
|
|
4
|
-
*
|
|
5
|
-
* `/v1/in-app/active` and `/v1/sdk/prefetch-bundle` both take `is_new_user`,
|
|
6
|
-
* and the server drops any campaign whose `display_rules.show_to_new_users_only`
|
|
7
|
-
* is set when it arrives false. The SDK used to write `aegis_returning_user=1`
|
|
8
|
-
* at the top of `AegisInAppManager.initialize()` and read it afterwards, inside
|
|
9
|
-
* the fetch — so the read always saw its own write, every fetch said
|
|
10
|
-
* `is_new_user=false`, and a new-users-only campaign could never be served.
|
|
11
|
-
*
|
|
12
|
-
* The rule this module enforces: the marker is read ONCE, before anything
|
|
13
|
-
* writes it, and the verdict is held for the whole browsing session.
|
|
14
|
-
*
|
|
15
|
-
* - `isNewVisitor()` resolves the verdict on first call and caches it in
|
|
16
|
-
* memory (this page load) and in sessionStorage (later page loads in the
|
|
17
|
-
* same tab session), so every fetch in a session sends the same value and
|
|
18
|
-
* the verdict does not flip after the marker is written.
|
|
19
|
-
* - `markReturningVisitor()` is the only writer. It resolves the verdict
|
|
20
|
-
* first, so no call order can make the read see the write.
|
|
21
|
-
*
|
|
22
|
-
* Storage unavailable (SSR, blocked site data, a browser that throws on
|
|
23
|
-
* access): the verdict is RETURNING (`false`). "New" is a positive claim that
|
|
24
|
-
* unlocks first-visit-only messages; when the SDK cannot remember a visit it
|
|
25
|
-
* cannot prove one never happened, and because the marker can never be saved,
|
|
26
|
-
* answering "new" would re-show a first-visit message on every page of every
|
|
27
|
-
* visit forever. `false` is also what the server assumes when the parameter is
|
|
28
|
-
* absent, so an unknown visitor reads the same on both sides.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Whether this browsing session belongs to a visitor the SDK has never seen
|
|
32
|
-
* before. Stable for the whole session; see the module doc for the default
|
|
33
|
-
* when storage is unavailable.
|
|
34
|
-
*/
|
|
35
|
-
export declare function isNewVisitor(): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Record that this visitor has now been seen, so the NEXT session reads as
|
|
38
|
-
* returning. Resolves the current session's verdict before writing.
|
|
39
|
-
*/
|
|
40
|
-
export declare function markReturningVisitor(): void;
|
|
41
|
-
/** Test seam: forget the in-memory verdict, as a fresh page load would. */
|
|
42
|
-
export declare function resetVisitorVerdictCacheForTests(): void;
|
|
43
|
-
//# sourceMappingURL=visitor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/utils/visitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAqCH;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C;AAED,2EAA2E;AAC3E,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD"}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AegisWidgetManager - Web SDK Widget Module
|
|
3
|
-
*
|
|
4
|
-
* Smart Pull architecture for persistent web widgets.
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - Games (spin wheel, scratch card) are in-app campaigns (AegisInAppManager), not widgets
|
|
8
|
-
* - Chat bubbles (WhatsApp, support)
|
|
9
|
-
* - Social proof toasts (real-time purchase notifications)
|
|
10
|
-
* - Feedback forms (NPS, surveys)
|
|
11
|
-
*
|
|
12
|
-
* Security:
|
|
13
|
-
* - XSS Protection: Uses DOM APIs instead of innerHTML
|
|
14
|
-
* - Server-side prize generation prevents client manipulation
|
|
15
|
-
* - URL validation prevents javascript: protocol injection
|
|
16
|
-
*
|
|
17
|
-
* Architecture:
|
|
18
|
-
* - Fetches widget configs from /v1/widgets/config on page load
|
|
19
|
-
* - Integrates with TriggerEngine for behavioral triggers
|
|
20
|
-
* - Tracks widget events (show, click, dismiss, submit)
|
|
21
|
-
* - Server-side prize generation for gamification
|
|
22
|
-
*/
|
|
23
|
-
import { TriggerEngine } from '../triggers/TriggerEngine';
|
|
24
|
-
export interface WidgetConfig {
|
|
25
|
-
widget_id: string;
|
|
26
|
-
widget_type: 'chat_bubble' | 'toast' | 'feedback_form' | 'exit_intent_popup';
|
|
27
|
-
name: string;
|
|
28
|
-
config: Record<string, any>;
|
|
29
|
-
position?: string;
|
|
30
|
-
priority: number;
|
|
31
|
-
trigger_rules?: {
|
|
32
|
-
type: 'exit_intent' | 'scroll_depth' | 'time_on_page' | 'immediate';
|
|
33
|
-
config?: Record<string, any>;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface AegisWidgetConfig {
|
|
37
|
-
writeKey: string;
|
|
38
|
-
apiHost?: string;
|
|
39
|
-
userId?: string;
|
|
40
|
-
contactId?: string;
|
|
41
|
-
/** Server-minted proof of `contactId` (C1b). Sent alongside `X-Contact-ID`
|
|
42
|
-
* so the cell-plane will honour the id. */
|
|
43
|
-
contactToken?: string;
|
|
44
|
-
organizationId?: string;
|
|
45
|
-
debugMode?: boolean;
|
|
46
|
-
triggerEngine?: TriggerEngine;
|
|
47
|
-
/** If true, WidgetManager takes ownership of the TriggerEngine and
|
|
48
|
-
* will call `triggerEngine.stop()` on destroy(). Leave false when
|
|
49
|
-
* the caller shares the engine across managers (e.g. the facade). */
|
|
50
|
-
ownsTriggerEngine?: boolean;
|
|
51
|
-
enablePrefetch?: boolean;
|
|
52
|
-
cssCustomization?: WidgetCSSCustomization;
|
|
53
|
-
onEvent?: (eventType: string, data: any) => void;
|
|
54
|
-
/** Source platform passed as X-Source-Platform header so the API
|
|
55
|
-
* can filter campaigns whose display_rules.sources restricts them
|
|
56
|
-
* to specific integrations (e.g. 'shopify', 'woocommerce'). */
|
|
57
|
-
sourcePlatform?: 'web' | 'shopify' | 'woocommerce' | 'mobile_sdk';
|
|
58
|
-
/**
|
|
59
|
-
* Workspace cascade reader. Host SDK sets this to
|
|
60
|
-
* `() => aegis.getEffectiveWorkspaceId()` so widget interaction events
|
|
61
|
-
* (impressions, clicks, feedback submissions)
|
|
62
|
-
* arrive at the gateway with the same workspace context the main
|
|
63
|
-
* analytics SDK uses. See PLUGIN_HANDSHAKE_AUTOMATION_TRACKER.md §P1.b.
|
|
64
|
-
*/
|
|
65
|
-
getWorkspaceId?: () => string | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Cart-store unification: invoked whenever the widget subsystem learns the
|
|
68
|
-
* cart — platform auto-detect (Shopify/Woo/Magento) or an explicit
|
|
69
|
-
* `setCartData(...)`. The runtime wires this to `applyCart(...)` so the ONE
|
|
70
|
-
* cart store (read by the Free-Delivery card / progress bar / rule eval) stays
|
|
71
|
-
* in sync. See CART_STORE_UNIFICATION_TRACKER.md.
|
|
72
|
-
*/
|
|
73
|
-
onCartDetected?: (cart: CartData) => void;
|
|
74
|
-
}
|
|
75
|
-
export interface WidgetCSSCustomization {
|
|
76
|
-
exitIntent?: {
|
|
77
|
-
backgroundColor?: string;
|
|
78
|
-
textColor?: string;
|
|
79
|
-
accentColor?: string;
|
|
80
|
-
borderRadius?: string;
|
|
81
|
-
fontFamily?: string;
|
|
82
|
-
overlayOpacity?: number;
|
|
83
|
-
};
|
|
84
|
-
chatBubble?: {
|
|
85
|
-
backgroundColor?: string;
|
|
86
|
-
textColor?: string;
|
|
87
|
-
position?: 'bottom_right' | 'bottom_left' | 'top_right' | 'top_left';
|
|
88
|
-
size?: 'small' | 'medium' | 'large';
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
export interface PrefetchWidgetConfig {
|
|
92
|
-
exit_intent?: {
|
|
93
|
-
enabled: boolean;
|
|
94
|
-
type: 'cart_recovery' | 'lead_gen';
|
|
95
|
-
tier?: string;
|
|
96
|
-
title?: string;
|
|
97
|
-
message?: string;
|
|
98
|
-
discount_code?: string;
|
|
99
|
-
discount_percentage?: number;
|
|
100
|
-
cta_text?: string;
|
|
101
|
-
cta_url?: string;
|
|
102
|
-
background_color?: string;
|
|
103
|
-
text_color?: string;
|
|
104
|
-
accent_color?: string;
|
|
105
|
-
show_cart_items?: boolean;
|
|
106
|
-
show_timer?: boolean;
|
|
107
|
-
timer_minutes?: number;
|
|
108
|
-
priority: number;
|
|
109
|
-
mobile_triggers?: {
|
|
110
|
-
scroll_velocity?: boolean;
|
|
111
|
-
scroll_threshold?: number;
|
|
112
|
-
scroll_min_position?: number;
|
|
113
|
-
scroll_cooldown?: number;
|
|
114
|
-
idle_timer?: boolean;
|
|
115
|
-
idle_seconds?: number;
|
|
116
|
-
visibility_change?: boolean;
|
|
117
|
-
back_button?: boolean;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
export interface CartData {
|
|
122
|
-
cart_id: string;
|
|
123
|
-
cart_total: number;
|
|
124
|
-
cart_currency: string;
|
|
125
|
-
cart_items: Array<{
|
|
126
|
-
product_id: string;
|
|
127
|
-
product_name?: string;
|
|
128
|
-
quantity: number;
|
|
129
|
-
price?: number;
|
|
130
|
-
}>;
|
|
131
|
-
}
|
|
132
|
-
export declare class AegisWidgetManager {
|
|
133
|
-
private writeKey;
|
|
134
|
-
private apiHost;
|
|
135
|
-
private userId?;
|
|
136
|
-
private contactId?;
|
|
137
|
-
private contactToken?;
|
|
138
|
-
private organizationId?;
|
|
139
|
-
private debugMode;
|
|
140
|
-
private triggerEngine?;
|
|
141
|
-
private enablePrefetch;
|
|
142
|
-
private cssCustomization;
|
|
143
|
-
private onEvent?;
|
|
144
|
-
private sourcePlatform?;
|
|
145
|
-
private getWorkspaceId?;
|
|
146
|
-
private onCartDetected?;
|
|
147
|
-
private widgets;
|
|
148
|
-
private renderedWidgets;
|
|
149
|
-
private isInitialized;
|
|
150
|
-
private isDestroyed;
|
|
151
|
-
private ownsTriggerEngine;
|
|
152
|
-
private prefetchWidgetConfigs;
|
|
153
|
-
private cartData?;
|
|
154
|
-
constructor(config: AegisWidgetConfig);
|
|
155
|
-
updateCSSCustomization(customization: WidgetCSSCustomization): void;
|
|
156
|
-
/**
|
|
157
|
-
* Swap the identity that outgoing widget requests are attributed to.
|
|
158
|
-
* Safe to call at any time; if prefetch is enabled and the manager
|
|
159
|
-
* has already initialised, this will re-fetch the per-contact widget
|
|
160
|
-
* configs so subsequent renders target the new identity. Does NOT
|
|
161
|
-
* re-render already-visible widgets — a full teardown requires destroy().
|
|
162
|
-
*/
|
|
163
|
-
updateContactId(contactId: string | undefined, contactToken?: string): Promise<void>;
|
|
164
|
-
/**
|
|
165
|
-
* Tear down everything the manager installed: trigger listeners (if
|
|
166
|
-
* we own the TriggerEngine), injected style sheets, and any rendered
|
|
167
|
-
* widget roots. Further render attempts from in-flight triggers are
|
|
168
|
-
* short-circuited by the `isDestroyed` flag.
|
|
169
|
-
*/
|
|
170
|
-
destroy(): void;
|
|
171
|
-
/**
|
|
172
|
-
* Fire a lifecycle event to the consumer-supplied callback. Public-API
|
|
173
|
-
* hook configured via `AegisWidgetConfig.onEvent`. Currently only used
|
|
174
|
-
* by external callers passing their own logger; internal widget lifecycle
|
|
175
|
-
* events get wired through here as they're added.
|
|
176
|
-
*/
|
|
177
|
-
private emitEvent;
|
|
178
|
-
initialize(): Promise<void>;
|
|
179
|
-
setCartData(cartData: CartData): void;
|
|
180
|
-
private detectPlatformCart;
|
|
181
|
-
private normalizeShopifyCart;
|
|
182
|
-
private normalizeWooCart;
|
|
183
|
-
private normalizeMagentoCart;
|
|
184
|
-
private preloadWidgetAssets;
|
|
185
|
-
private fetchPrefetchConfigs;
|
|
186
|
-
private fetchWidgets;
|
|
187
|
-
private renderImmediateWidgets;
|
|
188
|
-
private setupTriggerListeners;
|
|
189
|
-
private setupExitIntentWithPrefetch;
|
|
190
|
-
private sendCartAbandonmentBeacon;
|
|
191
|
-
private renderWidget;
|
|
192
|
-
private renderChatBubble;
|
|
193
|
-
private getUTMParams;
|
|
194
|
-
private renderToast;
|
|
195
|
-
private renderFeedbackForm;
|
|
196
|
-
private renderExitIntentPopup;
|
|
197
|
-
private submitFeedback;
|
|
198
|
-
private trackEvent;
|
|
199
|
-
private sanitizeUrl;
|
|
200
|
-
private sanitizeColor;
|
|
201
|
-
private getDeviceType;
|
|
202
|
-
private isMobileDevice;
|
|
203
|
-
private addAnimationStyles;
|
|
204
|
-
private renderCartRecoveryPopup;
|
|
205
|
-
private renderLeadGenPopup;
|
|
206
|
-
private interpolateCartVariables;
|
|
207
|
-
private log;
|
|
208
|
-
}
|
|
209
|
-
//# sourceMappingURL=AegisWidgetManager.d.ts.map
|