@hubspot/local-dev-lib 0.3.12 → 0.3.13
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/errors/apiErrors.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
2
|
import { GenericError, AxiosErrorContext, ValidationError } from '../types/Error';
|
|
3
3
|
import { HubSpotAuthError } from '../models/HubSpotAuthError';
|
|
4
|
-
export declare function isSpecifiedError(err: Error | AxiosError, { statusCode, category, subCategory, code, }: {
|
|
4
|
+
export declare function isSpecifiedError(err: Error | AxiosError, { statusCode, category, subCategory, errorType, code, }: {
|
|
5
5
|
statusCode?: number;
|
|
6
6
|
category?: string;
|
|
7
7
|
subCategory?: string;
|
|
8
|
+
errorType?: string;
|
|
8
9
|
code?: string;
|
|
9
10
|
}): boolean;
|
|
10
11
|
export declare function isMissingScopeError(err: Error | AxiosError): boolean;
|
package/errors/apiErrors.js
CHANGED
|
@@ -5,17 +5,19 @@ const api_1 = require("../constants/api");
|
|
|
5
5
|
const lang_1 = require("../utils/lang");
|
|
6
6
|
const standardErrors_1 = require("./standardErrors");
|
|
7
7
|
const i18nKey = 'errors.apiErrors';
|
|
8
|
-
function isSpecifiedError(err, { statusCode, category, subCategory, code, }) {
|
|
8
|
+
function isSpecifiedError(err, { statusCode, category, subCategory, errorType, code, }) {
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
10
|
const error = (err && err.cause) || err;
|
|
11
11
|
const statusCodeErr = !statusCode || error.response?.status === statusCode;
|
|
12
12
|
const categoryErr = !category || error.response?.data?.category === category;
|
|
13
13
|
const subCategoryErr = !subCategory || error.response?.data?.subCategory === subCategory;
|
|
14
|
+
const errorTypeErr = !errorType || error.response?.data?.errorType === errorType;
|
|
14
15
|
const codeError = !code || error.code === code;
|
|
15
16
|
return (error.isAxiosError &&
|
|
16
17
|
statusCodeErr &&
|
|
17
18
|
categoryErr &&
|
|
18
19
|
subCategoryErr &&
|
|
20
|
+
errorTypeErr &&
|
|
19
21
|
codeError);
|
|
20
22
|
}
|
|
21
23
|
exports.isSpecifiedError = isSpecifiedError;
|
|
@@ -34,7 +36,7 @@ exports.isTimeoutError = isTimeoutError;
|
|
|
34
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
37
|
function isApiUploadValidationError(err) {
|
|
36
38
|
return (err.isAxiosError &&
|
|
37
|
-
err.status === 400 &&
|
|
39
|
+
(err.status === 400 || err.response?.status === 400) &&
|
|
38
40
|
!!err.response &&
|
|
39
41
|
!!(err.response?.data?.message || !!err.response?.data?.errors));
|
|
40
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeveloperTestAccount } from '../types/developerTestAccounts';
|
|
1
|
+
import { DeveloperTestAccount, FetchDeveloperTestAccountsResponse } from '../types/developerTestAccounts';
|
|
2
2
|
export declare function createDeveloperTestAccount(accountId: number, accountName: string): Promise<DeveloperTestAccount>;
|
|
3
3
|
export declare function deleteDeveloperTestAccount(accountId: number, testAccountId: number): Promise<void>;
|
|
4
|
-
export declare function fetchDeveloperTestAccounts(accountId: number): Promise<
|
|
4
|
+
export declare function fetchDeveloperTestAccounts(accountId: number): Promise<FetchDeveloperTestAccountsResponse>;
|
|
@@ -26,7 +26,7 @@ exports.deleteDeveloperTestAccount = deleteDeveloperTestAccount;
|
|
|
26
26
|
async function fetchDeveloperTestAccounts(accountId) {
|
|
27
27
|
try {
|
|
28
28
|
const resp = await (0, developerTestAccounts_1.fetchDeveloperTestAccounts)(accountId);
|
|
29
|
-
return resp
|
|
29
|
+
return resp;
|
|
30
30
|
}
|
|
31
31
|
catch (err) {
|
|
32
32
|
(0, apiErrors_1.throwApiError)(err);
|
package/package.json
CHANGED