@hubspot/cli 7.7.16-experimental.5 → 7.7.16-experimental.7
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/commands/getStarted.js +53 -6
- package/commands/project/dev/unifiedFlow.js +7 -0
- package/commands/testAccount/create.js +25 -9
- package/lang/en.d.ts +15 -9
- package/lang/en.js +12 -6
- package/lib/accountTypes.d.ts +1 -0
- package/lib/accountTypes.js +20 -9
- package/lib/app/urls.d.ts +1 -1
- package/lib/projects/localDev/AppDevModeInterface.js +1 -1
- package/package.json +3 -3
package/commands/getStarted.js
CHANGED
|
@@ -21,13 +21,18 @@ const errorHandlers_1 = require("../lib/errorHandlers");
|
|
|
21
21
|
const upload_1 = require("../lib/projects/upload");
|
|
22
22
|
const constants_1 = require("../lib/constants");
|
|
23
23
|
const config_1 = require("../lib/projects/config");
|
|
24
|
+
const dependencyManagement_1 = require("../lib/dependencyManagement");
|
|
24
25
|
const buildAndDeploy_1 = require("../lib/projects/buildAndDeploy");
|
|
25
|
-
const urls_1 = require("../lib/projects/urls");
|
|
26
26
|
const links_1 = require("../lib/links");
|
|
27
|
+
const urls_1 = require("../lib/app/urls");
|
|
28
|
+
const config_2 = require("@hubspot/local-dev-lib/config");
|
|
29
|
+
const environments_1 = require("@hubspot/local-dev-lib/constants/environments");
|
|
30
|
+
const appsDev_1 = require("@hubspot/local-dev-lib/api/appsDev");
|
|
27
31
|
exports.command = 'get-started';
|
|
28
32
|
exports.describe = undefined;
|
|
29
33
|
async function handler(args) {
|
|
30
34
|
const { derivedAccountId } = args;
|
|
35
|
+
const env = (0, config_2.getEnv)(derivedAccountId) === 'qa' ? environments_1.ENVIRONMENTS.QA : environments_1.ENVIRONMENTS.PROD;
|
|
31
36
|
// TODO: Put this in constants.ts once we have a defined place for the template before INBOUND
|
|
32
37
|
const templateSource = 'robrown-hubspot/hubspot-project-components-ua-app-objects-beta';
|
|
33
38
|
(0, usageTracking_1.trackCommandUsage)('get-started', {}, derivedAccountId);
|
|
@@ -73,7 +78,7 @@ async function handler(args) {
|
|
|
73
78
|
}
|
|
74
79
|
else {
|
|
75
80
|
logger_1.uiLogger.log(' ');
|
|
76
|
-
logger_1.uiLogger.log(en_1.commands.getStarted.
|
|
81
|
+
logger_1.uiLogger.log(en_1.commands.getStarted.logs.appSelected);
|
|
77
82
|
// 1. Fetch project templates
|
|
78
83
|
let latestRepoReleaseTag;
|
|
79
84
|
const { dest, name } = await (0, projectNameAndDestPrompt_1.projectNameAndDestPrompt)(args);
|
|
@@ -122,7 +127,44 @@ async function handler(args) {
|
|
|
122
127
|
logger_1.uiLogger.log(' ');
|
|
123
128
|
logger_1.uiLogger.log(en_1.commands.getStarted.prompts.projectCreated.description);
|
|
124
129
|
logger_1.uiLogger.log(' ');
|
|
125
|
-
// 5. Ask user if they want to
|
|
130
|
+
// 5. Install dependencies - Ask user if they want to install dependencies
|
|
131
|
+
const { shouldInstallDependencies } = await (0, promptUtils_1.promptUser)([
|
|
132
|
+
{
|
|
133
|
+
type: 'confirm',
|
|
134
|
+
name: 'shouldInstallDependencies',
|
|
135
|
+
message: en_1.commands.getStarted.prompts.installDependencies,
|
|
136
|
+
default: true,
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
139
|
+
if (shouldInstallDependencies) {
|
|
140
|
+
try {
|
|
141
|
+
// Change to the project directory to install dependencies
|
|
142
|
+
const originalCwd = process.cwd();
|
|
143
|
+
process.chdir(projectDest);
|
|
144
|
+
try {
|
|
145
|
+
await (0, dependencyManagement_1.installPackages)({});
|
|
146
|
+
logger_1.uiLogger.log(' ');
|
|
147
|
+
logger_1.uiLogger.success(en_1.commands.getStarted.logs.dependenciesInstalled);
|
|
148
|
+
logger_1.uiLogger.log(' ');
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
// Always restore the original working directory
|
|
152
|
+
process.chdir(originalCwd);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
logger_1.uiLogger.log(' ');
|
|
157
|
+
logger_1.uiLogger.error(en_1.commands.getStarted.errors.installDepsFailed);
|
|
158
|
+
console.log(err);
|
|
159
|
+
logger_1.uiLogger.log(' ');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
logger_1.uiLogger.log(' ');
|
|
164
|
+
logger_1.uiLogger.log(en_1.commands.getStarted.logs.dependenciesNotInstalled);
|
|
165
|
+
logger_1.uiLogger.log(' ');
|
|
166
|
+
}
|
|
167
|
+
// 6. Ask user if they want to upload the project
|
|
126
168
|
const { shouldUpload } = await (0, promptUtils_1.promptUser)([
|
|
127
169
|
{
|
|
128
170
|
type: 'confirm',
|
|
@@ -162,8 +204,9 @@ async function handler(args) {
|
|
|
162
204
|
(0, errorHandlers_1.debugError)(uploadError);
|
|
163
205
|
}
|
|
164
206
|
else if (result) {
|
|
165
|
-
logger_1.uiLogger.log(' ');
|
|
166
207
|
logger_1.uiLogger.success(en_1.commands.getStarted.logs.uploadSuccess);
|
|
208
|
+
const { data: { results }, } = await (0, appsDev_1.fetchPublicAppsForPortal)(derivedAccountId);
|
|
209
|
+
const lastCreatedApp = results.sort((a, b) => b.createdAt - a.createdAt)[0];
|
|
167
210
|
if (process.env.BROWSER !== 'none') {
|
|
168
211
|
logger_1.uiLogger.log(' ');
|
|
169
212
|
logger_1.uiLogger.log(en_1.commands.getStarted.developerOverviewBrowserOpenPrep);
|
|
@@ -172,11 +215,15 @@ async function handler(args) {
|
|
|
172
215
|
{
|
|
173
216
|
name: 'shouldOpenOverview',
|
|
174
217
|
type: 'confirm',
|
|
175
|
-
message: en_1.commands.getStarted.
|
|
218
|
+
message: en_1.commands.getStarted.openInstallUrl,
|
|
176
219
|
},
|
|
177
220
|
]);
|
|
178
221
|
if (shouldOpenOverview) {
|
|
179
|
-
(0, open_1.default)((0, urls_1.
|
|
222
|
+
(0, open_1.default)((0, urls_1.getStaticAuthAppInstallUrl)({
|
|
223
|
+
targetAccountId: derivedAccountId,
|
|
224
|
+
env: env,
|
|
225
|
+
appId: lastCreatedApp.id,
|
|
226
|
+
}), { url: true });
|
|
180
227
|
logger_1.uiLogger.log(' ');
|
|
181
228
|
logger_1.uiLogger.success(en_1.commands.getStarted.openedDeveloperOverview);
|
|
182
229
|
}
|
|
@@ -58,6 +58,7 @@ async function unifiedProjectDevFlow({ args, targetProjectAccountId, providedTar
|
|
|
58
58
|
}
|
|
59
59
|
const accounts = (0, config_2.getConfigAccounts)();
|
|
60
60
|
const accountIsCombined = await (0, accountTypes_1.isUnifiedAccount)(targetProjectAccountConfig);
|
|
61
|
+
const targetProjectAccountIsTestAccountOrSandbox = (0, accountTypes_1.isTestAccountOrSandbox)(targetProjectAccountConfig);
|
|
61
62
|
if (!accountIsCombined && !profileConfig) {
|
|
62
63
|
logger_1.uiLogger.error(en_1.commands.project.dev.errors.accountNotCombined);
|
|
63
64
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
@@ -67,6 +68,12 @@ async function unifiedProjectDevFlow({ args, targetProjectAccountId, providedTar
|
|
|
67
68
|
// Bypass the prompt for the testing account if the user has a profile configured
|
|
68
69
|
targetTestingAccountId = profileConfig.accountId;
|
|
69
70
|
}
|
|
71
|
+
else if (
|
|
72
|
+
// Bypass the prompt for the testing account if default account is already a test account
|
|
73
|
+
!targetTestingAccountId &&
|
|
74
|
+
targetProjectAccountIsTestAccountOrSandbox) {
|
|
75
|
+
targetTestingAccountId = targetProjectAccountId;
|
|
76
|
+
}
|
|
70
77
|
else if (!targetTestingAccountId) {
|
|
71
78
|
logger_1.uiLogger.log('');
|
|
72
79
|
(0, ui_1.uiLine)();
|
|
@@ -77,11 +77,13 @@ async function handler(args) {
|
|
|
77
77
|
if (formatOutputAsJson) {
|
|
78
78
|
jsonOutput.accountName = data.accountName;
|
|
79
79
|
jsonOutput.accountId = data.id;
|
|
80
|
-
jsonOutput.personalAccessKey = data.personalAccessKey;
|
|
81
80
|
}
|
|
82
81
|
testAccountId = data.id;
|
|
83
82
|
}
|
|
84
83
|
catch (err) {
|
|
84
|
+
SpinniesManager_1.default.fail('createTestAccount', {
|
|
85
|
+
text: en_1.commands.testAccount.create.polling.createFailure,
|
|
86
|
+
});
|
|
85
87
|
(0, errorHandlers_1.logError)(err);
|
|
86
88
|
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
87
89
|
}
|
|
@@ -92,21 +94,35 @@ async function handler(args) {
|
|
|
92
94
|
await (0, polling_1.poll)(() => (0, developerTestAccounts_1.fetchDeveloperTestAccountGateSyncStatus)(derivedAccountId, testAccountId), {
|
|
93
95
|
successStates: ['SUCCESS'],
|
|
94
96
|
errorStates: [],
|
|
95
|
-
}, 5000 // 5 seconds
|
|
96
|
-
);
|
|
97
|
-
// HACK: The status endpoint sometimes returns an early success status.
|
|
98
|
-
// Sleep for an extra 5 seconds to make sure the status is actually success.
|
|
99
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
100
|
-
SpinniesManager_1.default.succeed('createTestAccount', {
|
|
101
|
-
text: en_1.commands.testAccount.create.polling.success(testAccountConfig.accountName, testAccountId),
|
|
102
97
|
});
|
|
103
98
|
}
|
|
104
99
|
catch (err) {
|
|
105
100
|
(0, errorHandlers_1.debugError)(err);
|
|
106
101
|
SpinniesManager_1.default.fail('createTestAccount', {
|
|
107
|
-
text: en_1.commands.testAccount.create.polling.
|
|
102
|
+
text: en_1.commands.testAccount.create.polling.syncFailure,
|
|
108
103
|
});
|
|
104
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
105
|
+
}
|
|
106
|
+
// HACK: The status endpoint sometimes returns an early success status.
|
|
107
|
+
// Sleep for an extra 5 seconds to make sure the sync is actually complete.
|
|
108
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
109
|
+
try {
|
|
110
|
+
// Attempt to generate a new personal access key for the test account now that gate sync is complete.
|
|
111
|
+
const { data } = await (0, developerTestAccounts_1.generateDeveloperTestAccountPersonalAccessKey)(derivedAccountId, testAccountId);
|
|
112
|
+
if (data.personalAccessKey && data.personalAccessKey) {
|
|
113
|
+
jsonOutput.personalAccessKey = data.personalAccessKey;
|
|
114
|
+
}
|
|
109
115
|
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
(0, errorHandlers_1.debugError)(err);
|
|
118
|
+
SpinniesManager_1.default.fail('createTestAccount', {
|
|
119
|
+
text: en_1.commands.testAccount.create.polling.pakFailure,
|
|
120
|
+
});
|
|
121
|
+
process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
122
|
+
}
|
|
123
|
+
SpinniesManager_1.default.succeed('createTestAccount', {
|
|
124
|
+
text: en_1.commands.testAccount.create.polling.success(testAccountConfig.accountName, testAccountId),
|
|
125
|
+
});
|
|
110
126
|
if (formatOutputAsJson) {
|
|
111
127
|
logger_1.uiLogger.json(jsonOutput);
|
|
112
128
|
}
|
package/lang/en.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const commands: {
|
|
|
28
28
|
readonly openDesignManagerPrompt: "Open Design Manager in your browser?";
|
|
29
29
|
readonly openedDesignManager: "Redirected to Design Manager!";
|
|
30
30
|
readonly developerOverviewBrowserOpenPrep: "We'll take you to your HubSpot account and walk you through installing and previewing your new app.";
|
|
31
|
-
readonly
|
|
31
|
+
readonly openInstallUrl: "Open HubSpot to install your app in your account?";
|
|
32
32
|
readonly openedDeveloperOverview: "HubSpot opened!";
|
|
33
33
|
readonly prompts: {
|
|
34
34
|
readonly selectOption: "Are you looking to build apps or CMS?";
|
|
@@ -36,17 +36,20 @@ export declare const commands: {
|
|
|
36
36
|
readonly app: "App";
|
|
37
37
|
readonly cms: "CMS";
|
|
38
38
|
};
|
|
39
|
+
readonly installDependencies: "Would you like to install dependencies now?";
|
|
39
40
|
readonly uploadProject: "Would you like to upload your project to HubSpot now?";
|
|
40
|
-
readonly appSelected: `We'll create a new project with a sample app for you.
|
|
41
|
-
Projects are what you can use to create apps, themes, and more at HubSpot.
|
|
42
|
-
Usually you'll use the ${string} command, but we'll go ahead and make one now.`;
|
|
43
41
|
readonly projectCreated: {
|
|
44
42
|
readonly title: string;
|
|
45
|
-
readonly description: `
|
|
46
|
-
|
|
43
|
+
readonly description: `Let's prepare and upload your project to HubSpot.
|
|
44
|
+
You can use ${string} to ${string} and ${string} to ${string} your project.`;
|
|
47
45
|
};
|
|
48
46
|
};
|
|
49
47
|
readonly logs: {
|
|
48
|
+
readonly appSelected: `We'll create a new project with a sample app for you.
|
|
49
|
+
Projects are what you can use to create apps, themes, and more at HubSpot.
|
|
50
|
+
Usually you'll use the ${string} command, but we'll go ahead and make one now.`;
|
|
51
|
+
readonly dependenciesInstalled: "Dependencies installed successfully.";
|
|
52
|
+
readonly dependenciesNotInstalled: `Dependencies not installed. Remember to do this later with the command ${string} from the project directory.`;
|
|
50
53
|
readonly uploadingProject: "Uploading your project to HubSpot...";
|
|
51
54
|
readonly uploadSuccess: "Project uploaded successfully!";
|
|
52
55
|
readonly developerOverviewLink: "Open this link to navigate to your HubSpot developer portal";
|
|
@@ -54,6 +57,7 @@ We'll start the process now.`;
|
|
|
54
57
|
readonly errors: {
|
|
55
58
|
readonly uploadFailed: "Failed to upload project to HubSpot.";
|
|
56
59
|
readonly configFileNotFound: "Could not find project configuration for upload.";
|
|
60
|
+
readonly installDepsFailed: "Failed to install dependencies.";
|
|
57
61
|
};
|
|
58
62
|
};
|
|
59
63
|
readonly completion: {
|
|
@@ -1499,10 +1503,10 @@ ${string}`;
|
|
|
1499
1503
|
readonly describe: "Commands for managing apps.";
|
|
1500
1504
|
readonly subcommands: {
|
|
1501
1505
|
readonly install: {
|
|
1502
|
-
readonly describe: "Install an app.";
|
|
1506
|
+
readonly describe: "Install an OAuth app into a test account.";
|
|
1503
1507
|
readonly options: {
|
|
1504
1508
|
readonly appUid: "The uid of the app to install";
|
|
1505
|
-
readonly projectName: "The name of the project
|
|
1509
|
+
readonly projectName: "The name of the project that contains the app";
|
|
1506
1510
|
};
|
|
1507
1511
|
readonly positionals: {
|
|
1508
1512
|
readonly testAccountId: "The id of the test account to install the app into";
|
|
@@ -1829,7 +1833,9 @@ ${string}`;
|
|
|
1829
1833
|
readonly start: (testAccountName: string) => string;
|
|
1830
1834
|
readonly syncing: "Test account created! Syncing account data... (may take a few minutes - you can exit and the sync will continue)";
|
|
1831
1835
|
readonly success: (testAccountName: string, testAccountId: number) => string;
|
|
1832
|
-
readonly
|
|
1836
|
+
readonly createFailure: "Failed to create test account.";
|
|
1837
|
+
readonly syncFailure: "Failed to sync data into test account. The account may not be ready to use.";
|
|
1838
|
+
readonly pakFailure: "Failed to generate a personal access key for the test account.";
|
|
1833
1839
|
};
|
|
1834
1840
|
readonly options: {
|
|
1835
1841
|
readonly configPath: "The path to the test account config";
|
package/lang/en.js
CHANGED
|
@@ -42,7 +42,7 @@ exports.commands = {
|
|
|
42
42
|
openDesignManagerPrompt: 'Open Design Manager in your browser?',
|
|
43
43
|
openedDesignManager: 'Redirected to Design Manager!',
|
|
44
44
|
developerOverviewBrowserOpenPrep: "We'll take you to your HubSpot account and walk you through installing and previewing your new app.",
|
|
45
|
-
|
|
45
|
+
openInstallUrl: 'Open HubSpot to install your app in your account?',
|
|
46
46
|
openedDeveloperOverview: 'HubSpot opened!',
|
|
47
47
|
prompts: {
|
|
48
48
|
selectOption: 'Are you looking to build apps or CMS?',
|
|
@@ -50,14 +50,17 @@ exports.commands = {
|
|
|
50
50
|
app: 'App',
|
|
51
51
|
cms: 'CMS',
|
|
52
52
|
},
|
|
53
|
+
installDependencies: 'Would you like to install dependencies now?',
|
|
53
54
|
uploadProject: 'Would you like to upload your project to HubSpot now?',
|
|
54
|
-
appSelected: `We'll create a new project with a sample app for you.\nProjects are what you can use to create apps, themes, and more at HubSpot.\nUsually you'll use the ${(0, ui_1.uiCommandReference)('hs project create')} command, but we'll go ahead and make one now.`,
|
|
55
55
|
projectCreated: {
|
|
56
56
|
title: chalk_1.default.bold('Next steps:'),
|
|
57
|
-
description: `
|
|
57
|
+
description: `Let's prepare and upload your project to HubSpot.\nYou can use ${(0, ui_1.uiCommandReference)('hs project install-deps')} to ${chalk_1.default.bold('install dependencies')} and ${(0, ui_1.uiCommandReference)('hs project upload')} to ${chalk_1.default.bold('upload')} your project.`,
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
logs: {
|
|
61
|
+
appSelected: `We'll create a new project with a sample app for you.\nProjects are what you can use to create apps, themes, and more at HubSpot.\nUsually you'll use the ${(0, ui_1.uiCommandReference)('hs project create')} command, but we'll go ahead and make one now.`,
|
|
62
|
+
dependenciesInstalled: 'Dependencies installed successfully.',
|
|
63
|
+
dependenciesNotInstalled: `Dependencies not installed. Remember to do this later with the command ${(0, ui_1.uiCommandReference)('hs project install-deps')} from the project directory.`,
|
|
61
64
|
uploadingProject: 'Uploading your project to HubSpot...',
|
|
62
65
|
uploadSuccess: 'Project uploaded successfully!',
|
|
63
66
|
developerOverviewLink: 'Open this link to navigate to your HubSpot developer portal',
|
|
@@ -65,6 +68,7 @@ exports.commands = {
|
|
|
65
68
|
errors: {
|
|
66
69
|
uploadFailed: 'Failed to upload project to HubSpot.',
|
|
67
70
|
configFileNotFound: 'Could not find project configuration for upload.',
|
|
71
|
+
installDepsFailed: 'Failed to install dependencies.',
|
|
68
72
|
},
|
|
69
73
|
},
|
|
70
74
|
completion: {
|
|
@@ -1497,10 +1501,10 @@ exports.commands = {
|
|
|
1497
1501
|
describe: 'Commands for managing apps.',
|
|
1498
1502
|
subcommands: {
|
|
1499
1503
|
install: {
|
|
1500
|
-
describe: 'Install an app.',
|
|
1504
|
+
describe: 'Install an OAuth app into a test account.',
|
|
1501
1505
|
options: {
|
|
1502
1506
|
appUid: 'The uid of the app to install',
|
|
1503
|
-
projectName: 'The name of the project
|
|
1507
|
+
projectName: 'The name of the project that contains the app',
|
|
1504
1508
|
},
|
|
1505
1509
|
positionals: {
|
|
1506
1510
|
testAccountId: 'The id of the test account to install the app into',
|
|
@@ -1827,7 +1831,9 @@ exports.commands = {
|
|
|
1827
1831
|
start: (testAccountName) => `Creating test account "${chalk_1.default.bold(testAccountName)}"...`,
|
|
1828
1832
|
syncing: 'Test account created! Syncing account data... (may take a few minutes - you can exit and the sync will continue)',
|
|
1829
1833
|
success: (testAccountName, testAccountId) => `Test account "${chalk_1.default.bold(testAccountName)}" successfully created with id: ${chalk_1.default.bold(testAccountId)}`,
|
|
1830
|
-
|
|
1834
|
+
createFailure: 'Failed to create test account.',
|
|
1835
|
+
syncFailure: 'Failed to sync data into test account. The account may not be ready to use.',
|
|
1836
|
+
pakFailure: 'Failed to generate a personal access key for the test account.',
|
|
1831
1837
|
},
|
|
1832
1838
|
options: {
|
|
1833
1839
|
configPath: 'The path to the test account config',
|
package/lib/accountTypes.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export declare function isStandardSandbox(accountConfig: CLIAccount): boolean;
|
|
|
5
5
|
export declare function isDevelopmentSandbox(accountConfig: CLIAccount): boolean;
|
|
6
6
|
export declare function isDeveloperTestAccount(accountConfig: CLIAccount): boolean;
|
|
7
7
|
export declare function isAppDeveloperAccount(accountConfig: CLIAccount): boolean;
|
|
8
|
+
export declare function isTestAccountOrSandbox(accountConfig: CLIAccount): boolean;
|
|
8
9
|
export declare function isUnifiedAccount(account: CLIAccount): Promise<boolean>;
|
package/lib/accountTypes.js
CHANGED
|
@@ -6,33 +6,44 @@ exports.isStandardSandbox = isStandardSandbox;
|
|
|
6
6
|
exports.isDevelopmentSandbox = isDevelopmentSandbox;
|
|
7
7
|
exports.isDeveloperTestAccount = isDeveloperTestAccount;
|
|
8
8
|
exports.isAppDeveloperAccount = isAppDeveloperAccount;
|
|
9
|
+
exports.isTestAccountOrSandbox = isTestAccountOrSandbox;
|
|
9
10
|
exports.isUnifiedAccount = isUnifiedAccount;
|
|
10
11
|
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
11
12
|
const hasFeature_1 = require("./hasFeature");
|
|
12
13
|
const constants_1 = require("./constants");
|
|
13
14
|
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
14
15
|
function isAccountType(accountConfig, accountType) {
|
|
15
|
-
return
|
|
16
|
-
accountConfig.accountType === accountType);
|
|
16
|
+
return Boolean(accountConfig.accountType && accountType.includes(accountConfig.accountType));
|
|
17
17
|
}
|
|
18
18
|
function isStandardAccount(accountConfig) {
|
|
19
|
-
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD);
|
|
19
|
+
return isAccountType(accountConfig, [config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD]);
|
|
20
20
|
}
|
|
21
21
|
function isSandbox(accountConfig) {
|
|
22
|
-
return
|
|
23
|
-
|
|
22
|
+
return isAccountType(accountConfig, [
|
|
23
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
|
|
24
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
25
|
+
]);
|
|
24
26
|
}
|
|
25
27
|
function isStandardSandbox(accountConfig) {
|
|
26
|
-
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
28
|
+
return isAccountType(accountConfig, [config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX]);
|
|
27
29
|
}
|
|
28
30
|
function isDevelopmentSandbox(accountConfig) {
|
|
29
|
-
return isAccountType(accountConfig,
|
|
31
|
+
return isAccountType(accountConfig, [
|
|
32
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
33
|
+
]);
|
|
30
34
|
}
|
|
31
35
|
function isDeveloperTestAccount(accountConfig) {
|
|
32
|
-
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST);
|
|
36
|
+
return isAccountType(accountConfig, [config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST]);
|
|
33
37
|
}
|
|
34
38
|
function isAppDeveloperAccount(accountConfig) {
|
|
35
|
-
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER);
|
|
39
|
+
return isAccountType(accountConfig, [config_1.HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER]);
|
|
40
|
+
}
|
|
41
|
+
function isTestAccountOrSandbox(accountConfig) {
|
|
42
|
+
return isAccountType(accountConfig, [
|
|
43
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST,
|
|
44
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
|
|
45
|
+
config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
46
|
+
]);
|
|
36
47
|
}
|
|
37
48
|
async function isUnifiedAccount(account) {
|
|
38
49
|
const accountId = (0, getAccountIdentifier_1.getAccountIdentifier)(account);
|
package/lib/app/urls.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.7.16-experimental.
|
|
3
|
+
"version": "7.7.16-experimental.7",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@hubspot/local-dev-lib": "3.
|
|
9
|
-
"@hubspot/project-parsing-lib": "0.5.
|
|
8
|
+
"@hubspot/local-dev-lib": "3.13.0",
|
|
9
|
+
"@hubspot/project-parsing-lib": "0.5.1",
|
|
10
10
|
"@hubspot/serverless-dev-runtime": "7.0.6",
|
|
11
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
12
12
|
"@hubspot/ui-extensions-dev-server": "0.9.2",
|