@hubspot/local-dev-lib 1.13.0 → 2.0.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/api/appsDev.d.ts +6 -5
- package/api/appsDev.js +6 -10
- package/api/customObjects.d.ts +7 -6
- package/api/customObjects.js +13 -16
- package/api/designManager.d.ts +3 -2
- package/api/designManager.js +5 -8
- package/api/developerTestAccounts.d.ts +5 -4
- package/api/developerTestAccounts.js +9 -10
- package/api/fileManager.d.ts +5 -4
- package/api/fileManager.js +9 -9
- package/api/fileMapper.d.ts +8 -8
- package/api/fileMapper.js +16 -16
- package/api/fileTransport.d.ts +4 -3
- package/api/fileTransport.js +5 -5
- package/api/functions.d.ts +6 -5
- package/api/functions.js +11 -14
- package/api/github.d.ts +6 -6
- package/api/github.js +5 -5
- package/api/hubdb.d.ts +9 -8
- package/api/hubdb.js +17 -20
- package/api/lighthouseScore.d.ts +4 -3
- package/api/lighthouseScore.js +7 -10
- package/api/localDevAuth.d.ts +5 -4
- package/api/localDevAuth.js +8 -9
- package/api/marketplaceValidation.d.ts +4 -3
- package/api/marketplaceValidation.js +4 -7
- package/api/projects.d.ts +31 -30
- package/api/projects.js +52 -52
- package/api/sandboxHubs.d.ts +5 -4
- package/api/sandboxHubs.js +9 -10
- package/api/sandboxSync.d.ts +4 -4
- package/api/sandboxSync.js +5 -14
- package/api/secrets.d.ts +5 -4
- package/api/secrets.js +9 -12
- package/api/validateHubl.d.ts +2 -1
- package/api/validateHubl.js +3 -6
- package/config/CLIConfiguration.d.ts +3 -3
- package/config/CLIConfiguration.js +22 -20
- package/config/configFile.js +7 -14
- package/config/config_DEPRECATED.js +5 -2
- package/config/index.js +45 -48
- package/errors/errors_DEPRECATED.js +2 -2
- package/errors/index.d.ts +18 -0
- package/errors/index.js +63 -0
- package/http/addQueryParams.d.ts +2 -0
- package/http/addQueryParams.js +14 -0
- package/http/getAxiosConfig.d.ts +2 -2
- package/http/getAxiosConfig.js +10 -2
- package/http/index.d.ts +9 -14
- package/http/index.js +28 -53
- package/http/unauthed.d.ts +15 -0
- package/http/unauthed.js +38 -0
- package/lang/en.json +2 -2
- package/lang/lang/en.json +2 -2
- package/lib/archive.js +11 -10
- package/lib/cms/functions.js +18 -17
- package/lib/cms/handleFieldsJS.js +8 -7
- package/lib/cms/modules.js +4 -5
- package/lib/cms/processFieldsJs.js +8 -7
- package/lib/cms/templates.js +2 -3
- package/lib/cms/uploadFolder.js +16 -14
- package/lib/cms/validate.js +1 -1
- package/lib/cms/watch.js +16 -9
- package/lib/customObjects.js +4 -15
- package/lib/fileManager.js +22 -21
- package/lib/fileMapper.js +24 -31
- package/lib/fs.js +2 -2
- package/lib/github.js +21 -21
- package/lib/gitignore.js +2 -2
- package/lib/hubdb.d.ts +3 -2
- package/lib/hubdb.js +11 -9
- package/lib/notify.js +2 -2
- package/lib/oauth.d.ts +1 -1
- package/lib/oauth.js +8 -17
- package/lib/personalAccessKey.js +16 -21
- package/lib/portManager.js +2 -2
- package/lib/trackUsage.js +12 -6
- package/models/FileSystemError.d.ts +6 -0
- package/models/FileSystemError.js +47 -0
- package/models/HubSpotHttpError.d.ts +24 -0
- package/models/HubSpotHttpError.js +197 -0
- package/models/OAuth2Manager.d.ts +1 -2
- package/models/OAuth2Manager.js +13 -28
- package/package.json +2 -1
- package/types/Error.d.ts +7 -5
- package/types/Files.d.ts +4 -4
- package/types/Http.d.ts +6 -10
- package/types/Sandbox.d.ts +0 -5
- package/utils/PortManagerServer.d.ts +3 -3
- package/utils/PortManagerServer.js +9 -9
- package/utils/cms/modules.js +2 -2
- package/utils/detectPort.js +3 -3
- package/errors/apiErrors.d.ts +0 -25
- package/errors/apiErrors.js +0 -176
- package/errors/fileSystemErrors.d.ts +0 -6
- package/errors/fileSystemErrors.js +0 -35
- package/errors/standardErrors.d.ts +0 -20
- package/errors/standardErrors.js +0 -62
- package/lib/developerTestAccounts.d.ts +0 -4
- package/lib/developerTestAccounts.js +0 -35
- package/lib/sandboxes.d.ts +0 -14
- package/lib/sandboxes.js +0 -70
- package/models/HubSpotAuthError.d.ts +0 -12
- package/models/HubSpotAuthError.js +0 -20
package/lib/sandboxes.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchTypes = exports.fetchTaskStatus = exports.initiateSync = exports.getSandboxUsageLimits = exports.deleteSandbox = exports.createSandbox = void 0;
|
|
4
|
-
const sandboxHubs_1 = require("../api/sandboxHubs");
|
|
5
|
-
const sandboxSync_1 = require("../api/sandboxSync");
|
|
6
|
-
const apiErrors_1 = require("../errors/apiErrors");
|
|
7
|
-
async function createSandbox(accountId, name, type) {
|
|
8
|
-
try {
|
|
9
|
-
const resp = await (0, sandboxHubs_1.createSandbox)(accountId, name, type);
|
|
10
|
-
return {
|
|
11
|
-
name,
|
|
12
|
-
...resp,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.createSandbox = createSandbox;
|
|
20
|
-
async function deleteSandbox(parentAccountId, sandboxAccountId) {
|
|
21
|
-
try {
|
|
22
|
-
await (0, sandboxHubs_1.deleteSandbox)(parentAccountId, sandboxAccountId);
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
parentAccountId,
|
|
29
|
-
sandboxAccountId,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.deleteSandbox = deleteSandbox;
|
|
33
|
-
async function getSandboxUsageLimits(parentAccountId) {
|
|
34
|
-
try {
|
|
35
|
-
const resp = await (0, sandboxHubs_1.getSandboxUsageLimits)(parentAccountId);
|
|
36
|
-
return resp && resp.usage;
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.getSandboxUsageLimits = getSandboxUsageLimits;
|
|
43
|
-
async function initiateSync(fromHubId, toHubId, tasks, sandboxHubId) {
|
|
44
|
-
try {
|
|
45
|
-
return await (0, sandboxSync_1.initiateSync)(fromHubId, toHubId, tasks, sandboxHubId);
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.initiateSync = initiateSync;
|
|
52
|
-
async function fetchTaskStatus(accountId, taskId) {
|
|
53
|
-
try {
|
|
54
|
-
return await (0, sandboxSync_1.fetchTaskStatus)(accountId, taskId);
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.fetchTaskStatus = fetchTaskStatus;
|
|
61
|
-
async function fetchTypes(accountId, toHubId) {
|
|
62
|
-
try {
|
|
63
|
-
const resp = await (0, sandboxSync_1.fetchTypes)(accountId, toHubId);
|
|
64
|
-
return resp && resp.results;
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
(0, apiErrors_1.throwApiError)(err);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.fetchTypes = fetchTypes;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
|
-
export declare class HubSpotAuthError extends Error {
|
|
3
|
-
status?: number;
|
|
4
|
-
category?: string;
|
|
5
|
-
subCategory?: string;
|
|
6
|
-
constructor(message: string, { cause, }: {
|
|
7
|
-
cause?: Partial<AxiosError<{
|
|
8
|
-
category?: string;
|
|
9
|
-
subCategory?: string;
|
|
10
|
-
}>>;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HubSpotAuthError = void 0;
|
|
4
|
-
class HubSpotAuthError extends Error {
|
|
5
|
-
status;
|
|
6
|
-
category;
|
|
7
|
-
subCategory;
|
|
8
|
-
constructor(message, { cause = {}, }) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = 'HubSpotAuthError';
|
|
11
|
-
this.status = cause.response?.status;
|
|
12
|
-
this.category = cause?.response?.data?.category || undefined;
|
|
13
|
-
this.subCategory =
|
|
14
|
-
(cause.response &&
|
|
15
|
-
cause.response.data &&
|
|
16
|
-
cause.response.data.subCategory) ||
|
|
17
|
-
undefined;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.HubSpotAuthError = HubSpotAuthError;
|