@hubspot/local-dev-lib 0.0.4 → 0.0.6
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/api/customObjects.d.ts +7 -0
- package/api/customObjects.js +48 -0
- package/api/designManager.d.ts +13 -0
- package/api/designManager.js +21 -0
- package/api/fileManager.d.ts +5 -0
- package/api/fileManager.js +62 -0
- package/api/fileMapper.d.ts +10 -0
- package/api/fileMapper.js +104 -0
- package/api/functions.d.ts +4 -0
- package/api/functions.js +32 -0
- package/api/hubdb.d.ts +10 -0
- package/api/hubdb.js +61 -0
- package/api/lighthouseScore.d.ts +5 -0
- package/api/lighthouseScore.js +29 -0
- package/api/localDevAuth.d.ts +12 -0
- package/api/localDevAuth.js +38 -0
- package/api/marketplaceValidation.d.ts +5 -0
- package/api/marketplaceValidation.js +29 -0
- package/api/projects.d.ts +27 -0
- package/api/projects.js +126 -0
- package/api/sandboxHubs.d.ts +6 -0
- package/api/sandboxHubs.js +50 -0
- package/api/sandboxSync.d.ts +4 -0
- package/api/sandboxSync.js +35 -0
- package/api/secrets.d.ts +8 -0
- package/api/secrets.js +40 -0
- package/api/validateHubl.d.ts +2 -0
- package/api/validateHubl.js +18 -0
- package/config/CLIConfiguration.d.ts +22 -16
- package/config/CLIConfiguration.js +39 -9
- package/config/configFile.d.ts +4 -4
- package/config/configFile.js +2 -2
- package/config/configUtils.d.ts +8 -8
- package/config/config_DEPRECATED.d.ts +78 -0
- package/config/config_DEPRECATED.js +636 -0
- package/config/environment.d.ts +2 -3
- package/config/environment.js +11 -17
- package/config/index.d.ts +38 -0
- package/config/index.js +232 -0
- package/constants/api.d.ts +17 -0
- package/constants/api.js +20 -0
- package/constants/auth.d.ts +13 -0
- package/constants/auth.js +8 -1
- package/constants/config.d.ts +0 -4
- package/constants/config.js +1 -5
- package/constants/environments.d.ts +1 -0
- package/constants/environments.js +1 -0
- package/constants/extensions.d.ts +2 -0
- package/constants/extensions.js +4 -1
- package/constants/files.d.ts +16 -0
- package/constants/files.js +17 -1
- package/enums/build.d.ts +36 -0
- package/enums/build.js +39 -0
- package/enums/deploy.d.ts +11 -0
- package/enums/deploy.js +14 -0
- package/enums/project.d.ts +6 -0
- package/enums/project.js +9 -0
- package/errors/HubSpotAuthError.d.ts +8 -2
- package/errors/HubSpotAuthError.js +14 -0
- package/errors/apiErrors.d.ts +9 -0
- package/errors/apiErrors.js +182 -0
- package/errors/errors_DEPRECATED.d.ts +7 -0
- package/errors/errors_DEPRECATED.js +73 -0
- package/errors/fileSystemErrors.d.ts +1 -7
- package/errors/standardErrors.d.ts +7 -1
- package/errors/standardErrors.js +20 -23
- package/http/getAxiosConfig.d.ts +6 -0
- package/http/getAxiosConfig.js +22 -0
- package/http/index.d.ts +18 -0
- package/http/index.js +175 -0
- package/lang/en.lyaml +247 -0
- package/lib/cms/functions.d.ts +13 -0
- package/lib/cms/functions.js +181 -0
- package/lib/cms/handleFieldsJS.d.ts +2 -1
- package/lib/cms/handleFieldsJS.js +4 -3
- package/lib/cms/modules.js +3 -3
- package/lib/cms/processFieldsJs.d.ts +1 -0
- package/lib/cms/processFieldsJs.js +122 -0
- package/lib/cms/templates.d.ts +25 -0
- package/lib/cms/templates.js +62 -0
- package/lib/cms/themes.js +2 -2
- package/lib/cms/uploadFolder.d.ts +18 -0
- package/lib/cms/uploadFolder.js +182 -0
- package/lib/cms/watch.d.ts +20 -0
- package/lib/cms/watch.js +194 -0
- package/lib/customObjects.d.ts +5 -0
- package/lib/customObjects.js +36 -0
- package/lib/environment.d.ts +2 -1
- package/lib/fileMapper.d.ts +13 -0
- package/lib/fileMapper.js +322 -0
- package/lib/github.d.ts +6 -3
- package/lib/github.js +36 -27
- package/lib/gitignore.js +1 -46
- package/lib/hubdb.d.ts +16 -0
- package/lib/hubdb.js +130 -0
- package/lib/ignoreRules.d.ts +3 -0
- package/lib/ignoreRules.js +69 -0
- package/lib/logging/git.d.ts +2 -0
- package/lib/logging/git.js +54 -0
- package/lib/logging/logger.d.ts +44 -0
- package/lib/logging/logger.js +146 -0
- package/lib/logging/logs.d.ts +22 -0
- package/lib/logging/logs.js +82 -0
- package/lib/logging/table.d.ts +3 -0
- package/lib/logging/table.js +47 -0
- package/lib/oauth.d.ts +7 -0
- package/lib/oauth.js +44 -0
- package/lib/path.d.ts +2 -1
- package/lib/path.js +8 -3
- package/lib/personalAccessKey.d.ts +13 -0
- package/lib/personalAccessKey.js +135 -0
- package/lib/sandboxes.d.ts +14 -0
- package/lib/sandboxes.js +71 -0
- package/lib/trackUsage.d.ts +1 -0
- package/lib/trackUsage.js +53 -0
- package/lib/validate.d.ts +2 -0
- package/lib/validate.js +40 -0
- package/models/OAuth2Manager.d.ts +34 -0
- package/models/OAuth2Manager.js +126 -0
- package/package.json +25 -13
- package/types/Accounts.d.ts +66 -21
- package/types/Activity.d.ts +20 -0
- package/types/Activity.js +2 -0
- package/types/Api.d.ts +2 -0
- package/types/Api.js +2 -0
- package/types/Build.d.ts +41 -0
- package/types/Build.js +2 -0
- package/types/CLIOptions.d.ts +5 -0
- package/types/ComponentStructure.d.ts +20 -0
- package/types/ComponentStructure.js +2 -0
- package/types/Config.d.ts +17 -4
- package/types/Deploy.d.ts +42 -0
- package/types/Deploy.js +2 -0
- package/types/Error.d.ts +32 -7
- package/types/FileManager.d.ts +66 -0
- package/types/FileManager.js +2 -0
- package/types/Files.d.ts +33 -1
- package/types/Functions.d.ts +40 -0
- package/types/Functions.js +2 -0
- package/types/Github.d.ts +6 -0
- package/types/Http.d.ts +33 -0
- package/types/Http.js +2 -0
- package/types/Hubdb.d.ts +90 -0
- package/types/Hubdb.js +2 -0
- package/types/HublValidation.d.ts +59 -0
- package/types/HublValidation.js +2 -0
- package/types/Lighthouse.d.ts +25 -0
- package/types/Lighthouse.js +2 -0
- package/types/MarketplaceValidation.d.ts +28 -0
- package/types/MarketplaceValidation.js +2 -0
- package/types/Project.d.ts +38 -0
- package/types/Project.js +2 -0
- package/types/Sandbox.d.ts +165 -0
- package/types/Sandbox.js +2 -0
- package/types/Schemas.d.ts +42 -0
- package/types/Schemas.js +2 -0
- package/utils/{modules.d.ts → cms/modules.d.ts} +1 -1
- package/utils/{modules.js → cms/modules.js} +3 -3
- package/utils/getAccountIdentifier.d.ts +10 -0
- package/utils/getAccountIdentifier.js +40 -0
- package/utils/git.d.ts +7 -2
- package/utils/git.js +54 -7
- package/utils/lang.d.ts +4 -0
- package/utils/lang.js +9 -2
- package/utils/notify.d.ts +1 -0
- package/utils/notify.js +42 -0
- package/utils/objectUtils.d.ts +8 -0
- package/utils/objectUtils.js +33 -0
- package/constants/index.d.ts +0 -16
- package/constants/index.js +0 -12
- package/http/requestOptions.d.ts +0 -20
- package/http/requestOptions.js +0 -27
- package/lib/cms/index.d.ts +0 -10
- package/lib/cms/index.js +0 -13
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -14
- /package/utils/{fieldsJS.d.ts → cms/fieldsJS.d.ts} +0 -0
- /package/utils/{fieldsJS.js → cms/fieldsJS.js} +0 -0
package/api/projects.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cancelStagedBuild = exports.fetchDeployComponentsMetadata = exports.fetchProjectSettings = exports.getDeployStructure = exports.getDeployStatus = exports.deployProject = exports.getBuildStructure = exports.getBuildStatus = exports.fetchProjectBuilds = exports.fetchPlatformVersions = exports.deleteProject = exports.downloadProject = exports.fetchProject = exports.uploadProject = exports.createProject = exports.fetchProjects = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("../http"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const PROJECTS_API_PATH = 'dfs/v1/projects';
|
|
10
|
+
const PROJECTS_DEPLOY_API_PATH = 'dfs/deploy/v1';
|
|
11
|
+
const DEVELOPER_PROJECTS_API_PATH = 'developer/projects/v1';
|
|
12
|
+
async function fetchProjects(accountId) {
|
|
13
|
+
return http_1.default.get(accountId, {
|
|
14
|
+
url: PROJECTS_API_PATH,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.fetchProjects = fetchProjects;
|
|
18
|
+
async function createProject(accountId, name) {
|
|
19
|
+
return http_1.default.post(accountId, {
|
|
20
|
+
url: PROJECTS_API_PATH,
|
|
21
|
+
body: {
|
|
22
|
+
name,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.createProject = createProject;
|
|
27
|
+
async function uploadProject(accountId, projectName, projectFile, uploadMessage, platformVersion) {
|
|
28
|
+
const formData = {
|
|
29
|
+
file: fs_1.default.createReadStream(projectFile),
|
|
30
|
+
uploadMessage,
|
|
31
|
+
};
|
|
32
|
+
if (platformVersion) {
|
|
33
|
+
formData.platformVersion = platformVersion;
|
|
34
|
+
}
|
|
35
|
+
return http_1.default.post(accountId, {
|
|
36
|
+
url: `${PROJECTS_API_PATH}/upload/${encodeURIComponent(projectName)}`,
|
|
37
|
+
timeout: 60000,
|
|
38
|
+
formData,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.uploadProject = uploadProject;
|
|
42
|
+
async function fetchProject(accountId, projectName) {
|
|
43
|
+
return http_1.default.get(accountId, {
|
|
44
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}`,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.fetchProject = fetchProject;
|
|
48
|
+
async function downloadProject(accountId, projectName, buildId) {
|
|
49
|
+
return http_1.default.get(accountId, {
|
|
50
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/${buildId}/archive-full`,
|
|
51
|
+
encoding: null,
|
|
52
|
+
headers: { accept: 'application/zip', contentType: 'application/json' },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
exports.downloadProject = downloadProject;
|
|
56
|
+
async function deleteProject(accountId, projectName) {
|
|
57
|
+
return http_1.default.delete(accountId, {
|
|
58
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.deleteProject = deleteProject;
|
|
62
|
+
async function fetchPlatformVersions(accountId) {
|
|
63
|
+
return http_1.default.get(accountId, {
|
|
64
|
+
url: `${DEVELOPER_PROJECTS_API_PATH}/platformVersion`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.fetchPlatformVersions = fetchPlatformVersions;
|
|
68
|
+
async function fetchProjectBuilds(accountId, projectName, query) {
|
|
69
|
+
return http_1.default.get(accountId, {
|
|
70
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds`,
|
|
71
|
+
query,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
exports.fetchProjectBuilds = fetchProjectBuilds;
|
|
75
|
+
async function getBuildStatus(accountId, projectName, buildId) {
|
|
76
|
+
return http_1.default.get(accountId, {
|
|
77
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/${buildId}/status`,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.getBuildStatus = getBuildStatus;
|
|
81
|
+
async function getBuildStructure(accountId, projectName, buildId) {
|
|
82
|
+
return http_1.default.get(accountId, {
|
|
83
|
+
url: `dfs/v1/builds/by-project-name/${encodeURIComponent(projectName)}/builds/${buildId}/structure`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.getBuildStructure = getBuildStructure;
|
|
87
|
+
async function deployProject(accountId, projectName, buildId) {
|
|
88
|
+
return http_1.default.post(accountId, {
|
|
89
|
+
url: `${PROJECTS_DEPLOY_API_PATH}/deploys/queue/async`,
|
|
90
|
+
body: {
|
|
91
|
+
projectName,
|
|
92
|
+
buildId,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
exports.deployProject = deployProject;
|
|
97
|
+
async function getDeployStatus(accountId, projectName, deployId) {
|
|
98
|
+
return http_1.default.get(accountId, {
|
|
99
|
+
url: `${PROJECTS_DEPLOY_API_PATH}/deploy-status/projects/${encodeURIComponent(projectName)}/deploys/${deployId}`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.getDeployStatus = getDeployStatus;
|
|
103
|
+
async function getDeployStructure(accountId, projectName, deployId) {
|
|
104
|
+
return http_1.default.get(accountId, {
|
|
105
|
+
url: `${PROJECTS_DEPLOY_API_PATH}/deploys/by-project-name/${encodeURIComponent(projectName)}/deploys/${deployId}/structure`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.getDeployStructure = getDeployStructure;
|
|
109
|
+
async function fetchProjectSettings(accountId, projectName) {
|
|
110
|
+
return http_1.default.get(accountId, {
|
|
111
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/settings`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
exports.fetchProjectSettings = fetchProjectSettings;
|
|
115
|
+
async function fetchDeployComponentsMetadata(accountId, projectId) {
|
|
116
|
+
return http_1.default.get(accountId, {
|
|
117
|
+
url: `${PROJECTS_API_PATH}/by-id/${projectId}/deploy-components-metadata`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
exports.fetchDeployComponentsMetadata = fetchDeployComponentsMetadata;
|
|
121
|
+
async function cancelStagedBuild(accountId, projectName) {
|
|
122
|
+
return http_1.default.post(accountId, {
|
|
123
|
+
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/cancel`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
exports.cancelStagedBuild = cancelStagedBuild;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Environment } from '../types/Config';
|
|
2
|
+
import { SandboxHubData, SandboxResponse, SandboxUsageLimitsResponse } from '../types/Sandbox';
|
|
3
|
+
export declare function createSandbox(accountId: number, name: string, type: string): Promise<SandboxResponse>;
|
|
4
|
+
export declare function deleteSandbox(parentAccountId: number, sandboxAccountId: number): Promise<void>;
|
|
5
|
+
export declare function getSandboxUsageLimits(parentAccountId: number): Promise<SandboxUsageLimitsResponse>;
|
|
6
|
+
export declare function fetchSandboxHubData(accessToken: string, portalId: number, env?: Environment): Promise<SandboxHubData>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchSandboxHubData = exports.getSandboxUsageLimits = exports.deleteSandbox = exports.createSandbox = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const http_1 = __importDefault(require("../http"));
|
|
9
|
+
const getAxiosConfig_1 = require("../http/getAxiosConfig");
|
|
10
|
+
const environments_1 = require("../constants/environments");
|
|
11
|
+
const api_1 = require("../constants/api");
|
|
12
|
+
const SANDBOX_API_PATH = 'sandbox-hubs/v1';
|
|
13
|
+
const SANDBOX_API_PATH_V2 = 'sandbox-hubs/v2';
|
|
14
|
+
async function createSandbox(accountId, name, type) {
|
|
15
|
+
return http_1.default.post(accountId, {
|
|
16
|
+
body: { name, type, generatePersonalAccessKey: true },
|
|
17
|
+
timeout: api_1.SANDBOX_TIMEOUT,
|
|
18
|
+
url: SANDBOX_API_PATH_V2, // Create uses v2 for sandbox type and PAK generation support
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.createSandbox = createSandbox;
|
|
22
|
+
async function deleteSandbox(parentAccountId, sandboxAccountId) {
|
|
23
|
+
return http_1.default.delete(parentAccountId, {
|
|
24
|
+
url: `${SANDBOX_API_PATH}/${sandboxAccountId}`,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.deleteSandbox = deleteSandbox;
|
|
28
|
+
async function getSandboxUsageLimits(parentAccountId) {
|
|
29
|
+
return http_1.default.get(parentAccountId, {
|
|
30
|
+
url: `${SANDBOX_API_PATH}/parent/${parentAccountId}/usage`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.getSandboxUsageLimits = getSandboxUsageLimits;
|
|
34
|
+
async function fetchSandboxHubData(accessToken, portalId, env = environments_1.ENVIRONMENTS.PROD) {
|
|
35
|
+
const axiosConfig = (0, getAxiosConfig_1.getAxiosConfig)({
|
|
36
|
+
env,
|
|
37
|
+
url: `${SANDBOX_API_PATH}/self`,
|
|
38
|
+
params: { portalId },
|
|
39
|
+
});
|
|
40
|
+
const reqWithToken = {
|
|
41
|
+
...axiosConfig,
|
|
42
|
+
headers: {
|
|
43
|
+
...axiosConfig.headers,
|
|
44
|
+
Authorization: `Bearer ${accessToken}`,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const { data } = await (0, axios_1.default)(reqWithToken);
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
50
|
+
exports.fetchSandboxHubData = fetchSandboxHubData;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InitiateSyncResponse, Task, SyncTask, FetchTypesResponse } from '../types/Sandbox';
|
|
2
|
+
export declare function initiateSync(fromHubId: number, toHubId: number, tasks: Array<SyncTask>, sandboxHubId: number): Promise<InitiateSyncResponse>;
|
|
3
|
+
export declare function fetchTaskStatus(accountId: number, taskId: number): Promise<Task>;
|
|
4
|
+
export declare function fetchTypes(accountId: number, toHubId: number): Promise<FetchTypesResponse>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchTypes = exports.fetchTaskStatus = exports.initiateSync = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("../http"));
|
|
8
|
+
const api_1 = require("../constants/api");
|
|
9
|
+
const SANDBOXES_SYNC_API_PATH = 'sandboxes-sync/v1';
|
|
10
|
+
async function initiateSync(fromHubId, toHubId, tasks, sandboxHubId) {
|
|
11
|
+
return http_1.default.post(fromHubId, {
|
|
12
|
+
body: {
|
|
13
|
+
command: 'SYNC',
|
|
14
|
+
fromHubId,
|
|
15
|
+
toHubId,
|
|
16
|
+
sandboxHubId,
|
|
17
|
+
tasks,
|
|
18
|
+
},
|
|
19
|
+
timeout: api_1.SANDBOX_TIMEOUT,
|
|
20
|
+
url: `${SANDBOXES_SYNC_API_PATH}/tasks/initiate/async`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.initiateSync = initiateSync;
|
|
24
|
+
async function fetchTaskStatus(accountId, taskId) {
|
|
25
|
+
return http_1.default.get(accountId, {
|
|
26
|
+
url: `${SANDBOXES_SYNC_API_PATH}/tasks/${taskId}`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.fetchTaskStatus = fetchTaskStatus;
|
|
30
|
+
async function fetchTypes(accountId, toHubId) {
|
|
31
|
+
return http_1.default.get(accountId, {
|
|
32
|
+
url: `${SANDBOXES_SYNC_API_PATH}/types${toHubId ? `?toHubId=${toHubId}` : ''}`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.fetchTypes = fetchTypes;
|
package/api/secrets.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type FetchSecretsResponse = {
|
|
2
|
+
results: Array<string>;
|
|
3
|
+
};
|
|
4
|
+
export declare function addSecret(accountId: number, key: string, value: string): Promise<void>;
|
|
5
|
+
export declare function updateSecret(accountId: number, key: string, value: string): Promise<void>;
|
|
6
|
+
export declare function deleteSecret(accountId: number, key: string): Promise<void>;
|
|
7
|
+
export declare function fetchSecrets(accountId: number): Promise<FetchSecretsResponse>;
|
|
8
|
+
export {};
|
package/api/secrets.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchSecrets = exports.deleteSecret = exports.updateSecret = exports.addSecret = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("../http"));
|
|
8
|
+
const SECRETS_API_PATH = 'cms/v3/functions/secrets';
|
|
9
|
+
async function addSecret(accountId, key, value) {
|
|
10
|
+
return http_1.default.post(accountId, {
|
|
11
|
+
url: SECRETS_API_PATH,
|
|
12
|
+
body: {
|
|
13
|
+
key,
|
|
14
|
+
secret: value,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.addSecret = addSecret;
|
|
19
|
+
async function updateSecret(accountId, key, value) {
|
|
20
|
+
return http_1.default.put(accountId, {
|
|
21
|
+
url: SECRETS_API_PATH,
|
|
22
|
+
body: {
|
|
23
|
+
key,
|
|
24
|
+
secret: value,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.updateSecret = updateSecret;
|
|
29
|
+
async function deleteSecret(accountId, key) {
|
|
30
|
+
return http_1.default.delete(accountId, {
|
|
31
|
+
url: `${SECRETS_API_PATH}/${key}`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.deleteSecret = deleteSecret;
|
|
35
|
+
async function fetchSecrets(accountId) {
|
|
36
|
+
return http_1.default.get(accountId, {
|
|
37
|
+
url: `${SECRETS_API_PATH}`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.fetchSecrets = fetchSecrets;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateHubl = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("../http"));
|
|
8
|
+
const HUBL_VALIDATE_API_PATH = 'cos-rendering/v1/internal/validate';
|
|
9
|
+
async function validateHubl(accountId, sourceCode, hublValidationOptions) {
|
|
10
|
+
return http_1.default.post(accountId, {
|
|
11
|
+
url: HUBL_VALIDATE_API_PATH,
|
|
12
|
+
body: {
|
|
13
|
+
template_source: sourceCode,
|
|
14
|
+
...hublValidationOptions,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.validateHubl = validateHubl;
|
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CLIConfig_NEW, Environment } from '../types/Config';
|
|
2
|
+
import { CLIAccount_NEW, FlatAccountFields_NEW } from '../types/Accounts';
|
|
3
3
|
import { CLIOptions } from '../types/CLIOptions';
|
|
4
4
|
import { LogCallbacksArg } from '../types/LogCallbacks';
|
|
5
5
|
declare const validateLogCallbackKeys: readonly ["noConfig", "noConfigAccounts", "emptyAccountConfig", "noAccountId", "duplicateAccountIds", "duplicateAccountNames", "nameContainsSpaces"];
|
|
6
6
|
declare class CLIConfiguration {
|
|
7
7
|
options: CLIOptions;
|
|
8
8
|
useEnvConfig: boolean;
|
|
9
|
-
config:
|
|
9
|
+
config: CLIConfig_NEW | null;
|
|
10
|
+
active: boolean;
|
|
10
11
|
constructor();
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
setActive(isActive: boolean): void;
|
|
13
|
+
isActive(): boolean;
|
|
14
|
+
init(options?: CLIOptions): CLIConfig_NEW | null;
|
|
15
|
+
load(): CLIConfig_NEW | null;
|
|
13
16
|
configIsEmpty(): boolean;
|
|
14
17
|
delete(): void;
|
|
15
|
-
write(updatedConfig?:
|
|
18
|
+
write(updatedConfig?: CLIConfig_NEW): CLIConfig_NEW | null;
|
|
16
19
|
validate(logCallbacks?: LogCallbacksArg<typeof validateLogCallbackKeys>): boolean;
|
|
17
|
-
getAccount(nameOrId: string | number | undefined):
|
|
18
|
-
|
|
20
|
+
getAccount(nameOrId: string | number | undefined): CLIAccount_NEW | null;
|
|
21
|
+
isConfigFlagEnabled(flag: keyof CLIConfig_NEW, defaultValue?: boolean): boolean;
|
|
22
|
+
getAccountId(nameOrId?: string | number): number | null;
|
|
19
23
|
getDefaultAccount(): string | number | null;
|
|
20
|
-
getResolvedDefaultAccountForCWD(nameOrId: string | number):
|
|
24
|
+
getResolvedDefaultAccountForCWD(nameOrId: string | number): CLIAccount_NEW | null;
|
|
21
25
|
getConfigAccountIndex(accountId: number): number;
|
|
26
|
+
getConfigForAccount(accountId?: number): CLIAccount_NEW | null;
|
|
22
27
|
isAccountInConfig(nameOrId: string | number): boolean;
|
|
23
|
-
getAndLoadConfigIfNeeded(options?: CLIOptions):
|
|
24
|
-
getEnv(nameOrId?: string | number):
|
|
28
|
+
getAndLoadConfigIfNeeded(options?: CLIOptions): CLIConfig_NEW;
|
|
29
|
+
getEnv(nameOrId?: string | number): Environment;
|
|
25
30
|
/**
|
|
26
31
|
* @throws {Error}
|
|
27
32
|
*/
|
|
28
|
-
updateAccount(updatedAccountFields:
|
|
33
|
+
updateAccount(updatedAccountFields: Partial<FlatAccountFields_NEW>, writeUpdate?: boolean): FlatAccountFields_NEW | null;
|
|
29
34
|
/**
|
|
30
35
|
* @throws {Error}
|
|
31
36
|
*/
|
|
32
|
-
updateDefaultAccount(defaultAccount: string | number):
|
|
37
|
+
updateDefaultAccount(defaultAccount: string | number): CLIConfig_NEW | null;
|
|
33
38
|
/**
|
|
34
39
|
* @throws {Error}
|
|
35
40
|
*/
|
|
@@ -41,15 +46,16 @@ declare class CLIConfiguration {
|
|
|
41
46
|
/**
|
|
42
47
|
* @throws {Error}
|
|
43
48
|
*/
|
|
44
|
-
updateDefaultMode(defaultMode: string):
|
|
49
|
+
updateDefaultMode(defaultMode: string): CLIConfig_NEW | null;
|
|
45
50
|
/**
|
|
46
51
|
* @throws {Error}
|
|
47
52
|
*/
|
|
48
|
-
updateHttpTimeout(timeout: string):
|
|
53
|
+
updateHttpTimeout(timeout: string): CLIConfig_NEW | null;
|
|
49
54
|
/**
|
|
50
55
|
* @throws {Error}
|
|
51
56
|
*/
|
|
52
|
-
updateAllowUsageTracking(isEnabled: boolean):
|
|
57
|
+
updateAllowUsageTracking(isEnabled: boolean): CLIConfig_NEW | null;
|
|
58
|
+
isTrackingAllowed(): boolean;
|
|
53
59
|
}
|
|
54
60
|
declare const _default: CLIConfiguration;
|
|
55
61
|
export default _default;
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const logger_1 = require("../utils/logger");
|
|
4
4
|
const standardErrors_1 = require("../errors/standardErrors");
|
|
5
5
|
const environment_1 = require("./environment");
|
|
6
|
+
const environment_2 = require("../lib/environment");
|
|
6
7
|
const configFile_1 = require("./configFile");
|
|
7
8
|
const text_1 = require("../lib/text");
|
|
8
|
-
const
|
|
9
|
+
const environments_1 = require("../constants/environments");
|
|
9
10
|
const auth_1 = require("../constants/auth");
|
|
10
11
|
const config_1 = require("../constants/config");
|
|
12
|
+
const files_1 = require("../constants/files");
|
|
11
13
|
const i18nKey = 'config.cliConfiguration';
|
|
12
14
|
const validateLogCallbackKeys = [
|
|
13
15
|
'noConfig',
|
|
@@ -22,14 +24,24 @@ class CLIConfiguration {
|
|
|
22
24
|
options;
|
|
23
25
|
useEnvConfig;
|
|
24
26
|
config;
|
|
27
|
+
active;
|
|
25
28
|
constructor() {
|
|
26
29
|
this.options = {};
|
|
27
30
|
this.useEnvConfig = false;
|
|
28
31
|
this.config = null;
|
|
32
|
+
this.active = false;
|
|
33
|
+
}
|
|
34
|
+
setActive(isActive) {
|
|
35
|
+
this.active = isActive;
|
|
36
|
+
}
|
|
37
|
+
isActive() {
|
|
38
|
+
return this.active;
|
|
29
39
|
}
|
|
30
40
|
init(options = {}) {
|
|
31
41
|
this.options = options;
|
|
32
42
|
this.load();
|
|
43
|
+
this.setActive(true);
|
|
44
|
+
return this.config;
|
|
33
45
|
}
|
|
34
46
|
load() {
|
|
35
47
|
if (this.options.useEnv) {
|
|
@@ -158,6 +170,12 @@ class CLIConfiguration {
|
|
|
158
170
|
}
|
|
159
171
|
return null;
|
|
160
172
|
}
|
|
173
|
+
isConfigFlagEnabled(flag, defaultValue = false) {
|
|
174
|
+
if (this.config && typeof this.config[flag] !== 'undefined') {
|
|
175
|
+
return Boolean(this.config[flag]);
|
|
176
|
+
}
|
|
177
|
+
return defaultValue;
|
|
178
|
+
}
|
|
161
179
|
getAccountId(nameOrId) {
|
|
162
180
|
const account = this.getAccount(nameOrId);
|
|
163
181
|
return account ? account.accountId : null;
|
|
@@ -183,6 +201,13 @@ class CLIConfiguration {
|
|
|
183
201
|
? this.config.accounts.findIndex(account => account.accountId === accountId)
|
|
184
202
|
: -1;
|
|
185
203
|
}
|
|
204
|
+
getConfigForAccount(accountId) {
|
|
205
|
+
if (this.config) {
|
|
206
|
+
this.config.accounts.find(account => account.accountId === accountId) ||
|
|
207
|
+
null;
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
186
211
|
isAccountInConfig(nameOrId) {
|
|
187
212
|
return (!!this.config && this.config.accounts && !!this.getAccountId(nameOrId));
|
|
188
213
|
}
|
|
@@ -200,7 +225,7 @@ class CLIConfiguration {
|
|
|
200
225
|
if (this.config && this.config.env) {
|
|
201
226
|
return this.config.env;
|
|
202
227
|
}
|
|
203
|
-
return
|
|
228
|
+
return environments_1.ENVIRONMENTS.PROD;
|
|
204
229
|
}
|
|
205
230
|
/*
|
|
206
231
|
* Config Update Utils
|
|
@@ -218,7 +243,7 @@ class CLIConfiguration {
|
|
|
218
243
|
return null;
|
|
219
244
|
}
|
|
220
245
|
const currentAccountConfig = this.getAccount(accountId);
|
|
221
|
-
let auth;
|
|
246
|
+
let auth = {};
|
|
222
247
|
if (clientId || clientSecret || scopes || tokenInfo) {
|
|
223
248
|
auth = {
|
|
224
249
|
...(currentAccountConfig ? currentAccountConfig.auth : {}),
|
|
@@ -239,9 +264,8 @@ class CLIConfiguration {
|
|
|
239
264
|
nextAccountConfig[fieldName] = newValue;
|
|
240
265
|
}
|
|
241
266
|
}
|
|
242
|
-
const updatedEnv = (0,
|
|
243
|
-
const updatedDefaultMode = defaultMode &&
|
|
244
|
-
defaultMode.toLowerCase();
|
|
267
|
+
const updatedEnv = (0, environment_2.getValidEnv)(env || (currentAccountConfig && currentAccountConfig.env));
|
|
268
|
+
const updatedDefaultMode = defaultMode && defaultMode.toLowerCase();
|
|
245
269
|
safelyApplyUpdates('name', name);
|
|
246
270
|
safelyApplyUpdates('env', updatedEnv);
|
|
247
271
|
safelyApplyUpdates('accountId', accountId);
|
|
@@ -252,7 +276,7 @@ class CLIConfiguration {
|
|
|
252
276
|
}
|
|
253
277
|
if (typeof updatedDefaultMode !== 'undefined') {
|
|
254
278
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
255
|
-
safelyApplyUpdates('defaultMode',
|
|
279
|
+
safelyApplyUpdates('defaultMode', files_1.MODE[updatedDefaultMode]);
|
|
256
280
|
}
|
|
257
281
|
safelyApplyUpdates('personalAccessKey', personalAccessKey);
|
|
258
282
|
safelyApplyUpdates('sandboxAccountType', sandboxAccountType);
|
|
@@ -309,7 +333,7 @@ class CLIConfiguration {
|
|
|
309
333
|
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.renameAccount`, { currentName });
|
|
310
334
|
}
|
|
311
335
|
if (accountId) {
|
|
312
|
-
this.updateAccount({ accountId, name: newName });
|
|
336
|
+
this.updateAccount({ accountId, name: newName, env: this.getEnv() });
|
|
313
337
|
}
|
|
314
338
|
if (accountConfigToRename.name === this.getDefaultAccount()) {
|
|
315
339
|
this.updateDefaultAccount(newName);
|
|
@@ -346,7 +370,7 @@ class CLIConfiguration {
|
|
|
346
370
|
if (!this.config) {
|
|
347
371
|
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.noConfigLoaded`);
|
|
348
372
|
}
|
|
349
|
-
const ALL_MODES = Object.values(
|
|
373
|
+
const ALL_MODES = Object.values(files_1.MODE);
|
|
350
374
|
if (!defaultMode || !ALL_MODES.find(m => m === defaultMode)) {
|
|
351
375
|
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.updateDefaultMode`, {
|
|
352
376
|
defaultMode,
|
|
@@ -388,5 +412,11 @@ class CLIConfiguration {
|
|
|
388
412
|
this.config.allowUsageTracking = isEnabled;
|
|
389
413
|
return this.write();
|
|
390
414
|
}
|
|
415
|
+
isTrackingAllowed() {
|
|
416
|
+
if (!this.config) {
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
return this.config.allowUsageTracking !== false;
|
|
420
|
+
}
|
|
391
421
|
}
|
|
392
422
|
exports.default = new CLIConfiguration();
|
package/config/configFile.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CLIConfig_NEW } from '../types/Config';
|
|
2
2
|
export declare function getConfigFilePath(): string;
|
|
3
3
|
export declare function configFileExists(): boolean;
|
|
4
4
|
export declare function configFileIsBlank(): boolean;
|
|
@@ -10,12 +10,12 @@ export declare function readConfigFile(configPath: string): string;
|
|
|
10
10
|
/**
|
|
11
11
|
* @throws {Error}
|
|
12
12
|
*/
|
|
13
|
-
export declare function parseConfig(configSource: string):
|
|
13
|
+
export declare function parseConfig(configSource: string): CLIConfig_NEW;
|
|
14
14
|
/**
|
|
15
15
|
* @throws {Error}
|
|
16
16
|
*/
|
|
17
|
-
export declare function loadConfigFromFile():
|
|
17
|
+
export declare function loadConfigFromFile(): CLIConfig_NEW | null;
|
|
18
18
|
/**
|
|
19
19
|
* @throws {Error}
|
|
20
20
|
*/
|
|
21
|
-
export declare function writeConfigToFile(config:
|
|
21
|
+
export declare function writeConfigToFile(config: CLIConfig_NEW): void;
|
package/config/configFile.js
CHANGED
|
@@ -11,11 +11,11 @@ const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
|
11
11
|
const logger_1 = require("../utils/logger");
|
|
12
12
|
const fileSystemErrors_1 = require("../errors/fileSystemErrors");
|
|
13
13
|
const standardErrors_1 = require("../errors/standardErrors");
|
|
14
|
-
const
|
|
14
|
+
const config_1 = require("../constants/config");
|
|
15
15
|
const configUtils_1 = require("./configUtils");
|
|
16
16
|
const i18nKey = 'config.configFile';
|
|
17
17
|
function getConfigFilePath() {
|
|
18
|
-
return path_1.default.join(os_1.default.homedir(),
|
|
18
|
+
return path_1.default.join(os_1.default.homedir(), config_1.HUBSPOT_CONFIGURATION_FOLDER, config_1.HUBSPOT_CONFIGURATION_FILE);
|
|
19
19
|
}
|
|
20
20
|
exports.getConfigFilePath = getConfigFilePath;
|
|
21
21
|
function configFileExists() {
|
package/config/configUtils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AuthType,
|
|
3
|
-
export declare function getOrderedAccount(unorderedAccount:
|
|
4
|
-
export declare function getOrderedConfig(unorderedConfig:
|
|
1
|
+
import { CLIConfig_NEW, Environment } from '../types/Config';
|
|
2
|
+
import { AuthType, CLIAccount_NEW } from '../types/Accounts';
|
|
3
|
+
export declare function getOrderedAccount(unorderedAccount: CLIAccount_NEW): CLIAccount_NEW;
|
|
4
|
+
export declare function getOrderedConfig(unorderedConfig: CLIConfig_NEW): CLIConfig_NEW;
|
|
5
5
|
type PersonalAccessKeyOptions = {
|
|
6
6
|
accountId: number;
|
|
7
7
|
personalAccessKey: string;
|
|
8
|
-
env:
|
|
8
|
+
env: Environment;
|
|
9
9
|
};
|
|
10
10
|
type OAuthOptions = {
|
|
11
11
|
accountId: number;
|
|
@@ -13,12 +13,12 @@ type OAuthOptions = {
|
|
|
13
13
|
clientSecret: string;
|
|
14
14
|
refreshToken: string;
|
|
15
15
|
scopes: Array<string>;
|
|
16
|
-
env:
|
|
16
|
+
env: Environment;
|
|
17
17
|
};
|
|
18
18
|
type APIKeyOptions = {
|
|
19
19
|
accountId: number;
|
|
20
20
|
apiKey: string;
|
|
21
|
-
env:
|
|
21
|
+
env: Environment;
|
|
22
22
|
};
|
|
23
|
-
export declare function generateConfig(type: AuthType, options: PersonalAccessKeyOptions | OAuthOptions | APIKeyOptions):
|
|
23
|
+
export declare function generateConfig(type: AuthType, options: PersonalAccessKeyOptions | OAuthOptions | APIKeyOptions): CLIConfig_NEW | null;
|
|
24
24
|
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CLIConfig_DEPRECATED, Environment } from '../types/Config';
|
|
2
|
+
import { CLIAccount_DEPRECATED, FlatAccountFields_DEPRECATED } from '../types/Accounts';
|
|
3
|
+
import { Mode } from '../types/Files';
|
|
4
|
+
import { CLIOptions, WriteConfigOptions } from '../types/CLIOptions';
|
|
5
|
+
export declare const getConfig: () => CLIConfig_DEPRECATED | null;
|
|
6
|
+
export declare function setConfig(updatedConfig?: CLIConfig_DEPRECATED): CLIConfig_DEPRECATED | null;
|
|
7
|
+
export declare function getConfigAccounts(config?: CLIConfig_DEPRECATED): Array<CLIAccount_DEPRECATED> | undefined;
|
|
8
|
+
export declare function getConfigDefaultAccount(config?: CLIConfig_DEPRECATED): string | number | undefined;
|
|
9
|
+
export declare function getConfigAccountId(account: CLIAccount_DEPRECATED): number | undefined;
|
|
10
|
+
export declare function setConfigPath(path: string | null): string | null;
|
|
11
|
+
export declare function getConfigPath(path?: string | null): string | null;
|
|
12
|
+
export declare function validateConfig(): boolean;
|
|
13
|
+
export declare function accountNameExistsInConfig(name: string): boolean;
|
|
14
|
+
export declare function getOrderedAccount(unorderedAccount: CLIAccount_DEPRECATED): CLIAccount_DEPRECATED;
|
|
15
|
+
export declare function getOrderedConfig(unorderedConfig: CLIConfig_DEPRECATED): {
|
|
16
|
+
portals: CLIAccount_DEPRECATED[];
|
|
17
|
+
env?: Environment | undefined;
|
|
18
|
+
httpUseLocalhost?: boolean | undefined;
|
|
19
|
+
defaultMode: string | undefined;
|
|
20
|
+
httpTimeout: number | undefined;
|
|
21
|
+
allowUsageTracking: boolean | undefined;
|
|
22
|
+
defaultPortal?: string | number | undefined;
|
|
23
|
+
};
|
|
24
|
+
export declare function writeConfig(options?: WriteConfigOptions): void;
|
|
25
|
+
export declare function loadConfig(path?: string, options?: CLIOptions): CLIConfig_DEPRECATED | null;
|
|
26
|
+
export declare function isTrackingAllowed(): boolean;
|
|
27
|
+
export declare function getAndLoadConfigIfNeeded(options?: {}): Partial<CLIConfig_DEPRECATED>;
|
|
28
|
+
export declare function findConfig(directory: string): string | null;
|
|
29
|
+
export declare function getEnv(nameOrId: string | number): Environment;
|
|
30
|
+
export declare function getAccountConfig(accountId: number | undefined): CLIAccount_DEPRECATED | undefined;
|
|
31
|
+
export declare function getAccountId(nameOrId?: string | number): number | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* @throws {Error}
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeSandboxAccountFromConfig(nameOrId: string | number): boolean;
|
|
36
|
+
type UpdateAccountConfigOptions = Partial<FlatAccountFields_DEPRECATED> & {
|
|
37
|
+
environment?: Environment;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* @throws {Error}
|
|
41
|
+
*/
|
|
42
|
+
export declare function updateAccountConfig(configOptions: UpdateAccountConfigOptions): FlatAccountFields_DEPRECATED;
|
|
43
|
+
/**
|
|
44
|
+
* @throws {Error}
|
|
45
|
+
*/
|
|
46
|
+
export declare function updateDefaultAccount(defaultAccount: string | number): void;
|
|
47
|
+
/**
|
|
48
|
+
* @throws {Error}
|
|
49
|
+
*/
|
|
50
|
+
export declare function updateDefaultMode(defaultMode: Mode): void;
|
|
51
|
+
/**
|
|
52
|
+
* @throws {Error}
|
|
53
|
+
*/
|
|
54
|
+
export declare function updateHttpTimeout(timeout: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* @throws {Error}
|
|
57
|
+
*/
|
|
58
|
+
export declare function updateAllowUsageTracking(isEnabled: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* @throws {Error}
|
|
61
|
+
*/
|
|
62
|
+
export declare function renameAccount(currentName: string, newName: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* @throws {Error}
|
|
65
|
+
*/
|
|
66
|
+
export declare function deleteAccount(accountName: string): Promise<void>;
|
|
67
|
+
export declare function createEmptyConfigFile({ path }?: {
|
|
68
|
+
path?: string;
|
|
69
|
+
}): void;
|
|
70
|
+
export declare function deleteEmptyConfigFile(): void;
|
|
71
|
+
export declare function deleteConfigFile(): void;
|
|
72
|
+
export declare function loadConfigFromEnvironment({ useEnv, }?: {
|
|
73
|
+
useEnv?: boolean;
|
|
74
|
+
}): {
|
|
75
|
+
portals: Array<CLIAccount_DEPRECATED>;
|
|
76
|
+
} | undefined;
|
|
77
|
+
export declare function isConfigFlagEnabled(flag: keyof CLIConfig_DEPRECATED): boolean;
|
|
78
|
+
export {};
|