@enplug/sdk-dashboard 5.4.0-dev.2 → 5.4.3
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 +83 -0
- package/dist/dashboard.js +1720 -1464
- package/dist/dashboard.js.map +1 -1
- package/index.d.ts +6 -6
- package/package.json +96 -89
- package/types/account.d.ts +261 -159
- package/types/bridge/bridge-base.d.ts +21 -21
- package/types/dashboard.d.ts +371 -196
- package/types/external-types.d.ts +623 -526
- package/types/index.ts +2 -2
- package/types/internal-types.d.ts +159 -161
- package/types/sdk.d.ts +8 -8
- package/types/social.d.ts +44 -39
- package/types/utils.d.ts +5 -5
package/package.json
CHANGED
|
@@ -1,89 +1,96 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@enplug/sdk-dashboard",
|
|
3
|
-
"version": "5.4.
|
|
4
|
-
"description": "Enplug Dashboard SDK",
|
|
5
|
-
"
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rimraf dist/ && mkdirp dist",
|
|
8
|
-
"lint": "
|
|
9
|
-
"test": "karma start test/karma.conf.js",
|
|
10
|
-
"bundle": "npm run clean && webpack && npm run generateTypings",
|
|
11
|
-
"bundle:prod": "npm-run-all lint test bundle",
|
|
12
|
-
"start": "npm-run-all clean lint test",
|
|
13
|
-
"publish-dev": "npm run bundle && npm publish --tag dev",
|
|
14
|
-
"release": "npm run bundle && enplug-release-sdk",
|
|
15
|
-
"release:prod": "npm run bundle:prod && enplug-release-sdk",
|
|
16
|
-
"release:dev": "npm run bundle && enplug-release-sdk --dev",
|
|
17
|
-
"generateTypings": "tsc -d ./src/sdk.ts --declarationDir ./types --emitDeclarationOnly --allowJs"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"apps.enplug.in",
|
|
35
|
-
"apps.enplug.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"@
|
|
61
|
-
"@types/
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@enplug/sdk-dashboard",
|
|
3
|
+
"version": "5.4.3",
|
|
4
|
+
"description": "Enplug Dashboard SDK",
|
|
5
|
+
"typings": "./index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"clean": "rimraf dist/ && mkdirp dist",
|
|
8
|
+
"lint": "eslint src/ --ext .ts --ignore-pattern *.d.ts --ignore-pattern *.spec.ts",
|
|
9
|
+
"test": "karma start test/karma.conf.js",
|
|
10
|
+
"bundle": "npm run clean && webpack && npm run generateTypings",
|
|
11
|
+
"bundle:prod": "npm-run-all lint test bundle",
|
|
12
|
+
"start": "npm-run-all clean lint test",
|
|
13
|
+
"publish-dev": "npm run bundle && npm publish --tag dev",
|
|
14
|
+
"release": "npm run bundle && enplug-release-sdk",
|
|
15
|
+
"release:prod": "npm run bundle:prod && enplug-release-sdk && npm run release:docs",
|
|
16
|
+
"release:dev": "npm run bundle && enplug-release-sdk --dev",
|
|
17
|
+
"generateTypings": "tsc -d ./src/sdk.ts --declarationDir ./types --emitDeclarationOnly --allowJs",
|
|
18
|
+
"release:docs": "echo Building Enplug SDK docs... && cd ../enplug-docs && npm run release:prod"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Enplug/sdk.git"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"types/",
|
|
27
|
+
"index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"config": {
|
|
30
|
+
"destination": "sdk/v1",
|
|
31
|
+
"destinationDev": "sdk/dev",
|
|
32
|
+
"aws": {
|
|
33
|
+
"buckets": [
|
|
34
|
+
"dev-apps.enplug.in",
|
|
35
|
+
"apps.enplug.in",
|
|
36
|
+
"apps.enplug.com"
|
|
37
|
+
],
|
|
38
|
+
"s3": {
|
|
39
|
+
"cache": false,
|
|
40
|
+
"overwrite": true,
|
|
41
|
+
"region": "us-west-2",
|
|
42
|
+
"sslEnabled": true,
|
|
43
|
+
"apiVersion": "2016-05-01",
|
|
44
|
+
"params": {
|
|
45
|
+
"ACL": "public-read"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"Enplug"
|
|
52
|
+
],
|
|
53
|
+
"author": "Enplug",
|
|
54
|
+
"license": "ISC",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/Enplug/sdk/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/Enplug/sdk#readme",
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@enplug/scripts": "1.11.3",
|
|
61
|
+
"@types/jasmine": "3.5.0",
|
|
62
|
+
"@types/node": "8.10.59",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^4.28.4",
|
|
64
|
+
"@typescript-eslint/eslint-plugin-tslint": "^4.28.4",
|
|
65
|
+
"@typescript-eslint/parser": "^4.28.4",
|
|
66
|
+
"command-line-args": "4.0.7",
|
|
67
|
+
"dts-gen": "^0.6.0",
|
|
68
|
+
"es6-shim": "0.35.5",
|
|
69
|
+
"eslint": "^7.31.0",
|
|
70
|
+
"eslint-plugin-import": "^2.23.4",
|
|
71
|
+
"eslint-plugin-jsdoc": "^35.5.0",
|
|
72
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
73
|
+
"eslint-plugin-tsdoc": "^0.2.14",
|
|
74
|
+
"fs": "0.0.1-security",
|
|
75
|
+
"inquirer": "6.5.2",
|
|
76
|
+
"jasmine": "3.5.0",
|
|
77
|
+
"jasmine-core": "2.99.1",
|
|
78
|
+
"karma": "^6.3.4",
|
|
79
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
80
|
+
"karma-jasmine": "^4.0.1",
|
|
81
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
82
|
+
"karma-typescript": "^5.5.1",
|
|
83
|
+
"mkdirp": "0.5.1",
|
|
84
|
+
"npm-run-all": "4.1.5",
|
|
85
|
+
"path": "0.12.7",
|
|
86
|
+
"rimraf": "2.7.1",
|
|
87
|
+
"s3": "4.4.0",
|
|
88
|
+
"shelljs": "0.7.8",
|
|
89
|
+
"ts-loader": "6.2.1",
|
|
90
|
+
"tslint": "^6.1.3",
|
|
91
|
+
"typescript": "~4.0.0",
|
|
92
|
+
"uglifyjs-webpack-plugin": "1.3.0",
|
|
93
|
+
"webpack": "4.41.2",
|
|
94
|
+
"webpack-cli": "3.3.10"
|
|
95
|
+
}
|
|
96
|
+
}
|
package/types/account.d.ts
CHANGED
|
@@ -1,159 +1,261 @@
|
|
|
1
|
-
import { Asset, DefaultAssetLevel, DeployDialogOptions,
|
|
2
|
-
import { BridgeBase } from './bridge/bridge-base';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
* @param
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
* @param
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
*
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
1
|
+
import { Asset, DefaultAssetLevel, DeployDialogOptions, EnplugAccount, EnplugUser, FeedData, Layout, ThemeDefinition, ThemeAsset, FontDefinition, FontsApiItem, DefaultAsset, ZoningAppsResponse, ZoningConfig, AccountCustomPropertiesResponse, AccountInfoResponse } from './external-types';
|
|
2
|
+
import { BridgeBase } from './bridge/bridge-base';
|
|
3
|
+
/**
|
|
4
|
+
* Account API is a part of the Dashboard SDK used for managing assets, and other app, user and account related data.
|
|
5
|
+
* Use global `enplug.account` object to access these methods.
|
|
6
|
+
*
|
|
7
|
+
* ```typescript title="Example usage of the Account API"
|
|
8
|
+
* const assets = await enplug.account.getAssets();
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Among others, this API allows you to fetch and manipulate the assets:
|
|
12
|
+
* - {@link getAssets|`enplug.account.getAssets()`} - fetch the asset list
|
|
13
|
+
* - {@link getAssetsByIds|`enplug.account.getAssetsByIds()`} - fetch provided assets
|
|
14
|
+
* - {@link saveAsset|`enplug.account.saveAsset()`} - creates/updates an asset, can display Deploy Dialog for editing
|
|
15
|
+
* - {@link deleteAsset|`enplug.account.deleteAsset()`} - removes an asset
|
|
16
|
+
* - {@link touchAsset|`enplug.account.touchAsset()`} - marks asset as recently viewed
|
|
17
|
+
*
|
|
18
|
+
* Other useful commands:
|
|
19
|
+
* - {@link getAccount|`enplug.account.getAccount()`} - fetch current account data
|
|
20
|
+
* - {@link getUser|`enplug.account.getUser()`} - fetch current user data
|
|
21
|
+
* - {@link getThemes|`enplug.account.getThemes()`} - fetches list of themes
|
|
22
|
+
* - {@link getTheme|`enplug.account.getTheme()`} - fetches theme
|
|
23
|
+
* - {@link editTheme|`enplug.account.editTheme()`} - edits the theme
|
|
24
|
+
* - {@link deleteTheme|`enplug.account.deleteTheme()`} - deletes the theme
|
|
25
|
+
*/
|
|
26
|
+
export declare class Account {
|
|
27
|
+
private bridge;
|
|
28
|
+
/** @internal */
|
|
29
|
+
constructor(bridge: BridgeBase);
|
|
30
|
+
/**
|
|
31
|
+
* Loads all information for the current user. App instance ID,
|
|
32
|
+
* account type, token, account ID, venue ID, and environment.
|
|
33
|
+
*/
|
|
34
|
+
getAccount(): Promise<EnplugAccount>;
|
|
35
|
+
/**
|
|
36
|
+
* Loads all information for the current user.
|
|
37
|
+
*/
|
|
38
|
+
getUser(): Promise<EnplugUser>;
|
|
39
|
+
/**
|
|
40
|
+
* Loads information for the currently selected display group(s).
|
|
41
|
+
*
|
|
42
|
+
* @returns In the account context, it will return all Display Groups in the account;
|
|
43
|
+
* in the Display Group context, it will return only this group’s information.
|
|
44
|
+
*/
|
|
45
|
+
getDisplayGroups(): Promise<any[]>;
|
|
46
|
+
getSelectedDisplayId(): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Loads an array of assets for the current app instance.
|
|
49
|
+
*
|
|
50
|
+
* The list is also limited to the {@link setDisplaySelectorCallback|Display Group selector} dropdown's choice.
|
|
51
|
+
*
|
|
52
|
+
* @param T - Model of asset's value
|
|
53
|
+
*
|
|
54
|
+
* @returns Array of assets added by current app filtered by the {@link setDisplaySelectorCallback|Display Group selection} if it is set.
|
|
55
|
+
*/
|
|
56
|
+
getAssets<T>(): Promise<Array<Asset<T>>>;
|
|
57
|
+
/**
|
|
58
|
+
* Loads an array of assets by Ids.
|
|
59
|
+
*
|
|
60
|
+
* @param T - Model of asset's value
|
|
61
|
+
* @param assetsIds - An array of ids of the assets that are to be returned.
|
|
62
|
+
*
|
|
63
|
+
* @returns Resolves to an array of requested assets.
|
|
64
|
+
*/
|
|
65
|
+
getAssetsByIds<T>(assetsIds: string[]): Promise<Array<Asset<T>>>;
|
|
66
|
+
/**
|
|
67
|
+
* Loads an array of assets for a specifig app instance.
|
|
68
|
+
* Data is passed as the first param to the success callback.
|
|
69
|
+
*
|
|
70
|
+
* @param T - Model of asset's value
|
|
71
|
+
* @param appId - An id of an app.
|
|
72
|
+
*/
|
|
73
|
+
getAssetsForApp<T>(appId: string): Promise<Array<Asset<T>>>;
|
|
74
|
+
/**
|
|
75
|
+
* Loads a content-approval asset revision.
|
|
76
|
+
*
|
|
77
|
+
* @param T - Model of asset's value
|
|
78
|
+
* @param assetId - ID of an asset
|
|
79
|
+
* @param version - Version of the asset
|
|
80
|
+
*
|
|
81
|
+
* @returns Resolves to the provided revision of the asset.
|
|
82
|
+
*/
|
|
83
|
+
getAssetRevision<T>(assetId: string, version: string): Promise<Asset<T>>;
|
|
84
|
+
/**
|
|
85
|
+
* Creates an asset under the current app instance.
|
|
86
|
+
* @param assets - An array of assets to create.
|
|
87
|
+
* @param dialogOptions - An object with details about displaying the deploy dialog
|
|
88
|
+
* and its content after save.
|
|
89
|
+
*
|
|
90
|
+
* @returns Resolves to list of saved assets as they came from the server.
|
|
91
|
+
*/
|
|
92
|
+
bulkCreateAssets<T>(assets: Array<Asset<T>>, dialogOptions?: DeployDialogOptions): Promise<Array<Asset<T>>>;
|
|
93
|
+
/**
|
|
94
|
+
* Creates an asset under the current app instance.
|
|
95
|
+
* @param assets - An array of assets to deploy.
|
|
96
|
+
* @param dialogOptions - An object with details about displaying the deploy dialog
|
|
97
|
+
* and its content after save.
|
|
98
|
+
*
|
|
99
|
+
* @returns Resolves to list of saved assets as they came from the server.
|
|
100
|
+
*/
|
|
101
|
+
bulkDeployAssets<T>(assets: Array<Asset<T>>, dialogOptions?: DeployDialogOptions): Promise<Array<Asset<T>>>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates or updates an asset. Can also be used to present the Deploy Dialog for changing asset's settings,
|
|
104
|
+
* such as assigning to Display Groups or changing the scheduling.
|
|
105
|
+
*
|
|
106
|
+
* When saving a new asset (`asset.Id` not defined) it will open the Deploy Dialog.
|
|
107
|
+
*
|
|
108
|
+
* <br />
|
|
109
|
+
* *Deploy Dialog*
|
|
110
|
+
*
|
|
111
|
+
* ```typescript title="Saving the asset"
|
|
112
|
+
* const dialogOptions: DeployDialogOptions = {
|
|
113
|
+
* showSchedule: true,
|
|
114
|
+
* scheduleOptions: {
|
|
115
|
+
* showDuration: true
|
|
116
|
+
* }
|
|
117
|
+
* };
|
|
118
|
+
*
|
|
119
|
+
* const savedAsset = await enplug.account.saveAsset(asset, dialogOptions);
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* Saving an already existing asset will save it instantly without showing the Deploy Dialog.
|
|
123
|
+
*
|
|
124
|
+
* Another useful scenario is to allow the user to assign an existing asset to Display Groups or change the scheduling.
|
|
125
|
+
* To achieve this, you can force showing the Deploy Dialog for an already saved asset, by adjusting the `dialogOptions`.
|
|
126
|
+
* ```typescript title="Opening the Deploy Dialog to assign existing asset to Display Groups"
|
|
127
|
+
* const dialogOptions: DeployDialogOptions = {
|
|
128
|
+
* showDeployDialog: true, // this forces the Deploy Dialog to appear for an already saved asset
|
|
129
|
+
* showSchedule: true,
|
|
130
|
+
* scheduleOptions: {
|
|
131
|
+
* showDuration: true
|
|
132
|
+
* }
|
|
133
|
+
* };
|
|
134
|
+
*
|
|
135
|
+
* const savedAsset = await enplug.account.saveAsset(asset, dialogOptions);
|
|
136
|
+
* ```
|
|
137
|
+
* *See more: {@link DeployDialogOptions}*
|
|
138
|
+
*
|
|
139
|
+
* @param T - Model of Asset's value
|
|
140
|
+
* @param asset - An asset to save.
|
|
141
|
+
* @param dialogOptions - Used to configure the Deploy Dialog, which can be shown to
|
|
142
|
+
* assign the asset to Display Groups or modify the scheduling options.
|
|
143
|
+
*
|
|
144
|
+
* @returns Promise resolving with the saved asset.
|
|
145
|
+
*/
|
|
146
|
+
saveAsset<T>(asset: Asset<T>, dialogOptions?: DeployDialogOptions): Promise<Asset<T>>;
|
|
147
|
+
saveAssetForApp<T>(appId: string, asset: Asset<T>, dialogOptions?: DeployDialogOptions): Promise<unknown>;
|
|
148
|
+
/**
|
|
149
|
+
* This is for saving an order of assets if needed for the current app. An array of asset IDs
|
|
150
|
+
* is all that is needed, but the implementation also accepts an array of asset objects with `Id` string properties.
|
|
151
|
+
*
|
|
152
|
+
* @param T - Model of asset's value
|
|
153
|
+
* @param assets - An array of assetIds or assets in order which is to be saved
|
|
154
|
+
*
|
|
155
|
+
* @returns Resolves if the order was successfully updated. Rejects otherwise.
|
|
156
|
+
*/
|
|
157
|
+
updateAssetOrder<T>(assets: string[] | Array<Asset<T>>): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Deletes one or many assets under the current app instance.
|
|
160
|
+
*
|
|
161
|
+
* @param id - Id of an asset to delete. To delete multiple assets, an array of ids can be passed.
|
|
162
|
+
*
|
|
163
|
+
* @returns Resolves after successfully deleting the assets.
|
|
164
|
+
*/
|
|
165
|
+
deleteAsset(id: string | string[]): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Marks asset as recently viewed.
|
|
168
|
+
*/
|
|
169
|
+
touchAsset(id: string): Promise<any>;
|
|
170
|
+
/**
|
|
171
|
+
* Marks asset as needing approval.
|
|
172
|
+
*/
|
|
173
|
+
getAssetNeedsApproval(id: string): Promise<any>;
|
|
174
|
+
/**
|
|
175
|
+
* Loads an array of default assets for the current instance's app definition.
|
|
176
|
+
*
|
|
177
|
+
* @param T - Model of asset's value
|
|
178
|
+
* @param level - 'Default', 'Network', 'Account'
|
|
179
|
+
* @param levelId - NetworkId or AccountId
|
|
180
|
+
*
|
|
181
|
+
* @returns Resolves to an array of default assets.
|
|
182
|
+
*/
|
|
183
|
+
getDefaultAssets<T>(level?: DefaultAssetLevel, levelId?: string): Promise<Array<DefaultAsset<T>>>;
|
|
184
|
+
/**
|
|
185
|
+
* @internal
|
|
186
|
+
* Loads list of banner/ticker widget apps.
|
|
187
|
+
*/
|
|
188
|
+
getZoningApps(): Promise<ZoningAppsResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
* Loads widget assets used in a given zoning asset layout.
|
|
192
|
+
*/
|
|
193
|
+
getZoningLayoutAssets(assetId: string): Promise<Array<Asset<any>>>;
|
|
194
|
+
/**
|
|
195
|
+
* @internal
|
|
196
|
+
* Shows modal allowing to pick existing widget or create new.
|
|
197
|
+
*/
|
|
198
|
+
acquireZoningWidget(zoningAssetId: string, slotConfig: ZoningConfig, widgetAppId: string, usedAssetsIds: string[]): Promise<Asset<any>>;
|
|
199
|
+
/**
|
|
200
|
+
* @internal
|
|
201
|
+
* Fetches zoning data available after adding/editing a widget.
|
|
202
|
+
*/
|
|
203
|
+
editZoningWidget(zoningAssetId: string, slotConfig: ZoningConfig, widgetAppId: string, widgetAssetId: string): Promise<any>;
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
* Fetches zoning data available after adding/editing a widget.
|
|
207
|
+
*/
|
|
208
|
+
getZoningData(): Promise<any>;
|
|
209
|
+
/**
|
|
210
|
+
* Loads the list of available fonts for the current app or for specified appId.
|
|
211
|
+
*
|
|
212
|
+
* ```typescript title="Loading the list of fonts"
|
|
213
|
+
* const { fonts } = await enplug.account.getFonts();
|
|
214
|
+
* console.log('List of available fonts', fonts);
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @param appId - ID of app for which the font list should be fetched. If not provided, the fonts for current app will be loaded.
|
|
218
|
+
*
|
|
219
|
+
* @returns Resolves to an object: `{ fonts: FontsApiItem[] }`. See: {@link FontsApiItem}.
|
|
220
|
+
*/
|
|
221
|
+
getFonts(appId?: string): Promise<{
|
|
222
|
+
fonts: FontsApiItem[];
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Loads available themes for the current app or for specified appId.
|
|
226
|
+
*/
|
|
227
|
+
getThemes<T>(appId?: string): Promise<Array<ThemeAsset<T>>>;
|
|
228
|
+
/**
|
|
229
|
+
* Loads theme by id.
|
|
230
|
+
* @param themeId - An id of a theme
|
|
231
|
+
*/
|
|
232
|
+
getTheme<T>(id: string): Promise<ThemeAsset<T>>;
|
|
233
|
+
/**
|
|
234
|
+
* Creates a new theme under the current app instance app definition.
|
|
235
|
+
* The new theme will be available only under the current user's account.
|
|
236
|
+
* @returns callId
|
|
237
|
+
*/
|
|
238
|
+
editTheme<AssetValue, FeedType>(themeDefinition: ThemeDefinition, theme: ThemeAsset<any>, previewUrl: string, previewAsset?: Array<Asset<AssetValue>>, layout?: Layout | ZoningConfig, fonts?: FontDefinition[], feedData?: FeedData<FeedType>): Promise<ThemeAsset<AssetValue>>;
|
|
239
|
+
/**
|
|
240
|
+
* Creates a new theme under the current app definition.
|
|
241
|
+
* The new theme will be available to all users in the account.
|
|
242
|
+
*/
|
|
243
|
+
saveTheme(theme: ThemeAsset<any>): Promise<any>;
|
|
244
|
+
/**
|
|
245
|
+
* Deletes a theme from the current user's account for
|
|
246
|
+
* the current app definition. Cannot remove default themes.
|
|
247
|
+
*/
|
|
248
|
+
deleteTheme(themeId: string): Promise<any>;
|
|
249
|
+
/**
|
|
250
|
+
* Returns flag status on account.
|
|
251
|
+
*/
|
|
252
|
+
hasFeatureFlag(flagName: string): Promise<any>;
|
|
253
|
+
/**
|
|
254
|
+
* Retrieve all custom display group properties on an account.
|
|
255
|
+
*/
|
|
256
|
+
getDisplayGroupCustomProperties(): Promise<AccountCustomPropertiesResponse[]>;
|
|
257
|
+
/**
|
|
258
|
+
* Returns account info such as network type and billing
|
|
259
|
+
*/
|
|
260
|
+
loadAccount(): Promise<AccountInfoResponse>;
|
|
261
|
+
}
|