@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.
@@ -77,7 +77,7 @@ exports.handler = async options => {
77
77
  accountId,
78
78
  accountName,
79
79
  options,
80
- migrateApp: false,
80
+ isMigratingApp: false,
81
81
  });
82
82
  appId = appIdResponse.appId;
83
83
  }
@@ -79,13 +79,16 @@ exports.handler = async options => {
79
79
  : await selectPublicAppPrompt({
80
80
  accountId,
81
81
  accountName,
82
- migrateApp: true,
82
+ isMigratingApp: true,
83
83
  });
84
84
 
85
85
  let appName;
86
86
  try {
87
87
  const selectedApp = await fetchPublicAppMetadata(appId, accountId);
88
- if (selectedApp.preventProjectMigrations) {
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 (accountId, accountName, migrateApp) => {
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
- (migrateApp &&
23
- !filteredPublicApps.find(app => !app.preventProjectMigrations))
26
+ (isMigratingApp &&
27
+ !filteredPublicApps.some(
28
+ app => !app.preventProjectMigrations || !app.listingInfo
29
+ ))
24
30
  ) {
25
- const headerTranslationKey = migrateApp
31
+ const headerTranslationKey = isMigratingApp
26
32
  ? 'noAppsMigration'
27
33
  : 'noAppsClone';
28
- const messageTranslationKey = migrateApp
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
- migrateApp = false,
56
+ isMigratingApp = false,
51
57
  }) => {
52
58
  const publicApps = await fetchPublicAppOptions(
53
59
  accountId,
54
60
  accountName,
55
- (migrateApp = false)
61
+ isMigratingApp
56
62
  );
57
- const translationKey = migrateApp ? 'selectAppIdMigrate' : 'selectAppIdClone';
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
- if (migrateApp && app.preventProjectMigrations) {
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.11",
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": "615fa1fe30d5343064ee0646fe5109546236c854"
49
+ "gitHead": "24f25e7728f70ea9628e268a08f6d26916c94e40"
50
50
  }