@hubspot/cli 4.1.8-beta.6 → 4.1.8-beta.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/sandbox/delete.js +15 -0
- package/lang/en.lyaml +6 -3
- package/lib/sandbox-create.js +15 -0
- package/lib/sandbox-sync.js +18 -0
- package/package.json +2 -2
|
@@ -187,6 +187,21 @@ exports.handler = async options => {
|
|
|
187
187
|
})
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
|
+
} else if (
|
|
191
|
+
isSpecifiedError(err, {
|
|
192
|
+
statusCode: 403,
|
|
193
|
+
category: 'BANNED',
|
|
194
|
+
subCategory: 'SandboxErrors.USER_ACCESS_NOT_ALLOWED',
|
|
195
|
+
})
|
|
196
|
+
) {
|
|
197
|
+
logger.log('');
|
|
198
|
+
logger.error(
|
|
199
|
+
i18n(`${i18nKey}.failure.invalidUser`, {
|
|
200
|
+
accountName: getAccountName(accountConfig),
|
|
201
|
+
parentAccountName: getAccountName(parentAccount),
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
logger.log('');
|
|
190
205
|
} else if (
|
|
191
206
|
isSpecifiedError(err, {
|
|
192
207
|
statusCode: 404,
|
package/lang/en.lyaml
CHANGED
|
@@ -662,10 +662,11 @@ en:
|
|
|
662
662
|
deleteDefault: "Sandbox \"{{ account }}\" with portalId \"{{ sandboxHubId }}\" was deleted successfully and removed as the default account."
|
|
663
663
|
configFileUpdated: "Removed account {{ account }} from {{ configFilename }}."
|
|
664
664
|
failure:
|
|
665
|
+
invalidUser: "Couldn't delete {{ accountName }} because your account has been removed from {{ parentAccountName }} or your permission set doesn't allow you to delete the sandbox. To update your permissions, contact a super admin in {{ parentAccountName }}."
|
|
665
666
|
noAccount: "No account specified. Specify an account by using the --account flag."
|
|
666
667
|
noSandboxAccounts: "There are no sandboxes connected to the CLI. To add a sandbox, run {{#bold}}hs auth{{/bold}}."
|
|
667
668
|
noParentAccount: "This sandbox can't be deleted from the CLI because you haven't given the CLI access to its parent account. To do this, run {{#bold}}hs auth{{/bold}} and add the parent account."
|
|
668
|
-
objectNotFound: "Sandbox {{#bold}}{{ account }}{{/bold}} may have been
|
|
669
|
+
objectNotFound: "Sandbox {{#bold}}{{ account }}{{/bold}} may have been deleted through the UI. The account has been removed from the config."
|
|
669
670
|
noParentPortalAvailable: "This sandbox can't be deleted from the CLI because you haven't given the CLI access to its parent account. To do this, run {{#bold}}{{ command }}{{/bold}}. You can also delete the sandbox from the HubSpot management tool: {{#bold}}{{ url }}{{/bold}}."
|
|
670
671
|
invalidKey: "Your personal access key for account {{#bold}}{{ account }}{{/bold}} is inactive. To re-authenticate, please run {{#bold}}hs auth personalaccesskey{{/bold}}."
|
|
671
672
|
options:
|
|
@@ -972,7 +973,7 @@ en:
|
|
|
972
973
|
describe: "Use environment variable config"
|
|
973
974
|
prompts:
|
|
974
975
|
projectDevTargetAccountPrompt:
|
|
975
|
-
createNewSandboxOption: "<Test on a new
|
|
976
|
+
createNewSandboxOption: "<Test on a new development sandbox>"
|
|
976
977
|
chooseDefaultAccountOption: "<{{#bold}}!{{/bold}} Test on this production account {{#bold}}!{{/bold}}>"
|
|
977
978
|
promptMessage: "[--account] Choose a sandbox under {{ accountIdentifier }} to test with:"
|
|
978
979
|
sandboxLimit: "You’ve reached the limit of {{ limit }} development sandboxes"
|
|
@@ -1128,6 +1129,7 @@ en:
|
|
|
1128
1129
|
success:
|
|
1129
1130
|
configFileUpdated: "{{ configFilename }} updated with {{ authMethod }} for account {{ account }}."
|
|
1130
1131
|
failure:
|
|
1132
|
+
invalidUser: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because your account has been removed from {{#bold}}{{ parentAccountName }}{{/bold}} or your permission set doesn't allow you to create the sandbox. To update your permissions, contact a super admin in {{#bold}}{{ parentAccountName }}{{/bold}}."
|
|
1131
1133
|
limit:
|
|
1132
1134
|
developer:
|
|
1133
1135
|
one: "{{#bold}}{{ accountName }}{{/bold}} reached the limit of {{ limit }} development sandbox.
|
|
@@ -1185,10 +1187,11 @@ en:
|
|
|
1185
1187
|
fail: "Failed to fetch sync updates. View the sync status at: {{ url }}"
|
|
1186
1188
|
succeed: "Sandbox sync complete."
|
|
1187
1189
|
failure:
|
|
1190
|
+
invalidUser: "Couldn't sync {{ accountName }} because your account has been removed from {{ parentAccountName }} or your permission set doesn't allow you to sync the sandbox. To update your permissions, contact a super admin in {{ parentAccountName }}."
|
|
1188
1191
|
missingScopes: "Couldn’t run the sync because there are scopes missing in your production account. To update scopes, deactivate your current personal access key for {{#bold}}{{ accountName }}{{/bold}}, and generate a new one. Then run `hs auth` to update the CLI with the new key."
|
|
1189
1192
|
syncInProgress: "Couldn’t run the sync because there’s another sync in progress. Wait for the current sync to finish and then try again. To check the sync status, visit the sync activity log: {{ url }}."
|
|
1190
1193
|
notSuperAdmin: "Couldn't run the sync because you are not a super admin in {{ account }}. Ask the account owner for super admin access to the sandbox."
|
|
1191
|
-
objectNotFound: "Couldn't sync the sandbox because {{#bold}}{{ account }}{{/bold}} may have been
|
|
1194
|
+
objectNotFound: "Couldn't sync the sandbox because {{#bold}}{{ account }}{{/bold}} may have been deleted through the UI. Run {{#bold}}hs sandbox delete{{/bold}} to remove this account from the config. "
|
|
1192
1195
|
types:
|
|
1193
1196
|
parcels:
|
|
1194
1197
|
label: "Account tools and features"
|
package/lib/sandbox-create.js
CHANGED
|
@@ -86,6 +86,21 @@ const buildSandbox = async ({
|
|
|
86
86
|
url,
|
|
87
87
|
})
|
|
88
88
|
);
|
|
89
|
+
} else if (
|
|
90
|
+
isSpecifiedError(err, {
|
|
91
|
+
statusCode: 403,
|
|
92
|
+
category: 'BANNED',
|
|
93
|
+
subCategory: 'SandboxErrors.USER_ACCESS_NOT_ALLOWED',
|
|
94
|
+
})
|
|
95
|
+
) {
|
|
96
|
+
logger.log('');
|
|
97
|
+
logger.error(
|
|
98
|
+
i18n(`${i18nKey}.failure.invalidUser`, {
|
|
99
|
+
accountName: name,
|
|
100
|
+
parentAccountName: accountConfig.name || accountId,
|
|
101
|
+
})
|
|
102
|
+
);
|
|
103
|
+
logger.log('');
|
|
89
104
|
} else if (
|
|
90
105
|
isSpecifiedError(err, {
|
|
91
106
|
statusCode: 400,
|
package/lib/sandbox-sync.js
CHANGED
|
@@ -19,6 +19,9 @@ const {
|
|
|
19
19
|
const { getSandboxTypeAsString } = require('./sandboxes');
|
|
20
20
|
const { getAccountId } = require('@hubspot/cli-lib');
|
|
21
21
|
const { uiAccountDescription } = require('./ui');
|
|
22
|
+
const {
|
|
23
|
+
debugErrorAndContext,
|
|
24
|
+
} = require('@hubspot/cli-lib/errorHandlers/standardErrors');
|
|
22
25
|
|
|
23
26
|
const i18nKey = 'cli.lib.sandbox.sync';
|
|
24
27
|
|
|
@@ -96,6 +99,8 @@ const syncSandbox = async ({
|
|
|
96
99
|
logger.log('');
|
|
97
100
|
}
|
|
98
101
|
} catch (err) {
|
|
102
|
+
debugErrorAndContext(err);
|
|
103
|
+
|
|
99
104
|
spinnies.fail('sandboxSync', {
|
|
100
105
|
text: i18n(`${i18nKey}.loading.fail`),
|
|
101
106
|
});
|
|
@@ -107,6 +112,19 @@ const syncSandbox = async ({
|
|
|
107
112
|
accountName: getAccountName(parentAccountConfig),
|
|
108
113
|
})
|
|
109
114
|
);
|
|
115
|
+
} else if (
|
|
116
|
+
isSpecifiedError(err, {
|
|
117
|
+
statusCode: 403,
|
|
118
|
+
category: 'BANNED',
|
|
119
|
+
subCategory: 'sandboxes-sync-api.SYNC_NOT_ALLOWED_INVALID_USER',
|
|
120
|
+
})
|
|
121
|
+
) {
|
|
122
|
+
logger.error(
|
|
123
|
+
i18n(`${i18nKey}.failure.invalidUser`, {
|
|
124
|
+
accountName: uiAccountDescription(accountId),
|
|
125
|
+
parentAccountName: getAccountName(parentAccountConfig),
|
|
126
|
+
})
|
|
127
|
+
);
|
|
110
128
|
} else if (
|
|
111
129
|
isSpecifiedError(err, {
|
|
112
130
|
statusCode: 429,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "4.1.8-beta.
|
|
3
|
+
"version": "4.1.8-beta.7",
|
|
4
4
|
"description": "CLI for working with HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "3116f0d518598a1b72d07457edf2374181a8f35e"
|
|
47
47
|
}
|