@adobe/exc-app 0.2.46 → 1.0.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.
Files changed (101) hide show
  1. package/RuntimeConfiguration.d.ts +4 -0
  2. package/appapi.d.ts +1 -1
  3. package/appapi.js +1 -1
  4. package/appapi.js.map +1 -1
  5. package/build/preBuild.js +14 -0
  6. package/capabilityapi.d.ts +4 -2
  7. package/capabilityapi.js +4 -2
  8. package/capabilityapi.js.map +1 -1
  9. package/docs/README.md +1 -0
  10. package/docs/enums/appapi.appids.md +21 -7
  11. package/docs/enums/capabilityapi.capabilityids.md +28 -0
  12. package/docs/enums/capabilityapi.capabilitynames.md +28 -0
  13. package/docs/enums/network.routing.md +21 -1
  14. package/docs/interfaces/ims.activeproductcontext.md +13 -0
  15. package/docs/interfaces/ims.imsprofile.md +130 -0
  16. package/docs/interfaces/ims.productcontext.md +141 -0
  17. package/docs/interfaces/ims.projectedproductcontext.md +21 -0
  18. package/docs/interfaces/network.queryrequest.md +20 -0
  19. package/docs/interfaces/root.poller.md +56 -0
  20. package/docs/interfaces/root.pollerhandle.md +21 -0
  21. package/docs/interfaces/root.pollingconfiguration.md +28 -0
  22. package/docs/interfaces/root.runtimeconfiguration.md +10 -1
  23. package/docs/interfaces/root.useractivityemitter.md +110 -0
  24. package/docs/interfaces/root.useractivitymonitor.md +151 -0
  25. package/docs/interfaces/user.userapi.md +1 -1
  26. package/docs/modules/ims.md +14 -0
  27. package/docs/modules/network.md +7 -0
  28. package/docs/modules/root.md +5 -0
  29. package/docs/modules/settings.md +8 -57
  30. package/docs/modules/user.md +14 -0
  31. package/index.js +7 -0
  32. package/index.js.map +1 -1
  33. package/internal.d.ts +9 -0
  34. package/internal.js +3 -0
  35. package/internal.js.map +1 -1
  36. package/network.d.ts +17 -1
  37. package/network.js +11 -0
  38. package/network.js.map +1 -1
  39. package/package.json +6 -7
  40. package/src/Global.d.ts +3 -1
  41. package/src/Global.js.map +1 -1
  42. package/tests/index.test.js +5 -0
  43. package/tests/index.test.js.map +1 -1
  44. package/tests/version.test.d.ts +1 -0
  45. package/tests/version.test.js +23 -0
  46. package/tests/version.test.js.map +1 -0
  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/coverage/lcov-report/block-navigation.js +0 -79
  54. package/coverage/lcov-report/prettify.js +0 -2
  55. package/coverage/lcov-report/sorter.js +0 -170
  56. package/helpcenter.ts +0 -253
  57. package/ims/ImsProfile.ts +0 -57
  58. package/index.ts +0 -76
  59. package/internal.ts +0 -102
  60. package/metrics/Analytics.ts +0 -55
  61. package/metrics/Application.ts +0 -24
  62. package/metrics/Configuration.ts +0 -33
  63. package/metrics/Events.ts +0 -28
  64. package/metrics/History.ts +0 -36
  65. package/metrics/Metric.ts +0 -52
  66. package/metrics/Metrics.ts +0 -129
  67. package/metrics/RecordType.ts +0 -139
  68. package/metrics/User.ts +0 -30
  69. package/metrics.ts +0 -94
  70. package/network.ts +0 -554
  71. package/nps.ts +0 -83
  72. package/orgswitcher.ts +0 -109
  73. package/page.ts +0 -497
  74. package/permissions.ts +0 -103
  75. package/pulse.ts +0 -198
  76. package/session.ts +0 -116
  77. package/settings.ts +0 -147
  78. package/shell.ts +0 -107
  79. package/sidebar.ts +0 -208
  80. package/sidenav.ts +0 -287
  81. package/src/EventEmitter.ts +0 -44
  82. package/src/Global.ts +0 -109
  83. package/src/Runtime.ts +0 -23
  84. package/tests/MockRuntime.ts +0 -28
  85. package/tests/appapi.test.ts +0 -78
  86. package/tests/capabilityapi.test.ts +0 -55
  87. package/tests/helpCenter.test.ts +0 -80
  88. package/tests/index.test.ts +0 -50
  89. package/tests/metrics.test.ts +0 -34
  90. package/tests/nps.test.ts +0 -37
  91. package/tests/page.test.ts +0 -110
  92. package/tests/permissions.test.ts +0 -96
  93. package/tests/pulse.test.ts +0 -37
  94. package/tests/shell.test.ts +0 -89
  95. package/tests/sidenav.test.ts +0 -91
  96. package/tests/topbar.test.ts +0 -85
  97. package/tests/user.test.ts +0 -129
  98. package/tests/userprofile.test.ts +0 -31
  99. package/topbar.ts +0 -288
  100. package/user.ts +0 -235
  101. package/userprofile.ts +0 -93
