@hubspot/cli 6.2.2-experimental.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -0
- package/README.md +71 -0
- package/commands/accounts/clean.d.ts +1 -4
- package/commands/accounts/clean.js +2 -0
- package/commands/accounts/info.d.ts +1 -4
- package/commands/accounts/info.js +3 -1
- package/commands/accounts/list.d.ts +1 -4
- package/commands/accounts/list.js +2 -0
- package/commands/accounts/remove.d.ts +1 -4
- package/commands/accounts/remove.js +2 -0
- package/commands/accounts/rename.d.ts +1 -4
- package/commands/accounts/rename.js +2 -0
- package/commands/accounts/use.d.ts +1 -4
- package/commands/accounts/use.js +2 -0
- package/commands/accounts.d.ts +1 -3
- package/commands/accounts.js +2 -0
- package/commands/auth.d.ts +1 -4
- package/commands/auth.js +2 -2
- package/commands/cms/convertFields.d.ts +1 -4
- package/commands/cms/convertFields.js +2 -0
- package/commands/cms/lighthouseScore.d.ts +1 -4
- package/commands/cms/lighthouseScore.js +2 -0
- package/commands/cms/reactModules.d.ts +1 -4
- package/commands/cms/reactModules.js +2 -0
- package/commands/cms.d.ts +1 -3
- package/commands/cms.js +2 -0
- package/commands/config/set.d.ts +1 -4
- package/commands/config/set.js +3 -3
- package/commands/config.d.ts +1 -3
- package/commands/config.js +2 -0
- package/commands/create/api-sample.d.ts +1 -13
- package/commands/create/api-sample.js +4 -2
- package/commands/create/app.d.ts +1 -10
- package/commands/create/app.js +2 -0
- package/commands/create/function.d.ts +1 -6
- package/commands/create/function.js +2 -0
- package/commands/create/index.d.ts +1 -109
- package/commands/create/index.js +2 -0
- package/commands/create/module.d.ts +1 -11
- package/commands/create/module.js +2 -0
- package/commands/create/react-app.d.ts +1 -9
- package/commands/create/react-app.js +2 -0
- package/commands/create/template.d.ts +1 -12
- package/commands/create/template.js +2 -0
- package/commands/create/vue-app.d.ts +1 -9
- package/commands/create/vue-app.js +2 -0
- package/commands/create/webpack-serverless.d.ts +1 -9
- package/commands/create/webpack-serverless.js +2 -0
- package/commands/create/website-theme.d.ts +1 -9
- package/commands/create/website-theme.js +2 -0
- package/commands/create.d.ts +24 -4
- package/commands/create.js +4 -3
- package/commands/customObject/create.d.ts +1 -4
- package/commands/customObject/create.js +2 -0
- package/commands/customObject/schema/create.d.ts +1 -4
- package/commands/customObject/schema/create.js +2 -0
- package/commands/customObject/schema/delete.d.ts +1 -4
- package/commands/customObject/schema/delete.js +3 -1
- package/commands/customObject/schema/fetch-all.d.ts +1 -4
- package/commands/customObject/schema/fetch-all.js +2 -0
- package/commands/customObject/schema/fetch.d.ts +1 -4
- package/commands/customObject/schema/fetch.js +3 -1
- package/commands/customObject/schema/list.d.ts +1 -3
- package/commands/customObject/schema/list.js +2 -0
- package/commands/customObject/schema/update.d.ts +1 -4
- package/commands/customObject/schema/update.js +2 -0
- package/commands/customObject/schema.d.ts +1 -3
- package/commands/customObject/schema.js +2 -0
- package/commands/customObject.d.ts +1 -3
- package/commands/customObject.js +2 -0
- package/commands/feedback.d.ts +1 -4
- package/commands/feedback.js +21 -4
- package/commands/fetch.d.ts +1 -4
- package/commands/fetch.js +2 -0
- package/commands/filemanager/fetch.d.ts +1 -4
- package/commands/filemanager/fetch.js +4 -2
- package/commands/filemanager/upload.d.ts +1 -4
- package/commands/filemanager/upload.js +2 -0
- package/commands/filemanager.d.ts +1 -3
- package/commands/filemanager.js +2 -0
- package/commands/functions/deploy.d.ts +1 -4
- package/commands/functions/deploy.js +2 -0
- package/commands/functions/list.d.ts +1 -4
- package/commands/functions/list.js +13 -2
- package/commands/functions/server.d.ts +1 -4
- package/commands/functions/server.js +2 -0
- package/commands/functions.d.ts +1 -3
- package/commands/functions.js +2 -0
- package/commands/hubdb/clear.d.ts +1 -4
- package/commands/hubdb/clear.js +2 -0
- package/commands/hubdb/create.d.ts +1 -4
- package/commands/hubdb/create.js +2 -0
- package/commands/hubdb/delete.d.ts +1 -4
- package/commands/hubdb/delete.js +2 -0
- package/commands/hubdb/fetch.d.ts +1 -4
- package/commands/hubdb/fetch.js +2 -0
- package/commands/hubdb.d.ts +1 -3
- package/commands/hubdb.js +2 -0
- package/commands/init.d.ts +1 -4
- package/commands/init.js +2 -2
- package/commands/lint.d.ts +1 -4
- package/commands/lint.js +30 -1
- package/commands/list.d.ts +1 -4
- package/commands/list.js +2 -0
- package/commands/logs.d.ts +1 -4
- package/commands/logs.js +2 -0
- package/commands/module/marketplace-validate.d.ts +1 -4
- package/commands/module/marketplace-validate.js +3 -1
- package/commands/module.d.ts +1 -3
- package/commands/module.js +2 -0
- package/commands/mv.d.ts +1 -4
- package/commands/mv.js +2 -0
- package/commands/open.d.ts +1 -4
- package/commands/open.js +2 -0
- package/commands/project/add.d.ts +1 -4
- package/commands/project/add.js +2 -0
- package/commands/project/cloneApp.d.ts +1 -4
- package/commands/project/cloneApp.js +2 -0
- package/commands/project/create.d.ts +1 -4
- package/commands/project/create.js +2 -0
- package/commands/project/deploy.d.ts +1 -4
- package/commands/project/deploy.js +12 -3
- package/commands/project/dev.d.ts +1 -4
- package/commands/project/dev.js +3 -0
- package/commands/project/download.d.ts +1 -4
- package/commands/project/download.js +4 -2
- package/commands/project/installDeps.d.ts +1 -6
- package/commands/project/installDeps.js +2 -0
- package/commands/project/listBuilds.d.ts +1 -4
- package/commands/project/listBuilds.js +2 -0
- package/commands/project/logs.d.ts +1 -4
- package/commands/project/logs.js +3 -1
- package/commands/project/migrateApp.d.ts +1 -4
- package/commands/project/migrateApp.js +2 -0
- package/commands/project/open.d.ts +1 -4
- package/commands/project/open.js +2 -0
- package/commands/project/upload.d.ts +1 -4
- package/commands/project/upload.js +2 -0
- package/commands/project/watch.d.ts +1 -4
- package/commands/project/watch.js +2 -0
- package/commands/project.d.ts +1 -3
- package/commands/project.js +2 -0
- package/commands/remove.d.ts +1 -4
- package/commands/remove.js +2 -0
- package/commands/sandbox/create.d.ts +1 -4
- package/commands/sandbox/create.js +2 -0
- package/commands/sandbox/delete.d.ts +1 -4
- package/commands/sandbox/delete.js +7 -3
- package/commands/sandbox.d.ts +1 -3
- package/commands/sandbox.js +2 -0
- package/commands/secrets/addSecret.d.ts +1 -4
- package/commands/secrets/addSecret.js +2 -0
- package/commands/secrets/deleteSecret.d.ts +1 -4
- package/commands/secrets/deleteSecret.js +2 -0
- package/commands/secrets/listSecrets.d.ts +1 -4
- package/commands/secrets/listSecrets.js +2 -0
- package/commands/secrets/updateSecret.d.ts +1 -4
- package/commands/secrets/updateSecret.js +2 -0
- package/commands/secrets.d.ts +1 -3
- package/commands/secrets.js +2 -0
- package/commands/theme/generate-selectors.d.ts +1 -4
- package/commands/theme/generate-selectors.js +3 -1
- package/commands/theme/marketplace-validate.d.ts +1 -4
- package/commands/theme/marketplace-validate.js +3 -1
- package/commands/theme/preview.d.ts +1 -4
- package/commands/theme/preview.js +56 -46
- package/commands/theme.d.ts +1 -3
- package/commands/theme.js +2 -0
- package/commands/upload.d.ts +1 -4
- package/commands/upload.js +2 -0
- package/commands/watch.d.ts +1 -4
- package/commands/watch.js +2 -0
- package/lang/en.lyaml +8 -13
- package/lib/DevServerManager.d.ts +1 -35
- package/lib/DevServerManager.js +2 -0
- package/lib/LocalDevManager.d.ts +1 -41
- package/lib/LocalDevManager.js +5 -3
- package/lib/ProjectLogsManager.d.ts +1 -0
- package/lib/{projectLogsManager.js → ProjectLogsManager.js} +2 -0
- package/lib/accountTypes.d.ts +7 -6
- package/lib/accountTypes.js +31 -17
- package/lib/buildAccount.d.ts +1 -22
- package/lib/buildAccount.js +2 -0
- package/lib/commonOpts.d.ts +23 -17
- package/lib/commonOpts.js +73 -54
- package/lib/configOptions.d.ts +1 -0
- package/lib/configOptions.js +110 -0
- package/lib/constants.d.ts +76 -83
- package/lib/constants.js +21 -46
- package/lib/dependencyManagement.d.ts +1 -7
- package/lib/dependencyManagement.js +2 -0
- package/lib/developerTestAccounts.d.ts +1 -7
- package/lib/developerTestAccounts.js +2 -0
- package/lib/enums/exitCodes.d.ts +5 -5
- package/lib/enums/exitCodes.js +3 -2
- package/lib/errorHandlers/index.d.ts +1 -19
- package/lib/errorHandlers/index.js +2 -0
- package/lib/errorHandlers/suppressError.d.ts +1 -1
- package/lib/errorHandlers/suppressError.js +2 -0
- package/lib/filesystem.d.ts +2 -2
- package/lib/filesystem.js +12 -10
- package/lib/generateSelectors.d.ts +1 -0
- package/lib/{generate-selectors.js → generateSelectors.js} +3 -1
- package/lib/hasFeature.d.ts +1 -1
- package/lib/hasFeature.js +7 -8
- package/lib/hasFlag.d.ts +1 -2
- package/lib/hasFlag.js +7 -3
- package/lib/interpolation.d.ts +5 -10
- package/lib/interpolation.js +39 -45
- package/lib/lang.d.ts +9 -3
- package/lib/lang.js +38 -31
- package/lib/links.d.ts +1 -127
- package/lib/links.js +2 -0
- package/lib/localDev.d.ts +1 -11
- package/lib/localDev.js +2 -0
- package/lib/marketplaceValidate.d.ts +1 -0
- package/lib/{marketplace-validate.js → marketplaceValidate.js} +2 -0
- package/lib/oauth.d.ts +1 -1
- package/lib/oauth.js +3 -1
- package/lib/polling.d.ts +1 -1
- package/lib/polling.js +2 -0
- package/lib/process.d.ts +12 -2
- package/lib/process.js +17 -15
- package/lib/projectStructure.d.ts +1 -13
- package/lib/projectStructure.js +4 -2
- package/lib/projects.d.ts +1 -40
- package/lib/projects.js +10 -5
- package/lib/projectsWatch.d.ts +1 -1
- package/lib/projectsWatch.js +8 -3
- package/lib/prompts/accountNamePrompt.d.ts +1 -11
- package/lib/prompts/accountNamePrompt.js +3 -2
- package/lib/prompts/accountsPrompt.d.ts +1 -3
- package/lib/prompts/accountsPrompt.js +2 -17
- package/lib/prompts/cleanUploadPrompt.d.ts +1 -1
- package/lib/prompts/cleanUploadPrompt.js +2 -0
- package/lib/prompts/cmsFieldPrompt.d.ts +1 -1
- package/lib/prompts/cmsFieldPrompt.js +2 -0
- package/lib/prompts/createApiSamplePrompt.d.ts +1 -1
- package/lib/prompts/createApiSamplePrompt.js +2 -0
- package/lib/prompts/createFunctionPrompt.d.ts +1 -1
- package/lib/prompts/createFunctionPrompt.js +5 -4
- package/lib/prompts/createModulePrompt.d.ts +1 -1
- package/lib/prompts/createModulePrompt.js +2 -0
- package/lib/prompts/createProjectPrompt.d.ts +1 -1
- package/lib/prompts/createProjectPrompt.js +10 -5
- package/lib/prompts/createTemplatePrompt.d.ts +1 -1
- package/lib/prompts/createTemplatePrompt.js +2 -0
- package/lib/prompts/downloadProjectPrompt.d.ts +1 -1
- package/lib/prompts/downloadProjectPrompt.js +3 -1
- package/lib/prompts/installPublicAppPrompt.d.ts +1 -1
- package/lib/prompts/installPublicAppPrompt.js +2 -0
- package/lib/prompts/personalAccessKeyPrompt.d.ts +1 -69
- package/lib/prompts/personalAccessKeyPrompt.js +2 -0
- package/lib/prompts/previewPrompt.d.ts +1 -2
- package/lib/prompts/previewPrompt.js +2 -0
- package/lib/prompts/projectAddPrompt.d.ts +1 -1
- package/lib/prompts/projectAddPrompt.js +2 -0
- package/lib/prompts/projectDevTargetAccountPrompt.d.ts +1 -4
- package/lib/prompts/projectDevTargetAccountPrompt.js +2 -0
- package/lib/prompts/projectNamePrompt.d.ts +1 -1
- package/lib/prompts/projectNamePrompt.js +2 -0
- package/lib/prompts/projectsLogsPrompt.d.ts +1 -5
- package/lib/prompts/projectsLogsPrompt.js +2 -0
- package/lib/prompts/promptUtils.d.ts +12 -2
- package/lib/prompts/promptUtils.js +25 -12
- package/lib/prompts/sandboxesPrompt.d.ts +1 -2
- package/lib/prompts/sandboxesPrompt.js +2 -0
- package/lib/prompts/secretPrompt.d.ts +1 -1
- package/lib/prompts/secretPrompt.js +2 -0
- package/lib/prompts/selectPublicAppPrompt.d.ts +1 -5
- package/lib/prompts/selectPublicAppPrompt.js +3 -1
- package/lib/prompts/setAsDefaultAccountPrompt.d.ts +1 -1
- package/lib/prompts/setAsDefaultAccountPrompt.js +2 -0
- package/lib/prompts/uploadPrompt.d.ts +1 -1
- package/lib/prompts/uploadPrompt.js +2 -0
- package/lib/sandboxSync.d.ts +1 -8
- package/lib/sandboxSync.js +3 -1
- package/lib/sandboxes.d.ts +1 -40
- package/lib/sandboxes.js +2 -0
- package/lib/schema.d.ts +3 -2
- package/lib/schema.js +20 -18
- package/lib/serverlessLogs.d.ts +1 -8
- package/lib/serverlessLogs.js +3 -1
- package/lib/ui/SpinniesManager.d.ts +1 -61
- package/lib/ui/SpinniesManager.js +2 -0
- package/lib/ui/git.d.ts +1 -1
- package/lib/ui/git.js +2 -0
- package/lib/ui/index.d.ts +1 -36
- package/lib/ui/index.js +2 -0
- package/lib/ui/serverlessFunctionLogs.d.ts +1 -1
- package/lib/ui/serverlessFunctionLogs.js +2 -0
- package/lib/ui/spinniesUtils.d.ts +1 -60
- package/lib/ui/spinniesUtils.js +2 -0
- package/lib/ui/supportHyperlinks.d.ts +1 -3
- package/lib/ui/supportHyperlinks.js +3 -1
- package/lib/ui/supportsColor.d.ts +1 -13
- package/lib/ui/supportsColor.js +3 -1
- package/lib/ui/table.d.ts +1 -2
- package/lib/ui/table.js +2 -0
- package/lib/upload.d.ts +1 -1
- package/lib/upload.js +4 -2
- package/lib/usageTracking.d.ts +1 -6
- package/lib/usageTracking.js +12 -1
- package/lib/validation.d.ts +1 -16
- package/lib/validation.js +2 -2
- package/package.json +17 -9
- package/commands/config/set/allowUsageTracking.d.ts +0 -4
- package/commands/config/set/allowUsageTracking.js +0 -45
- package/commands/config/set/defaultMode.d.ts +0 -4
- package/commands/config/set/defaultMode.js +0 -48
- package/commands/config/set/httpTimeout.d.ts +0 -4
- package/commands/config/set/httpTimeout.js +0 -33
- package/lib/debugInfo.d.ts +0 -3
- package/lib/debugInfo.js +0 -18
- package/lib/environment.d.ts +0 -1
- package/lib/environment.js +0 -14
- package/lib/generate-selectors.d.ts +0 -6
- package/lib/getFunctionArrays.d.ts +0 -1
- package/lib/getFunctionArrays.js +0 -17
- package/lib/hublValidate.d.ts +0 -4
- package/lib/hublValidate.js +0 -28
- package/lib/interpolationHelpers.d.ts +0 -6
- package/lib/interpolationHelpers.js +0 -26
- package/lib/marketplace-validate.d.ts +0 -5
- package/lib/projectLogsManager.d.ts +0 -19
- package/lib/prompts/activeInstallConfirmationPrompt.d.ts +0 -1
- package/lib/prompts/activeInstallConfirmationPrompt.js +0 -18
- package/lib/prompts/deployBuildIdPrompt.d.ts +0 -1
- package/lib/prompts/deployBuildIdPrompt.js +0 -20
- package/lib/prompts/feedbackPrompt.d.ts +0 -2
- package/lib/prompts/feedbackPrompt.js +0 -37
- package/lib/prompts/folderOverwritePrompt.d.ts +0 -1
- package/lib/prompts/folderOverwritePrompt.js +0 -15
- package/lib/regex.d.ts +0 -1
- package/lib/regex.js +0 -5
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const fs = require('fs');
|
|
3
5
|
const path = require('path');
|
|
4
6
|
const { i18n } = require('../../lib/lang');
|
|
@@ -87,56 +89,59 @@ const determineSrcAndDest = async (options) => {
|
|
|
87
89
|
return { absoluteSrc, dest };
|
|
88
90
|
};
|
|
89
91
|
exports.handler = async (options) => {
|
|
90
|
-
const { notify, skipUpload, noSsl, port, debug } = options;
|
|
92
|
+
const { notify, skipUpload, noSsl, port, debug, resetSession } = options;
|
|
91
93
|
await loadAndValidateOptions(options);
|
|
92
94
|
const accountId = getAccountId(options);
|
|
93
95
|
const { absoluteSrc, dest } = await determineSrcAndDest(options);
|
|
94
96
|
const filePaths = await getUploadableFileList(absoluteSrc, false);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
uploadsHaveStarted
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
onFirstErrorCallback: () => {
|
|
118
|
-
/* Intentionally blank */
|
|
119
|
-
},
|
|
120
|
-
onRetryCallback: () => {
|
|
121
|
-
/* Intentionally blank */
|
|
122
|
-
},
|
|
123
|
-
onFinalErrorCallback: () => initialUploadProgressBar.increment(),
|
|
124
|
-
onFinishCallback: results => {
|
|
125
|
-
initialUploadProgressBar.update(filePaths.length, {
|
|
126
|
-
label: i18n(`${i18nKey}.initialUploadProgressBar.finish`),
|
|
127
|
-
});
|
|
128
|
-
initialUploadProgressBar.stop();
|
|
129
|
-
results.forEach(result => {
|
|
130
|
-
if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
131
|
-
logger.error('Uploading file "%s" to "%s" failed', result.file, dest);
|
|
132
|
-
logError(result.error, new ApiErrorContext({
|
|
133
|
-
accountId,
|
|
134
|
-
request: dest,
|
|
135
|
-
payload: result.file,
|
|
136
|
-
}));
|
|
97
|
+
const startProgressBar = numFiles => {
|
|
98
|
+
const initialUploadProgressBar = new cliProgress.SingleBar({
|
|
99
|
+
gracefulExit: true,
|
|
100
|
+
format: '[{bar}] {percentage}% | {value}/{total} | {label}',
|
|
101
|
+
hideCursor: true,
|
|
102
|
+
}, cliProgress.Presets.rect);
|
|
103
|
+
initialUploadProgressBar.start(numFiles, 0, {
|
|
104
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.start`),
|
|
105
|
+
});
|
|
106
|
+
let uploadsHaveStarted = false;
|
|
107
|
+
const uploadOptions = {
|
|
108
|
+
onAttemptCallback: () => {
|
|
109
|
+
/* Intentionally blank */
|
|
110
|
+
},
|
|
111
|
+
onSuccessCallback: () => {
|
|
112
|
+
initialUploadProgressBar.increment();
|
|
113
|
+
if (!uploadsHaveStarted) {
|
|
114
|
+
uploadsHaveStarted = true;
|
|
115
|
+
initialUploadProgressBar.update(0, {
|
|
116
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.uploading`),
|
|
117
|
+
});
|
|
137
118
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
119
|
+
},
|
|
120
|
+
onFirstErrorCallback: () => {
|
|
121
|
+
/* Intentionally blank */
|
|
122
|
+
},
|
|
123
|
+
onRetryCallback: () => {
|
|
124
|
+
/* Intentionally blank */
|
|
125
|
+
},
|
|
126
|
+
onFinalErrorCallback: () => initialUploadProgressBar.increment(),
|
|
127
|
+
onFinishCallback: results => {
|
|
128
|
+
initialUploadProgressBar.update(numFiles, {
|
|
129
|
+
label: i18n(`${i18nKey}.initialUploadProgressBar.finish`),
|
|
130
|
+
});
|
|
131
|
+
initialUploadProgressBar.stop();
|
|
132
|
+
results.forEach(result => {
|
|
133
|
+
if (result.resultType == FILE_UPLOAD_RESULT_TYPES.FAILURE) {
|
|
134
|
+
logger.error('Uploading file "%s" to "%s" failed', result.file, dest);
|
|
135
|
+
logError(result.error, new ApiErrorContext({
|
|
136
|
+
accountId,
|
|
137
|
+
request: dest,
|
|
138
|
+
payload: result.file,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
return uploadOptions;
|
|
140
145
|
};
|
|
141
146
|
trackCommandUsage('preview', accountId);
|
|
142
147
|
preview(accountId, absoluteSrc, dest, {
|
|
@@ -146,7 +151,8 @@ exports.handler = async (options) => {
|
|
|
146
151
|
noSsl,
|
|
147
152
|
port,
|
|
148
153
|
debug,
|
|
149
|
-
|
|
154
|
+
resetSession,
|
|
155
|
+
startProgressBar,
|
|
150
156
|
handleUserInput,
|
|
151
157
|
});
|
|
152
158
|
};
|
|
@@ -186,5 +192,9 @@ exports.builder = yargs => {
|
|
|
186
192
|
describe: false,
|
|
187
193
|
type: 'boolean',
|
|
188
194
|
});
|
|
195
|
+
yargs.option('resetSession', {
|
|
196
|
+
describe: false,
|
|
197
|
+
type: 'boolean',
|
|
198
|
+
});
|
|
189
199
|
return yargs;
|
|
190
200
|
};
|
package/commands/theme.d.ts
CHANGED
package/commands/theme.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const marketplaceValidate = require('./theme/marketplace-validate');
|
|
3
5
|
const generateSelectors = require('./theme/generate-selectors');
|
|
4
6
|
const previewCommand = require('./theme/preview');
|
package/commands/upload.d.ts
CHANGED
package/commands/upload.js
CHANGED
package/commands/watch.d.ts
CHANGED
package/commands/watch.js
CHANGED
package/lang/en.lyaml
CHANGED
|
@@ -178,6 +178,7 @@ en:
|
|
|
178
178
|
describe: "Type of asset"
|
|
179
179
|
subcommands:
|
|
180
180
|
apiSample:
|
|
181
|
+
folderOverwritePrompt: "The folder with name \"{{ folderName }}\" already exists. Overwrite?"
|
|
181
182
|
errors:
|
|
182
183
|
nameRequired: "The \"name\" argument is required when creating an API Sample."
|
|
183
184
|
noSamples: "Currently there are no samples available, please, try again later."
|
|
@@ -570,6 +571,7 @@ en:
|
|
|
570
571
|
withFlags: "Use --name and --type flags to bypass the prompt."
|
|
571
572
|
deploy:
|
|
572
573
|
describe: "Deploy a project build"
|
|
574
|
+
deployBuildIdPrompt: "[--build] Deploy which build?"
|
|
573
575
|
debug:
|
|
574
576
|
deploying: "Deploying project at path: {{ path }}"
|
|
575
577
|
errors:
|
|
@@ -702,6 +704,11 @@ en:
|
|
|
702
704
|
success: "Successfully opened \"{{ projectName }}\""
|
|
703
705
|
feedback:
|
|
704
706
|
describe: "Leave feedback on HubSpot projects or file a bug report"
|
|
707
|
+
feedbackType:
|
|
708
|
+
prompt: "What type of feedback would you like to leave?"
|
|
709
|
+
bug: "[--bug] Report a bug"
|
|
710
|
+
general: "[--general] Tell us about your experience with HubSpot's developer tools"
|
|
711
|
+
openPrompt: "Create a Github issue in your browser?"
|
|
705
712
|
success: "We opened {{ url }} in your browser."
|
|
706
713
|
options:
|
|
707
714
|
bug:
|
|
@@ -999,6 +1006,7 @@ en:
|
|
|
999
1006
|
installCount: "{{#bold}}The app {{ appName }} has {{ installCount }} production {{ installText }}{{/bold}}"
|
|
1000
1007
|
explanation: "Some changes made during local development may need to be synced to HubSpot, which will impact those existing installs. We strongly recommend creating a copy of this app to use instead."
|
|
1001
1008
|
confirmation: "You will always be asked to confirm any permanent changes to your app’s configuration before uploading them."
|
|
1009
|
+
confirmationPrompt: "Proceed with local development of this {{#bold}}production{{/bold}} app?"
|
|
1002
1010
|
devServer:
|
|
1003
1011
|
cleanupError: "Failed to cleanup local dev server: {{ message }}"
|
|
1004
1012
|
setupError: "Failed to setup local dev server: {{ message }}"
|
|
@@ -1193,8 +1201,6 @@ en:
|
|
|
1193
1201
|
invalidOauthClientSecretCopy: "Please copy the actual OAuth2 client secret rather than the asterisks that mask it."
|
|
1194
1202
|
invalidPersonalAccessKey: "You did not enter a valid access key. Please try again."
|
|
1195
1203
|
invalidPersonalAccessKeyCopy: "Please copy the actual access key rather than the bullets that mask it."
|
|
1196
|
-
folderOverwritePrompt:
|
|
1197
|
-
overwriteConfirm: "The folder with name \"{{ folderName }}\" already exists. Overwrite?"
|
|
1198
1204
|
createTemplatePrompt:
|
|
1199
1205
|
selectTemplate: "Select the type of template to create"
|
|
1200
1206
|
createModulePrompt:
|
|
@@ -1276,15 +1282,6 @@ en:
|
|
|
1276
1282
|
errors:
|
|
1277
1283
|
invalidName: "You entered an invalid name. Please try again."
|
|
1278
1284
|
projectDoesNotExist: "Project {{#bold}}{{ projectName }}{{/bold}} could not be found in \"{{ accountIdentifier }}\""
|
|
1279
|
-
feedbackPrompt:
|
|
1280
|
-
feedbackType:
|
|
1281
|
-
message: "What type of feedback would you like to leave?"
|
|
1282
|
-
bug: "[--bug] Report a bug"
|
|
1283
|
-
general: "[--general] Tell us about your experience with HubSpot's developer tools"
|
|
1284
|
-
bugPrompt: "Create an issue on Github in your browser?"
|
|
1285
|
-
generalPrompt: "Create an issue on Github in your browser?"
|
|
1286
|
-
deployBuildIdPrompt:
|
|
1287
|
-
enterBuildId: "[--build] Deploy which build?"
|
|
1288
1285
|
previewPrompt:
|
|
1289
1286
|
enterSrc: "[--src] Enter a local theme directory to preview."
|
|
1290
1287
|
enterDest: "[--dest] Enter the destination path for the src theme in HubSpot Design Tools."
|
|
@@ -1300,8 +1297,6 @@ en:
|
|
|
1300
1297
|
prompt: "Open hubspot.com to install this app?"
|
|
1301
1298
|
reinstallPrompt: "Open hubspot.com to reinstall this app?"
|
|
1302
1299
|
decline: "To continue local development of this app, install it in your target test account and re-run {{#bold}}`hs project dev`{{/bold}}"
|
|
1303
|
-
activeInstallConfirmationPrompt:
|
|
1304
|
-
message: "Proceed with local development of this {{#bold}}production{{/bold}} app?"
|
|
1305
1300
|
convertFields:
|
|
1306
1301
|
positionals:
|
|
1307
1302
|
src:
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export = _exports;
|
|
3
|
-
declare class DevServerManager {
|
|
4
|
-
initialized: boolean;
|
|
5
|
-
started: boolean;
|
|
6
|
-
componentsByType: {};
|
|
7
|
-
server: any;
|
|
8
|
-
path: any;
|
|
9
|
-
devServers: {
|
|
10
|
-
[x: string]: {
|
|
11
|
-
componentType: "private-app";
|
|
12
|
-
serverInterface: import("@hubspot/ui-extensions-dev-server").DevModeInterfaceNonSingleton;
|
|
13
|
-
} | {
|
|
14
|
-
componentType: "public-app";
|
|
15
|
-
serverInterface: import("@hubspot/ui-extensions-dev-server").DevModeInterfaceNonSingleton;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
iterateDevServers(callback: any): Promise<void>;
|
|
19
|
-
arrangeComponentsByType(components: any): any;
|
|
20
|
-
setup({ components, onUploadRequired, accountId, setActiveApp }: {
|
|
21
|
-
components: any;
|
|
22
|
-
onUploadRequired: any;
|
|
23
|
-
accountId: any;
|
|
24
|
-
setActiveApp: any;
|
|
25
|
-
}): Promise<void>;
|
|
26
|
-
start({ accountId, projectConfig }: {
|
|
27
|
-
accountId: any;
|
|
28
|
-
projectConfig: any;
|
|
29
|
-
}): Promise<void>;
|
|
30
|
-
fileChange({ filePath, event }: {
|
|
31
|
-
filePath: any;
|
|
32
|
-
event: any;
|
|
33
|
-
}): void;
|
|
34
|
-
cleanup(): Promise<void>;
|
|
35
|
-
}
|
|
1
|
+
export {};
|
package/lib/DevServerManager.js
CHANGED
package/lib/LocalDevManager.d.ts
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
declare class LocalDevManager {
|
|
3
|
-
constructor(options: any);
|
|
4
|
-
targetAccountId: any;
|
|
5
|
-
targetProjectAccountId: any;
|
|
6
|
-
projectConfig: any;
|
|
7
|
-
projectDir: any;
|
|
8
|
-
projectId: any;
|
|
9
|
-
debug: any;
|
|
10
|
-
deployedBuild: any;
|
|
11
|
-
isGithubLinked: any;
|
|
12
|
-
watcher: chokidar.FSWatcher | null;
|
|
13
|
-
uploadWarnings: {};
|
|
14
|
-
runnableComponents: any;
|
|
15
|
-
activeApp: any;
|
|
16
|
-
activePublicAppData: any;
|
|
17
|
-
env: any;
|
|
18
|
-
publicAppActiveInstalls: number | null;
|
|
19
|
-
projectSourceDir: string;
|
|
20
|
-
setActiveApp(appUid: any): Promise<void>;
|
|
21
|
-
setActivePublicAppData(): Promise<void>;
|
|
22
|
-
checkActivePublicAppInstalls(): Promise<void>;
|
|
23
|
-
start(): Promise<void>;
|
|
24
|
-
stop(showProgress?: boolean): Promise<void>;
|
|
25
|
-
getActiveAppInstallationData(): Promise<import("@hubspot/local-dev-lib/types/Apps").PublicAppInstallationData>;
|
|
26
|
-
checkPublicAppInstallation(): Promise<void>;
|
|
27
|
-
updateKeypressListeners(): void;
|
|
28
|
-
getUploadCommand(): string;
|
|
29
|
-
logUploadWarning(reason: any): void;
|
|
30
|
-
mostRecentUploadWarning: any;
|
|
31
|
-
monitorConsoleOutput(): void;
|
|
32
|
-
compareLocalProjectToDeployed(): void;
|
|
33
|
-
startWatching(): void;
|
|
34
|
-
stopWatching(): Promise<void>;
|
|
35
|
-
handleWatchEvent(filePath: any, event: any, configPaths: any): void;
|
|
36
|
-
devServerSetup(): Promise<boolean>;
|
|
37
|
-
devServerStart(): Promise<void>;
|
|
38
|
-
devServerFileChange(filePath: any, event: any): void;
|
|
39
|
-
devServerCleanup(): Promise<boolean>;
|
|
40
|
-
}
|
|
41
|
-
import chokidar = require("chokidar");
|
|
1
|
+
export {};
|
package/lib/LocalDevManager.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const path = require('path');
|
|
3
5
|
const chokidar = require('chokidar');
|
|
4
6
|
const chalk = require('chalk');
|
|
@@ -18,7 +20,7 @@ const { CONFIG_FILES, COMPONENT_TYPES, getAppCardConfigs, } = require('./project
|
|
|
18
20
|
const { UI_COLORS, uiCommandReference, uiAccountDescription, uiBetaTag, uiLink, uiLine, } = require('./ui');
|
|
19
21
|
const { logError } = require('./errorHandlers/index');
|
|
20
22
|
const { installPublicAppPrompt } = require('./prompts/installPublicAppPrompt');
|
|
21
|
-
const {
|
|
23
|
+
const { confirmPrompt } = require('./prompts/promptUtils');
|
|
22
24
|
const WATCH_EVENTS = {
|
|
23
25
|
add: 'add',
|
|
24
26
|
change: 'change',
|
|
@@ -96,7 +98,7 @@ class LocalDevManager {
|
|
|
96
98
|
}));
|
|
97
99
|
logger.log(i18n(`${i18nKey}.activeInstallWarning.explanation`));
|
|
98
100
|
uiLine();
|
|
99
|
-
const proceed = await
|
|
101
|
+
const proceed = await confirmPrompt(i18n(`${i18nKey}.activeInstallWarning.confirmationPrompt`), { defaultAnswer: false });
|
|
100
102
|
if (!proceed) {
|
|
101
103
|
process.exit(EXIT_CODES.SUCCESS);
|
|
102
104
|
}
|
|
@@ -240,7 +242,7 @@ class LocalDevManager {
|
|
|
240
242
|
}
|
|
241
243
|
compareLocalProjectToDeployed() {
|
|
242
244
|
const deployedComponentNames = this.deployedBuild.subbuildStatuses.map(subbuildStatus => subbuildStatus.buildName);
|
|
243
|
-
|
|
245
|
+
const missingComponents = [];
|
|
244
246
|
this.runnableComponents.forEach(({ type, config, path }) => {
|
|
245
247
|
if (Object.values(COMPONENT_TYPES).includes(type)) {
|
|
246
248
|
const cardConfigs = getAppCardConfigs(config, path);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { getProjectConfig, ensureProjectExists } = require('./projects');
|
|
3
5
|
const { fetchProjectComponentsMetadata, } = require('@hubspot/local-dev-lib/api/projects');
|
|
4
6
|
const { i18n } = require('./lang');
|
package/lib/accountTypes.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export function
|
|
3
|
-
export function
|
|
4
|
-
export function
|
|
5
|
-
export function
|
|
6
|
-
export function
|
|
1
|
+
import { CLIAccount } from '@hubspot/local-dev-lib/types/Accounts';
|
|
2
|
+
export declare function isStandardAccount(accountConfig: CLIAccount): boolean;
|
|
3
|
+
export declare function isSandbox(accountConfig: CLIAccount): boolean;
|
|
4
|
+
export declare function isStandardSandbox(accountConfig: CLIAccount): boolean;
|
|
5
|
+
export declare function isDevelopmentSandbox(accountConfig: CLIAccount): boolean;
|
|
6
|
+
export declare function isDeveloperTestAccount(accountConfig: CLIAccount): boolean;
|
|
7
|
+
export declare function isAppDeveloperAccount(accountConfig: CLIAccount): boolean;
|
package/lib/accountTypes.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStandardAccount = isStandardAccount;
|
|
4
|
+
exports.isSandbox = isSandbox;
|
|
5
|
+
exports.isStandardSandbox = isStandardSandbox;
|
|
6
|
+
exports.isDevelopmentSandbox = isDevelopmentSandbox;
|
|
7
|
+
exports.isDeveloperTestAccount = isDeveloperTestAccount;
|
|
8
|
+
exports.isAppDeveloperAccount = isAppDeveloperAccount;
|
|
9
|
+
const config_1 = require("@hubspot/local-dev-lib/constants/config");
|
|
10
|
+
function isAccountType(accountConfig, accountType) {
|
|
11
|
+
return (Boolean(accountConfig.accountType) &&
|
|
12
|
+
accountConfig.accountType === accountType);
|
|
13
|
+
}
|
|
14
|
+
function isStandardAccount(accountConfig) {
|
|
15
|
+
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD);
|
|
16
|
+
}
|
|
17
|
+
function isSandbox(accountConfig) {
|
|
18
|
+
return (isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX) ||
|
|
19
|
+
isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX));
|
|
20
|
+
}
|
|
21
|
+
function isStandardSandbox(accountConfig) {
|
|
22
|
+
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
23
|
+
}
|
|
24
|
+
function isDevelopmentSandbox(accountConfig) {
|
|
25
|
+
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
|
|
26
|
+
}
|
|
27
|
+
function isDeveloperTestAccount(accountConfig) {
|
|
28
|
+
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.DEVELOPER_TEST);
|
|
29
|
+
}
|
|
30
|
+
function isAppDeveloperAccount(accountConfig) {
|
|
31
|
+
return isAccountType(accountConfig, config_1.HUBSPOT_ACCOUNT_TYPES.APP_DEVELOPER);
|
|
32
|
+
}
|
package/lib/buildAccount.d.ts
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
name: any;
|
|
3
|
-
accountType: any;
|
|
4
|
-
accountConfig: any;
|
|
5
|
-
env: any;
|
|
6
|
-
portalLimit: any;
|
|
7
|
-
force?: boolean | undefined;
|
|
8
|
-
}): Promise<{
|
|
9
|
-
configAccountName: string | undefined;
|
|
10
|
-
result: import("@hubspot/local-dev-lib/types/developerTestAccounts").DeveloperTestAccount | {
|
|
11
|
-
sandbox: import("@hubspot/local-dev-lib/types/Sandbox").Sandbox;
|
|
12
|
-
personalAccessKey: string;
|
|
13
|
-
name: any;
|
|
14
|
-
} | undefined;
|
|
15
|
-
}>;
|
|
16
|
-
export function saveAccountToConfig({ env, personalAccessKey, accountName, accountId, force, }: {
|
|
17
|
-
env: any;
|
|
18
|
-
personalAccessKey: any;
|
|
19
|
-
accountName: any;
|
|
20
|
-
accountId: any;
|
|
21
|
-
force?: boolean | undefined;
|
|
22
|
-
}): Promise<string | undefined>;
|
|
1
|
+
export {};
|
package/lib/buildAccount.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-nocheck
|
|
2
4
|
const { getAccessToken, updateConfigWithAccessToken, } = require('@hubspot/local-dev-lib/personalAccessKey');
|
|
3
5
|
const { personalAccessKeyPrompt, } = require('./prompts/personalAccessKeyPrompt');
|
|
4
6
|
const { accountNameExistsInConfig, updateAccountConfig, writeConfig, getAccountId, } = require('@hubspot/local-dev-lib/config');
|
package/lib/commonOpts.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
export function
|
|
3
|
-
export function
|
|
4
|
-
export function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export function getCommandName(argv:
|
|
15
|
-
|
|
1
|
+
import { Argv, Arguments } from 'yargs';
|
|
2
|
+
export declare function addAccountOptions(yargs: Argv): Argv;
|
|
3
|
+
export declare function addConfigOptions(yargs: Argv): Argv;
|
|
4
|
+
export declare function addOverwriteOptions(yargs: Argv): Argv;
|
|
5
|
+
export declare function addModeOptions(yargs: Argv, { read, write }: {
|
|
6
|
+
read?: boolean;
|
|
7
|
+
write?: boolean;
|
|
8
|
+
}): Argv;
|
|
9
|
+
export declare function addTestingOptions(yargs: Argv): Argv;
|
|
10
|
+
export declare function addUseEnvironmentOptions(yargs: Argv): Argv;
|
|
11
|
+
export declare function setLogLevel(options: Arguments<{
|
|
12
|
+
debug?: boolean;
|
|
13
|
+
}>): void;
|
|
14
|
+
export declare function getCommandName(argv: Arguments<{
|
|
15
|
+
_?: string[];
|
|
16
|
+
}>): string;
|
|
16
17
|
/**
|
|
17
18
|
* Obtains accountId using supplied --account flag or from environment variables
|
|
18
19
|
*/
|
|
19
|
-
export function getAccountId(options
|
|
20
|
-
|
|
20
|
+
export declare function getAccountId(options: Arguments<{
|
|
21
|
+
portal?: number | string;
|
|
22
|
+
account?: number | string;
|
|
23
|
+
}>): number | null;
|
|
24
|
+
export declare function getMode(options: Arguments<{
|
|
25
|
+
mode?: string;
|
|
26
|
+
}>): string;
|