ngx-pendo 2.2.1 → 2.3.1
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 +3 -5
- package/fesm2022/ngx-pendo.mjs +30 -33
- package/fesm2022/ngx-pendo.mjs.map +1 -1
- package/index.d.ts +238 -5
- package/package.json +1 -1
- package/schematics/ng-add/index.spec.js +3 -2
- package/schematics/ng-add/index.spec.js.map +1 -1
- package/lib/ngx-pendo-id.directive.d.ts +0 -15
- package/lib/ngx-pendo-section.directive.d.ts +0 -14
- package/lib/ngx-pendo.injectors.d.ts +0 -5
- package/lib/ngx-pendo.interfaces.d.ts +0 -118
- package/lib/ngx-pendo.module.d.ts +0 -12
- package/lib/ngx-pendo.provide.d.ts +0 -2
- package/lib/ngx-pendo.service.d.ts +0 -65
- package/lib/ngx-pendo.tokens.d.ts +0 -6
- package/lib/ngx-pendo.types.d.ts +0 -4
- package/public-api.d.ts +0 -9
package/README.md
CHANGED
|
@@ -110,8 +110,7 @@ import { NgxPendoService } from 'ngx-pendo';
|
|
|
110
110
|
@Component( ... )
|
|
111
111
|
export class AppComponent implements OnInit {
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
}
|
|
113
|
+
private ngxPendoService = inject(NgxPendoService);
|
|
115
114
|
|
|
116
115
|
ngOnInit() {
|
|
117
116
|
this.ngxPendoService.initialize({
|
|
@@ -132,13 +131,12 @@ export class AppComponent implements OnInit {
|
|
|
132
131
|
|
|
133
132
|
```ts
|
|
134
133
|
import { Component, OnInit } from '@angular/core';
|
|
135
|
-
import { NGX_PENDO_CONTEXT
|
|
134
|
+
import { NGX_PENDO_CONTEXT } from 'ngx-pendo';
|
|
136
135
|
|
|
137
136
|
@Component( ... )
|
|
138
137
|
export class AppComponent implements OnInit {
|
|
139
138
|
|
|
140
|
-
|
|
141
|
-
}
|
|
139
|
+
private pendo = inject(NGX_PENDO_CONTEXT);
|
|
142
140
|
|
|
143
141
|
ngOnInit() {
|
|
144
142
|
this.pendo.initialize({
|
package/fesm2022/ngx-pendo.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable,
|
|
2
|
+
import { InjectionToken, inject, Injectable, input, signal, computed, Directive, contentChildren, effect, APP_INITIALIZER, isDevMode, NgModule, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { DOCUMENT } from '@angular/common';
|
|
4
4
|
import { interval } from 'rxjs';
|
|
5
5
|
|
|
@@ -23,15 +23,9 @@ const NGX_PENDO_CONTEXT = new InjectionToken('ngx-pendo-context', {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
class NgxPendoService {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param settings IPendoSettings
|
|
30
|
-
* @param pendo IPendo
|
|
31
|
-
*/
|
|
32
|
-
constructor(settings, pendo) {
|
|
33
|
-
this.pendo = pendo;
|
|
34
|
-
this.pendoIdFormatter = settings.pendoIdFormatter;
|
|
26
|
+
constructor() {
|
|
27
|
+
this.pendo = inject(NGX_PENDO_CONTEXT);
|
|
28
|
+
this.pendoIdFormatter = inject(NGX_PENDO_SETTINGS_TOKEN).pendoIdFormatter;
|
|
35
29
|
}
|
|
36
30
|
initialize(optionsOrVisitor, account) {
|
|
37
31
|
if ('id' in optionsOrVisitor) {
|
|
@@ -97,25 +91,24 @@ class NgxPendoService {
|
|
|
97
91
|
disableDebugging() {
|
|
98
92
|
this.pendo?.disableDebugging();
|
|
99
93
|
}
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Method to manually track events. Requires a non-empty name string to collect event.
|
|
96
|
+
*/
|
|
97
|
+
track(trackType, metadata) {
|
|
98
|
+
this.pendo?.track(trackType, metadata);
|
|
99
|
+
}
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
101
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoService, providedIn: 'root' }); }
|
|
102
102
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoService, decorators: [{
|
|
104
104
|
type: Injectable,
|
|
105
105
|
args: [{
|
|
106
106
|
providedIn: 'root'
|
|
107
107
|
}]
|
|
108
|
-
}]
|
|
109
|
-
type: Inject,
|
|
110
|
-
args: [NGX_PENDO_SETTINGS_TOKEN]
|
|
111
|
-
}] }, { type: undefined, decorators: [{
|
|
112
|
-
type: Inject,
|
|
113
|
-
args: [NGX_PENDO_CONTEXT]
|
|
114
|
-
}] }] });
|
|
108
|
+
}] });
|
|
115
109
|
|
|
116
110
|
class NgxPendoIdDirective {
|
|
117
|
-
constructor(
|
|
118
|
-
this.service = service;
|
|
111
|
+
constructor() {
|
|
119
112
|
this.pendoId = input('', { alias: 'ngx-pendo-id' });
|
|
120
113
|
this.inherit = input(true, { alias: 'ngx-pendo-inherit' });
|
|
121
114
|
this.parent = signal(undefined);
|
|
@@ -129,11 +122,12 @@ class NgxPendoIdDirective {
|
|
|
129
122
|
return this.service.formatPendoId(...pendoSections, this.pendoId());
|
|
130
123
|
});
|
|
131
124
|
this.disableInherit = computed(() => (this.inherit() ? undefined : true));
|
|
125
|
+
this.service = inject(NgxPendoService);
|
|
132
126
|
}
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
127
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoIdDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
128
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.3", type: NgxPendoIdDirective, isStandalone: true, selector: "[ngx-pendo-id]", inputs: { pendoId: { classPropertyName: "pendoId", publicName: "ngx-pendo-id", isSignal: true, isRequired: false, transformFunction: null }, inherit: { classPropertyName: "inherit", publicName: "ngx-pendo-inherit", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-pendo-id": "mergedPendoId()", "attr.ngx-pendo-disable-inherit": "disableInherit()" } }, ngImport: i0 }); }
|
|
135
129
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoIdDirective, decorators: [{
|
|
137
131
|
type: Directive,
|
|
138
132
|
args: [{
|
|
139
133
|
selector: '[ngx-pendo-id]',
|
|
@@ -143,7 +137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
|
143
137
|
'[attr.ngx-pendo-disable-inherit]': 'disableInherit()'
|
|
144
138
|
}
|
|
145
139
|
}]
|
|
146
|
-
}]
|
|
140
|
+
}] });
|
|
147
141
|
|
|
148
142
|
class NgxPendoSectionDirective {
|
|
149
143
|
constructor() {
|
|
@@ -161,10 +155,10 @@ class NgxPendoSectionDirective {
|
|
|
161
155
|
});
|
|
162
156
|
});
|
|
163
157
|
}
|
|
164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
165
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
158
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoSectionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
159
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.0.3", type: NgxPendoSectionDirective, isStandalone: true, selector: "[ngx-pendo-section]", inputs: { pendoSection: { classPropertyName: "pendoSection", publicName: "ngx-pendo-section", isSignal: true, isRequired: false, transformFunction: null }, inherit: { classPropertyName: "inherit", publicName: "ngx-pendo-inherit", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-pendo-section": "pendoSection()", "attr.ngx-pendo-disable-inherit": "disableInherit()" } }, queries: [{ propertyName: "idDirectives", predicate: NgxPendoIdDirective, isSignal: true }, { propertyName: "sectionDirectivs", predicate: NgxPendoSectionDirective, isSignal: true }], ngImport: i0 }); }
|
|
166
160
|
}
|
|
167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoSectionDirective, decorators: [{
|
|
168
162
|
type: Directive,
|
|
169
163
|
args: [{
|
|
170
164
|
selector: '[ngx-pendo-section]',
|
|
@@ -220,6 +214,9 @@ function pendoInitializer($settings, window) {
|
|
|
220
214
|
};
|
|
221
215
|
}
|
|
222
216
|
|
|
217
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
218
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
219
|
+
|
|
223
220
|
class NgxPendoModule {
|
|
224
221
|
static forRoot(settings) {
|
|
225
222
|
return {
|
|
@@ -238,11 +235,11 @@ class NgxPendoModule {
|
|
|
238
235
|
ngModule: NgxPendoModule
|
|
239
236
|
};
|
|
240
237
|
}
|
|
241
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
242
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
243
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
238
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
239
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoModule, imports: [NgxPendoIdDirective, NgxPendoSectionDirective], exports: [NgxPendoIdDirective, NgxPendoSectionDirective] }); }
|
|
240
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoModule }); }
|
|
244
241
|
}
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: NgxPendoModule, decorators: [{
|
|
246
243
|
type: NgModule,
|
|
247
244
|
args: [{
|
|
248
245
|
imports: [NgxPendoIdDirective, NgxPendoSectionDirective],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-pendo.mjs","sources":["../../../projects/ngx-pendo/src/lib/ngx-pendo.tokens.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.service.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-id.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-section.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.injectors.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.module.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.provide.ts","../../../projects/ngx-pendo/src/public-api.ts","../../../projects/ngx-pendo/src/ngx-pendo.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { InjectionToken, inject } from '@angular/core';\nimport { PendoWindow } from './ngx-pendo.types';\nimport { IPendo, IPendoSettings } from './ngx-pendo.interfaces';\n\nexport const NGX_PENDO_SETTINGS_TOKEN = new InjectionToken<IPendoSettings>('ngx-pendo-settings', {\n providedIn: 'root',\n factory: () => ({ pendoApiKey: '' })\n});\n\nexport const NGX_PENDO_WINDOW = new InjectionToken<PendoWindow>('ngx-pendo-window', {\n providedIn: 'root',\n factory: () => {\n const { defaultView } = inject(DOCUMENT);\n\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n\n return defaultView;\n }\n});\n\nexport const NGX_PENDO_CONTEXT = new InjectionToken<IPendo>('ngx-pendo-context', {\n providedIn: 'root',\n factory: () => inject(NGX_PENDO_WINDOW).pendo!\n});\n","import { Injectable, Inject } from '@angular/core';\nimport { NGX_PENDO_CONTEXT, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { IAccount, IPendo, IPendoOptions, IPendoSettings, IVisitor } from './ngx-pendo.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxPendoService {\n private pendoIdFormatter?: (pendoId: string) => string;\n\n /**\n * Constructor\n *\n * @param settings IPendoSettings\n * @param pendo IPendo\n */\n constructor(\n @Inject(NGX_PENDO_SETTINGS_TOKEN) settings: IPendoSettings,\n @Inject(NGX_PENDO_CONTEXT) private pendo: IPendo\n ) {\n this.pendoIdFormatter = settings.pendoIdFormatter;\n }\n\n /**\n * Completely re-initialize the Agent with new options\n *\n * @param optionsOrVisitor IPendoOptions | IVisitor\n * @param account IAccount\n */\n initialize(options: IPendoOptions): void;\n initialize(visitor: IVisitor, account?: IAccount): void;\n initialize(optionsOrVisitor: IPendoOptions | IVisitor, account?: IAccount): void {\n if ('id' in optionsOrVisitor) {\n this.pendo?.initialize({ visitor: optionsOrVisitor, account });\n } else {\n this.pendo?.initialize(optionsOrVisitor);\n }\n }\n\n /**\n * Send an identify event and a meta event.\n *\n * @param visitor IVisitor | string\n * @param account IAccount | string\n */\n identify(visitor: string, account?: string): void;\n identify(visitor: IVisitor, account?: IAccount): void;\n identify(visitor: IVisitor | string, account?: IAccount | string): void {\n if (typeof visitor === 'string' && (!account || typeof account === 'string')) {\n this.pendo?.identify(visitor, account);\n } else {\n this.pendo?.identify({ visitor: <IVisitor>visitor, account: <IAccount>account });\n }\n }\n\n /**\n * Updates metadata object for the Pendo agent.\n *\n * @param options IPendoOptions\n */\n updateOptions(options: IPendoOptions): void {\n this.pendo?.updateOptions(options);\n }\n\n /**\n * Format Pendo\n *\n * @param ids string[]\n */\n formatPendoId(...ids: string[]): string {\n return (this.pendoIdFormatter ? ids.map(id => this.pendoIdFormatter!(id)) : ids).join('.');\n }\n\n /**\n * Shuts down the agent and cleans up all timers and listeners.\n */\n teardown(): void {\n this.pendo?.teardown();\n }\n\n /**\n * Checks if a given visitor id string is anonymous.\n * If no argument is given, calls with pendo.getVisitorId() to check current visitor status.\n */\n isAnonymousVisitor(visitorId?: string): boolean {\n return this.pendo?.isAnonymousVisitor(visitorId);\n }\n\n /**\n * Removes current visitor id and account id.\n * Triggers an identify event and reloads with a new anonymous visitor.\n */\n clearSession(): void {\n this.pendo?.clearSession();\n }\n\n /**\n * Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.\n */\n enableDebugging(): void {\n this.pendo?.enableDebugging();\n }\n\n /**\n * Removes Pendo Debugger extension.\n */\n disableDebugging(): void {\n this.pendo?.disableDebugging();\n }\n}\n","import { Directive, input, computed, signal } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoService } from './ngx-pendo.service';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\n\n@Directive({\n selector: '[ngx-pendo-id]',\n standalone: true,\n host: {\n '[attr.data-pendo-id]': 'mergedPendoId()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoIdDirective implements IPendoDirective {\n pendoId = input<string>('', { alias: 'ngx-pendo-id' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n mergedPendoId = computed<string>(() => {\n const pendoSections = [];\n\n let cur = this.inherit() ? this.parent() : null;\n while (cur) {\n pendoSections.unshift(cur.pendoSection());\n cur = cur.inherit() ? cur.parent() : null;\n }\n\n return this.service.formatPendoId(...pendoSections, this.pendoId());\n });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n constructor(private service: NgxPendoService) {}\n}\n","import { Directive, input, computed, signal, contentChildren, effect } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\n\n@Directive({\n selector: '[ngx-pendo-section]',\n standalone: true,\n host: {\n '[attr.data-pendo-section]': 'pendoSection()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoSectionDirective implements IPendoDirective {\n pendoSection = input<string>('', { alias: 'ngx-pendo-section' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n idDirectives = contentChildren(NgxPendoIdDirective, { descendants: false });\n\n sectionDirectivs = contentChildren(NgxPendoSectionDirective, { descendants: false });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n constructor() {\n effect(() => {\n [...this.idDirectives(), ...this.sectionDirectivs()].forEach(item => {\n if (item !== this) {\n item.parent.set(this);\n }\n });\n });\n }\n}\n","import { APP_INITIALIZER, isDevMode, Provider } from '@angular/core';\nimport { interval } from 'rxjs';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_WINDOW, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { PendoWindow } from './ngx-pendo.types';\n\nconst DEFAULT_PENDO_SCRIPT_ORIGIN = 'https://cdn.pendo.io';\n\n// export const NGX_PENDO_INITIALIZER_PROVIDER = provideAppInitializer(() => {\n// const initializerFn = pendoInitializer(inject(NGX_PENDO_SETTINGS_TOKEN), inject(NGX_PENDO_WINDOW));\n// return initializerFn();\n// });\n\n// Keep the `APP_INITIALIZER` to support angular 17 and 18 version\nexport const NGX_PENDO_INITIALIZER_PROVIDER: Provider = {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: pendoInitializer,\n deps: [NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW]\n};\n\nexport function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void> {\n return async () => {\n const { pendoApiKey, pendoScriptOrigin } = $settings;\n if (!pendoApiKey) {\n if (isDevMode()) {\n console.error('Empty api key for Pendo. Make sure to provide one when initializing NgxPendoModule.');\n }\n\n return;\n }\n\n await new Promise<void>(resolve => {\n const script = document.createElement('script');\n script.async = true;\n script.src = `${pendoScriptOrigin || DEFAULT_PENDO_SCRIPT_ORIGIN}/agent/static/${pendoApiKey}/pendo.js`;\n document.head.appendChild(script);\n script.onerror = async () => {\n // The script may have been blocked by an ad blocker\n console.error('The pendo script may have been blocked.');\n resolve();\n };\n script.onload = async () => {\n // when enableDebugging should load extra js\n const sub = interval(100).subscribe(() => {\n if (window.pendo) {\n sub.unsubscribe();\n resolve();\n }\n });\n };\n });\n };\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\n\n@NgModule({\n imports: [NgxPendoIdDirective, NgxPendoSectionDirective],\n exports: [NgxPendoIdDirective, NgxPendoSectionDirective]\n})\nexport class NgxPendoModule {\n static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule,\n providers: [\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]\n };\n }\n\n static forChild(): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule\n };\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\n\nexport function provideNgxPendo(settings: IPendoSettings) {\n return makeEnvironmentProviders([\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]);\n}\n","/*\n * Public API Surface of ngx-pendo\n */\n\nexport * from './lib/ngx-pendo-id.directive';\nexport * from './lib/ngx-pendo-section.directive';\nexport * from './lib/ngx-pendo.service';\nexport * from './lib/ngx-pendo.injectors';\nexport * from './lib/ngx-pendo.interfaces';\nexport * from './lib/ngx-pendo.module';\nexport * from './lib/ngx-pendo.provide';\nexport * from './lib/ngx-pendo.tokens';\nexport * from './lib/ngx-pendo.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxPendoService"],"mappings":";;;;;MAKa,wBAAwB,GAAG,IAAI,cAAc,CAAiB,oBAAoB,EAAE;AAC/F,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;AACpC,CAAA;MAEY,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;QAExC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;;AAG5C,QAAA,OAAO,WAAW;;AAErB,CAAA;MAEY,iBAAiB,GAAG,IAAI,cAAc,CAAS,mBAAmB,EAAE;AA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service.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-id.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo-section.directive.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.injectors.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.interfaces.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.module.ts","../../../projects/ngx-pendo/src/lib/ngx-pendo.provide.ts","../../../projects/ngx-pendo/src/public-api.ts","../../../projects/ngx-pendo/src/ngx-pendo.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { PendoWindow } from './ngx-pendo.types';\nimport { IPendo, IPendoSettings } from './ngx-pendo.interfaces';\n\nexport const NGX_PENDO_SETTINGS_TOKEN = new InjectionToken<IPendoSettings>('ngx-pendo-settings', {\n providedIn: 'root',\n factory: () => ({ pendoApiKey: '' })\n});\n\nexport const NGX_PENDO_WINDOW = new InjectionToken<PendoWindow>('ngx-pendo-window', {\n providedIn: 'root',\n factory: () => {\n const { defaultView } = inject(DOCUMENT);\n\n if (!defaultView) {\n throw new Error('Window is not available');\n }\n\n return defaultView;\n }\n});\n\nexport const NGX_PENDO_CONTEXT = new InjectionToken<IPendo>('ngx-pendo-context', {\n providedIn: 'root',\n factory: () => inject(NGX_PENDO_WINDOW).pendo!\n});\n","import { Injectable, inject } from '@angular/core';\nimport { NGX_PENDO_CONTEXT, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { IAccount, IPendoOptions, IVisitor } from './ngx-pendo.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxPendoService {\n private pendo = inject(NGX_PENDO_CONTEXT);\n private pendoIdFormatter = inject(NGX_PENDO_SETTINGS_TOKEN).pendoIdFormatter;\n\n /**\n * Completely re-initialize the Agent with new options\n *\n * @param optionsOrVisitor IPendoOptions | IVisitor\n * @param account IAccount\n */\n initialize(options: IPendoOptions): void;\n initialize(visitor: IVisitor, account?: IAccount): void;\n initialize(optionsOrVisitor: IPendoOptions | IVisitor, account?: IAccount): void {\n if ('id' in optionsOrVisitor) {\n this.pendo?.initialize({ visitor: optionsOrVisitor, account });\n } else {\n this.pendo?.initialize(optionsOrVisitor);\n }\n }\n\n /**\n * Send an identify event and a meta event.\n *\n * @param visitor IVisitor | string\n * @param account IAccount | string\n */\n identify(visitor: string, account?: string): void;\n identify(visitor: IVisitor, account?: IAccount): void;\n identify(visitor: IVisitor | string, account?: IAccount | string): void {\n if (typeof visitor === 'string' && (!account || typeof account === 'string')) {\n this.pendo?.identify(visitor, account);\n } else {\n this.pendo?.identify({ visitor: visitor as IVisitor, account: account as IAccount });\n }\n }\n\n /**\n * Updates metadata object for the Pendo agent.\n *\n * @param options IPendoOptions\n */\n updateOptions(options: IPendoOptions): void {\n this.pendo?.updateOptions(options);\n }\n\n /**\n * Format Pendo\n *\n * @param ids string[]\n */\n formatPendoId(...ids: string[]): string {\n return (this.pendoIdFormatter ? ids.map(id => this.pendoIdFormatter!(id)) : ids).join('.');\n }\n\n /**\n * Shuts down the agent and cleans up all timers and listeners.\n */\n teardown(): void {\n this.pendo?.teardown();\n }\n\n /**\n * Checks if a given visitor id string is anonymous.\n * If no argument is given, calls with pendo.getVisitorId() to check current visitor status.\n */\n isAnonymousVisitor(visitorId?: string): boolean {\n return this.pendo?.isAnonymousVisitor(visitorId);\n }\n\n /**\n * Removes current visitor id and account id.\n * Triggers an identify event and reloads with a new anonymous visitor.\n */\n clearSession(): void {\n this.pendo?.clearSession();\n }\n\n /**\n * Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.\n */\n enableDebugging(): void {\n this.pendo?.enableDebugging();\n }\n\n /**\n * Removes Pendo Debugger extension.\n */\n disableDebugging(): void {\n this.pendo?.disableDebugging();\n }\n\n /**\n * Method to manually track events. Requires a non-empty name string to collect event.\n */\n track(trackType: string, metadata?: Record<string, string | number | boolean | string[] | null>): void {\n this.pendo?.track(trackType, metadata);\n }\n}\n","import { Directive, inject, input, computed, signal } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoService } from './ngx-pendo.service';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\n\n@Directive({\n selector: '[ngx-pendo-id]',\n standalone: true,\n host: {\n '[attr.data-pendo-id]': 'mergedPendoId()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoIdDirective implements IPendoDirective {\n pendoId = input<string>('', { alias: 'ngx-pendo-id' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n mergedPendoId = computed<string>(() => {\n const pendoSections = [];\n\n let cur = this.inherit() ? this.parent() : null;\n while (cur) {\n pendoSections.unshift(cur.pendoSection());\n cur = cur.inherit() ? cur.parent() : null;\n }\n\n return this.service.formatPendoId(...pendoSections, this.pendoId());\n });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n service = inject(NgxPendoService);\n}\n","import { Directive, input, computed, signal, contentChildren, effect } from '@angular/core';\nimport { IPendoDirective } from './ngx-pendo.interfaces';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\n\n@Directive({\n selector: '[ngx-pendo-section]',\n standalone: true,\n host: {\n '[attr.data-pendo-section]': 'pendoSection()',\n '[attr.ngx-pendo-disable-inherit]': 'disableInherit()'\n }\n})\nexport class NgxPendoSectionDirective implements IPendoDirective {\n pendoSection = input<string>('', { alias: 'ngx-pendo-section' });\n\n inherit = input<boolean>(true, { alias: 'ngx-pendo-inherit' });\n\n parent = signal<NgxPendoSectionDirective | undefined>(undefined);\n\n idDirectives = contentChildren(NgxPendoIdDirective, { descendants: false });\n\n sectionDirectivs = contentChildren(NgxPendoSectionDirective, { descendants: false });\n\n disableInherit = computed<boolean | undefined>(() => (this.inherit() ? undefined : true));\n\n constructor() {\n effect(() => {\n [...this.idDirectives(), ...this.sectionDirectivs()].forEach(item => {\n if (item !== this) {\n item.parent.set(this);\n }\n });\n });\n }\n}\n","import { APP_INITIALIZER, isDevMode, Provider } from '@angular/core';\nimport { interval } from 'rxjs';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_WINDOW, NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { PendoWindow } from './ngx-pendo.types';\n\nconst DEFAULT_PENDO_SCRIPT_ORIGIN = 'https://cdn.pendo.io';\n\n// export const NGX_PENDO_INITIALIZER_PROVIDER = provideAppInitializer(() => {\n// const initializerFn = pendoInitializer(inject(NGX_PENDO_SETTINGS_TOKEN), inject(NGX_PENDO_WINDOW));\n// return initializerFn();\n// });\n\n// Keep the `APP_INITIALIZER` to support angular 17 and 18 version\nexport const NGX_PENDO_INITIALIZER_PROVIDER: Provider = {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: pendoInitializer,\n deps: [NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW]\n};\n\nexport function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void> {\n return async () => {\n const { pendoApiKey, pendoScriptOrigin } = $settings;\n if (!pendoApiKey) {\n if (isDevMode()) {\n console.error('Empty api key for Pendo. Make sure to provide one when initializing NgxPendoModule.');\n }\n\n return;\n }\n\n await new Promise<void>(resolve => {\n const script = document.createElement('script');\n script.async = true;\n script.src = `${pendoScriptOrigin || DEFAULT_PENDO_SCRIPT_ORIGIN}/agent/static/${pendoApiKey}/pendo.js`;\n document.head.appendChild(script);\n script.onerror = async () => {\n // The script may have been blocked by an ad blocker\n console.error('The pendo script may have been blocked.');\n resolve();\n };\n script.onload = async () => {\n // when enableDebugging should load extra js\n const sub = interval(100).subscribe(() => {\n if (window.pendo) {\n sub.unsubscribe();\n resolve();\n }\n });\n };\n });\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-function-type */\n\nimport { InputSignal, WritableSignal, Provider } from '@angular/core';\n\nexport interface IPendoSettings {\n pendoApiKey: string;\n pendoScriptOrigin?: string;\n pendoIdFormatter?: (pendoId: string) => string;\n pendoInitializerProvider?: Provider;\n}\n\nexport interface IPendoDirective {\n inherit: InputSignal<boolean>;\n parent: WritableSignal<IPendoDirective | undefined>;\n}\n\n// The following interfaces and types are based on the Pendo documentation.\n// Please according to the Pendo documentation, here's the link: https://agent.pendo.io/\nexport interface IVisitor {\n id: string;\n [key: string]: string;\n}\n\nexport interface IAccount {\n id: string;\n [key: string]: string;\n}\n\nexport interface IPendoIdentity {\n visitor?: IVisitor;\n account?: IAccount;\n}\n\nexport interface IPendoOptions extends IPendoIdentity {\n // Core\n additionalApiKeys?: string[];\n annotateUrl?: Function;\n apiKey?: string;\n appAutoOrdering?: string[];\n autoFrameInstall?: boolean;\n contentHost?: string;\n cookieDomain?: string;\n dataHost?: string;\n disableCookies?: boolean;\n disableFeedback?: boolean;\n disablePendo?: boolean;\n disablePersistence?: boolean;\n frameIdentitySync?: boolean;\n ignoreHashRouting?: boolean;\n initializeImmediately?: boolean;\n observeShadowRoots?: boolean;\n leaderKey?: string[];\n localStorageOnly?: boolean;\n preferBroadcastChannel?: boolean;\n preferMutationObserver?: boolean;\n preventUnloadListener?: boolean;\n queryStringWhitelist?: string[] | Function;\n sanitizeUrl?: Function;\n selfHostedAgentUrl?: string;\n sendEventsWithPostOnly?: boolean;\n // Analytics\n allowedText?: string[];\n analytics?: {\n excludeEvents?: string[];\n };\n enableDebugEvents?: boolean;\n eventPropertyMatchParents?: boolean;\n excludeAllText?: boolean;\n excludeNonGuideAnalytics?: boolean;\n syntheticClicks?: {\n elementRemoval?: boolean;\n targetChanged?: boolean;\n };\n // Guides\n disableGlobalCSS?: boolean;\n disableGuidePseudoStyles?: boolean;\n disablePrefetch?: boolean;\n enableDesignerKeyboardShortcut?: boolean;\n enableGuideTimeout?: boolean;\n guideSeenTimeoutLength?: number;\n guideValidation?: boolean;\n guides?: {\n attachPoint?: string | Function;\n delay?: boolean;\n disabled?: boolean;\n globalScripts?: any[];\n timeout?: number;\n tooltip?: {\n arrowSize?: number;\n };\n };\n preventCodeInjection?: boolean;\n}\n\nexport interface IPendo {\n // Agent\n additionalApiKeys: string[];\n apiKey: string;\n getVersion(): string;\n initialize(options: IPendoOptions): void;\n isReady(): boolean;\n teardown(): void;\n\n // Classic Guides\n hideLauncher(): void;\n removeLauncher(): void;\n showLauncher(): void;\n toggleLauncher(): void;\n\n // Debugging\n addDebuggingFunctions(): void;\n disableDebugging(): void;\n disableLogging(): void;\n enableDebugging(): void;\n enableLogging(): void;\n isDebuggingEnabled(): void;\n logPublic(): void;\n\n // DOM\n dom(input: string): HTMLElement;\n\n // Events\n attachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;\n detachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;\n doNotProcess: string;\n flushNow(force?: boolean): void;\n isSendingEvents(): boolean;\n startSendingEvents(): boolean;\n stopSendingEvents(): boolean;\n stopSendingEvents(): boolean;\n track(trackType: string, metadata?: any): void;\n\n // TODO: Guides\n\n // Identity\n clearSession(): void;\n generate_unique_id(prefix?: string): string;\n getAccountId(): string | null;\n get_account_id(): string | null;\n getSerializedMetadata(): any;\n getVisitorId(): string;\n get_visitor_id(): string;\n identify(options: IPendoIdentity | string, accountId?: string): void;\n isAnonymousVisitor(visitorId?: string): boolean;\n set_account_id(newAccountId?: string): void;\n set_visitor_id(newVisitorId?: string): void;\n updateOptions(options: IPendoOptions): void;\n\n // URL\n url: {\n get: () => string;\n };\n normalizedUrl: string;\n getCurrentUrl: () => string;\n getNormalizedUrl: () => string;\n pageLoad: (url: string) => void;\n\n // TODO: Utility\n\n // TODO: Validation\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { NgxPendoIdDirective } from './ngx-pendo-id.directive';\nimport { NgxPendoSectionDirective } from './ngx-pendo-section.directive';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\n\n@NgModule({\n imports: [NgxPendoIdDirective, NgxPendoSectionDirective],\n exports: [NgxPendoIdDirective, NgxPendoSectionDirective]\n})\nexport class NgxPendoModule {\n static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule,\n providers: [\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]\n };\n }\n\n static forChild(): ModuleWithProviders<NgxPendoModule> {\n return {\n ngModule: NgxPendoModule\n };\n }\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { NGX_PENDO_SETTINGS_TOKEN } from './ngx-pendo.tokens';\nimport { NGX_PENDO_INITIALIZER_PROVIDER } from './ngx-pendo.injectors';\nimport { IPendoSettings } from './ngx-pendo.interfaces';\n\nexport function provideNgxPendo(settings: IPendoSettings) {\n return makeEnvironmentProviders([\n {\n provide: NGX_PENDO_SETTINGS_TOKEN,\n useValue: settings\n },\n settings.pendoInitializerProvider || NGX_PENDO_INITIALIZER_PROVIDER\n ]);\n}\n","/*\n * Public API Surface of ngx-pendo\n */\n\nexport * from './lib/ngx-pendo-id.directive';\nexport * from './lib/ngx-pendo-section.directive';\nexport * from './lib/ngx-pendo.service';\nexport * from './lib/ngx-pendo.injectors';\nexport * from './lib/ngx-pendo.interfaces';\nexport * from './lib/ngx-pendo.module';\nexport * from './lib/ngx-pendo.provide';\nexport * from './lib/ngx-pendo.tokens';\nexport * from './lib/ngx-pendo.types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,wBAAwB,GAAG,IAAI,cAAc,CAAiB,oBAAoB,EAAE;AAC/F,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAA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ACLK,SAAU,eAAe,CAAC,QAAwB,EAAA;AACtD,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,wBAAwB;AACjC,YAAA,QAAQ,EAAE;AACX,SAAA;QACD,QAAQ,CAAC,wBAAwB,IAAI;AACtC,KAAA,CAAC;AACJ;;ACbA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,238 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InputSignal, WritableSignal, Provider, ModuleWithProviders, InjectionToken } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
interface IPendoSettings {
|
|
5
|
+
pendoApiKey: string;
|
|
6
|
+
pendoScriptOrigin?: string;
|
|
7
|
+
pendoIdFormatter?: (pendoId: string) => string;
|
|
8
|
+
pendoInitializerProvider?: Provider;
|
|
9
|
+
}
|
|
10
|
+
interface IPendoDirective {
|
|
11
|
+
inherit: InputSignal<boolean>;
|
|
12
|
+
parent: WritableSignal<IPendoDirective | undefined>;
|
|
13
|
+
}
|
|
14
|
+
interface IVisitor {
|
|
15
|
+
id: string;
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
}
|
|
18
|
+
interface IAccount {
|
|
19
|
+
id: string;
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
}
|
|
22
|
+
interface IPendoIdentity {
|
|
23
|
+
visitor?: IVisitor;
|
|
24
|
+
account?: IAccount;
|
|
25
|
+
}
|
|
26
|
+
interface IPendoOptions extends IPendoIdentity {
|
|
27
|
+
additionalApiKeys?: string[];
|
|
28
|
+
annotateUrl?: Function;
|
|
29
|
+
apiKey?: string;
|
|
30
|
+
appAutoOrdering?: string[];
|
|
31
|
+
autoFrameInstall?: boolean;
|
|
32
|
+
contentHost?: string;
|
|
33
|
+
cookieDomain?: string;
|
|
34
|
+
dataHost?: string;
|
|
35
|
+
disableCookies?: boolean;
|
|
36
|
+
disableFeedback?: boolean;
|
|
37
|
+
disablePendo?: boolean;
|
|
38
|
+
disablePersistence?: boolean;
|
|
39
|
+
frameIdentitySync?: boolean;
|
|
40
|
+
ignoreHashRouting?: boolean;
|
|
41
|
+
initializeImmediately?: boolean;
|
|
42
|
+
observeShadowRoots?: boolean;
|
|
43
|
+
leaderKey?: string[];
|
|
44
|
+
localStorageOnly?: boolean;
|
|
45
|
+
preferBroadcastChannel?: boolean;
|
|
46
|
+
preferMutationObserver?: boolean;
|
|
47
|
+
preventUnloadListener?: boolean;
|
|
48
|
+
queryStringWhitelist?: string[] | Function;
|
|
49
|
+
sanitizeUrl?: Function;
|
|
50
|
+
selfHostedAgentUrl?: string;
|
|
51
|
+
sendEventsWithPostOnly?: boolean;
|
|
52
|
+
allowedText?: string[];
|
|
53
|
+
analytics?: {
|
|
54
|
+
excludeEvents?: string[];
|
|
55
|
+
};
|
|
56
|
+
enableDebugEvents?: boolean;
|
|
57
|
+
eventPropertyMatchParents?: boolean;
|
|
58
|
+
excludeAllText?: boolean;
|
|
59
|
+
excludeNonGuideAnalytics?: boolean;
|
|
60
|
+
syntheticClicks?: {
|
|
61
|
+
elementRemoval?: boolean;
|
|
62
|
+
targetChanged?: boolean;
|
|
63
|
+
};
|
|
64
|
+
disableGlobalCSS?: boolean;
|
|
65
|
+
disableGuidePseudoStyles?: boolean;
|
|
66
|
+
disablePrefetch?: boolean;
|
|
67
|
+
enableDesignerKeyboardShortcut?: boolean;
|
|
68
|
+
enableGuideTimeout?: boolean;
|
|
69
|
+
guideSeenTimeoutLength?: number;
|
|
70
|
+
guideValidation?: boolean;
|
|
71
|
+
guides?: {
|
|
72
|
+
attachPoint?: string | Function;
|
|
73
|
+
delay?: boolean;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
globalScripts?: any[];
|
|
76
|
+
timeout?: number;
|
|
77
|
+
tooltip?: {
|
|
78
|
+
arrowSize?: number;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
preventCodeInjection?: boolean;
|
|
82
|
+
}
|
|
83
|
+
interface IPendo {
|
|
84
|
+
additionalApiKeys: string[];
|
|
85
|
+
apiKey: string;
|
|
86
|
+
getVersion(): string;
|
|
87
|
+
initialize(options: IPendoOptions): void;
|
|
88
|
+
isReady(): boolean;
|
|
89
|
+
teardown(): void;
|
|
90
|
+
hideLauncher(): void;
|
|
91
|
+
removeLauncher(): void;
|
|
92
|
+
showLauncher(): void;
|
|
93
|
+
toggleLauncher(): void;
|
|
94
|
+
addDebuggingFunctions(): void;
|
|
95
|
+
disableDebugging(): void;
|
|
96
|
+
disableLogging(): void;
|
|
97
|
+
enableDebugging(): void;
|
|
98
|
+
enableLogging(): void;
|
|
99
|
+
isDebuggingEnabled(): void;
|
|
100
|
+
logPublic(): void;
|
|
101
|
+
dom(input: string): HTMLElement;
|
|
102
|
+
attachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;
|
|
103
|
+
detachEvent(element: HTMLElement, evt: string, fn: (event: Event) => void, useCapture?: boolean): void;
|
|
104
|
+
doNotProcess: string;
|
|
105
|
+
flushNow(force?: boolean): void;
|
|
106
|
+
isSendingEvents(): boolean;
|
|
107
|
+
startSendingEvents(): boolean;
|
|
108
|
+
stopSendingEvents(): boolean;
|
|
109
|
+
stopSendingEvents(): boolean;
|
|
110
|
+
track(trackType: string, metadata?: any): void;
|
|
111
|
+
clearSession(): void;
|
|
112
|
+
generate_unique_id(prefix?: string): string;
|
|
113
|
+
getAccountId(): string | null;
|
|
114
|
+
get_account_id(): string | null;
|
|
115
|
+
getSerializedMetadata(): any;
|
|
116
|
+
getVisitorId(): string;
|
|
117
|
+
get_visitor_id(): string;
|
|
118
|
+
identify(options: IPendoIdentity | string, accountId?: string): void;
|
|
119
|
+
isAnonymousVisitor(visitorId?: string): boolean;
|
|
120
|
+
set_account_id(newAccountId?: string): void;
|
|
121
|
+
set_visitor_id(newVisitorId?: string): void;
|
|
122
|
+
updateOptions(options: IPendoOptions): void;
|
|
123
|
+
url: {
|
|
124
|
+
get: () => string;
|
|
125
|
+
};
|
|
126
|
+
normalizedUrl: string;
|
|
127
|
+
getCurrentUrl: () => string;
|
|
128
|
+
getNormalizedUrl: () => string;
|
|
129
|
+
pageLoad: (url: string) => void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
declare class NgxPendoService {
|
|
133
|
+
private pendo;
|
|
134
|
+
private pendoIdFormatter;
|
|
135
|
+
/**
|
|
136
|
+
* Completely re-initialize the Agent with new options
|
|
137
|
+
*
|
|
138
|
+
* @param optionsOrVisitor IPendoOptions | IVisitor
|
|
139
|
+
* @param account IAccount
|
|
140
|
+
*/
|
|
141
|
+
initialize(options: IPendoOptions): void;
|
|
142
|
+
initialize(visitor: IVisitor, account?: IAccount): void;
|
|
143
|
+
/**
|
|
144
|
+
* Send an identify event and a meta event.
|
|
145
|
+
*
|
|
146
|
+
* @param visitor IVisitor | string
|
|
147
|
+
* @param account IAccount | string
|
|
148
|
+
*/
|
|
149
|
+
identify(visitor: string, account?: string): void;
|
|
150
|
+
identify(visitor: IVisitor, account?: IAccount): void;
|
|
151
|
+
/**
|
|
152
|
+
* Updates metadata object for the Pendo agent.
|
|
153
|
+
*
|
|
154
|
+
* @param options IPendoOptions
|
|
155
|
+
*/
|
|
156
|
+
updateOptions(options: IPendoOptions): void;
|
|
157
|
+
/**
|
|
158
|
+
* Format Pendo
|
|
159
|
+
*
|
|
160
|
+
* @param ids string[]
|
|
161
|
+
*/
|
|
162
|
+
formatPendoId(...ids: string[]): string;
|
|
163
|
+
/**
|
|
164
|
+
* Shuts down the agent and cleans up all timers and listeners.
|
|
165
|
+
*/
|
|
166
|
+
teardown(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Checks if a given visitor id string is anonymous.
|
|
169
|
+
* If no argument is given, calls with pendo.getVisitorId() to check current visitor status.
|
|
170
|
+
*/
|
|
171
|
+
isAnonymousVisitor(visitorId?: string): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Removes current visitor id and account id.
|
|
174
|
+
* Triggers an identify event and reloads with a new anonymous visitor.
|
|
175
|
+
*/
|
|
176
|
+
clearSession(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.
|
|
179
|
+
*/
|
|
180
|
+
enableDebugging(): void;
|
|
181
|
+
/**
|
|
182
|
+
* Removes Pendo Debugger extension.
|
|
183
|
+
*/
|
|
184
|
+
disableDebugging(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Method to manually track events. Requires a non-empty name string to collect event.
|
|
187
|
+
*/
|
|
188
|
+
track(trackType: string, metadata?: Record<string, string | number | boolean | string[] | null>): void;
|
|
189
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPendoService, never>;
|
|
190
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxPendoService>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare class NgxPendoSectionDirective implements IPendoDirective {
|
|
194
|
+
pendoSection: _angular_core.InputSignal<string>;
|
|
195
|
+
inherit: _angular_core.InputSignal<boolean>;
|
|
196
|
+
parent: _angular_core.WritableSignal<NgxPendoSectionDirective | undefined>;
|
|
197
|
+
idDirectives: _angular_core.Signal<readonly NgxPendoIdDirective[]>;
|
|
198
|
+
sectionDirectivs: _angular_core.Signal<readonly NgxPendoSectionDirective[]>;
|
|
199
|
+
disableInherit: _angular_core.Signal<boolean | undefined>;
|
|
200
|
+
constructor();
|
|
201
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPendoSectionDirective, never>;
|
|
202
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxPendoSectionDirective, "[ngx-pendo-section]", never, { "pendoSection": { "alias": "ngx-pendo-section"; "required": false; "isSignal": true; }; "inherit": { "alias": "ngx-pendo-inherit"; "required": false; "isSignal": true; }; }, {}, ["idDirectives", "sectionDirectivs"], never, true, never>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class NgxPendoIdDirective implements IPendoDirective {
|
|
206
|
+
pendoId: _angular_core.InputSignal<string>;
|
|
207
|
+
inherit: _angular_core.InputSignal<boolean>;
|
|
208
|
+
parent: _angular_core.WritableSignal<NgxPendoSectionDirective | undefined>;
|
|
209
|
+
mergedPendoId: _angular_core.Signal<string>;
|
|
210
|
+
disableInherit: _angular_core.Signal<boolean | undefined>;
|
|
211
|
+
service: NgxPendoService;
|
|
212
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPendoIdDirective, never>;
|
|
213
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxPendoIdDirective, "[ngx-pendo-id]", never, { "pendoId": { "alias": "ngx-pendo-id"; "required": false; "isSignal": true; }; "inherit": { "alias": "ngx-pendo-inherit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
type PendoWindow = Window & {
|
|
217
|
+
pendo?: IPendo;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
declare const NGX_PENDO_INITIALIZER_PROVIDER: Provider;
|
|
221
|
+
declare function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void>;
|
|
222
|
+
|
|
223
|
+
declare class NgxPendoModule {
|
|
224
|
+
static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule>;
|
|
225
|
+
static forChild(): ModuleWithProviders<NgxPendoModule>;
|
|
226
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxPendoModule, never>;
|
|
227
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<NgxPendoModule, never, [typeof NgxPendoIdDirective, typeof NgxPendoSectionDirective], [typeof NgxPendoIdDirective, typeof NgxPendoSectionDirective]>;
|
|
228
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<NgxPendoModule>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare function provideNgxPendo(settings: IPendoSettings): _angular_core.EnvironmentProviders;
|
|
232
|
+
|
|
233
|
+
declare const NGX_PENDO_SETTINGS_TOKEN: InjectionToken<IPendoSettings>;
|
|
234
|
+
declare const NGX_PENDO_WINDOW: InjectionToken<PendoWindow>;
|
|
235
|
+
declare const NGX_PENDO_CONTEXT: InjectionToken<IPendo>;
|
|
236
|
+
|
|
237
|
+
export { NGX_PENDO_CONTEXT, NGX_PENDO_INITIALIZER_PROVIDER, NGX_PENDO_SETTINGS_TOKEN, NGX_PENDO_WINDOW, NgxPendoIdDirective, NgxPendoModule, NgxPendoSectionDirective, NgxPendoService, pendoInitializer, provideNgxPendo };
|
|
238
|
+
export type { IAccount, IPendo, IPendoDirective, IPendoIdentity, IPendoOptions, IPendoSettings, IVisitor, PendoWindow };
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
13
|
-
const path = require("path");
|
|
14
13
|
const schema_1 = require("@schematics/angular/application/schema");
|
|
14
|
+
const path = require("path");
|
|
15
15
|
describe('ng add ngx pendo', () => {
|
|
16
16
|
const schematicRunner = new testing_1.SchematicTestRunner('ngx-pendo', path.join(__dirname, '../collection.json'));
|
|
17
17
|
const defaultOptions = {
|
|
@@ -48,11 +48,12 @@ describe('ng add ngx pendo', () => {
|
|
|
48
48
|
}));
|
|
49
49
|
it('should update app module', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
50
|
const options = Object.assign({}, defaultOptions);
|
|
51
|
+
const projectPath = '/projects/bar';
|
|
51
52
|
const importRegex = /import { NgxPendoModule } from 'ngx-pendo';/gm;
|
|
52
53
|
const providerRegex = /NgxPendoModule.forRoot\({\n\W{2,}pendoApiKey: 'pendo-api-key',\n\W{2,}pendoIdFormatter: \(pendoId: string\) => pendoId.toLowerCase\(\)\n\W{2,}\}\)/gm;
|
|
53
54
|
for (let i = 0; i < 2; i++) {
|
|
54
55
|
const tree = yield schematicRunner.runSchematic('ng-add', options, appTree);
|
|
55
|
-
const content = tree.readContent(
|
|
56
|
+
const content = tree.readContent(`${projectPath}/src/app/app-module.ts`);
|
|
56
57
|
const importMatches = content.match(importRegex);
|
|
57
58
|
const providerMatches = content.match(providerRegex);
|
|
58
59
|
// check config import and not duplicated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../projects/ngx-pendo/schematics/ng-add/index.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,gEAAuF;AACvF,
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../projects/ngx-pendo/schematics/ng-add/index.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,gEAAuF;AACvF,mEAA6F;AAE7F,6BAA6B;AAG7B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,eAAe,GAAG,IAAI,6BAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACzG,MAAM,cAAc,GAAoB;QACtC,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,eAAe;KAC7B,CAAC;IAEF,MAAM,gBAAgB,GAAqB;QACzC,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,UAAU;QAC1B,OAAO,EAAE,OAAO;KACjB,CAAC;IACF,MAAM,UAAU,GAAuB;QACrC,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,KAAK;QACrB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,cAAK,CAAC,IAAI;QACjB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,KAAK;KAClB,CAAC;IACF,IAAI,OAAiC,CAAC;IAEtC,UAAU,CAAC,GA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,uBAAb,aAAa,CAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM,CAAC,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IPendoDirective } from './ngx-pendo.interfaces';
|
|
2
|
-
import { NgxPendoService } from './ngx-pendo.service';
|
|
3
|
-
import { NgxPendoSectionDirective } from './ngx-pendo-section.directive';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class NgxPendoIdDirective implements IPendoDirective {
|
|
6
|
-
private service;
|
|
7
|
-
pendoId: import("@angular/core").InputSignal<string>;
|
|
8
|
-
inherit: import("@angular/core").InputSignal<boolean>;
|
|
9
|
-
parent: import("@angular/core").WritableSignal<NgxPendoSectionDirective | undefined>;
|
|
10
|
-
mergedPendoId: import("@angular/core").Signal<string>;
|
|
11
|
-
disableInherit: import("@angular/core").Signal<boolean | undefined>;
|
|
12
|
-
constructor(service: NgxPendoService);
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPendoIdDirective, never>;
|
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPendoIdDirective, "[ngx-pendo-id]", never, { "pendoId": { "alias": "ngx-pendo-id"; "required": false; "isSignal": true; }; "inherit": { "alias": "ngx-pendo-inherit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
15
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IPendoDirective } from './ngx-pendo.interfaces';
|
|
2
|
-
import { NgxPendoIdDirective } from './ngx-pendo-id.directive';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class NgxPendoSectionDirective implements IPendoDirective {
|
|
5
|
-
pendoSection: import("@angular/core").InputSignal<string>;
|
|
6
|
-
inherit: import("@angular/core").InputSignal<boolean>;
|
|
7
|
-
parent: import("@angular/core").WritableSignal<NgxPendoSectionDirective | undefined>;
|
|
8
|
-
idDirectives: import("@angular/core").Signal<readonly NgxPendoIdDirective[]>;
|
|
9
|
-
sectionDirectivs: import("@angular/core").Signal<readonly NgxPendoSectionDirective[]>;
|
|
10
|
-
disableInherit: import("@angular/core").Signal<boolean | undefined>;
|
|
11
|
-
constructor();
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPendoSectionDirective, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPendoSectionDirective, "[ngx-pendo-section]", never, { "pendoSection": { "alias": "ngx-pendo-section"; "required": false; "isSignal": true; }; "inherit": { "alias": "ngx-pendo-inherit"; "required": false; "isSignal": true; }; }, {}, ["idDirectives", "sectionDirectivs"], never, true, never>;
|
|
14
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Provider } from '@angular/core';
|
|
2
|
-
import { IPendoSettings } from './ngx-pendo.interfaces';
|
|
3
|
-
import { PendoWindow } from './ngx-pendo.types';
|
|
4
|
-
export declare const NGX_PENDO_INITIALIZER_PROVIDER: Provider;
|
|
5
|
-
export declare function pendoInitializer($settings: IPendoSettings, window: PendoWindow): () => Promise<void>;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { InputSignal, WritableSignal, Provider } from '@angular/core';
|
|
2
|
-
export interface IPendoSettings {
|
|
3
|
-
pendoApiKey: string;
|
|
4
|
-
pendoScriptOrigin?: string;
|
|
5
|
-
pendoIdFormatter?: (pendoId: string) => string;
|
|
6
|
-
pendoInitializerProvider?: Provider;
|
|
7
|
-
}
|
|
8
|
-
export interface IPendoDirective {
|
|
9
|
-
inherit: InputSignal<boolean>;
|
|
10
|
-
parent: WritableSignal<IPendoDirective | undefined>;
|
|
11
|
-
}
|
|
12
|
-
export interface IVisitor {
|
|
13
|
-
id: string;
|
|
14
|
-
[key: string]: string;
|
|
15
|
-
}
|
|
16
|
-
export interface IAccount {
|
|
17
|
-
id: string;
|
|
18
|
-
[key: string]: string;
|
|
19
|
-
}
|
|
20
|
-
export interface IPendoOptions {
|
|
21
|
-
visitor?: IVisitor;
|
|
22
|
-
account?: IAccount;
|
|
23
|
-
additionalApiKeys?: string[];
|
|
24
|
-
annotateUrl?: Function;
|
|
25
|
-
apiKey?: string;
|
|
26
|
-
appAutoOrdering?: string[];
|
|
27
|
-
autoFrameInstall?: boolean;
|
|
28
|
-
contentHost?: string;
|
|
29
|
-
cookieDomain?: string;
|
|
30
|
-
dataHost?: string;
|
|
31
|
-
disableCookies?: boolean;
|
|
32
|
-
disableFeedback?: boolean;
|
|
33
|
-
disablePendo?: boolean;
|
|
34
|
-
disablePersistence?: boolean;
|
|
35
|
-
frameIdentitySync?: boolean;
|
|
36
|
-
ignoreHashRouting?: boolean;
|
|
37
|
-
initializeImmediately?: boolean;
|
|
38
|
-
observeShadowRoots?: boolean;
|
|
39
|
-
leaderKey?: string[];
|
|
40
|
-
localStorageOnly?: boolean;
|
|
41
|
-
preferBroadcastChannel?: boolean;
|
|
42
|
-
preferMutationObserver?: boolean;
|
|
43
|
-
preventUnloadListener?: boolean;
|
|
44
|
-
queryStringWhitelist?: string[] | Function;
|
|
45
|
-
sanitizeUrl?: Function;
|
|
46
|
-
selfHostedAgentUrl?: string;
|
|
47
|
-
sendEventsWithPostOnly?: boolean;
|
|
48
|
-
allowedText?: string[];
|
|
49
|
-
analytics?: {
|
|
50
|
-
excludeEvents?: string[];
|
|
51
|
-
};
|
|
52
|
-
enableDebugEvents?: boolean;
|
|
53
|
-
eventPropertyMatchParents?: boolean;
|
|
54
|
-
excludeAllText?: boolean;
|
|
55
|
-
excludeNonGuideAnalytics?: boolean;
|
|
56
|
-
syntheticClicks?: {
|
|
57
|
-
elementRemoval?: boolean;
|
|
58
|
-
targetChanged?: boolean;
|
|
59
|
-
};
|
|
60
|
-
disableGlobalCSS?: boolean;
|
|
61
|
-
disableGuidePseudoStyles?: boolean;
|
|
62
|
-
disablePrefetch?: boolean;
|
|
63
|
-
enableDesignerKeyboardShortcut?: boolean;
|
|
64
|
-
enableGuideTimeout?: boolean;
|
|
65
|
-
guideSeenTimeoutLength?: number;
|
|
66
|
-
guideValidation?: boolean;
|
|
67
|
-
guides?: {
|
|
68
|
-
attachPoint?: string | Function;
|
|
69
|
-
delay?: boolean;
|
|
70
|
-
disabled?: boolean;
|
|
71
|
-
globalScripts?: any[];
|
|
72
|
-
timeout?: number;
|
|
73
|
-
tooltip?: {
|
|
74
|
-
arrowSize?: number;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
preventCodeInjection?: boolean;
|
|
78
|
-
}
|
|
79
|
-
export interface ISerializedMetadata {
|
|
80
|
-
}
|
|
81
|
-
export interface IPendo {
|
|
82
|
-
additionalApiKeys: string[];
|
|
83
|
-
apiKey: string;
|
|
84
|
-
getVersion: () => string;
|
|
85
|
-
initialize: (options: IPendoOptions) => void;
|
|
86
|
-
isReady: () => boolean;
|
|
87
|
-
teardown: () => void;
|
|
88
|
-
hideLauncher: () => void;
|
|
89
|
-
removeLauncher: () => void;
|
|
90
|
-
showLauncher: () => void;
|
|
91
|
-
toggleLauncher: () => void;
|
|
92
|
-
addDebuggingFunctions: () => void;
|
|
93
|
-
disableDebugging: () => void;
|
|
94
|
-
disableLogging: () => void;
|
|
95
|
-
enableDebugging: () => void;
|
|
96
|
-
enableLogging: () => void;
|
|
97
|
-
isDebuggingEnabled: () => void;
|
|
98
|
-
logPublic: () => void;
|
|
99
|
-
clearSession: () => void;
|
|
100
|
-
generate_unique_id: (prefix?: string) => string;
|
|
101
|
-
getAccountId: () => string | null;
|
|
102
|
-
get_account_id: () => string | null;
|
|
103
|
-
getSerializedMetadata: () => ISerializedMetadata;
|
|
104
|
-
getVisitorId: () => string;
|
|
105
|
-
get_visitor_id: () => string;
|
|
106
|
-
identify: (options: Pick<IPendoOptions, 'visitor' | 'account'> | string, accountId?: string) => void;
|
|
107
|
-
isAnonymousVisitor: (visitorId?: string) => boolean;
|
|
108
|
-
set_account_id: (newAccountId?: string) => void;
|
|
109
|
-
set_visitor_id: (newVisitorId?: string) => void;
|
|
110
|
-
updateOptions: (options: IPendoOptions) => void;
|
|
111
|
-
url: {
|
|
112
|
-
get: () => string;
|
|
113
|
-
};
|
|
114
|
-
normalizedUrl: string;
|
|
115
|
-
getCurrentUrl: () => string;
|
|
116
|
-
getNormalizedUrl: () => string;
|
|
117
|
-
pageLoad: (url: string) => void;
|
|
118
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { IPendoSettings } from './ngx-pendo.interfaces';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./ngx-pendo-id.directive";
|
|
5
|
-
import * as i2 from "./ngx-pendo-section.directive";
|
|
6
|
-
export declare class NgxPendoModule {
|
|
7
|
-
static forRoot(settings: IPendoSettings): ModuleWithProviders<NgxPendoModule>;
|
|
8
|
-
static forChild(): ModuleWithProviders<NgxPendoModule>;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPendoModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxPendoModule, never, [typeof i1.NgxPendoIdDirective, typeof i2.NgxPendoSectionDirective], [typeof i1.NgxPendoIdDirective, typeof i2.NgxPendoSectionDirective]>;
|
|
11
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<NgxPendoModule>;
|
|
12
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { IAccount, IPendo, IPendoOptions, IPendoSettings, IVisitor } from './ngx-pendo.interfaces';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class NgxPendoService {
|
|
4
|
-
private pendo;
|
|
5
|
-
private pendoIdFormatter?;
|
|
6
|
-
/**
|
|
7
|
-
* Constructor
|
|
8
|
-
*
|
|
9
|
-
* @param settings IPendoSettings
|
|
10
|
-
* @param pendo IPendo
|
|
11
|
-
*/
|
|
12
|
-
constructor(settings: IPendoSettings, pendo: IPendo);
|
|
13
|
-
/**
|
|
14
|
-
* Completely re-initialize the Agent with new options
|
|
15
|
-
*
|
|
16
|
-
* @param optionsOrVisitor IPendoOptions | IVisitor
|
|
17
|
-
* @param account IAccount
|
|
18
|
-
*/
|
|
19
|
-
initialize(options: IPendoOptions): void;
|
|
20
|
-
initialize(visitor: IVisitor, account?: IAccount): void;
|
|
21
|
-
/**
|
|
22
|
-
* Send an identify event and a meta event.
|
|
23
|
-
*
|
|
24
|
-
* @param visitor IVisitor | string
|
|
25
|
-
* @param account IAccount | string
|
|
26
|
-
*/
|
|
27
|
-
identify(visitor: string, account?: string): void;
|
|
28
|
-
identify(visitor: IVisitor, account?: IAccount): void;
|
|
29
|
-
/**
|
|
30
|
-
* Updates metadata object for the Pendo agent.
|
|
31
|
-
*
|
|
32
|
-
* @param options IPendoOptions
|
|
33
|
-
*/
|
|
34
|
-
updateOptions(options: IPendoOptions): void;
|
|
35
|
-
/**
|
|
36
|
-
* Format Pendo
|
|
37
|
-
*
|
|
38
|
-
* @param ids string[]
|
|
39
|
-
*/
|
|
40
|
-
formatPendoId(...ids: string[]): string;
|
|
41
|
-
/**
|
|
42
|
-
* Shuts down the agent and cleans up all timers and listeners.
|
|
43
|
-
*/
|
|
44
|
-
teardown(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Checks if a given visitor id string is anonymous.
|
|
47
|
-
* If no argument is given, calls with pendo.getVisitorId() to check current visitor status.
|
|
48
|
-
*/
|
|
49
|
-
isAnonymousVisitor(visitorId?: string): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Removes current visitor id and account id.
|
|
52
|
-
* Triggers an identify event and reloads with a new anonymous visitor.
|
|
53
|
-
*/
|
|
54
|
-
clearSession(): void;
|
|
55
|
-
/**
|
|
56
|
-
* Loads Pendo Debugger and extends the global pendo object with additional functionality for debugging purposes.
|
|
57
|
-
*/
|
|
58
|
-
enableDebugging(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Removes Pendo Debugger extension.
|
|
61
|
-
*/
|
|
62
|
-
disableDebugging(): void;
|
|
63
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPendoService, never>;
|
|
64
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<NgxPendoService>;
|
|
65
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { PendoWindow } from './ngx-pendo.types';
|
|
3
|
-
import { IPendo, IPendoSettings } from './ngx-pendo.interfaces';
|
|
4
|
-
export declare const NGX_PENDO_SETTINGS_TOKEN: InjectionToken<IPendoSettings>;
|
|
5
|
-
export declare const NGX_PENDO_WINDOW: InjectionToken<PendoWindow>;
|
|
6
|
-
export declare const NGX_PENDO_CONTEXT: InjectionToken<IPendo>;
|
package/lib/ngx-pendo.types.d.ts
DELETED
package/public-api.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './lib/ngx-pendo-id.directive';
|
|
2
|
-
export * from './lib/ngx-pendo-section.directive';
|
|
3
|
-
export * from './lib/ngx-pendo.service';
|
|
4
|
-
export * from './lib/ngx-pendo.injectors';
|
|
5
|
-
export * from './lib/ngx-pendo.interfaces';
|
|
6
|
-
export * from './lib/ngx-pendo.module';
|
|
7
|
-
export * from './lib/ngx-pendo.provide';
|
|
8
|
-
export * from './lib/ngx-pendo.tokens';
|
|
9
|
-
export * from './lib/ngx-pendo.types';
|