@hubspot/local-dev-lib 0.2.2 → 0.2.3
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/api/fileMapper.d.ts +2 -2
- package/api/fileMapper.js +2 -2
- package/api/functions.d.ts +4 -1
- package/api/functions.js +17 -3
- package/api/projects.js +1 -1
- package/errors/apiErrors.d.ts +1 -4
- package/errors/apiErrors.js +41 -44
- package/errors/fileSystemErrors.d.ts +1 -0
- package/errors/fileSystemErrors.js +10 -6
- package/errors/standardErrors.d.ts +0 -6
- package/errors/standardErrors.js +1 -8
- package/http/getAxiosConfig.js +2 -1
- package/lang/en.json +4 -4
- package/lang/lang/en.json +4 -4
- package/lib/fileMapper.js +1 -1
- package/package.json +1 -1
- package/types/Http.d.ts +1 -0
- package/utils/cms/modules.js +1 -1
package/api/fileMapper.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export declare function fetchModule(accountId: number, moduleId: number, options
|
|
|
7
7
|
export declare function fetchFileStream(accountId: number, filePath: string, destination: string, options?: FileMapperOptions): Promise<FileMapperNode>;
|
|
8
8
|
export declare function download(accountId: number, filepath: string, options?: FileMapperOptions): Promise<FileMapperNode>;
|
|
9
9
|
export declare function downloadDefault(accountId: number, filepath: string, options?: FileMapperOptions): Promise<FileMapperNode>;
|
|
10
|
-
export declare function deleteFile(accountId: number, filePath: string
|
|
10
|
+
export declare function deleteFile(accountId: number, filePath: string): Promise<void>;
|
|
11
11
|
export declare function moveFile(accountId: number, srcPath: string, destPath: string): Promise<void>;
|
|
12
|
-
export declare function getDirectoryContentsByPath(accountId: number, path: string): Promise<
|
|
12
|
+
export declare function getDirectoryContentsByPath(accountId: number, path: string): Promise<FileMapperNode>;
|
package/api/fileMapper.js
CHANGED
|
@@ -83,10 +83,9 @@ async function downloadDefault(accountId, filepath, options = {}) {
|
|
|
83
83
|
}
|
|
84
84
|
exports.downloadDefault = downloadDefault;
|
|
85
85
|
// Delete a file or folder by path
|
|
86
|
-
async function deleteFile(accountId, filePath
|
|
86
|
+
async function deleteFile(accountId, filePath) {
|
|
87
87
|
return http_1.default.delete(accountId, {
|
|
88
88
|
url: `${exports.FILE_MAPPER_API_PATH}/delete/${encodeURIComponent(filePath)}`,
|
|
89
|
-
...options,
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
91
|
exports.deleteFile = deleteFile;
|
|
@@ -94,6 +93,7 @@ exports.deleteFile = deleteFile;
|
|
|
94
93
|
async function moveFile(accountId, srcPath, destPath) {
|
|
95
94
|
return http_1.default.put(accountId, {
|
|
96
95
|
url: `${exports.FILE_MAPPER_API_PATH}/rename/${srcPath}?path=${destPath}`,
|
|
96
|
+
headers: { 'Content-Type': 'application/json' },
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
exports.moveFile = moveFile;
|
package/api/functions.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { QueryParams } from '../types/Http';
|
|
1
2
|
import { GetBuildStatusResponse, GetRoutesResponse } from '../types/Functions';
|
|
2
3
|
export declare function getRoutes(accountId: number): Promise<GetRoutesResponse>;
|
|
4
|
+
export declare function getFunctionLogs(accountId: number, route: string, query?: QueryParams): Promise<unknown>;
|
|
5
|
+
export declare function getLatestFunctionLog(accountId: number, route: string): Promise<unknown>;
|
|
3
6
|
export declare function buildPackage(accountId: number, folderPath: string): Promise<string>;
|
|
4
|
-
export declare function getBuildStatus(
|
|
7
|
+
export declare function getBuildStatus(accountId: number, buildId: number): Promise<GetBuildStatusResponse>;
|
package/api/functions.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getBuildStatus = exports.buildPackage = exports.getRoutes = void 0;
|
|
6
|
+
exports.getBuildStatus = exports.buildPackage = exports.getLatestFunctionLog = exports.getFunctionLogs = exports.getRoutes = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("../http"));
|
|
8
8
|
const FUNCTION_API_PATH = 'cms/v3/functions';
|
|
9
9
|
async function getRoutes(accountId) {
|
|
@@ -12,6 +12,20 @@ async function getRoutes(accountId) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
exports.getRoutes = getRoutes;
|
|
15
|
+
async function getFunctionLogs(accountId, route, query = {}) {
|
|
16
|
+
const { limit = 5 } = query;
|
|
17
|
+
return http_1.default.get(accountId, {
|
|
18
|
+
url: `${FUNCTION_API_PATH}/results/by-route/${encodeURIComponent(route)}`,
|
|
19
|
+
query: { ...query, limit },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.getFunctionLogs = getFunctionLogs;
|
|
23
|
+
async function getLatestFunctionLog(accountId, route) {
|
|
24
|
+
return http_1.default.get(accountId, {
|
|
25
|
+
url: `${FUNCTION_API_PATH}/results/by-route/${encodeURIComponent(route)}/latest`,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.getLatestFunctionLog = getLatestFunctionLog;
|
|
15
29
|
async function buildPackage(accountId, folderPath) {
|
|
16
30
|
return http_1.default.post(accountId, {
|
|
17
31
|
url: `${FUNCTION_API_PATH}/build/async`,
|
|
@@ -24,8 +38,8 @@ async function buildPackage(accountId, folderPath) {
|
|
|
24
38
|
});
|
|
25
39
|
}
|
|
26
40
|
exports.buildPackage = buildPackage;
|
|
27
|
-
async function getBuildStatus(
|
|
28
|
-
return http_1.default.get(
|
|
41
|
+
async function getBuildStatus(accountId, buildId) {
|
|
42
|
+
return http_1.default.get(accountId, {
|
|
29
43
|
url: `${FUNCTION_API_PATH}/build/${buildId}/poll`,
|
|
30
44
|
});
|
|
31
45
|
}
|
package/api/projects.js
CHANGED
|
@@ -50,7 +50,7 @@ async function downloadProject(accountId, projectName, buildId) {
|
|
|
50
50
|
return http_1.default.get(accountId, {
|
|
51
51
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/${buildId}/archive-full`,
|
|
52
52
|
encoding: null,
|
|
53
|
-
headers: { accept: 'application/zip',
|
|
53
|
+
headers: { accept: 'application/zip', 'Content-Type': 'application/json' },
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
exports.downloadProject = downloadProject;
|
package/errors/apiErrors.d.ts
CHANGED
|
@@ -5,10 +5,7 @@ export declare function isMissingScopeError(err: AxiosError<any>): boolean;
|
|
|
5
5
|
export declare function isGatingError(err: AxiosError<any>): boolean;
|
|
6
6
|
export declare function isApiUploadValidationError(err: AxiosError<any>): boolean;
|
|
7
7
|
export declare function isSpecifiedHubSpotAuthError(err: GenericError, { status, category, subCategory }: Partial<HubSpotAuthError>): boolean;
|
|
8
|
-
|
|
9
|
-
* @throws
|
|
10
|
-
*/
|
|
11
|
-
export declare function throwAxiosErrorWithContext(error: AxiosError<any>, context?: AxiosErrorContext): never;
|
|
8
|
+
export declare function getAxiosErrorWithContext(error: AxiosError<any>, context?: AxiosErrorContext): Error;
|
|
12
9
|
/**
|
|
13
10
|
* @throws
|
|
14
11
|
*/
|
package/errors/apiErrors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throwApiUploadError = exports.throwApiError = exports.
|
|
3
|
+
exports.throwApiUploadError = exports.throwApiError = exports.getAxiosErrorWithContext = exports.isSpecifiedHubSpotAuthError = exports.isApiUploadValidationError = exports.isGatingError = exports.isMissingScopeError = void 0;
|
|
4
4
|
const api_1 = require("../constants/api");
|
|
5
5
|
const lang_1 = require("../utils/lang");
|
|
6
6
|
const standardErrors_1 = require("./standardErrors");
|
|
@@ -57,37 +57,40 @@ function parseValidationErrors(responseData = { errors: [], message: '' }) {
|
|
|
57
57
|
}
|
|
58
58
|
return errorMessages;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* @throws
|
|
62
|
+
*/
|
|
60
63
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
-
function
|
|
64
|
+
function throwValidationErrors(error) {
|
|
62
65
|
const validationErrorMessages = parseValidationErrors(error?.response?.data);
|
|
63
66
|
if (validationErrorMessages.length) {
|
|
64
67
|
(0, standardErrors_1.throwError)(new Error(validationErrorMessages.join(' '), { cause: error }));
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
* @throws
|
|
69
|
-
*/
|
|
70
|
-
function throwAxiosErrorWithContext(
|
|
70
|
+
function getAxiosErrorWithContext(
|
|
71
71
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
72
|
error, context = {}) {
|
|
73
73
|
const { status } = error;
|
|
74
74
|
const method = error.config?.method;
|
|
75
75
|
const { projectName } = context;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
api_1.HTTP_METHOD_PREPOSITIONS
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
request,
|
|
76
|
+
let messageDetail;
|
|
77
|
+
if (context.accountId) {
|
|
78
|
+
const action = (method && api_1.HTTP_METHOD_VERBS[method]) || api_1.HTTP_METHOD_VERBS.get;
|
|
79
|
+
const preposition = (method && api_1.HTTP_METHOD_PREPOSITIONS[method]) ||
|
|
80
|
+
api_1.HTTP_METHOD_PREPOSITIONS.get;
|
|
81
|
+
const requestName = context.request
|
|
82
|
+
? `${action} ${preposition} '${context.request}'`
|
|
83
|
+
: action;
|
|
84
|
+
messageDetail = (0, lang_1.i18n)(`${i18nKey}.messageDetail`, {
|
|
86
85
|
accountId: context.accountId,
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
requestName,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
messageDetail = (0, lang_1.i18n)(`${i18nKey}.genericMessageDetail`);
|
|
91
|
+
}
|
|
89
92
|
const errorMessage = [];
|
|
90
|
-
if (
|
|
93
|
+
if ((method === 'put' || method === 'post') && context.payload) {
|
|
91
94
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.unableToUpload`, { payload: context.payload }));
|
|
92
95
|
}
|
|
93
96
|
const isProjectMissingScopeError = isMissingScopeError(error) && projectName;
|
|
@@ -101,12 +104,12 @@ error, context = {}) {
|
|
|
101
104
|
break;
|
|
102
105
|
case 403:
|
|
103
106
|
if (isProjectMissingScopeError) {
|
|
104
|
-
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.
|
|
107
|
+
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.403ProjectMissingScope`, {
|
|
105
108
|
accountId: context.accountId || '',
|
|
106
109
|
}));
|
|
107
110
|
}
|
|
108
111
|
else if (isProjectGatingError) {
|
|
109
|
-
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.
|
|
112
|
+
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.403ProjectGating`, {
|
|
110
113
|
accountId: context.accountId || '',
|
|
111
114
|
}));
|
|
112
115
|
}
|
|
@@ -115,16 +118,7 @@ error, context = {}) {
|
|
|
115
118
|
}
|
|
116
119
|
break;
|
|
117
120
|
case 404:
|
|
118
|
-
|
|
119
|
-
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.404Request`, {
|
|
120
|
-
action: action || 'request',
|
|
121
|
-
request: context.request,
|
|
122
|
-
account: context.accountId || '',
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.404`, { messageDetail }));
|
|
127
|
-
}
|
|
121
|
+
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.404`, { messageDetail }));
|
|
128
122
|
break;
|
|
129
123
|
case 429:
|
|
130
124
|
errorMessage.push((0, lang_1.i18n)(`${i18nKey}.codes.429`, { messageDetail }));
|
|
@@ -144,25 +138,28 @@ error, context = {}) {
|
|
|
144
138
|
}
|
|
145
139
|
break;
|
|
146
140
|
}
|
|
147
|
-
if (error?.response?.data
|
|
148
|
-
|
|
149
|
-
!isProjectGatingError) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
if (error?.response?.data) {
|
|
142
|
+
const { message, errors } = error.response.data;
|
|
143
|
+
if (message && !isProjectMissingScopeError && !isProjectGatingError) {
|
|
144
|
+
errorMessage.push(message);
|
|
145
|
+
}
|
|
146
|
+
if (errors) {
|
|
147
|
+
errors.forEach((err) => {
|
|
148
|
+
if (err.message) {
|
|
149
|
+
errorMessage.push('\n- ' + err.message);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
156
153
|
}
|
|
157
|
-
|
|
154
|
+
return new Error(errorMessage.join(' '), { cause: error });
|
|
158
155
|
}
|
|
159
|
-
exports.
|
|
156
|
+
exports.getAxiosErrorWithContext = getAxiosErrorWithContext;
|
|
160
157
|
/**
|
|
161
158
|
* @throws
|
|
162
159
|
*/
|
|
163
160
|
function throwApiError(error, context = {}) {
|
|
164
161
|
if (error.isAxiosError) {
|
|
165
|
-
|
|
162
|
+
throw getAxiosErrorWithContext(error, context);
|
|
166
163
|
}
|
|
167
164
|
(0, standardErrors_1.throwError)(error);
|
|
168
165
|
}
|
|
@@ -172,7 +169,7 @@ exports.throwApiError = throwApiError;
|
|
|
172
169
|
*/
|
|
173
170
|
function throwApiUploadError(error, context = {}) {
|
|
174
171
|
if (isApiUploadValidationError(error)) {
|
|
175
|
-
|
|
172
|
+
throwValidationErrors(error);
|
|
176
173
|
}
|
|
177
174
|
throwApiError(error, context);
|
|
178
175
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throwFileSystemError = void 0;
|
|
3
|
+
exports.throwFileSystemError = exports.getFileSystemError = void 0;
|
|
4
4
|
const lang_1 = require("../utils/lang");
|
|
5
5
|
const standardErrors_1 = require("./standardErrors");
|
|
6
6
|
const i18nKey = 'errors.fileSystemErrors';
|
|
7
|
-
|
|
8
|
-
* @throws
|
|
9
|
-
*/
|
|
10
|
-
function throwFileSystemError(error, context) {
|
|
7
|
+
function getFileSystemError(error, context) {
|
|
11
8
|
let fileAction = '';
|
|
12
9
|
if (context.read) {
|
|
13
10
|
fileAction = (0, lang_1.i18n)(`${i18nKey}.readAction`);
|
|
@@ -26,6 +23,13 @@ function throwFileSystemError(error, context) {
|
|
|
26
23
|
if ((0, standardErrors_1.isSystemError)(error)) {
|
|
27
24
|
message.push((0, lang_1.i18n)(`${i18nKey}.baseMessage`, { errorMessage: error.message }));
|
|
28
25
|
}
|
|
29
|
-
|
|
26
|
+
return new Error(message.join(' '), { cause: error });
|
|
27
|
+
}
|
|
28
|
+
exports.getFileSystemError = getFileSystemError;
|
|
29
|
+
/**
|
|
30
|
+
* @throws
|
|
31
|
+
*/
|
|
32
|
+
function throwFileSystemError(error, context) {
|
|
33
|
+
throw getFileSystemError(error, context);
|
|
30
34
|
}
|
|
31
35
|
exports.throwFileSystemError = throwFileSystemError;
|
|
@@ -9,12 +9,6 @@ export declare function isFatalError(err: BaseError): boolean;
|
|
|
9
9
|
export declare function throwErrorWithMessage(identifier: LangKey, interpolation?: {
|
|
10
10
|
[key: string]: string | number;
|
|
11
11
|
}, cause?: BaseError): never;
|
|
12
|
-
/**
|
|
13
|
-
* @throws
|
|
14
|
-
*/
|
|
15
|
-
export declare function throwTypeErrorWithMessage(identifier: LangKey, interpolation?: {
|
|
16
|
-
[key: string]: string | number;
|
|
17
|
-
}, cause?: BaseError): never;
|
|
18
12
|
/**
|
|
19
13
|
* @throws
|
|
20
14
|
*/
|
package/errors/standardErrors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throwError = exports.throwAuthErrorWithMessage = exports.
|
|
3
|
+
exports.throwError = exports.throwAuthErrorWithMessage = exports.throwErrorWithMessage = exports.isFatalError = exports.isSystemError = void 0;
|
|
4
4
|
const HubSpotAuthError_1 = require("../models/HubSpotAuthError");
|
|
5
5
|
const lang_1 = require("../utils/lang");
|
|
6
6
|
function isSystemError(err) {
|
|
@@ -25,13 +25,6 @@ function throwErrorWithMessage(identifier, interpolation, cause) {
|
|
|
25
25
|
genericThrowErrorWithMessage(Error, identifier, interpolation, cause);
|
|
26
26
|
}
|
|
27
27
|
exports.throwErrorWithMessage = throwErrorWithMessage;
|
|
28
|
-
/**
|
|
29
|
-
* @throws
|
|
30
|
-
*/
|
|
31
|
-
function throwTypeErrorWithMessage(identifier, interpolation, cause) {
|
|
32
|
-
genericThrowErrorWithMessage(TypeError, identifier, interpolation, cause);
|
|
33
|
-
}
|
|
34
|
-
exports.throwTypeErrorWithMessage = throwTypeErrorWithMessage;
|
|
35
28
|
/**
|
|
36
29
|
* @throws
|
|
37
30
|
*/
|
package/http/getAxiosConfig.js
CHANGED
|
@@ -8,12 +8,13 @@ exports.DEFAULT_USER_AGENT_HEADERS = {
|
|
|
8
8
|
'User-Agent': `HubSpot Local Dev Lib/${package_json_1.version}`,
|
|
9
9
|
};
|
|
10
10
|
function getAxiosConfig(options) {
|
|
11
|
-
const { env, localHostOverride, ...rest } = options;
|
|
11
|
+
const { env, localHostOverride, headers, ...rest } = options;
|
|
12
12
|
const { httpTimeout, httpUseLocalhost } = (0, config_1.getAndLoadConfigIfNeeded)();
|
|
13
13
|
return {
|
|
14
14
|
baseURL: (0, urls_1.getHubSpotApiOrigin)(env, localHostOverride ? false : httpUseLocalhost),
|
|
15
15
|
headers: {
|
|
16
16
|
...exports.DEFAULT_USER_AGENT_HEADERS,
|
|
17
|
+
...(headers || {}),
|
|
17
18
|
},
|
|
18
19
|
timeout: httpTimeout || 15000,
|
|
19
20
|
...rest,
|
package/lang/en.json
CHANGED
|
@@ -379,7 +379,8 @@
|
|
|
379
379
|
"baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
|
|
380
380
|
},
|
|
381
381
|
"apiErrors": {
|
|
382
|
-
"messageDetail": "{{
|
|
382
|
+
"messageDetail": "{{ requestName }} in account {{ accountId }}",
|
|
383
|
+
"genericMessageDetail": "request",
|
|
383
384
|
"unableToUpload": "Unable to upload \"{{ payload }}.",
|
|
384
385
|
"codes": {
|
|
385
386
|
"400": "The {{ messageDetail }} was bad.",
|
|
@@ -388,9 +389,8 @@
|
|
|
388
389
|
"404": "The {{ messageDetail }} was not found.",
|
|
389
390
|
"429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
|
|
390
391
|
"503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"404Request": "The {{ action }} failed because \"{{ request }}\" was not found in account {{ accountId }}.",
|
|
392
|
+
"403ProjectMissingScope": "Couldn't run the project command because there are scopes missing in your production account. To update scopes, deactivate your current personal access key for {{ accountId }}, and generate a new one. Then run `hs auth` to update the CLI with the new key.",
|
|
393
|
+
"403ProjectGating": "The current target account {{ accountId }} does not have access to HubSpot projects. To opt in to the CRM Development Beta and use projects, visit https://app.hubspot.com/l/whats-new/betas?productUpdateId=13860216.",
|
|
394
394
|
"500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
395
395
|
"400Generic": "The {{ messageDetail }} failed due to a client error.",
|
|
396
396
|
"generic": "The {{ messageDetail }} failed."
|
package/lang/lang/en.json
CHANGED
|
@@ -379,7 +379,8 @@
|
|
|
379
379
|
"baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
|
|
380
380
|
},
|
|
381
381
|
"apiErrors": {
|
|
382
|
-
"messageDetail": "{{
|
|
382
|
+
"messageDetail": "{{ requestName }} in account {{ accountId }}",
|
|
383
|
+
"genericMessageDetail": "request",
|
|
383
384
|
"unableToUpload": "Unable to upload \"{{ payload }}.",
|
|
384
385
|
"codes": {
|
|
385
386
|
"400": "The {{ messageDetail }} was bad.",
|
|
@@ -388,9 +389,8 @@
|
|
|
388
389
|
"404": "The {{ messageDetail }} was not found.",
|
|
389
390
|
"429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
|
|
390
391
|
"503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"404Request": "The {{ action }} failed because \"{{ request }}\" was not found in account {{ accountId }}.",
|
|
392
|
+
"403ProjectMissingScope": "Couldn't run the project command because there are scopes missing in your production account. To update scopes, deactivate your current personal access key for {{ accountId }}, and generate a new one. Then run `hs auth` to update the CLI with the new key.",
|
|
393
|
+
"403ProjectGating": "The current target account {{ accountId }} does not have access to HubSpot projects. To opt in to the CRM Development Beta and use projects, visit https://app.hubspot.com/l/whats-new/betas?productUpdateId=13860216.",
|
|
394
394
|
"500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
|
|
395
395
|
"400Generic": "The {{ messageDetail }} failed due to a client error.",
|
|
396
396
|
"generic": "The {{ messageDetail }} failed."
|
package/lib/fileMapper.js
CHANGED
|
@@ -82,7 +82,7 @@ function validateFileMapperNode(node) {
|
|
|
82
82
|
catch (err) {
|
|
83
83
|
json = node;
|
|
84
84
|
}
|
|
85
|
-
(0, standardErrors_1.
|
|
85
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.errors.invalidNode`, {
|
|
86
86
|
json: JSON.stringify(json),
|
|
87
87
|
});
|
|
88
88
|
}
|
package/package.json
CHANGED
package/types/Http.d.ts
CHANGED
package/utils/cms/modules.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.isPathInput = isPathInput;
|
|
|
19
19
|
function throwInvalidPathInput(pathInput) {
|
|
20
20
|
if (isPathInput(pathInput))
|
|
21
21
|
return;
|
|
22
|
-
(0, standardErrors_1.
|
|
22
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.throwInvalidPathInput`);
|
|
23
23
|
}
|
|
24
24
|
function isModuleFolder(pathInput) {
|
|
25
25
|
throwInvalidPathInput(pathInput);
|