@adobe/exc-app 0.2.45 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/RuntimeConfiguration.d.ts +4 -0
  2. package/appapi.d.ts +0 -1
  3. package/appapi.js +0 -1
  4. package/appapi.js.map +1 -1
  5. package/build/preBuild.js +14 -0
  6. package/capabilityapi.d.ts +2 -2
  7. package/capabilityapi.js +2 -2
  8. package/capabilityapi.js.map +1 -1
  9. package/docs/README.md +1 -0
  10. package/docs/enums/appapi.appids.md +14 -7
  11. package/docs/enums/capabilityapi.capabilityids.md +21 -0
  12. package/docs/enums/capabilityapi.capabilitynames.md +21 -0
  13. package/docs/interfaces/ims.activeproductcontext.md +13 -0
  14. package/docs/interfaces/ims.imsprofile.md +130 -0
  15. package/docs/interfaces/ims.productcontext.md +141 -0
  16. package/docs/interfaces/ims.projectedproductcontext.md +21 -0
  17. package/docs/interfaces/network.queryrequest.md +11 -0
  18. package/docs/interfaces/root.poller.md +56 -0
  19. package/docs/interfaces/root.pollerhandle.md +21 -0
  20. package/docs/interfaces/root.pollingconfiguration.md +28 -0
  21. package/docs/interfaces/root.runtimeconfiguration.md +10 -1
  22. package/docs/interfaces/root.useractivityemitter.md +110 -0
  23. package/docs/interfaces/root.useractivitymonitor.md +151 -0
  24. package/docs/interfaces/user.userapi.md +1 -1
  25. package/docs/modules/ims.md +14 -0
  26. package/docs/modules/root.md +5 -0
  27. package/docs/modules/settings.md +8 -57
  28. package/docs/modules/user.md +14 -0
  29. package/index.js +7 -0
  30. package/index.js.map +1 -1
  31. package/internal.d.ts +9 -0
  32. package/internal.js +3 -0
  33. package/internal.js.map +1 -1
  34. package/network.d.ts +0 -11
  35. package/network.js +1 -10
  36. package/network.js.map +1 -1
  37. package/package.json +5 -6
  38. package/src/Global.d.ts +3 -1
  39. package/src/Global.js.map +1 -1
  40. package/tests/index.test.js +5 -0
  41. package/tests/index.test.js.map +1 -1
  42. package/tests/version.test.d.ts +1 -0
  43. package/tests/version.test.js +23 -0
  44. package/tests/version.test.js.map +1 -0
  45. package/user.d.ts +10 -1
  46. package/user.js.map +1 -1
  47. package/{settings/SettingsLevel.ts → version.d.ts} +2 -20
  48. package/{metrics/Level.ts → version.js} +6 -20
  49. package/version.js.map +1 -0
  50. package/RuntimeConfiguration.ts +0 -272
  51. package/appapi.ts +0 -140
  52. package/capabilityapi.ts +0 -162
  53. package/helpcenter.ts +0 -253
  54. package/ims/ImsProfile.ts +0 -57
  55. package/index.ts +0 -76
  56. package/internal.ts +0 -102
  57. package/metrics/Analytics.ts +0 -55
  58. package/metrics/Application.ts +0 -24
  59. package/metrics/Configuration.ts +0 -33
  60. package/metrics/Events.ts +0 -28
  61. package/metrics/History.ts +0 -36
  62. package/metrics/Metric.ts +0 -52
  63. package/metrics/Metrics.ts +0 -129
  64. package/metrics/RecordType.ts +0 -139
  65. package/metrics/User.ts +0 -30
  66. package/metrics.ts +0 -94
  67. package/network.ts +0 -568
  68. package/nps.ts +0 -83
  69. package/orgswitcher.ts +0 -109
  70. package/page.ts +0 -497
  71. package/permissions.ts +0 -103
  72. package/pulse.ts +0 -198
  73. package/session.ts +0 -116
  74. package/settings.ts +0 -147
  75. package/shell.ts +0 -107
  76. package/sidebar.ts +0 -208
  77. package/sidenav.ts +0 -287
  78. package/src/EventEmitter.ts +0 -44
  79. package/src/Global.ts +0 -109
  80. package/src/Runtime.ts +0 -23
  81. package/tests/MockRuntime.ts +0 -28
  82. package/tests/appapi.test.ts +0 -78
  83. package/tests/capabilityapi.test.ts +0 -55
  84. package/tests/helpCenter.test.ts +0 -80
  85. package/tests/index.test.ts +0 -50
  86. package/tests/metrics.test.ts +0 -34
  87. package/tests/nps.test.ts +0 -37
  88. package/tests/page.test.ts +0 -110
  89. package/tests/permissions.test.ts +0 -96
  90. package/tests/pulse.test.ts +0 -37
  91. package/tests/shell.test.ts +0 -89
  92. package/tests/sidenav.test.ts +0 -91
  93. package/tests/topbar.test.ts +0 -85
  94. package/tests/user.test.ts +0 -129
  95. package/tests/userprofile.test.ts +0 -31
  96. package/topbar.ts +0 -288
  97. package/user.ts +0 -228
  98. package/userprofile.ts +0 -93
