@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/orgswitcher.ts DELETED
@@ -1,109 +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
- * APIs that let solutions interact with Org Switcher menu.
14
- *
15
- * ***Import:***
16
- *
17
- * ```typescript
18
- * import orgSwitcher from '@adobe/exc-app/orgswitcher';
19
- * ```
20
- *
21
- * ***Default export:***
22
- *
23
- * [OrgSwitcherApi](../interfaces/orgswitcher.orgswitcherapi.md#interface-orgswitcherapi)
24
- *
25
- * ***Usage:***
26
- *
27
- * ```typescript
28
- * orgswitcher.subOrgs = {
29
- * 'OrgId1': [
30
- * {id: '123', name: 'Sub Org 1'},
31
- * {id: '321', name:'Sub Org 2'}
32
- * ],
33
- * 'OrgId2': [
34
- * {id: '124', name: 'Sub Org 3'},
35
- * {id: '412', name:'Sub Org 4'}
36
- * ],
37
- * selectedSubOrg: {id: '123', name: 'Sub Org 1'}
38
- * };
39
- * ```
40
- * @packageDocumentation
41
- * @module orgswitcher
42
- */
43
-
44
- import {connect} from './src/Global';
45
-
46
- export interface SubOrg {
47
- /**
48
- * The ID of the sub-org.
49
- */
50
- id: string;
51
-
52
- /**
53
- * The name of the sub-org.
54
- */
55
- name: string;
56
- }
57
-
58
- export interface SelectedSubOrg {
59
- /**
60
- * The sub-org that's currently selected.
61
- */
62
- selectedSubOrg?: SubOrg;
63
- }
64
-
65
- /**
66
- * Defines the attributes of the configuration for sub-orgs.
67
- */
68
- export type SubOrgs = SelectedSubOrg & Record<string, SubOrg[]>;
69
-
70
- /**
71
- * APIs that let solutions interact with Org Switcher menu.
72
- */
73
- export interface OrgSwitcherApi {
74
- /**
75
- * Configuration to add sub-orgs (nested under their parent org) to the org switcher. In this
76
- * object, the key is the parent org that the sub orgs in the array are associated with.
77
- *
78
- * ***Example:***
79
- *
80
- * ```typescript
81
- * orgswitcher.subOrgs: {
82
- * 'OrgId1': [
83
- * {id: '123', name: 'Sub Org 1'},
84
- * {id: '321', name:'Sub Org 2'}
85
- * ],
86
- * 'OrgId2': [
87
- * {id: '124', name: 'Sub Org 3'},
88
- * {id: '412', name:'Sub Org 4'}
89
- * ],
90
- * selectedSubOrg: {id: '123', name: 'Sub Org 1'}
91
- * };
92
- * ```
93
- *
94
- * Options:
95
- * * subOrgs: Object mapping parent org ids to an array of its sub orgs with a special key for
96
- * specifying the currently selected sub org.
97
- * * id: The unique id of the sub org.
98
- * * name: The name of the sub org that will be displayed in the org switcher.
99
- * * selectedSubOrg: The current selected sub org. This goes inside of the subOrgs object as a
100
- * special key.
101
- */
102
- subOrgs: SubOrgs;
103
- }
104
-
105
- const orgSwitcher = connect('orgSwitcher', [
106
- ['subOrgs']
107
- ]);
108
-
109
- export default orgSwitcher;
package/page.ts DELETED
@@ -1,497 +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
- * APIs that let solutions interact with the main page and personalize it, e.g. setting the title,
14
- * favicon, refreshing the solution iframe, etc.
15
- *
16
- * ***Import:***
17
- *
18
- * ```typescript
19
- * import page from '@adobe/exc-app/page';
20
- * ```
21
- *
22
- * ***Default export:***
23
- *
24
- * [PageApi](../interfaces/page.pageapi.md#interface-pageapi)
25
- *
26
- * ***Usage:***
27
- *
28
- * ```typescript
29
- * import page from '@adobe/exc-app/page';
30
- *
31
- * page.title = 'Experience Cloud';
32
- *
33
- * // Show spinner while performing an async operation
34
- * page.spinner = true;
35
- * try {
36
- * await performOperation();
37
- * } finally {
38
- * page.spinner = false;
39
- * }
40
- *
41
- * // Generate a shell URL that directly opens the specified solution URL
42
- * const shellUrl = page.generateShellUrl('/relative/path');
43
- *
44
- * // Navigate to another solution
45
- * page.shellRedirect('/target');
46
- * ```
47
- * @packageDocumentation
48
- * @module page
49
- */
50
-
51
- import {connect} from './src/Global';
52
-
53
- export interface ObjectWithHref {
54
- /**
55
- * The URL of the solution page.
56
- *
57
- * ***Example:***
58
- *
59
- * ```typescript
60
- * { href: 'https://example.com/abc' }
61
- * ```
62
- */
63
- href: string;
64
- }
65
-
66
- export interface BlockNavigationOptions {
67
- /**
68
- * Set to true if org changes are the only hash location changes that should be blocked.
69
- *
70
- * ***Example:***
71
- *
72
- * ```typescript
73
- * {onOrgChangeOnly: true}
74
- * ```
75
- */
76
- onOrgChangeOnly: boolean;
77
- }
78
-
79
- export interface ObjectWithPath {
80
- /**
81
- * The relative path within the solution.
82
- *
83
- * ***Example:***
84
- *
85
- * ```typescript
86
- * {path: '/abc'}
87
- * ```
88
- */
89
- path: string;
90
- /**
91
- * Optional sandbox name to be added to URL path.
92
- *
93
- * ***Example:***
94
- *
95
- * ```typescript
96
- * {path: '/abc', sandbox: 'prod'}
97
- * ```
98
- */
99
- sandbox?: string;
100
- }
101
-
102
- export interface ShellRedirectOptions {
103
- /**
104
- * Optional boolean which specifies if the redirect requires discovery.
105
- *
106
- * ***Example:***
107
- *
108
- * ```typescript
109
- * {discovery: true}
110
- * ```
111
- */
112
- discovery?: boolean;
113
- /**
114
- * Optional boolean which specifies if the history action should be a replace
115
- * instead of a push.
116
- *
117
- * ***Example:***
118
- *
119
- * ```typescript
120
- * {replace: true}
121
- * ```
122
- */
123
- replace?: boolean;
124
- }
125
-
126
- /**
127
- * Defines the location-like object for which to get the shell URL. You can either specify a path or
128
- * an absolute URL.
129
- *
130
- * ***Example:***
131
- *
132
- * `{path: '/abc'}` or `{href: 'https://example.com/abc'}`
133
- */
134
- export type LocationLike = ObjectWithHref | ObjectWithPath;
135
-
136
- /**
137
- * Subset of page-level APIs available to solutions that are settable attributes.
138
- */
139
- export interface PageApiProperties {
140
- /**
141
- * Configuration for specifying which element should have the left margin and top margin added to it when
142
- * fullscreen overlay or modal needs to be displayed. Left margin will only be added if there is a side nav.
143
- * This should be a string with an element selector.
144
- *
145
- * ***Example:***
146
- *
147
- * ```typescript
148
- * page.appContainer = '#example'
149
- * ```
150
- */
151
- appContainer: string;
152
-
153
- /**
154
- * Gets or set the favicon for the page. If this isn't set, then the default experience cloud
155
- * favicon will be used.
156
- *
157
- * ***Example:***
158
- *
159
- * ```typescript
160
- * page.favicon = "https://img.icons8.com/color/48/000000/thumb-up.png";
161
- * ```
162
- */
163
- favicon: string;
164
-
165
- /**
166
- * Configuration to show/hide a modal with fullscreen overlay. Defaults to false.
167
- *
168
- * ***Example:***
169
- *
170
- * ```typescript
171
- * page.modal = true;
172
- * ```
173
- */
174
- modal: boolean;
175
-
176
- /**
177
- * Toggle for whether or not runtime should observe DOM changes and check the changes against
178
- * modal query selectors to automatically set modal = true. If you use this option consider adding
179
- * selectors with setModalQuerySelectors.
180
- *
181
- * ***Example:***
182
- *
183
- * ```typescript
184
- * page.modalAutoDetect = true;
185
- * ```
186
- */
187
- modalAutoDetect: boolean;
188
-
189
- /**
190
- * An array of key combinations for the shell to prevent default browser behavior on in cases
191
- * where an application performs some other action.
192
- *
193
- * ***Example:***
194
- *
195
- * ```typescript
196
- * page.preventDefaultCombos = [
197
- * {
198
- * ctrlKey: true,
199
- * key: 's'
200
- * }
201
- * ];
202
- * ```
203
- */
204
- preventDefaultCombos: {
205
- altKey?: boolean;
206
- ctrlKey?: boolean;
207
- metaKey?: boolean;
208
- shiftKey?: boolean;
209
- key: string;
210
- }[];
211
-
212
- /**
213
- * Gets or sets a value indicating whether or not to show a spinner on the page. This
214
- * configuration value is NOT used for the initial loading spinner (see Route Configuration
215
- * hideInitialSpinner for that), but can be used to dismiss it if the spinner needs to be
216
- * dismissed before a solution invokes runtime.done().
217
- *
218
- * ***Example:***
219
- *
220
- * ```typescript
221
- * page.spinner = true;
222
- * ```
223
- */
224
- spinner: boolean;
225
-
226
- /**
227
- * Gets or sets the title of the page.
228
- *
229
- * ***Example:***
230
- *
231
- * ```typescript
232
- * page.title = 'Adobe Experience Cloud';
233
- * ```
234
- */
235
- title: string;
236
-
237
- /**
238
- * Sets a message to be displayed if the user is prompted before navigating away from the page.
239
- * This will only be effective if page.blockNavigation is being used. Prompt messages should be
240
- * localized based on the current locale of the user before being set. The default value is 'Are you sure?'.
241
- *
242
- * ***Example:***
243
- *
244
- * ```typescript
245
- * page.unloadPromptMessage = 'Are you sure you want to leave?';
246
- * ```
247
- */
248
- unloadPromptMessage: string;
249
- }
250
-
251
- export interface Callback {(value?: any): void}
252
-
253
- /**
254
- * Defines page-level APIs available to solutions.
255
- */
256
- export interface PageApi extends PageApiProperties {
257
- /**
258
- * A function that listens and handles the afterPrint event.
259
- *
260
- * ```typescript
261
- * ***Example:***
262
- * page.afterPrintHandler = function () {
263
- * // Revert temporary CSS changes
264
- * };
265
- * ````
266
- * @param callback The function that results in printing.
267
- */
268
- afterPrintHandler(callback: Callback): void;
269
-
270
- /**
271
- * A function that listens and handles the beforePrint event.
272
- *
273
- * ```typescript
274
- * ***Example:***
275
- * page.beforePrintHandler = function () {
276
- * // Temporary CSS changes, like unsetting height
277
- * };
278
- * ````
279
- * @param callback The function that results in printing.
280
- */
281
- beforePrintHandler(callback: Callback): void;
282
-
283
- /**
284
- * Sometimes applications will need to block navigation away from the current page. The most common use case
285
- * for this is when a user has unsaved changes that would be lost on navigation.
286
- *
287
- * There are 3 types of navigation in unified shell that must be accounted for:
288
- * 1. User attempts to navigate in a way that will cause the browser to reload. This includes page refreshes, manual URL changes, and solution switcher clicks to a non-unified shell application.
289
- * 2. User attempts to navigate to another page hosted on unified shell via the shell. This includes workspace clicks, org changes, and solution switches to a unified shell application. Because this is only a hash history change, it does not cause a full browser reload.
290
- * 3. User attempts to navigate to another page in the current application via a link in the iframe.
291
- *
292
- * In order to prevent the first and second types of navigation, unified shell offers a `blockNavigation` function. To turn on navigation blocking, the application should set:
293
- *
294
- * ***Example:***
295
- *
296
- * ```typescript
297
- * page.blockNavigation(true);
298
- * ```
299
- * When this function is called with `true`, Unified Shell will set a `beforeUnload` handler on the page. This will block the first type of navigation. Unified Shell will also use `history.block` to block hash navigations such as org switches and workspace changes.
300
- * To handle the third type of navigation, applications must block the location change from within the iframe before it propogates to the shell. This is because unified shell won't know about the iframe navigation until after it happens.
301
- * To solve for this, solutions should `history.block` from within the iframe as well. It is important to note that only `push` location changes should be blocked. If the solution blocks all location changes, the navigation blocking prompt will be shown to the user multiple times.
302
- * When navigation blocking is no longer needed the application should set `runtime.blockNavigation(false)`.
303
- *
304
- * In special cases, a solution may want to allow workspace changes but block any other type of navigation. To enable this, the option `onOrgChangeOnly` should be passed in.
305
- *
306
- * ***Example:***
307
- *
308
- * ```
309
- * runtime.blockNavigation(true, {onOrgChangeOnly: true});
310
- * ```
311
- *
312
- * Please note that navigation blocking is currently only supported for tenanted solutions. If you would like to block navigation from a tenantless solution please contact a unified shell team member to discuss your use case.
313
- */
314
- blockNavigation(enabled: boolean, options?: BlockNavigationOptions): void;
315
-
316
- /**
317
- * Browsers do not currently allow pages within the iframe to write data to the user's clipboard.
318
- * Utilizing this method, we are able to check that the user has granted permission to write to
319
- * their clipboard and then do so.
320
- *
321
- * **Example:**
322
- *
323
- * ```typescript
324
- * page.clipboardWrite('Message to write to the clipboard');
325
- * ```
326
- * @param msg The string to write to the clipboard.
327
- */
328
- clipboardWrite(msg: string): void;
329
-
330
- /**
331
- * Tells the Shell that the Solution has loaded and is ready to be used by a user and dismisses
332
- * the initial loading spinner.
333
- *
334
- * At the earliest, done should be called after Ready event was fired to ensure accurate reporting.
335
- *
336
- * One of the main objectives of using done is to measure UX performance, it should be called after
337
- * all network activity is completed and the app is interactive - Ready for users to do their work.
338
- *
339
- * ***Example:***
340
- *
341
- * ```typescript
342
- * page.done();
343
- * ```
344
- */
345
- done(): void;
346
-
347
- /**
348
- * Method to take a relative path or full iframe URL and generate a unified shell url.
349
- *
350
- * ***Example:***
351
- *
352
- * ```typescript
353
- * // returns `https://experience.adobe.com/#/@tenant/solution/abc`
354
- * page.generateShellUrl({path: '/abc'});
355
- *
356
- * // returns `https://experience.adobe.com/#/@tenant/sname:prod/solution/abc`
357
- * page.generateShellUrl({path: '/abc', sandbox: 'prod'});
358
- *
359
- * // returns `https://experience.adobe.com/#/@tenant/solution/abc`
360
- * page.generateShellUrl({href: 'https://example.com/abc'});
361
- * ```
362
- * @param location Object with either a path and optional sandbox or href key and corresponding
363
- * value from which to generate the shell URL.
364
- * @param newApp When true generates a new url with the given location without hash values
365
- * or pathname resolutions specific to the current app.
366
- * @returns The shell URL for the specified view of the solution.
367
- */
368
- generateShellUrl(location: LocationLike, newApp?: boolean): string;
369
-
370
- /**
371
- * Get the list of selectors presently being used by modalAutoDetect.
372
- *
373
- * ***Example:***
374
- *
375
- * ```typescript
376
- * page.getModalQuerySelectors({path: '/abc'});
377
- * ```
378
- * @returns The list of selectors presently being used by modalAutoDetect.
379
- */
380
- getModalQuerySelectors(): Array<string>
381
-
382
- /**
383
- * Triggers the reload of the solution iframe. Calling this function will regenerate the iframe
384
- * source, triggering the discovery URL flow if configured.
385
- *
386
- * ***Example:***
387
- *
388
- * ```typescript
389
- * page.iframeReload();
390
- * ```
391
- * @param cacheBust Whether the reload should include a unique query param on the iframe URL to
392
- * cache bust the page. This defaults to false for SPA pipeline apps, true to other apps for
393
- * backwards compatibility purposes.
394
- */
395
- iframeReload(cacheBust?: boolean): void;
396
-
397
- /**
398
- * Replaces the application iframe with the not found page.
399
- *
400
- * ***Example:***
401
- *
402
- * ```typescript
403
- * page.notFound();
404
- * ```
405
- */
406
- notFound(): void;
407
-
408
- /**
409
- * Opens the specified URL in the shell in a new tab. This is useful in scenarios where an element
410
- * won't be an anchor or link and solution needs to open the URL.
411
- *
412
- * ***Example:***
413
- *
414
- * ```typescript
415
- * page.openInNewTab('/path');
416
- * ```
417
- * @param path The relative path within the solution.
418
- * @param newApp When true generates a new url with the given location without hash values
419
- * or pathname resolutions specific to the current app.
420
- */
421
- openInNewTab(path: string, newApp?: boolean): void;
422
-
423
- /**
424
- * A function to control printing. The callback function should call `window.print()`
425
- * at some point. It's important that the callback not be an arrow function if you
426
- * want the `window` object to be the iframe contents. Feel free to adjust your
427
- * CSS or UI before `window.print()` and reverse those changes afterwards.
428
- *
429
- * ```typescript
430
- * ***Example:***
431
- * page.print = function () {
432
- * window.print();
433
- * };
434
- * ````
435
- * @param callback The function that results in printing.
436
- */
437
- print(callback: Callback): void;
438
-
439
- /**
440
- * Set the list of selectors presently being used by modalAutoDetect. If set to an empty
441
- * array, the default selectors used by runtime will be used instead. To stop observing changes
442
- * unset modalAutoDetect. Setting additonal selectors replaces the currently set selectors, use
443
- * page.getModalQuerySelectors and append new selectors to the returned list before resetting
444
- * to modify the existing list of selectors.
445
- *
446
- * ***Example:***
447
- *
448
- * ```typescript
449
- * page.setModalQuerySelectors(['.someSpecialCaseModal', '.yourNormalModal']);
450
- * ```
451
- * @param selectors The list of selectors for modalAutoDetect to use.
452
- */
453
- setModalQuerySelectors(selectors: Array<string>): void
454
-
455
- /**
456
- * Redirects to another unified shell solution. Path should be the complete relative path of a
457
- * valid unified shell solution url (i.e. if shellRedirect is called from /target to /analytics,
458
- * the path paremeter would need to start with /analytics). Query and hash are optional.
459
- *
460
- * ***Example:***
461
- *
462
- * ```typescript
463
- * page.shellRedirect('/path?a=b#workspace');
464
- * ```
465
- * @param path Path including search and hash to a unified shell solution.
466
- * @param options Options for redirect. Options include discovery which determines if the new
467
- * location requires a discovery call and replace which determines if the history action should be
468
- * a replace or push.
469
- */
470
- shellRedirect(path: string, options?: ShellRedirectOptions): void;
471
- }
472
-
473
- const page = connect('page', [
474
- ['afterPrintHandler'],
475
- ['appContainer'],
476
- ['beforePrintHandler'],
477
- ['blockNavigation', true],
478
- ['clipboardWrite', true],
479
- ['done', true],
480
- ['generateShellUrl', true],
481
- ['getModalQuerySelectors'],
482
- ['favicon'],
483
- ['iframeReload', true],
484
- ['modal'],
485
- ['modalAutoDetect'],
486
- ['notFound', true],
487
- ['openInNewTab', true],
488
- ['preventDefaultCombos'],
489
- ['print', true],
490
- ['shellRedirect', true],
491
- ['setModalQuerySelectors'],
492
- ['spinner'],
493
- ['title'],
494
- ['unloadPromptMessage']
495
- ]);
496
-
497
- export default page;
package/permissions.ts DELETED
@@ -1,103 +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
- * APIs to get permissions for a user. An app in unified shell can consume Permissions service.
14
- *
15
- * To consume this API, add the following import to your code.
16
- *
17
- * ```typescript
18
- * import permissions from '@adobe/exc-app/permissions';
19
- * ```
20
- *
21
- * The default export is an object of type [PermissionsApi](../interfaces/_permissions_.permissionsapi.md)
22
- *
23
- * API reference: [scroll down](#index)
24
- *
25
- * ### Sample code
26
- *
27
- * ```typescript
28
- * import permissions from '@adobe/exc-app/permissions';
29
- *
30
- * const {permissions: perms} = await permissions.get({permissions: [
31
- * 'permission1',
32
- * 'permission2'
33
- * ]});
34
- * ```
35
- *
36
- * All permissions can be requested using the key '*'
37
- * ```typescript
38
- * import permissions from '@adobe/exc-app/permissions';
39
- *
40
- * const {permissions: perms} = await permissions.get({permissions: ['*']});
41
- * ```
42
- * @packageDocumentation
43
- * @module permissions
44
- */
45
-
46
- import {getImpl} from './src/Global';
47
-
48
- /**
49
- * A map of permissions in the permissions service.
50
- */
51
- export interface Permissions {
52
- [key: string]: string[];
53
- }
54
-
55
- /**
56
- * The response from the permissions service.
57
- */
58
- export interface PermissionsResponse<T extends Permissions> {
59
- /**
60
- * The map of permissions.
61
- */
62
- permissions?: T;
63
-
64
- /**
65
- * The map of resource types.
66
- */
67
- resourceTypes?: T;
68
- }
69
-
70
- /**
71
- * The input parameters for the permissions API.
72
- */
73
- export interface Parameters {
74
- /**
75
- * List of permissions to get.
76
- */
77
- permissions?: string[];
78
-
79
- /**
80
- * List of resource types to get.
81
- */
82
- resourceTypes?: string[];
83
- }
84
-
85
- /**
86
- * APIs to get permissions. An app in unified shell can consume PALM ACL service.
87
- */
88
- export interface PermissionsApi {
89
- /**
90
- * Gets permissions based on the specified parameters.
91
- * @param params Parameters used to identify permissions to retrieve.
92
- * @returns A promise for the specified permissions.
93
- */
94
- get<T extends Permissions>(params: Parameters): Promise<PermissionsResponse<T>>;
95
- }
96
-
97
- const permissions: PermissionsApi = {
98
- get: (params) => {
99
- return getImpl('permissions')().get(params);
100
- }
101
- };
102
-
103
- export default permissions;