@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.
- package/RuntimeConfiguration.d.ts +4 -0
- package/appapi.d.ts +0 -1
- package/appapi.js +0 -1
- package/appapi.js.map +1 -1
- package/build/preBuild.js +14 -0
- package/capabilityapi.d.ts +2 -2
- package/capabilityapi.js +2 -2
- package/capabilityapi.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/enums/appapi.appids.md +14 -7
- package/docs/enums/capabilityapi.capabilityids.md +21 -0
- package/docs/enums/capabilityapi.capabilitynames.md +21 -0
- package/docs/interfaces/ims.activeproductcontext.md +13 -0
- package/docs/interfaces/ims.imsprofile.md +130 -0
- package/docs/interfaces/ims.productcontext.md +141 -0
- package/docs/interfaces/ims.projectedproductcontext.md +21 -0
- package/docs/interfaces/network.queryrequest.md +11 -0
- package/docs/interfaces/root.poller.md +56 -0
- package/docs/interfaces/root.pollerhandle.md +21 -0
- package/docs/interfaces/root.pollingconfiguration.md +28 -0
- package/docs/interfaces/root.runtimeconfiguration.md +10 -1
- package/docs/interfaces/root.useractivityemitter.md +110 -0
- package/docs/interfaces/root.useractivitymonitor.md +151 -0
- package/docs/interfaces/user.userapi.md +1 -1
- package/docs/modules/ims.md +14 -0
- package/docs/modules/root.md +5 -0
- package/docs/modules/settings.md +8 -57
- package/docs/modules/user.md +14 -0
- package/index.js +7 -0
- package/index.js.map +1 -1
- package/internal.d.ts +9 -0
- package/internal.js +3 -0
- package/internal.js.map +1 -1
- package/network.d.ts +0 -11
- package/network.js +1 -10
- package/network.js.map +1 -1
- package/package.json +5 -6
- package/src/Global.d.ts +3 -1
- package/src/Global.js.map +1 -1
- package/tests/index.test.js +5 -0
- package/tests/index.test.js.map +1 -1
- package/tests/version.test.d.ts +1 -0
- package/tests/version.test.js +23 -0
- package/tests/version.test.js.map +1 -0
- package/user.d.ts +10 -1
- package/user.js.map +1 -1
- package/{settings/SettingsLevel.ts → version.d.ts} +2 -20
- package/{metrics/Level.ts → version.js} +6 -20
- package/version.js.map +1 -0
- package/RuntimeConfiguration.ts +0 -272
- package/appapi.ts +0 -140
- package/capabilityapi.ts +0 -162
- package/helpcenter.ts +0 -253
- package/ims/ImsProfile.ts +0 -57
- package/index.ts +0 -76
- package/internal.ts +0 -102
- package/metrics/Analytics.ts +0 -55
- package/metrics/Application.ts +0 -24
- package/metrics/Configuration.ts +0 -33
- package/metrics/Events.ts +0 -28
- package/metrics/History.ts +0 -36
- package/metrics/Metric.ts +0 -52
- package/metrics/Metrics.ts +0 -129
- package/metrics/RecordType.ts +0 -139
- package/metrics/User.ts +0 -30
- package/metrics.ts +0 -94
- package/network.ts +0 -568
- package/nps.ts +0 -83
- package/orgswitcher.ts +0 -109
- package/page.ts +0 -497
- package/permissions.ts +0 -103
- package/pulse.ts +0 -198
- package/session.ts +0 -116
- package/settings.ts +0 -147
- package/shell.ts +0 -107
- package/sidebar.ts +0 -208
- package/sidenav.ts +0 -287
- package/src/EventEmitter.ts +0 -44
- package/src/Global.ts +0 -109
- package/src/Runtime.ts +0 -23
- package/tests/MockRuntime.ts +0 -28
- package/tests/appapi.test.ts +0 -78
- package/tests/capabilityapi.test.ts +0 -55
- package/tests/helpCenter.test.ts +0 -80
- package/tests/index.test.ts +0 -50
- package/tests/metrics.test.ts +0 -34
- package/tests/nps.test.ts +0 -37
- package/tests/page.test.ts +0 -110
- package/tests/permissions.test.ts +0 -96
- package/tests/pulse.test.ts +0 -37
- package/tests/shell.test.ts +0 -89
- package/tests/sidenav.test.ts +0 -91
- package/tests/topbar.test.ts +0 -85
- package/tests/user.test.ts +0 -129
- package/tests/userprofile.test.ts +0 -31
- package/topbar.ts +0 -288
- package/user.ts +0 -228
- package/userprofile.ts +0 -93
package/user.ts
DELETED
|
@@ -1,228 +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
|
-
export interface IMS {
|
|
107
|
-
client_id: string;
|
|
108
|
-
scopes: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* ImsInfo encompasses all of the information associated with a given ims org.
|
|
113
|
-
*/
|
|
114
|
-
export interface IMSInfo {
|
|
115
|
-
imsOrg?: string;
|
|
116
|
-
imsOrgName?: string;
|
|
117
|
-
imsProfile?: Record<string, any>;
|
|
118
|
-
imsToken?: string;
|
|
119
|
-
locale?: string;
|
|
120
|
-
tenant?: string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface UserInfo {
|
|
124
|
-
imsInfo: IMSInfo;
|
|
125
|
-
imsOrg: string;
|
|
126
|
-
imsOrgName: string;
|
|
127
|
-
imsOrgs: {label: string; value: string}[];
|
|
128
|
-
imsToken: string;
|
|
129
|
-
imsProfile: Record<string, any>;
|
|
130
|
-
locale: string;
|
|
131
|
-
preferredLanguages: string[];
|
|
132
|
-
sandbox: Sandbox;
|
|
133
|
-
sandboxes: Array<Sandbox>;
|
|
134
|
-
subOrg: string | null;
|
|
135
|
-
tenant: string;
|
|
136
|
-
theme: 'spectrum--darkest' | 'spectrum--lightest';
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
interface UserInfoEvent {
|
|
140
|
-
'change:imsInfo': IMSInfo;
|
|
141
|
-
'change:imsOrg': string;
|
|
142
|
-
'change:imsOrgName': string;
|
|
143
|
-
'change:imsOrgs': { label: string; value: string }[];
|
|
144
|
-
'change:imsToken': string;
|
|
145
|
-
'change:imsProfile': Record<string, any>;
|
|
146
|
-
'change:locale': string;
|
|
147
|
-
'change:preferredLanguages': string[];
|
|
148
|
-
'change:sandbox': Sandbox;
|
|
149
|
-
'change:sandboxes': Array<Sandbox>;
|
|
150
|
-
'change:subOrg': string | null;
|
|
151
|
-
'change:tenant': string;
|
|
152
|
-
'change:theme': string;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface UserApi extends EventEmitter<UserInfoEvent> {
|
|
156
|
-
/**
|
|
157
|
-
* API to notify the unified shell that APIs are returning 401 and user needs to be
|
|
158
|
-
* re-authenticated.
|
|
159
|
-
*/
|
|
160
|
-
authExpired(): void;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* API to do token exchange.
|
|
164
|
-
*/
|
|
165
|
-
/**
|
|
166
|
-
* @ignore
|
|
167
|
-
*/
|
|
168
|
-
getCustomToken(ims: IMS): Promise<string>;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Gets the specified type of information about an user.
|
|
172
|
-
* @param type The type of information to get.
|
|
173
|
-
*/
|
|
174
|
-
get<T extends keyof UserInfo>(type: T): Promise<UserInfo[T]>;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Optional. When specified this URL will be invoked upon user logging out. This is useful to
|
|
178
|
-
* reduce the number of lingering sessions for solutions who have their own sessions server
|
|
179
|
-
* (in addition to IMS).
|
|
180
|
-
*/
|
|
181
|
-
logoutUrl: string | undefined;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* If language picker should be opened.
|
|
185
|
-
*/
|
|
186
|
-
showLanguagePicker: boolean | undefined;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const user = {
|
|
190
|
-
authExpired: () => {
|
|
191
|
-
return getImpl('user')().authExpired();
|
|
192
|
-
},
|
|
193
|
-
emit: (type, evt) => {
|
|
194
|
-
return getImpl('user')().emit(type, evt);
|
|
195
|
-
},
|
|
196
|
-
get: params => {
|
|
197
|
-
return getImpl('user')().get(params);
|
|
198
|
-
},
|
|
199
|
-
getCustomToken: (ims) => {
|
|
200
|
-
return getImpl('user')().getCustomToken(ims);
|
|
201
|
-
},
|
|
202
|
-
off: (type, handler) => {
|
|
203
|
-
return getImpl('user')().off(type, handler);
|
|
204
|
-
},
|
|
205
|
-
on: (type, handler) => {
|
|
206
|
-
return getImpl('user')().on(type, handler);
|
|
207
|
-
}
|
|
208
|
-
} as UserApi;
|
|
209
|
-
|
|
210
|
-
Object.defineProperty(user, 'logoutUrl', {
|
|
211
|
-
get: () => {
|
|
212
|
-
return getImpl('user')().logoutUrl;
|
|
213
|
-
},
|
|
214
|
-
set: (value) => {
|
|
215
|
-
getImpl('user')().logoutUrl = value;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
Object.defineProperty(user, 'showLanguagePicker', {
|
|
220
|
-
get: (): boolean | undefined => {
|
|
221
|
-
return getImpl('user')().showLanguagePicker;
|
|
222
|
-
},
|
|
223
|
-
set: (value: boolean) => {
|
|
224
|
-
getImpl('user')().showLanguagePicker = value;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
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;
|