@hubspot/cli 7.0.1 → 7.0.2-experimental.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/commands/project/dev.js +4 -3
- package/commands/project/upload.js +7 -2
- package/commands/sandbox/create.js +5 -10
- package/commands/theme/preview.js +3 -2
- package/lang/en.lyaml +2 -0
- package/lib/DevServerManager.d.ts +40 -1
- package/lib/DevServerManager.js +39 -30
- package/lib/LocalDevManager.js +7 -6
- package/lib/buildAccount.js +3 -3
- package/lib/dependencyManagement.d.ts +9 -4
- package/lib/dependencyManagement.js +45 -49
- package/lib/errorHandlers/index.js +5 -2
- package/lib/localDev.js +1 -7
- package/lib/projects/structure.d.ts +2 -71
- package/lib/projects/structure.js +6 -10
- package/lib/projects/upload.d.ts +1 -1
- package/lib/projects/upload.js +27 -5
- package/lib/sandboxSync.d.ts +4 -1
- package/lib/sandboxSync.js +67 -68
- package/lib/sandboxes.d.ts +20 -1
- package/lib/sandboxes.js +77 -175
- package/package.json +7 -5
- package/types/Projects.d.ts +68 -0
- package/types/Projects.js +7 -0
- package/types/Sandboxes.d.ts +3 -0
- package/types/Sandboxes.js +2 -0
package/lib/sandboxes.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
3
|
+
exports.SANDBOX_API_TYPE_MAP = exports.SANDBOX_TYPE_MAP = exports.SYNC_TYPES = void 0;
|
|
4
|
+
exports.getSandboxTypeAsString = getSandboxTypeAsString;
|
|
5
|
+
exports.getAvailableSyncTypes = getAvailableSyncTypes;
|
|
6
|
+
exports.validateSandboxUsageLimits = validateSandboxUsageLimits;
|
|
7
|
+
exports.handleSandboxCreateError = handleSandboxCreateError;
|
|
8
|
+
const logger_1 = require("@hubspot/local-dev-lib/logger");
|
|
9
|
+
const sandboxHubs_1 = require("@hubspot/local-dev-lib/api/sandboxHubs");
|
|
10
|
+
const sandboxSync_1 = require("@hubspot/local-dev-lib/api/sandboxSync");
|
|
11
|
+
const config_1 = require("@hubspot/local-dev-lib/config");
|
|
12
|
+
const urls_1 = require("@hubspot/local-dev-lib/urls");
|
|
13
|
+
const config_2 = require("@hubspot/local-dev-lib/constants/config");
|
|
14
|
+
const getAccountIdentifier_1 = require("@hubspot/local-dev-lib/config/getAccountIdentifier");
|
|
15
|
+
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
16
|
+
const lang_1 = require("./lang");
|
|
17
|
+
const ui_1 = require("./ui");
|
|
18
|
+
const index_2 = require("./errorHandlers/index");
|
|
19
|
+
const i18nKey = 'lib.sandbox';
|
|
20
|
+
exports.SYNC_TYPES = {
|
|
19
21
|
OBJECT_RECORDS: 'object-records',
|
|
20
22
|
};
|
|
21
|
-
|
|
22
|
-
dev: HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
23
|
-
developer: HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
24
|
-
development: HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
25
|
-
standard: HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
|
|
23
|
+
exports.SANDBOX_TYPE_MAP = {
|
|
24
|
+
dev: config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
25
|
+
developer: config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
26
|
+
development: config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX,
|
|
27
|
+
standard: config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX,
|
|
26
28
|
};
|
|
27
|
-
|
|
28
|
-
[HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX]: 1,
|
|
29
|
-
[HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX]: 2,
|
|
29
|
+
exports.SANDBOX_API_TYPE_MAP = {
|
|
30
|
+
[config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX]: 1,
|
|
31
|
+
[config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX]: 2,
|
|
30
32
|
};
|
|
31
|
-
|
|
32
|
-
if (accountType === HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
33
|
+
function getSandboxTypeAsString(accountType) {
|
|
34
|
+
if (accountType === config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
33
35
|
return 'development'; // Only place we're using this specific name
|
|
34
36
|
}
|
|
35
37
|
return 'standard';
|
|
36
|
-
}
|
|
38
|
+
}
|
|
37
39
|
function getHasSandboxesByType(parentAccountConfig, type) {
|
|
38
|
-
const id = getAccountIdentifier(parentAccountConfig);
|
|
39
|
-
const parentPortalId = getAccountId(id);
|
|
40
|
-
const accountsList = getConfigAccounts();
|
|
40
|
+
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(parentAccountConfig);
|
|
41
|
+
const parentPortalId = (0, config_1.getAccountId)(id);
|
|
42
|
+
const accountsList = (0, config_1.getConfigAccounts)() || [];
|
|
41
43
|
for (const portal of accountsList) {
|
|
42
44
|
if ((portal.parentAccountId !== null ||
|
|
43
45
|
portal.parentAccountId !== undefined) &&
|
|
@@ -49,79 +51,45 @@ function getHasSandboxesByType(parentAccountConfig, type) {
|
|
|
49
51
|
}
|
|
50
52
|
return false;
|
|
51
53
|
}
|
|
52
|
-
function getSandboxLimit(error) {
|
|
53
|
-
// Error context should contain a limit property with a list of one number. That number is the current limit
|
|
54
|
-
const limit = error.context && error.context.limit && error.context.limit[0];
|
|
55
|
-
return limit ? parseInt(limit, 10) : 1; // Default to 1
|
|
56
|
-
}
|
|
57
54
|
// Fetches available sync types for a given sandbox portal
|
|
58
55
|
async function getAvailableSyncTypes(parentAccountConfig, config) {
|
|
59
|
-
const parentId = getAccountIdentifier(parentAccountConfig);
|
|
60
|
-
const parentPortalId = getAccountId(parentId);
|
|
61
|
-
const id = getAccountIdentifier(config);
|
|
62
|
-
const portalId = getAccountId(id);
|
|
63
|
-
|
|
56
|
+
const parentId = (0, getAccountIdentifier_1.getAccountIdentifier)(parentAccountConfig);
|
|
57
|
+
const parentPortalId = (0, config_1.getAccountId)(parentId);
|
|
58
|
+
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(config);
|
|
59
|
+
const portalId = (0, config_1.getAccountId)(id);
|
|
60
|
+
if (!parentPortalId || !portalId) {
|
|
61
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.sync.failure.syncTypeFetch`));
|
|
62
|
+
}
|
|
63
|
+
const { data: { results: syncTypes }, } = await (0, sandboxSync_1.fetchTypes)(parentPortalId, portalId);
|
|
64
64
|
if (!syncTypes) {
|
|
65
|
-
throw new Error(
|
|
65
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.sync.failure.syncTypeFetch`));
|
|
66
66
|
}
|
|
67
67
|
return syncTypes.map(t => ({ type: t.name }));
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*/
|
|
75
|
-
const getSyncTypesWithContactRecordsPrompt = async (accountConfig, syncTasks, skipPrompt = false) => {
|
|
76
|
-
// TODO: remove this entire helper once hs sandbox sync is fully deprecated
|
|
77
|
-
const isDevSandbox = isDevelopmentSandbox(accountConfig);
|
|
78
|
-
if (isDevSandbox) {
|
|
79
|
-
// Disable dev sandbox from syncing contacts
|
|
80
|
-
return syncTasks.filter(t => t.type !== syncTypes.OBJECT_RECORDS);
|
|
69
|
+
async function validateSandboxUsageLimits(accountConfig, sandboxType, env) {
|
|
70
|
+
const id = (0, getAccountIdentifier_1.getAccountIdentifier)(accountConfig);
|
|
71
|
+
const accountId = (0, config_1.getAccountId)(id);
|
|
72
|
+
if (!accountId) {
|
|
73
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.usageLimitFetch`));
|
|
81
74
|
}
|
|
82
|
-
|
|
83
|
-
syncTasks.some(t => t.type === syncTypes.OBJECT_RECORDS) &&
|
|
84
|
-
!skipPrompt) {
|
|
85
|
-
const { contactRecordsSyncPrompt } = await promptUser([
|
|
86
|
-
{
|
|
87
|
-
name: 'contactRecordsSyncPrompt',
|
|
88
|
-
type: 'confirm',
|
|
89
|
-
message: i18n('lib.sandbox.sync.confirm.syncContactRecords.standard'),
|
|
90
|
-
},
|
|
91
|
-
]);
|
|
92
|
-
if (!contactRecordsSyncPrompt) {
|
|
93
|
-
return syncTasks.filter(t => t.type !== syncTypes.OBJECT_RECORDS);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return syncTasks;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* @param {Object} accountConfig - Account config of sandbox portal
|
|
100
|
-
* @param {String} sandboxType - Sandbox type for limit validation
|
|
101
|
-
* @param {String} env - Environment
|
|
102
|
-
* @returns {null}
|
|
103
|
-
*/
|
|
104
|
-
const validateSandboxUsageLimits = async (accountConfig, sandboxType, env) => {
|
|
105
|
-
const id = getAccountIdentifier(accountConfig);
|
|
106
|
-
const accountId = getAccountId(id);
|
|
107
|
-
const { data: { usage }, } = await getSandboxUsageLimits(accountId);
|
|
75
|
+
const { data: { usage }, } = await (0, sandboxHubs_1.getSandboxUsageLimits)(accountId);
|
|
108
76
|
if (!usage) {
|
|
109
|
-
throw new Error(
|
|
77
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.usageLimitFetch`));
|
|
110
78
|
}
|
|
111
|
-
if (sandboxType === HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
79
|
+
if (sandboxType === config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX) {
|
|
112
80
|
if (usage['DEVELOPER'].available === 0) {
|
|
113
81
|
const devSandboxLimit = usage['DEVELOPER'].limit;
|
|
114
82
|
const plural = devSandboxLimit !== 1;
|
|
115
|
-
const hasDevelopmentSandboxes = getHasSandboxesByType(accountConfig, HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
|
|
83
|
+
const hasDevelopmentSandboxes = getHasSandboxesByType(accountConfig, config_2.HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
|
|
116
84
|
if (hasDevelopmentSandboxes) {
|
|
117
|
-
throw new Error(i18n(
|
|
85
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.alreadyInConfig.developer.${plural ? 'other' : 'one'}`, {
|
|
118
86
|
accountName: accountConfig.name || accountId,
|
|
119
87
|
limit: devSandboxLimit,
|
|
120
88
|
}));
|
|
121
89
|
}
|
|
122
90
|
else {
|
|
123
|
-
const baseUrl = getHubSpotWebsiteOrigin(env);
|
|
124
|
-
throw new Error(i18n(
|
|
91
|
+
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
92
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.limit.developer.${plural ? 'other' : 'one'}`, {
|
|
125
93
|
accountName: accountConfig.name || accountId,
|
|
126
94
|
limit: devSandboxLimit,
|
|
127
95
|
link: `${baseUrl}/sandboxes-developer/${accountId}/development`,
|
|
@@ -129,20 +97,20 @@ const validateSandboxUsageLimits = async (accountConfig, sandboxType, env) => {
|
|
|
129
97
|
}
|
|
130
98
|
}
|
|
131
99
|
}
|
|
132
|
-
if (sandboxType === HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX) {
|
|
100
|
+
if (sandboxType === config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX) {
|
|
133
101
|
if (usage['STANDARD'].available === 0) {
|
|
134
102
|
const standardSandboxLimit = usage['STANDARD'].limit;
|
|
135
103
|
const plural = standardSandboxLimit !== 1;
|
|
136
|
-
const hasStandardSandboxes = getHasSandboxesByType(accountConfig, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
104
|
+
const hasStandardSandboxes = getHasSandboxesByType(accountConfig, config_2.HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
137
105
|
if (hasStandardSandboxes) {
|
|
138
|
-
throw new Error(i18n(
|
|
106
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.alreadyInConfig.standard.${plural ? 'other' : 'one'}`, {
|
|
139
107
|
accountName: accountConfig.name || accountId,
|
|
140
108
|
limit: standardSandboxLimit,
|
|
141
109
|
}));
|
|
142
110
|
}
|
|
143
111
|
else {
|
|
144
|
-
const baseUrl = getHubSpotWebsiteOrigin(env);
|
|
145
|
-
throw new Error(i18n(
|
|
112
|
+
const baseUrl = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
113
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.create.failure.limit.standard.${plural ? 'other' : 'one'}`, {
|
|
146
114
|
accountName: accountConfig.name || accountId,
|
|
147
115
|
limit: standardSandboxLimit,
|
|
148
116
|
link: `${baseUrl}/sandboxes-developer/${accountId}/standard`,
|
|
@@ -150,112 +118,46 @@ const validateSandboxUsageLimits = async (accountConfig, sandboxType, env) => {
|
|
|
150
118
|
}
|
|
151
119
|
}
|
|
152
120
|
}
|
|
153
|
-
}
|
|
154
|
-
function handleSandboxCreateError(
|
|
155
|
-
if (isMissingScopeError(err)) {
|
|
156
|
-
logger.error(i18n(
|
|
157
|
-
accountName: uiAccountDescription(accountId),
|
|
121
|
+
}
|
|
122
|
+
function handleSandboxCreateError(err, env, name, accountId) {
|
|
123
|
+
if ((0, index_1.isMissingScopeError)(err)) {
|
|
124
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.create.failure.scopes.message`, {
|
|
125
|
+
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
158
126
|
}));
|
|
159
|
-
const websiteOrigin = getHubSpotWebsiteOrigin(env);
|
|
127
|
+
const websiteOrigin = (0, urls_1.getHubSpotWebsiteOrigin)(env);
|
|
160
128
|
const url = `${websiteOrigin}/personal-access-key/${accountId}`;
|
|
161
|
-
logger.info(i18n(
|
|
162
|
-
accountName: uiAccountDescription(accountId),
|
|
129
|
+
logger_1.logger.info((0, lang_1.i18n)(`${i18nKey}.create.failure.scopes.instructions`, {
|
|
130
|
+
accountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
163
131
|
url,
|
|
164
132
|
}));
|
|
165
133
|
}
|
|
166
|
-
else if (isSpecifiedError(err, {
|
|
134
|
+
else if ((0, index_1.isSpecifiedError)(err, {
|
|
167
135
|
statusCode: 403,
|
|
168
136
|
category: 'BANNED',
|
|
169
137
|
subCategory: 'SandboxErrors.USER_ACCESS_NOT_ALLOWED',
|
|
170
138
|
})) {
|
|
171
|
-
logger.log('');
|
|
172
|
-
logger.error(i18n(
|
|
139
|
+
logger_1.logger.log('');
|
|
140
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.create.failure.invalidUser`, {
|
|
173
141
|
accountName: name,
|
|
174
|
-
parentAccountName: uiAccountDescription(accountId),
|
|
142
|
+
parentAccountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
175
143
|
}));
|
|
176
|
-
logger.log('');
|
|
144
|
+
logger_1.logger.log('');
|
|
177
145
|
}
|
|
178
|
-
else if (isSpecifiedError(err, {
|
|
146
|
+
else if ((0, index_1.isSpecifiedError)(err, {
|
|
179
147
|
statusCode: 403,
|
|
180
148
|
category: 'BANNED',
|
|
181
149
|
subCategory: 'SandboxErrors.DEVELOPMENT_SANDBOX_ACCESS_NOT_ALLOWED',
|
|
182
150
|
})) {
|
|
183
|
-
logger.log('');
|
|
184
|
-
logger.error(i18n(
|
|
151
|
+
logger_1.logger.log('');
|
|
152
|
+
logger_1.logger.error((0, lang_1.i18n)(`${i18nKey}.create.failure.403Gating`, {
|
|
185
153
|
accountName: name,
|
|
186
|
-
parentAccountName: uiAccountDescription(accountId),
|
|
154
|
+
parentAccountName: (0, ui_1.uiAccountDescription)(accountId),
|
|
187
155
|
accountId,
|
|
188
156
|
}));
|
|
189
|
-
logger.log('');
|
|
190
|
-
}
|
|
191
|
-
else if (isSpecifiedError(err, {
|
|
192
|
-
statusCode: 400,
|
|
193
|
-
category: 'VALIDATION_ERROR',
|
|
194
|
-
subCategory: 'SandboxErrors.NUM_DEVELOPMENT_SANDBOXES_LIMIT_EXCEEDED_ERROR',
|
|
195
|
-
}) &&
|
|
196
|
-
err.error &&
|
|
197
|
-
err.error.message) {
|
|
198
|
-
logger.log('');
|
|
199
|
-
const devSandboxLimit = getSandboxLimit(err.error);
|
|
200
|
-
const plural = devSandboxLimit !== 1;
|
|
201
|
-
const hasDevelopmentSandboxes = getHasSandboxesByType(accountConfig, HUBSPOT_ACCOUNT_TYPES.DEVELOPMENT_SANDBOX);
|
|
202
|
-
if (hasDevelopmentSandboxes) {
|
|
203
|
-
logger.error(i18n(`lib.sandboxes.create.failure.alreadyInConfig.developer.${plural ? 'other' : 'one'}`, {
|
|
204
|
-
accountName: uiAccountDescription(accountId),
|
|
205
|
-
limit: devSandboxLimit,
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
const baseUrl = getHubSpotWebsiteOrigin(getValidEnv(getEnv(accountId)));
|
|
210
|
-
logger.error(i18n(`lib.sandboxes.create.failure.limit.developer.${plural ? 'other' : 'one'}`, {
|
|
211
|
-
accountName: uiAccountDescription(accountId),
|
|
212
|
-
limit: devSandboxLimit,
|
|
213
|
-
link: `${baseUrl}/sandboxes-developer/${accountId}/development`,
|
|
214
|
-
}));
|
|
215
|
-
}
|
|
216
|
-
logger.log('');
|
|
217
|
-
}
|
|
218
|
-
else if (isSpecifiedError(err, {
|
|
219
|
-
statusCode: 400,
|
|
220
|
-
category: 'VALIDATION_ERROR',
|
|
221
|
-
subCategory: 'SandboxErrors.NUM_STANDARD_SANDBOXES_LIMIT_EXCEEDED_ERROR',
|
|
222
|
-
}) &&
|
|
223
|
-
err.error &&
|
|
224
|
-
err.error.message) {
|
|
225
|
-
logger.log('');
|
|
226
|
-
const standardSandboxLimit = getSandboxLimit(err.error);
|
|
227
|
-
const plural = standardSandboxLimit !== 1;
|
|
228
|
-
const hasStandardSandboxes = getHasSandboxesByType(accountConfig, HUBSPOT_ACCOUNT_TYPES.STANDARD_SANDBOX);
|
|
229
|
-
if (hasStandardSandboxes) {
|
|
230
|
-
logger.error(i18n(`lib.sandboxes.create.failure.alreadyInConfig.standard.${plural ? 'other' : 'one'}`, {
|
|
231
|
-
accountName: uiAccountDescription(accountId),
|
|
232
|
-
limit: standardSandboxLimit,
|
|
233
|
-
}));
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
const baseUrl = getHubSpotWebsiteOrigin(getValidEnv(getEnv(accountId)));
|
|
237
|
-
logger.error(i18n(`lib.sandboxes.create.failure.limit.standard.${plural ? 'other' : 'one'}`, {
|
|
238
|
-
accountName: uiAccountDescription(accountId),
|
|
239
|
-
limit: standardSandboxLimit,
|
|
240
|
-
link: `${baseUrl}/sandboxes-developer/${accountId}/standard`,
|
|
241
|
-
}));
|
|
242
|
-
}
|
|
243
|
-
logger.log('');
|
|
157
|
+
logger_1.logger.log('');
|
|
244
158
|
}
|
|
245
159
|
else {
|
|
246
|
-
logError(err);
|
|
160
|
+
(0, index_2.logError)(err);
|
|
247
161
|
}
|
|
248
162
|
throw err;
|
|
249
163
|
}
|
|
250
|
-
module.exports = {
|
|
251
|
-
sandboxTypeMap,
|
|
252
|
-
sandboxApiTypeMap,
|
|
253
|
-
syncTypes,
|
|
254
|
-
getSandboxTypeAsString,
|
|
255
|
-
getHasSandboxesByType,
|
|
256
|
-
getSandboxLimit,
|
|
257
|
-
validateSandboxUsageLimits,
|
|
258
|
-
getAvailableSyncTypes,
|
|
259
|
-
getSyncTypesWithContactRecordsPrompt,
|
|
260
|
-
handleSandboxCreateError,
|
|
261
|
-
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2-experimental.0",
|
|
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
8
|
"@hubspot/local-dev-lib": "3.1.1",
|
|
9
|
+
"@hubspot/project-parsing-lib": "^0.0.2-experimental.0",
|
|
9
10
|
"@hubspot/serverless-dev-runtime": "7.0.1",
|
|
10
11
|
"@hubspot/theme-preview-dev-server": "0.0.10",
|
|
11
12
|
"@hubspot/ui-extensions-dev-server": "0.8.40",
|
|
@@ -64,14 +65,15 @@
|
|
|
64
65
|
"list-all-commands": "yarn ts-node ./scripts/get-all-commands.ts",
|
|
65
66
|
"prettier:write": "prettier --write ./**/*.{ts,js,json}",
|
|
66
67
|
"test": "jest",
|
|
67
|
-
"test-cli": "yarn --cwd 'acceptance-tests' test-ci",
|
|
68
|
-
"test-cli-debug": "yarn --cwd 'acceptance-tests' test-debug",
|
|
69
|
-
"test-cli-qa": "yarn --cwd 'acceptance-tests' test-qa",
|
|
70
|
-
"test-cli-latest": "yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
|
|
68
|
+
"test-cli": "yarn build && yarn --cwd 'acceptance-tests' test-ci",
|
|
69
|
+
"test-cli-debug": "yarn build && yarn --cwd 'acceptance-tests' test-debug",
|
|
70
|
+
"test-cli-qa": "yarn build && yarn --cwd 'acceptance-tests' test-qa",
|
|
71
|
+
"test-cli-latest": "yarn build && yarn build-docker && docker container run -it --rm --name=hs-cli-container hs-cli-image yarn --cwd 'acceptance-tests' test-latest",
|
|
71
72
|
"build-docker": "docker image build --tag hs-cli-image . && docker image prune -f",
|
|
72
73
|
"circular-deps": "yarn madge --circular .",
|
|
73
74
|
"release": "yarn ts-node ./scripts/release.ts release",
|
|
74
75
|
"hs": "yarn build && node ./dist/bin/hs",
|
|
76
|
+
"hs-debug": "yarn build && NODE_DEBUG=http* node --inspect-brk ./dist/bin/hs",
|
|
75
77
|
"update-ldl": "yarn add --exact @hubspot/local-dev-lib@latest"
|
|
76
78
|
},
|
|
77
79
|
"lint-staged": {
|
package/types/Projects.d.ts
CHANGED
|
@@ -41,3 +41,71 @@ export type ProjectTemplateRepoConfig = {
|
|
|
41
41
|
projects?: ProjectTemplate[];
|
|
42
42
|
components?: ComponentTemplate[];
|
|
43
43
|
};
|
|
44
|
+
export type PrivateAppComponentConfig = {
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
uid: string;
|
|
48
|
+
scopes: Array<string>;
|
|
49
|
+
public: boolean;
|
|
50
|
+
extensions?: {
|
|
51
|
+
crm: {
|
|
52
|
+
cards: Array<{
|
|
53
|
+
file: string;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export type PublicAppComponentConfig = {
|
|
59
|
+
name: string;
|
|
60
|
+
uid: string;
|
|
61
|
+
description: string;
|
|
62
|
+
allowedUrls: Array<string>;
|
|
63
|
+
auth: {
|
|
64
|
+
redirectUrls: Array<string>;
|
|
65
|
+
requiredScopes: Array<string>;
|
|
66
|
+
optionalScopes: Array<string>;
|
|
67
|
+
conditionallyRequiredScopes: Array<string>;
|
|
68
|
+
};
|
|
69
|
+
support: {
|
|
70
|
+
supportEmail: string;
|
|
71
|
+
documentationUrl: string;
|
|
72
|
+
supportUrl: string;
|
|
73
|
+
supportPhone: string;
|
|
74
|
+
};
|
|
75
|
+
extensions?: {
|
|
76
|
+
crm: {
|
|
77
|
+
cards: Array<{
|
|
78
|
+
file: string;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
webhooks?: {
|
|
83
|
+
file: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type AppCardComponentConfig = {
|
|
87
|
+
type: 'crm-card';
|
|
88
|
+
data: {
|
|
89
|
+
title: string;
|
|
90
|
+
uid: string;
|
|
91
|
+
location: string;
|
|
92
|
+
module: {
|
|
93
|
+
file: string;
|
|
94
|
+
};
|
|
95
|
+
objectTypes: Array<{
|
|
96
|
+
name: string;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export type GenericComponentConfig = PublicAppComponentConfig | PrivateAppComponentConfig | AppCardComponentConfig;
|
|
101
|
+
export declare enum ComponentTypes {
|
|
102
|
+
PrivateApp = "private-app",
|
|
103
|
+
PublicApp = "public-app",
|
|
104
|
+
HublTheme = "hubl-theme"
|
|
105
|
+
}
|
|
106
|
+
export type Component = {
|
|
107
|
+
type: ComponentTypes;
|
|
108
|
+
config: GenericComponentConfig;
|
|
109
|
+
runnable: boolean;
|
|
110
|
+
path: string;
|
|
111
|
+
};
|
package/types/Projects.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentTypes = void 0;
|
|
4
|
+
var ComponentTypes;
|
|
5
|
+
(function (ComponentTypes) {
|
|
6
|
+
ComponentTypes["PrivateApp"] = "private-app";
|
|
7
|
+
ComponentTypes["PublicApp"] = "public-app";
|
|
8
|
+
ComponentTypes["HublTheme"] = "hubl-theme";
|
|
9
|
+
})(ComponentTypes || (exports.ComponentTypes = ComponentTypes = {}));
|