package/capabilityapi.ts DELETED
@@ -1,162 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2021 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
-
12
- /**
13
- * API to request capability icons by id (or secondarily by display name).
14
- *
15
- * ***Import:***
16
- *
17
- * ```typescript
18
- * import capabilityApi from '@adobe/exc-app/capabilityapi';
19
- * ```
20
- *
21
- * ***Default export:***
22
- *
23
- * [CapabilityApi](../interfaces/capability.capabilityapi.md#interface-capabilityapi)
24
- *
25
- * ***Usage:***
26
- * These APIs return promises, not properties, and will need to be
27
- * asynchronously loaded by calling `get`.
28
- *
29
- * ```typescript
30
- * const [home, assets, offer] = await Promise.all([
31
- * capabilityApi.get('home'),
32
- * capabilityApi.get('assets'),
33
- * capabilityApi.get('offer')
34
- * ]);
35
- *
36
- * ```
37
- *
38
- * API for fetching capability icon data.
39
- * @packageDocumentation
40
- * @module capabilityapi
41
- */
42
-
43
- import {getImpl} from './src/Global';
44
-
45
- export interface CapabilityResponse {
46
- /**
47
- * Unique key to identify the capability.
48
- */
49
- capabilityId: string;
50
- /**
51
- * A URL to fetch the capability's icon.
52
- */
53
- iconUrl: string;
54
- }
55
-
56
- // This list is dynamically generated in preBuild
57
- export enum CapabilityNames {
58
- ACCOUNTPROFILE = 'Profiles',
59
- ADMIN = 'Configurations',
60
- ALERT = 'Alerts',
61
- APPCONFIGURATIONS = 'App Configurations',
62
- APPLICATIONS = 'Applications',
63
- APPSURFACES = 'App Surfaces',
64
- ASSETS = 'Assets',
65
- CLIENTPROPERTIES = 'Tags',
66
- COMPONENTS = 'Components',
67
- DASHBOARD = 'Dashboards',
68
- DATAFLOW = 'Dataflows',
69
- DATASET = 'Datasets',
70
- DATASTREAMS = 'Datastreams',
71
- DATASTREAMSBETA = 'Datastreams (Beta)',
72
- DESTINATION = 'Destinations',
73
- HOME = 'Home',
74
- IDENTITIES = 'Identities',
75
- IDENTITY = 'Identities',
76
- JOURNEYS = 'Journeys',
77
- LANDINGPAGES = 'Landing pages',
78
- LICENSEUSAGE = 'License Usage',
79
- MESSAGES = 'Messages',
80
- MODEL = 'Models',
81
- MONITORING = 'Monitoring',
82
- NOTEBOOK = 'Notebooks',
83
- OFFER = 'Offers',
84
- OFFERACTIVITY = 'Components',
85
- POLICY = 'Policies',
86
- PRIVACYAUDIT = 'Audits',
87
- PROFILE = 'Profiles',
88
- QUERY = 'Queries',
89
- REQUEST = 'Requests',
90
- RULESPOLICIES = 'Rules & policies',
91
- SANDBOX = 'Sandboxes',
92
- SCHEMA = 'Schemas',
93
- SEGMENT = 'Segments',
94
- SERVERPROPERTIES = 'Event Forwarding',
95
- SERVICE = 'Services',
96
- SETTINGS = 'Channels',
97
- SOURCE = 'Sources',
98
- SUBSCRIPTIONS = 'Subscription list',
99
- WORKFLOW = 'Workflows'
100
- }
101
-
102
- // This list is dynamically generated in preBuild
103
- export enum CapabilityIds {
104
- ACCOUNTPROFILE = 'accountProfile',
105
- ADMIN = 'admin',
106
- ALERT = 'alert',
107
- APPCONFIGURATIONS = 'appconfigurations',
108
- APPLICATIONS = 'applications',
109
- APPSURFACES = 'appsurfaces',
110
- ASSETS = 'assets',
111
- CLIENTPROPERTIES = 'clientproperties',
112
- COMPONENTS = 'components',
113
- DASHBOARD = 'dashboard',
114
- DATAFLOW = 'dataflow',
115
- DATASET = 'dataset',
116
- DATASTREAMS = 'datastreams',
117
- DATASTREAMSBETA = 'datastreamsbeta',
118
- DESTINATION = 'destination',
119
- HOME = 'home',
120
- IDENTITIES = 'identities',
121
- IDENTITY = 'identity',
122
- JOURNEYS = 'journeys',
123
- LANDINGPAGES = 'landingPages',
124
- LICENSEUSAGE = 'licenseUsage',
125
- MESSAGES = 'messages',
126
- MODEL = 'model',
127
- MONITORING = 'monitoring',
128
- NOTEBOOK = 'notebook',
129
- OFFER = 'offer',
130
- OFFERACTIVITY = 'offeractivity',
131
- POLICY = 'policy',
132
- PRIVACYAUDIT = 'privacyAudit',
133
- PROFILE = 'profile',
134
- QUERY = 'query',
135
- REQUEST = 'request',
136
- RULESPOLICIES = 'rulesPolicies',
137
- SANDBOX = 'sandbox',
138
- SCHEMA = 'schema',
139
- SEGMENT = 'segment',
140
- SERVERPROPERTIES = 'serverproperties',
141
- SERVICE = 'service',
142
- SETTINGS = 'settings',
143
- SOURCE = 'source',
144
- SUBSCRIPTIONS = 'subscriptions',
145
- WORKFLOW = 'workflow'
146
- }
147
-
148
- export interface CapabilityApi {
149
- /**
150
- * Gets the specified icon.
151
- * @param icon The name of the capability, solution, or other to get an icon for.
152
- */
153
- get(capability: CapabilityNames | CapabilityIds): Promise<CapabilityResponse>;
154
- }
155
-
156
- const capabilityapi = {
157
- get: params => {
158
- return getImpl('capabilityApi')().get(params);
159
- }
160
- } as CapabilityApi;
161
-
162
- export default capabilityapi;
package/helpcenter.ts DELETED
@@ -1,253 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2020 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
- /**
12
- * APIs that let solutions interact with Help Center.
13
- *
14
- * ***Import:***
15
- *
16
- * ```typescript
17
- * import helpCenter from '@adobe/exc-app/helpcenter';
18
- * ```
19
- *
20
- * ***Default export:***
21
- *
22
- * [HelpCenterApi](../interfaces/helpcenter.helpcenterapi.md#interface-helpcenterapi)
23
- *
24
- * ***Usage:***
25
- *
26
- * ```typescript
27
- * import helpCenter from '@adobe/exc-app/helpcenter';
28
- *
29
- * helpCenter.config = {
30
- * resources: [
31
- * {
32
- * href: 'https://marketing.adobe.com/resources/help/en_US/home/index.html',
33
- * label: 'Help Home'
34
- * }
35
- * ]
36
- * };
37
- * ```
38
- * @packageDocumentation
39
- * @module helpCenter
40
- */
41
- import {connect} from './src/Global';
42
-
43
- export interface HelpCenterConfig {
44
- /**
45
- * Adds help links to the *featured* section of the help center.
46
- */
47
- featured?: Array<{
48
- /**
49
- * URL for the link to go to.
50
- */
51
- href: string;
52
- /**
53
- * Title for the link.
54
- */
55
- label: string;
56
- /**
57
- * Pattern to define path(s) the link can navigate to. The value is not regex but a Path-to-RegExp form.
58
- */
59
- path: string | Array<string>;
60
- }>;
61
- /**
62
- * Customizes *for you* section of the help center.
63
- */
64
- recommendations?: {
65
- /**
66
- * Used to disable feature. It is enabled by default.
67
- */
68
- enabled: boolean;
69
- /**
70
- * Help center populates "For You" content by conducting a search against Experience League based on a list of terms supplied.
71
- */
72
- terms: Array<{
73
- /**
74
- * Pattern to define path(s) the link can navigate to. Please note that the most general ones should come last.
75
- */
76
- path: string;
77
- /**
78
- * Specific term used in searching.
79
- */
80
- term: string;
81
- }>;
82
- };
83
- /**
84
- * Overrides default links present in *resources* section. Product owners are advised to supply custom resources links to ensure greater relevance.
85
- */
86
- resources?: Array<{
87
- /**
88
- * URL of the link.
89
- */
90
- href: string;
91
- /**
92
- * Title for the link.
93
- */
94
- label: string;
95
- }>;
96
- /**
97
- * If the solution wants to simulate "Frequently asked questions", it can provide them as an array of strings. These appear as the user starts typing in the Search field.
98
- */
99
- questions?: Array<string>;
100
- }
101
-
102
- export interface HelpCenterOpenConfig {
103
- /**
104
- * Configuration for Help Center fields when opened.
105
- */
106
- config?: {
107
- /**
108
- * String that prepopulates the subject field in the Help center feedback section.
109
- */
110
- subject: string;
111
- /**
112
- * Type of feedback. Only CONTEXTUAL_FEEDBACK_SUBMISSION is supported, meaning that the Help Center feedback tab will be opened.
113
- */
114
- type: 'CONTEXTUAL_FEEDBACK_SUBMISSION';
115
- };
116
- /**
117
- * Selected Help Center Tab.
118
- */
119
- selectedTab: 'feedback' | 'support';
120
- }
121
-
122
- export interface HelpCenterButtonConfig {
123
- /**
124
- * Callback function to be automatically executed on click.
125
- */
126
- callback?: (value?: any) => void;
127
- /**
128
- * ID of the string to use for handling callback.
129
- */
130
- id?: string;
131
- /**
132
- * Text of the button.
133
- */
134
- label: string;
135
- /**
136
- * Scope of the button. Options are:
137
- * 1. helpCenter: Shows as a button in the support section.
138
- * 2. helpCenterResource: Shows at the bottom of the resources section.
139
- */
140
- scope?: string;
141
- }
142
-
143
- export interface HelpCenterApiProperties {
144
- /**
145
- * Gets or sets the configuration for Help Center.
146
- *
147
- * ```typescript
148
- * helpCenter.config = {
149
- * featured: [
150
- * {
151
- * href: 'https://helpx.adobe.com/support/experience-cloud.html',
152
- * label: 'Adobe Experience Cloud Learn & Support',
153
- * path: '/:orgId?/home'
154
- * },
155
- * {
156
- * href: 'https://helpx.adobe.com/support/target.html',
157
- * label: 'Adobe Target'
158
- * }
159
- * ],
160
- * recommendations: {
161
- * enabled: true,
162
- * terms: [
163
- * {
164
- * path: '/:orgId?/analytics/home/(.*)?',
165
- * term: 'get started'
166
- * },
167
- * {
168
- * path: '/:orgId?/analytics/create',
169
- * term: 'create new'
170
- * }
171
- * ]
172
- * },
173
- * resources: [
174
- * {
175
- * href: 'https://marketing.adobe.com/resources/help/en_US/home/index.html',
176
- * label: 'Help Home'
177
- * }
178
- * ]
179
- * };
180
- * ```
181
- */
182
- config: HelpCenterConfig;
183
- }
184
-
185
- /**
186
- * Defines helpCenter-level APIs available to solutions.
187
- */
188
- export interface HelpCenterApi extends HelpCenterApiProperties {
189
- /**
190
- * Method to open the help center from within the iframe.
191
- *
192
- * ```typescript
193
- * helpCenter.open({
194
- * config: {
195
- * subject: 'Analytics'
196
- * type: 'CONTEXTUAL_FEEDBACK_SUBMISSION'
197
- * },
198
- * selectedTab: 'feedback'
199
- * });
200
- * ```
201
- */
202
- open(config?: HelpCenterOpenConfig): void;
203
-
204
- /**
205
- * Method to close the help center from within the iframe.
206
- *
207
- * ```typescript
208
- * helpCenter.close();
209
- * ```
210
- */
211
- close(): void;
212
-
213
- /**
214
- * Adds a custom button to the help center and enacts a callback onclick.
215
- * The button will be present under the support tab in help center.
216
- * The help center button may be reset by entering a null parameter.
217
- *
218
- * ```typescript
219
- * helpCenter.setButton({
220
- * callback: () => {},
221
- * label: 'Create Support Ticket'
222
- * });
223
- * ```
224
- */
225
- setButton(config: HelpCenterButtonConfig | HelpCenterButtonConfig[] | null): void;
226
-
227
- /**
228
- * Adds 1-many custom buttons to the help center and enacts a callback onclick.
229
- * Depending on the scope (helpCenter or helpCenterResource), the buttons will
230
- * be present under the support tab (helpCenter) or at the button of the
231
- * resources section on the main tab (helpCenterResource) in help center.
232
- * The help center button may be reset by entering a null parameter.
233
- *
234
- * ```typescript
235
- * helpCenter.setButtons([{
236
- * callback: () => {},
237
- * id: 'support',
238
- * label: 'Create Support Ticket',
239
- * scope: 'helpCenter'
240
- * }]);
241
- * ```
242
- */
243
- setButtons(buttons: HelpCenterButtonConfig[] | null): void;
244
- }
245
-
246
- const helpCenter = connect('helpCenter', [
247
- ['setButton', true],
248
- ['setButtons', true],
249
- ['config'],
250
- ['open', true]
251
- ]);
252
-
253
- export default helpCenter;
package/ims/ImsProfile.ts DELETED
@@ -1,57 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2021 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
-
12
- export interface ProductContext {
13
- createDts: number;
14
- geo?: string;
15
- global_company_id?: string; // dma_analytics
16
- groupid: string;
17
- ident: string;
18
- label: string;
19
- login_company?: string;
20
- migration_status?: string;
21
- modDts: number;
22
- offer_id?: string;
23
- owningEntity: string;
24
- serviceCode: string;
25
- serviceLevel: string;
26
- statusCode: string;
27
- tenant_id?: string; // dma_tartan
28
- [key: string]: any;
29
- }
30
-
31
- export interface ActiveProductContext {
32
- [serviceCode: string]: ProductContext;
33
- }
34
-
35
- export interface ProjectedProductContext {
36
- prodCtx: ProductContext
37
- }
38
-
39
- export interface ImsProfile {
40
- account_type: string;
41
- authId: string;
42
- avatar?: string;
43
- avatarSrc?: string;
44
- countryCode: string;
45
- displayName: string;
46
- email: string;
47
- emailVerified: boolean;
48
- first_name: string;
49
- job_function: string;
50
- last_name: string;
51
- name: string;
52
- preferred_languages: string[];
53
- projectedProductContext: ProjectedProductContext[];
54
- session: string;
55
- userId: string;
56
- [key: string]: any;
57
- }
package/index.ts DELETED
@@ -1,76 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2020 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
-
12
- /**
13
- * API used to integrate as solution web application with the unified shell of the Adobe Experience
14
- * Cloud.
15
- * @packageDocumentation
16
- * @preferred
17
- */
18
- import Global, {getImpl} from './src/Global';
19
- import Runtime from './src/Runtime';
20
- export type {RuntimeConfiguration} from './RuntimeConfiguration';
21
-
22
- /**
23
- * Get the runtime object which contains all unified-shell APIs.
24
- *
25
- * ***Example:***
26
- *
27
- * ```typescript
28
- * import React from 'react';
29
- * import ReactDOM from 'react-dom';
30
- * import excApp from '@adobe/exc-app';
31
- *
32
- * export class MyComponent extends React.Component {
33
- * constructor(props) {
34
- * this.runtime = excApp();
35
- * }
36
- * }
37
- * ```
38
- * @returns The runtime object.
39
- */
40
- export default function runtime(): Runtime {
41
- // Pass through first argument for backwards compatibility
42
- return getImpl('default')(arguments[0]); // eslint-disable-line prefer-rest-params
43
- }
44
-
45
- /**
46
- * Initializes a solution web application by invoking the bootstrap callback
47
- * once the runtime is ready.
48
- * 1. if the module is already defined, start to bootstrap
49
- * 2. otherwise define the global callback that will be called when runtime is ready.
50
- *
51
- * ***Example:***
52
- *
53
- * ```typescript
54
- * import React from 'react';
55
- * import ReactDOM from 'react-dom';
56
- * import runtime, {init} from '@adobe/exc-app';
57
- *
58
- * init(() => {
59
- * ReactDOM.render(<MainComponent runtime={runtime()} />, document.querySelector('#main'));
60
- * });
61
- * ```
62
- * @param bootstrap Callback used to bootstrap a solution. The runtime object is passed in as a
63
- * parameter to this callback.
64
- */
65
- export function init(bootstrap: (runtime: Runtime) => void): void {
66
- const callback = (): void => {
67
- bootstrap(runtime());
68
- };
69
- if (Global['exc-module-runtime']) {
70
- callback();
71
- } else {
72
- Global.EXC_MR_READY = callback;
73
- }
74
- }
75
-
76
- export type {Runtime};
package/internal.ts DELETED
@@ -1,102 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2020 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
-
12
- /**
13
- * Internal APIs, meant to be used by Unified Shell only.
14
- * @ignore
15
- */
16
- import {Application} from './metrics/Application';
17
- import EventEmitter from './src/EventEmitter';
18
- import {getImpl, Modules} from './src/Global';
19
- import MetricsConfiguration from './metrics/Configuration';
20
- import {Configuration as NetworkConfiguration} from './network';
21
- import User from './metrics/User';
22
-
23
- export type {Modules};
24
-
25
- export interface Poller {
26
- activeFrequency: number;
27
- hiddenFrequency?: number;
28
- name: string;
29
- inactiveFrequency: number;
30
- immediate: boolean;
31
- pollFn: () => Promise<void>;
32
- }
33
-
34
- export interface PollerHandle {
35
- handle: string;
36
- }
37
-
38
- export interface UserActivityEmitter extends EventEmitter {
39
- activityEvents: string[];
40
- }
41
-
42
- export interface PollingConfiguration {
43
- inactivityTimeoutSec?: number;
44
- pollWhileInactive?: boolean;
45
- }
46
-
47
- /**
48
- * @ignore
49
- */
50
- export interface InternalApi {
51
- addPoller(poller: Poller): Promise<PollerHandle>
52
- clearUser(version?: string): void
53
- configureMetrics(config?: MetricsConfiguration): Promise<MetricsConfiguration>;
54
- configureNetwork(config: NetworkConfiguration): void;
55
- configurePolling(config: PollingConfiguration): Promise<void>;
56
- flush(): Promise<number>;
57
- registerActivityEmitter(emitter: UserActivityEmitter): Promise<void>;
58
- removePoller(handle: PollerHandle): Promise<void>;
59
- setApplication(app: Application): void;
60
- setFilter(filterFunction: <T>(record: T) => Promise<T>): void;
61
- setUser(user: User, version?: string): void;
62
- }
63
-
64
- /**
65
- * @ignore
66
- */
67
- export class Internal {
68
- public static addPoller(poller: Poller): Promise<PollerHandle> {
69
- return getImpl('internal').addPoller(poller);
70
- }
71
- public static configureMetrics(config?: MetricsConfiguration): Promise<MetricsConfiguration> {
72
- return getImpl('internal').configureMetrics(config);
73
- }
74
- public static configureNetwork(config: NetworkConfiguration): void {
75
- return getImpl('internal').configureNetwork(config);
76
- }
77
- public static configurePolling(config: PollingConfiguration): Promise<void> {
78
- return getImpl('internal').configurePolling(config);
79
- }
80
- public static flush(): Promise<number> {
81
- return getImpl('internal').flush();
82
- }
83
- public static registerActivityEmitter(emitter: UserActivityEmitter): Promise<void> {
84
- return getImpl('internal').registerActivityEmitter(emitter);
85
- }
86
- public static removePoller(handle: PollerHandle): Promise<void> {
87
- return getImpl('internal').removePoller(handle);
88
- }
89
- public static setApplication(app: Application): void {
90
- return getImpl('internal').setApplication(app);
91
- }
92
- public static setFilter(filterFunction: <T>(record: T) => Promise<T>): void {
93
- return getImpl('internal').setFilter(filterFunction);
94
- }
95
- public static setUser(user: User, version?: string): void {
96
- return getImpl('internal').setUser(user, version);
97
- }
98
- public static clearUser(version?: string): void {
99
- return getImpl('internal').clearUser(version);
100
- }
101
- }
102
-
@@ -1,55 +0,0 @@
1
- /*************************************************************************
2
- * Copyright 2020 Adobe
3
- * All Rights Reserved.
4
- *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this file in
6
- * accordance with the terms of the Adobe license agreement accompanying
7
- * it. If you have received this file from a source other than Adobe,
8
- * then your use, modification, or distribution of it requires the prior
9
- * written permission of Adobe.
10
- **************************************************************************/
11
-
12
- /**
13
- * @packageDocumentation
14
- * @module metrics
15
- */
16
-
17
- /**
18
- * The Analytics APIs are designed to mirror the Omega APIs, enabling an Analtyics record to be
19
- * remotely stored which simulatenously captures additional context provided by the Metrics system
20
- * at the same time that window.digitalData is sent to analytics. Two use cases are supported,
21
- * described as follows.
22
- *
23
- * For applications that provide Omega launch script configuration to the
24
- * `MetricsBrowserRuntime.init()` method, the corresponding portions of the digitalData object can
25
- * be supplied to the following APIs, and the Metrics SDK will store the provided object in
26
- * `window.digitalData`, and simultaneously record the Analytics record in remote storage and call
27
- * the Omega `window._satellite.track()` method. This approach assures consistency in the data
28
- * between Omega and Metrics.
29
- */
30
- export default interface Analytics {
31
- /**
32
- * Complements the corresponding window._satellite.track() method and records an Analytics record.
33
- * @param type The type of event.
34
- * @param args Additional data to log.
35
- */
36
- track(type: 'event' | 'page' | 'user', ...args: any): void;
37
-
38
- /**
39
- * Set `window.digialData.eventData` to the specified input and record an Analytics record.
40
- * @param event The object to assign to `window.digitalData.eventData`.
41
- */
42
- trackEvent(eventData: Record<string, any>): void;
43
-
44
- /**
45
- * Set `window.digialData.pageData` to the specified input and record an Analytics record.
46
- * @param pageData The object to assign to `window.digitalData.pageData`.
47
- */
48
- trackPage(pageData: Record<string, any>): void;
49
-
50
- /**
51
- * Set `window.digialData.userData` to the specified input and record an Analytics record.
52
- * @param userData The object to assign to `window.digitalData.userData`.
53
- */
54
- trackUser(userData: Record<string, any>): void;
55
- }