@hubspot/cli 5.2.1-beta.11 → 5.2.1-beta.12
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.
|
@@ -79,13 +79,16 @@ exports.handler = async options => {
|
|
|
79
79
|
: await selectPublicAppPrompt({
|
|
80
80
|
accountId,
|
|
81
81
|
accountName,
|
|
82
|
-
|
|
82
|
+
isMigratingApp: true,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
let appName;
|
|
86
86
|
try {
|
|
87
87
|
const selectedApp = await fetchPublicAppMetadata(appId, accountId);
|
|
88
|
-
if
|
|
88
|
+
// preventProjectMigrations returns true if we have not added app to allowlist config.
|
|
89
|
+
// listingInfo will only exist for marketplace apps
|
|
90
|
+
const { preventProjectMigrations, listingInfo } = selectedApp;
|
|
91
|
+
if (preventProjectMigrations && listingInfo) {
|
|
89
92
|
logger.error(i18n(`${i18nKey}.errors.invalidApp`, { appId }));
|
|
90
93
|
process.exit(EXIT_CODES.ERROR);
|
|
91
94
|
}
|
|
@@ -10,7 +10,11 @@ const { EXIT_CODES } = require('../../lib/enums/exitCodes');
|
|
|
10
10
|
|
|
11
11
|
const i18nKey = 'lib.prompts.selectPublicAppPrompt';
|
|
12
12
|
|
|
13
|
-
const fetchPublicAppOptions = async (
|
|
13
|
+
const fetchPublicAppOptions = async (
|
|
14
|
+
accountId,
|
|
15
|
+
accountName,
|
|
16
|
+
isMigratingApp = false
|
|
17
|
+
) => {
|
|
14
18
|
try {
|
|
15
19
|
const publicApps = await fetchPublicAppsForPortal(accountId);
|
|
16
20
|
const filteredPublicApps = publicApps.filter(
|
|
@@ -19,13 +23,15 @@ const fetchPublicAppOptions = async (accountId, accountName, migrateApp) => {
|
|
|
19
23
|
|
|
20
24
|
if (
|
|
21
25
|
!filteredPublicApps.length ||
|
|
22
|
-
(
|
|
23
|
-
!filteredPublicApps.
|
|
26
|
+
(isMigratingApp &&
|
|
27
|
+
!filteredPublicApps.some(
|
|
28
|
+
app => !app.preventProjectMigrations || !app.listingInfo
|
|
29
|
+
))
|
|
24
30
|
) {
|
|
25
|
-
const headerTranslationKey =
|
|
31
|
+
const headerTranslationKey = isMigratingApp
|
|
26
32
|
? 'noAppsMigration'
|
|
27
33
|
: 'noAppsClone';
|
|
28
|
-
const messageTranslationKey =
|
|
34
|
+
const messageTranslationKey = isMigratingApp
|
|
29
35
|
? 'noAppsMigrationMessage'
|
|
30
36
|
: 'noAppsCloneMessage';
|
|
31
37
|
uiLine();
|
|
@@ -47,14 +53,16 @@ const fetchPublicAppOptions = async (accountId, accountName, migrateApp) => {
|
|
|
47
53
|
const selectPublicAppPrompt = async ({
|
|
48
54
|
accountId,
|
|
49
55
|
accountName,
|
|
50
|
-
|
|
56
|
+
isMigratingApp = false,
|
|
51
57
|
}) => {
|
|
52
58
|
const publicApps = await fetchPublicAppOptions(
|
|
53
59
|
accountId,
|
|
54
60
|
accountName,
|
|
55
|
-
|
|
61
|
+
isMigratingApp
|
|
56
62
|
);
|
|
57
|
-
const translationKey =
|
|
63
|
+
const translationKey = isMigratingApp
|
|
64
|
+
? 'selectAppIdMigrate'
|
|
65
|
+
: 'selectAppIdClone';
|
|
58
66
|
|
|
59
67
|
return promptUser([
|
|
60
68
|
{
|
|
@@ -64,7 +72,8 @@ const selectPublicAppPrompt = async ({
|
|
|
64
72
|
}),
|
|
65
73
|
type: 'list',
|
|
66
74
|
choices: publicApps.map(app => {
|
|
67
|
-
|
|
75
|
+
const { preventProjectMigrations, listingInfo } = app;
|
|
76
|
+
if (isMigratingApp && preventProjectMigrations && listingInfo) {
|
|
68
77
|
return {
|
|
69
78
|
name: `${app.name} (${app.id})`,
|
|
70
79
|
disabled: i18n(`${i18nKey}.errors.cannotBeMigrated`),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "5.2.1-beta.
|
|
3
|
+
"version": "5.2.1-beta.12",
|
|
4
4
|
"description": "CLI for working with HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "24f25e7728f70ea9628e268a08f6d26916c94e40"
|
|
50
50
|
}
|