@hubspot/local-dev-lib 0.0.4 → 0.0.6
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/customObjects.d.ts +7 -0
- package/api/customObjects.js +48 -0
- package/api/designManager.d.ts +13 -0
- package/api/designManager.js +21 -0
- package/api/fileManager.d.ts +5 -0
- package/api/fileManager.js +62 -0
- package/api/fileMapper.d.ts +10 -0
- package/api/fileMapper.js +104 -0
- package/api/functions.d.ts +4 -0
- package/api/functions.js +32 -0
- package/api/hubdb.d.ts +10 -0
- package/api/hubdb.js +61 -0
- package/api/lighthouseScore.d.ts +5 -0
- package/api/lighthouseScore.js +29 -0
- package/api/localDevAuth.d.ts +12 -0
- package/api/localDevAuth.js +38 -0
- package/api/marketplaceValidation.d.ts +5 -0
- package/api/marketplaceValidation.js +29 -0
- package/api/projects.d.ts +27 -0
- package/api/projects.js +126 -0
- package/api/sandboxHubs.d.ts +6 -0
- package/api/sandboxHubs.js +50 -0
- package/api/sandboxSync.d.ts +4 -0
- package/api/sandboxSync.js +35 -0
- package/api/secrets.d.ts +8 -0
- package/api/secrets.js +40 -0
- package/api/validateHubl.d.ts +2 -0
- package/api/validateHubl.js +18 -0
- package/config/CLIConfiguration.d.ts +22 -16
- package/config/CLIConfiguration.js +39 -9
- package/config/configFile.d.ts +4 -4
- package/config/configFile.js +2 -2
- package/config/configUtils.d.ts +8 -8
- package/config/config_DEPRECATED.d.ts +78 -0
- package/config/config_DEPRECATED.js +636 -0
- package/config/environment.d.ts +2 -3
- package/config/environment.js +11 -17
- package/config/index.d.ts +38 -0
- package/config/index.js +232 -0
- package/constants/api.d.ts +17 -0
- package/constants/api.js +20 -0
- package/constants/auth.d.ts +13 -0
- package/constants/auth.js +8 -1
- package/constants/config.d.ts +0 -4
- package/constants/config.js +1 -5
- package/constants/environments.d.ts +1 -0
- package/constants/environments.js +1 -0
- package/constants/extensions.d.ts +2 -0
- package/constants/extensions.js +4 -1
- package/constants/files.d.ts +16 -0
- package/constants/files.js +17 -1
- package/enums/build.d.ts +36 -0
- package/enums/build.js +39 -0
- package/enums/deploy.d.ts +11 -0
- package/enums/deploy.js +14 -0
- package/enums/project.d.ts +6 -0
- package/enums/project.js +9 -0
- package/errors/HubSpotAuthError.d.ts +8 -2
- package/errors/HubSpotAuthError.js +14 -0
- package/errors/apiErrors.d.ts +9 -0
- package/errors/apiErrors.js +182 -0
- package/errors/errors_DEPRECATED.d.ts +7 -0
- package/errors/errors_DEPRECATED.js +73 -0
- package/errors/fileSystemErrors.d.ts +1 -7
- package/errors/standardErrors.d.ts +7 -1
- package/errors/standardErrors.js +20 -23
- package/http/getAxiosConfig.d.ts +6 -0
- package/http/getAxiosConfig.js +22 -0
- package/http/index.d.ts +18 -0
- package/http/index.js +175 -0
- package/lang/en.lyaml +247 -0
- package/lib/cms/functions.d.ts +13 -0
- package/lib/cms/functions.js +181 -0
- package/lib/cms/handleFieldsJS.d.ts +2 -1
- package/lib/cms/handleFieldsJS.js +4 -3
- package/lib/cms/modules.js +3 -3
- package/lib/cms/processFieldsJs.d.ts +1 -0
- package/lib/cms/processFieldsJs.js +122 -0
- package/lib/cms/templates.d.ts +25 -0
- package/lib/cms/templates.js +62 -0
- package/lib/cms/themes.js +2 -2
- package/lib/cms/uploadFolder.d.ts +18 -0
- package/lib/cms/uploadFolder.js +182 -0
- package/lib/cms/watch.d.ts +20 -0
- package/lib/cms/watch.js +194 -0
- package/lib/customObjects.d.ts +5 -0
- package/lib/customObjects.js +36 -0
- package/lib/environment.d.ts +2 -1
- package/lib/fileMapper.d.ts +13 -0
- package/lib/fileMapper.js +322 -0
- package/lib/github.d.ts +6 -3
- package/lib/github.js +36 -27
- package/lib/gitignore.js +1 -46
- package/lib/hubdb.d.ts +16 -0
- package/lib/hubdb.js +130 -0
- package/lib/ignoreRules.d.ts +3 -0
- package/lib/ignoreRules.js +69 -0
- package/lib/logging/git.d.ts +2 -0
- package/lib/logging/git.js +54 -0
- package/lib/logging/logger.d.ts +44 -0
- package/lib/logging/logger.js +146 -0
- package/lib/logging/logs.d.ts +22 -0
- package/lib/logging/logs.js +82 -0
- package/lib/logging/table.d.ts +3 -0
- package/lib/logging/table.js +47 -0
- package/lib/oauth.d.ts +7 -0
- package/lib/oauth.js +44 -0
- package/lib/path.d.ts +2 -1
- package/lib/path.js +8 -3
- package/lib/personalAccessKey.d.ts +13 -0
- package/lib/personalAccessKey.js +135 -0
- package/lib/sandboxes.d.ts +14 -0
- package/lib/sandboxes.js +71 -0
- package/lib/trackUsage.d.ts +1 -0
- package/lib/trackUsage.js +53 -0
- package/lib/validate.d.ts +2 -0
- package/lib/validate.js +40 -0
- package/models/OAuth2Manager.d.ts +34 -0
- package/models/OAuth2Manager.js +126 -0
- package/package.json +25 -13
- package/types/Accounts.d.ts +66 -21
- package/types/Activity.d.ts +20 -0
- package/types/Activity.js +2 -0
- package/types/Api.d.ts +2 -0
- package/types/Api.js +2 -0
- package/types/Build.d.ts +41 -0
- package/types/Build.js +2 -0
- package/types/CLIOptions.d.ts +5 -0
- package/types/ComponentStructure.d.ts +20 -0
- package/types/ComponentStructure.js +2 -0
- package/types/Config.d.ts +17 -4
- package/types/Deploy.d.ts +42 -0
- package/types/Deploy.js +2 -0
- package/types/Error.d.ts +32 -7
- package/types/FileManager.d.ts +66 -0
- package/types/FileManager.js +2 -0
- package/types/Files.d.ts +33 -1
- package/types/Functions.d.ts +40 -0
- package/types/Functions.js +2 -0
- package/types/Github.d.ts +6 -0
- package/types/Http.d.ts +33 -0
- package/types/Http.js +2 -0
- package/types/Hubdb.d.ts +90 -0
- package/types/Hubdb.js +2 -0
- package/types/HublValidation.d.ts +59 -0
- package/types/HublValidation.js +2 -0
- package/types/Lighthouse.d.ts +25 -0
- package/types/Lighthouse.js +2 -0
- package/types/MarketplaceValidation.d.ts +28 -0
- package/types/MarketplaceValidation.js +2 -0
- package/types/Project.d.ts +38 -0
- package/types/Project.js +2 -0
- package/types/Sandbox.d.ts +165 -0
- package/types/Sandbox.js +2 -0
- package/types/Schemas.d.ts +42 -0
- package/types/Schemas.js +2 -0
- package/utils/{modules.d.ts → cms/modules.d.ts} +1 -1
- package/utils/{modules.js → cms/modules.js} +3 -3
- package/utils/getAccountIdentifier.d.ts +10 -0
- package/utils/getAccountIdentifier.js +40 -0
- package/utils/git.d.ts +7 -2
- package/utils/git.js +54 -7
- package/utils/lang.d.ts +4 -0
- package/utils/lang.js +9 -2
- package/utils/notify.d.ts +1 -0
- package/utils/notify.js +42 -0
- package/utils/objectUtils.d.ts +8 -0
- package/utils/objectUtils.js +33 -0
- package/constants/index.d.ts +0 -16
- package/constants/index.js +0 -12
- package/http/requestOptions.d.ts +0 -20
- package/http/requestOptions.js +0 -27
- package/lib/cms/index.d.ts +0 -10
- package/lib/cms/index.js +0 -13
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -14
- /package/utils/{fieldsJS.d.ts → cms/fieldsJS.d.ts} +0 -0
- /package/utils/{fieldsJS.js → cms/fieldsJS.js} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeDeep = exports.isObject = void 0;
|
|
4
|
+
function isObject(value) {
|
|
5
|
+
const type = typeof value;
|
|
6
|
+
return value != null && (type === 'object' || type === 'function');
|
|
7
|
+
}
|
|
8
|
+
exports.isObject = isObject;
|
|
9
|
+
function mergeDeep(
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
target,
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
...sources
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
) {
|
|
16
|
+
if (!sources.length)
|
|
17
|
+
return target;
|
|
18
|
+
const source = sources.shift();
|
|
19
|
+
if (isObject(target) && source && isObject(source)) {
|
|
20
|
+
for (const key in source) {
|
|
21
|
+
if (isObject(source[key])) {
|
|
22
|
+
if (!target[key])
|
|
23
|
+
Object.assign(target, { [key]: {} });
|
|
24
|
+
mergeDeep(target[key], source[key]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
Object.assign(target, { [key]: source[key] });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return mergeDeep(target, ...sources);
|
|
32
|
+
}
|
|
33
|
+
exports.mergeDeep = mergeDeep;
|
package/constants/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const ENVIRONMENTS: {
|
|
2
|
-
readonly PROD: "prod";
|
|
3
|
-
readonly QA: "qa";
|
|
4
|
-
};
|
|
5
|
-
export declare const ENVIRONMENT_VARIABLES: {
|
|
6
|
-
readonly HUBSPOT_API_KEY: "HUBSPOT_API_KEY";
|
|
7
|
-
readonly HUBSPOT_CLIENT_ID: "HUBSPOT_CLIENT_ID";
|
|
8
|
-
readonly HUBSPOT_CLIENT_SECRET: "HUBSPOT_CLIENT_SECRET";
|
|
9
|
-
readonly HUBSPOT_PERSONAL_ACCESS_KEY: "HUBSPOT_PERSONAL_ACCESS_KEY";
|
|
10
|
-
readonly HUBSPOT_ACCOUNT_ID: "HUBSPOT_ACCOUNT_ID";
|
|
11
|
-
readonly HUBSPOT_REFRESH_TOKEN: "HUBSPOT_REFRESH_TOKEN";
|
|
12
|
-
readonly HUBSPOT_ENVIRONMENT: "HUBSPOT_ENVIRONMENT";
|
|
13
|
-
};
|
|
14
|
-
export declare const DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = "hubspot.config.yml";
|
|
15
|
-
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".hubspot";
|
|
16
|
-
export declare const HUBSPOT_CONFIGURATION_FILE = "config.yml";
|
package/constants/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = exports.ENVIRONMENT_VARIABLES = exports.ENVIRONMENTS = void 0;
|
|
4
|
-
const environments_1 = require("./environments");
|
|
5
|
-
const config_1 = require("./config");
|
|
6
|
-
// Environment Variables
|
|
7
|
-
exports.ENVIRONMENTS = environments_1.ENVIRONMENTS;
|
|
8
|
-
exports.ENVIRONMENT_VARIABLES = environments_1.ENVIRONMENT_VARIABLES;
|
|
9
|
-
// Config Variables
|
|
10
|
-
exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = config_1.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME;
|
|
11
|
-
exports.HUBSPOT_CONFIGURATION_FOLDER = config_1.HUBSPOT_CONFIGURATION_FOLDER;
|
|
12
|
-
exports.HUBSPOT_CONFIGURATION_FILE = config_1.HUBSPOT_CONFIGURATION_FILE;
|
package/http/requestOptions.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_USER_AGENT_HEADERS: {
|
|
2
|
-
'User-Agent': string;
|
|
3
|
-
};
|
|
4
|
-
type GetRequestOptionsOptions = {
|
|
5
|
-
env?: string;
|
|
6
|
-
localHostOverride?: boolean;
|
|
7
|
-
};
|
|
8
|
-
type RequestOptions = {
|
|
9
|
-
baseUrl: string;
|
|
10
|
-
headers: {
|
|
11
|
-
'User-Agent': string;
|
|
12
|
-
};
|
|
13
|
-
json: boolean;
|
|
14
|
-
simple: boolean;
|
|
15
|
-
timeout: number;
|
|
16
|
-
env?: string;
|
|
17
|
-
localHostOverride?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare function getRequestOptions(options?: GetRequestOptionsOptions, requestOptions?: {}): RequestOptions;
|
|
20
|
-
export {};
|
package/http/requestOptions.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getRequestOptions = exports.DEFAULT_USER_AGENT_HEADERS = void 0;
|
|
7
|
-
const package_json_1 = require("../package.json");
|
|
8
|
-
const CLIConfiguration_1 = __importDefault(require("../config/CLIConfiguration"));
|
|
9
|
-
const urls_1 = require("../lib/urls");
|
|
10
|
-
exports.DEFAULT_USER_AGENT_HEADERS = {
|
|
11
|
-
'User-Agent': `HubSpot Local Dev Lib/${package_json_1.version}`,
|
|
12
|
-
};
|
|
13
|
-
function getRequestOptions(options = {}, requestOptions = {}) {
|
|
14
|
-
const { env, localHostOverride } = options;
|
|
15
|
-
const { httpTimeout, httpUseLocalhost } = CLIConfiguration_1.default.getAndLoadConfigIfNeeded();
|
|
16
|
-
return {
|
|
17
|
-
baseUrl: (0, urls_1.getHubSpotApiOrigin)(env, localHostOverride ? false : httpUseLocalhost),
|
|
18
|
-
headers: {
|
|
19
|
-
...exports.DEFAULT_USER_AGENT_HEADERS,
|
|
20
|
-
},
|
|
21
|
-
json: true,
|
|
22
|
-
simple: true,
|
|
23
|
-
timeout: httpTimeout || 15000,
|
|
24
|
-
...requestOptions,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
exports.getRequestOptions = getRequestOptions;
|
package/lib/cms/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { isConvertableFieldJs as __isConvertableFieldJs, createTmpDirSync as __createTmpDirSync, cleanupTmpDirSync as __cleanupTmpDirSync } from './handleFieldsJS';
|
|
2
|
-
import { validateSrcAndDestPaths as __validateSrcAndDestPaths, createModule as __createModule } from './modules';
|
|
3
|
-
import { getThemeJSONPath as __getThemeJSONPath, getThemePreviewUrl as __getThemePreviewUrl } from './themes';
|
|
4
|
-
export declare const isConvertableFieldJs: typeof __isConvertableFieldJs;
|
|
5
|
-
export declare const createTmpDirSync: typeof __createTmpDirSync;
|
|
6
|
-
export declare const cleanupTmpDirSync: typeof __cleanupTmpDirSync;
|
|
7
|
-
export declare const validateSrcAndDestPaths: typeof __validateSrcAndDestPaths;
|
|
8
|
-
export declare const createModule: typeof __createModule;
|
|
9
|
-
export declare const getThemeJSONPath: typeof __getThemeJSONPath;
|
|
10
|
-
export declare const getThemePreviewUrl: typeof __getThemePreviewUrl;
|
package/lib/cms/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getThemePreviewUrl = exports.getThemeJSONPath = exports.createModule = exports.validateSrcAndDestPaths = exports.cleanupTmpDirSync = exports.createTmpDirSync = exports.isConvertableFieldJs = void 0;
|
|
4
|
-
const handleFieldsJS_1 = require("./handleFieldsJS");
|
|
5
|
-
const modules_1 = require("./modules");
|
|
6
|
-
const themes_1 = require("./themes");
|
|
7
|
-
exports.isConvertableFieldJs = handleFieldsJS_1.isConvertableFieldJs;
|
|
8
|
-
exports.createTmpDirSync = handleFieldsJS_1.createTmpDirSync;
|
|
9
|
-
exports.cleanupTmpDirSync = handleFieldsJS_1.cleanupTmpDirSync;
|
|
10
|
-
exports.validateSrcAndDestPaths = modules_1.validateSrcAndDestPaths;
|
|
11
|
-
exports.createModule = modules_1.createModule;
|
|
12
|
-
exports.getThemeJSONPath = themes_1.getThemeJSONPath;
|
|
13
|
-
exports.getThemePreviewUrl = themes_1.getThemePreviewUrl;
|
package/lib/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { extractZipArchive as __extractZipArchive } from './archive';
|
|
2
|
-
import { getValidEnv as __getValidEnv } from './environment';
|
|
3
|
-
import { walk as __walk } from './fs';
|
|
4
|
-
import { commaSeparatedValues as __commaSeparatedValues } from './text';
|
|
5
|
-
import { getHubSpotApiOrigin as __getHubSpotApiOrigin } from './urls';
|
|
6
|
-
export declare const extractZipArchive: typeof __extractZipArchive;
|
|
7
|
-
export declare const getValidEnv: typeof __getValidEnv;
|
|
8
|
-
export declare const walk: typeof __walk;
|
|
9
|
-
export declare const commaSeparatedValues: typeof __commaSeparatedValues;
|
|
10
|
-
export declare const getHubSpotApiOrigin: typeof __getHubSpotApiOrigin;
|
|
11
|
-
export declare const getHubSpotWebsiteOrigin: (env: string) => string;
|
package/lib/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHubSpotWebsiteOrigin = exports.getHubSpotApiOrigin = exports.commaSeparatedValues = exports.walk = exports.getValidEnv = exports.extractZipArchive = void 0;
|
|
4
|
-
const archive_1 = require("./archive");
|
|
5
|
-
const environment_1 = require("./environment");
|
|
6
|
-
const fs_1 = require("./fs");
|
|
7
|
-
const text_1 = require("./text");
|
|
8
|
-
const urls_1 = require("./urls");
|
|
9
|
-
exports.extractZipArchive = archive_1.extractZipArchive;
|
|
10
|
-
exports.getValidEnv = environment_1.getValidEnv;
|
|
11
|
-
exports.walk = fs_1.walk;
|
|
12
|
-
exports.commaSeparatedValues = text_1.commaSeparatedValues;
|
|
13
|
-
exports.getHubSpotApiOrigin = urls_1.getHubSpotApiOrigin;
|
|
14
|
-
exports.getHubSpotWebsiteOrigin = urls_1.getHubSpotWebsiteOrigin;
|
|
File without changes
|
|
File without changes
|