package/user.ts DELETED
@@ -1,235 +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 to request user-specific information such as IMS organization, IMS profile, access token,
14
- * tenant, etc. It also provides solutions with other capabilities such as notifying the shell that
15
- * the session has expired and configuring a logout URL to expire custom sessions.
16
- *
17
- * ***Import:***
18
- *
19
- * ```typescript
20
- * import user from '@adobe/exc-app/user';
21
- * ```
22
- *
23
- * ***Default export:***
24
- *
25
- * [UserApi](../interfaces/user.userapi.md#interface-userapi)
26
- *
27
- * ***Usage:***
28
- *
29
- * Below is an example of how to get various attributes associated to the user:
30
- *
31
- * ```typescript
32
- * import user from '@adobe/exc-app/user';
33
- *
34
- * const [orgInfo, org, name, orgs, token, profile, locale, languages, subOrg, tenant, theme] = await Promise.all([
35
- * user.get('imsInfo'),
36
- * user.get('imsOrg'),
37
- * user.get('imsOrgName'),
38
- * user.get('imsOrgs'),
39
- * user.get('imsToken'),
40
- * user.get('imsProfile'),
41
- * user.get('locale'),
42
- * user.get('preferredLanguages'),
43
- * user.get('subOrg'),
44
- * user.get('tenant'),
45
- * user.get('theme')
46
- * ]);
47
- * ```
48
- *
49
- * ### Receiving updates
50
- *
51
- * You can also listen for updates on the requested data by listening to specific change events.
52
- *
53
- * These change events are emitted from the api that the data is requested from. For example, if a
54
- * user calls `await user.get('locale');` they must listen for the change event on
55
- * `user.on('change:locale')`. If a user calls `await user.get('imsOrg')` they must listen for the
56
- * change event on `user.on('change:imsOrg')`. Here is a more detailed example of how the promise
57
- * api and change events can be used to keep track of specific values from the config:
58
- *
59
- * ```typescript
60
- * import user from '@adobe/exc-app/user';
61
- *
62
- * constructor() {
63
- * this.state = {org: null, shell: {}};
64
- *
65
- * user.on('change:imsOrg', (org) => {
66
- * this.setState({org});
67
- * });
68
- * }
69
- *
70
- * async componentDidMount() {
71
- * const org = await user.get('imsOrg');
72
- * this.setState({org});
73
- * }
74
- * ```
75
- *
76
- * imsInfo is a special case. When listening for updates on imsInfo, the callback will receive
77
- * two arguments. The first is the entire imsInfo object. The second is an object containing only
78
- * the values that have changed (for example, an org change between an individual account and a
79
- * type2e account will cause the imsProfile to change, while an org change within the same account will not).
80
- *
81
- * ```typescript
82
- * user.on('change:imsInfo', (info, changed) => {
83
- * if ('imsProfile' in changed) {
84
- * // load information for new account
85
- * }
86
- *
87
- * this.setState({...info});
88
- * });
89
- * ```
90
- * @packageDocumentation
91
- * @module user
92
- */
93
-
94
- import EventEmitter from './src/EventEmitter';
95
- import {getImpl} from './src/Global';
96
-
97
- export interface Sandbox {
98
- isDefault: boolean;
99
- name: string;
100
- region: string;
101
- state: string;
102
- title: string;
103
- type: string;
104
- }
105
-
106
- /**
107
- * Logout URL can either be a string or an object. The object includes the URL
108
- * to be called on logout and whether this URL should be the only version of the
109
- * host in the logout list.
110
- */
111
- export type LogoutUrl = string | { distinctDomain?: boolean; url: string };
112
-
113
- export interface IMS {
114
- client_id: string;
115
- scopes: string;
116
- }
117
-
118
- /**
119
- * ImsInfo encompasses all of the information associated with a given ims org.
120
- */
121
- export interface IMSInfo {
122
- imsOrg?: string;
123
- imsOrgName?: string;
124
- imsProfile?: Record<string, any>;
125
- imsToken?: string;
126
- locale?: string;
127
- tenant?: string;
128
- }
129
-
130
- export interface UserInfo {
131
- imsInfo: IMSInfo;
132
- imsOrg: string;
133
- imsOrgName: string;
134
- imsOrgs: {label: string; value: string}[];
135
- imsToken: string;
136
- imsProfile: Record<string, any>;
137
- locale: string;
138
- preferredLanguages: string[];
139
- sandbox: Sandbox;
140
- sandboxes: Array<Sandbox>;
141
- subOrg: string | null;
142
- tenant: string;
143
- theme: 'spectrum--darkest' | 'spectrum--lightest';
144
- }
145
-
146
- interface UserInfoEvent {
147
- 'change:imsInfo': IMSInfo;
148
- 'change:imsOrg': string;
149
- 'change:imsOrgName': string;
150
- 'change:imsOrgs': { label: string; value: string }[];
151
- 'change:imsToken': string;
152
- 'change:imsProfile': Record<string, any>;
153
- 'change:locale': string;
154
- 'change:preferredLanguages': string[];
155
- 'change:sandbox': Sandbox;
156
- 'change:sandboxes': Array<Sandbox>;
157
- 'change:subOrg': string | null;
158
- 'change:tenant': string;
159
- 'change:theme': string;
160
- }
161
-
162
- export interface UserApi extends EventEmitter<UserInfoEvent> {
163
- /**
164
- * API to notify the unified shell that APIs are returning 401 and user needs to be
165
- * re-authenticated.
166
- */
167
- authExpired(): void;
168
-
169
- /**
170
- * API to do token exchange.
171
- */
172
- /**
173
- * @ignore
174
- */
175
- getCustomToken(ims: IMS): Promise<string>;
176
-
177
- /**
178
- * Gets the specified type of information about an user.
179
- * @param type The type of information to get.
180
- */
181
- get<T extends keyof UserInfo>(type: T): Promise<UserInfo[T]>;
182
-
183
- /**
184
- * Optional. When specified this URL will be invoked upon user logging out. This is useful to
185
- * reduce the number of lingering sessions for solutions who have their own sessions server
186
- * (in addition to IMS).
187
- */
188
- logoutUrl?: LogoutUrl;
189
-
190
- /**
191
- * If language picker should be opened.
192
- */
193
- showLanguagePicker: boolean | undefined;
194
- }
195
-
196
- const user = {
197
- authExpired: () => {
198
- return getImpl('user')().authExpired();
199
- },
200
- emit: (type, evt) => {
201
- return getImpl('user')().emit(type, evt);
202
- },
203
- get: params => {
204
- return getImpl('user')().get(params);
205
- },
206
- getCustomToken: (ims) => {
207
- return getImpl('user')().getCustomToken(ims);
208
- },
209
- off: (type, handler) => {
210
- return getImpl('user')().off(type, handler);
211
- },
212
- on: (type, handler) => {
213
- return getImpl('user')().on(type, handler);
214
- }
215
- } as UserApi;
216
-
217
- Object.defineProperty(user, 'logoutUrl', {
218
- get: () => {
219
- return getImpl('user')().logoutUrl;
220
- },
221
- set: (value) => {
222
- getImpl('user')().logoutUrl = value;
223
- }
224
- });
225
-
226
- Object.defineProperty(user, 'showLanguagePicker', {
227
- get: (): boolean | undefined => {
228
- return getImpl('user')().showLanguagePicker;
229
- },
230
- set: (value: boolean) => {
231
- getImpl('user')().showLanguagePicker = value;
232
- }
233
- });
234
-
235
- export default user;
package/userprofile.ts DELETED
@@ -1,93 +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 User Profile menu.
13
- *
14
- * ***Import:***
15
- *
16
- * ```typescript
17
- * import userProfile from '@adobe/exc-app/userProfile';
18
- * ```
19
- *
20
- * ***Default export:***
21
- *
22
- * [UserProfileApi](../interfaces/userprofile.userprofileapi.md#interface-userprofileapi)
23
- *
24
- * ***Usage:***
25
- *
26
- * ```typescript
27
- * import userProfile from '@adobe/exc-app/userProfile';
28
- *
29
- * userProfile.setButtons([{
30
- * callback: () => {},
31
- * id: 'button',
32
- * label: 'Button'
33
- * }]);
34
- * ```
35
- *
36
- * This configuration is a method only for solutions that need to manage alternative User Profile flows not covered by the Shell.
37
- * @packageDocumentation
38
- * @module userProfile
39
- */
40
- import {connect} from './src/Global';
41
-
42
- export interface Button {
43
- /**
44
- * Callback function to be enacted onclick.
45
- */
46
- callback: (value?: any) => void;
47
- /**
48
- * Text shown on the button.
49
- */
50
- label: string;
51
- /**
52
- * Unique identifier for the button.
53
- */
54
- id: string;
55
- }
56
-
57
- /**
58
- * A maximum of 3 buttons can be supplied.
59
- */
60
- export type ButtonArray = [] | [Button] | [Button, Button] | [Button, Button, Button];
61
-
62
- /**
63
- * Defines the user profile api.
64
- */
65
- export interface UserProfileApi {
66
- /**
67
- * Adds custom button(s) to the profile dropdown and enacts a callback onclick.
68
- * Custom user profile buttons may be reset by entering a null parameter.
69
- * A maximum of 3 custom buttons will be displayed in the User Profile popover.
70
- *
71
- * ```typescript
72
- * userProfile.setButtons([
73
- * {
74
- * callback: () => {},
75
- * label: 'Alpha',
76
- * id: 'alpha'
77
- * },
78
- * {
79
- * callback: () => {},
80
- * label: 'View My Profile',
81
- * id: 'viewprofile'
82
- * }
83
- * ]);
84
- * ```
85
- */
86
- setButtons(buttons: ButtonArray | null): void;
87
- }
88
-
89
- const userProfile = connect('userProfile', [
90
- ['setButtons', true]
91
- ]);
92
-
93
- export default userProfile;