@hubspot/local-dev-lib 3.5.2 → 3.5.3-beta.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DeveloperTestAccount, FetchDeveloperTestAccountsResponse } from '../types/developerTestAccounts';
|
|
1
|
+
import { DeveloperTestAccount, CreateDeveloperTestAccountResponse, FetchDeveloperTestAccountsResponse } from '../types/developerTestAccounts';
|
|
2
2
|
import { Environment } from '../types/Config';
|
|
3
3
|
import { HubSpotPromise } from '../types/Http';
|
|
4
4
|
export declare function fetchDeveloperTestAccounts(accountId: number): HubSpotPromise<FetchDeveloperTestAccountsResponse>;
|
|
5
|
-
export declare function createDeveloperTestAccount(accountId: number, accountName: string): HubSpotPromise<
|
|
5
|
+
export declare function createDeveloperTestAccount(accountId: number, accountName: string): HubSpotPromise<CreateDeveloperTestAccountResponse>;
|
|
6
6
|
export declare function deleteDeveloperTestAccount(accountId: number, testAccountId: number): HubSpotPromise<void>;
|
|
7
7
|
export declare function fetchDeveloperTestAccountData(accessToken: string, accountId: number, env?: Environment): HubSpotPromise<DeveloperTestAccount>;
|
package/constants/projects.d.ts
CHANGED
package/constants/projects.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.UNMIGRATABLE_REASONS = {
|
|
|
5
5
|
UP_TO_DATE: 'UP_TO_DATE',
|
|
6
6
|
IS_A_PRIVATE_APP: 'IS_A_PRIVATE_APP',
|
|
7
7
|
LISTED_IN_MARKETPLACE: 'LISTED_IN_MARKETPLACE',
|
|
8
|
+
PROJECT_CONNECTED_TO_GITHUB: 'PROJECT_CONNECTED_TO_GITHUB',
|
|
8
9
|
};
|
|
9
10
|
exports.PLATFORM_VERSIONS = {
|
|
10
11
|
v2023_2: '2023.2',
|
|
@@ -15,6 +15,7 @@ export declare class HubSpotHttpError<T = any> extends Error {
|
|
|
15
15
|
private divider;
|
|
16
16
|
cause: ErrorOptions['cause'];
|
|
17
17
|
timeout?: number;
|
|
18
|
+
correlationId?: string;
|
|
18
19
|
constructor(message?: string, options?: ErrorOptions, context?: HubSpotHttpErrorContext);
|
|
19
20
|
updateContext(context: Partial<HubSpotHttpErrorContext>): void;
|
|
20
21
|
toString(): string;
|
|
@@ -19,6 +19,7 @@ class HubSpotHttpError extends Error {
|
|
|
19
19
|
divider = `\n- `;
|
|
20
20
|
cause;
|
|
21
21
|
timeout;
|
|
22
|
+
correlationId;
|
|
22
23
|
constructor(message, options, context) {
|
|
23
24
|
super(message, options);
|
|
24
25
|
this.name = 'HubSpotHttpError';
|
|
@@ -39,6 +40,11 @@ class HubSpotHttpError extends Error {
|
|
|
39
40
|
this.status = response.status;
|
|
40
41
|
this.statusText = response.statusText;
|
|
41
42
|
this.data = response.data;
|
|
43
|
+
if (response.data &&
|
|
44
|
+
typeof response.data === 'object' &&
|
|
45
|
+
'correlationId' in response.data) {
|
|
46
|
+
this.correlationId = response.data.correlationId;
|
|
47
|
+
}
|
|
42
48
|
this.headers = response.headers;
|
|
43
49
|
this.parseValidationErrors(response.data);
|
|
44
50
|
}
|
|
@@ -77,6 +83,9 @@ class HubSpotHttpError extends Error {
|
|
|
77
83
|
if (this.context) {
|
|
78
84
|
messages.push(`context: ${JSON.stringify(this.context, undefined, 2)}`);
|
|
79
85
|
}
|
|
86
|
+
if (this.correlationId) {
|
|
87
|
+
messages.push(`correlationId: ${this.correlationId}`);
|
|
88
|
+
}
|
|
80
89
|
if (this.derivedContext) {
|
|
81
90
|
messages.push(`derivedContext: ${JSON.stringify(this.derivedContext, undefined, 2)}`);
|
|
82
91
|
}
|
package/package.json
CHANGED
|
@@ -7,6 +7,16 @@ export type DeveloperTestAccount = {
|
|
|
7
7
|
status: string;
|
|
8
8
|
id: number;
|
|
9
9
|
};
|
|
10
|
+
export type CreateDeveloperTestAccountResponse = {
|
|
11
|
+
id: number;
|
|
12
|
+
accountName: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
trialEndsAt: string;
|
|
16
|
+
status: string;
|
|
17
|
+
currentUserHasAccess: boolean;
|
|
18
|
+
personalAccessKey: string;
|
|
19
|
+
};
|
|
10
20
|
export type FetchDeveloperTestAccountsResponse = {
|
|
11
21
|
results: DeveloperTestAccount[];
|
|
12
22
|
maxTestPortals: number;
|