@hubspot/local-dev-lib 0.0.2 → 0.0.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/config/CLIConfiguration.d.ts +55 -0
- package/config/CLIConfiguration.js +392 -0
- package/config/configFile.d.ts +21 -0
- package/config/configFile.js +110 -0
- package/config/configUtils.d.ts +24 -0
- package/config/configUtils.js +85 -0
- package/config/environment.d.ts +3 -0
- package/config/environment.js +64 -0
- package/constants/auth.d.ts +24 -0
- package/constants/auth.js +31 -0
- package/constants/config.d.ts +8 -0
- package/constants/config.js +12 -0
- package/constants/environments.d.ts +13 -0
- package/constants/environments.js +16 -0
- package/constants/extensions.d.ts +1 -0
- package/constants/extensions.js +22 -0
- package/constants/index.d.ts +16 -0
- package/constants/index.js +12 -0
- package/errors/HubSpotAuthError.d.ts +3 -0
- package/errors/HubSpotAuthError.js +6 -0
- package/errors/cmsFieldsJsErrors.d.ts +9 -0
- package/errors/cmsFieldsJsErrors.js +31 -0
- package/errors/fileSystemErrors.d.ts +2 -0
- package/errors/fileSystemErrors.js +29 -0
- package/errors/standardErrors.d.ts +9 -0
- package/errors/standardErrors.js +63 -0
- package/index.d.ts +2 -0
- package/index.js +5 -0
- package/lib/archive.d.ts +7 -0
- package/lib/archive.js +113 -0
- package/lib/path.d.ts +13 -0
- package/lib/path.js +101 -0
- package/package.json +1 -4
- package/src/config/CLIConfiguration.d.ts +55 -0
- package/src/config/CLIConfiguration.js +392 -0
- package/src/config/configFile.d.ts +21 -0
- package/src/config/configFile.js +109 -0
- package/src/config/configUtils.d.ts +24 -0
- package/src/config/configUtils.js +85 -0
- package/src/config/environment.d.ts +3 -0
- package/src/config/environment.js +64 -0
- package/src/constants/auth.d.ts +24 -0
- package/src/constants/auth.js +31 -0
- package/src/constants/config.d.ts +8 -0
- package/src/constants/config.js +12 -0
- package/src/constants/environments.d.ts +13 -0
- package/src/constants/environments.js +16 -0
- package/src/constants/extensions.d.ts +2 -0
- package/src/constants/extensions.js +23 -0
- package/src/constants/files.d.ts +5 -0
- package/src/constants/files.js +8 -0
- package/src/constants/github.d.ts +4 -0
- package/src/constants/github.js +7 -0
- package/src/constants/index.d.ts +16 -0
- package/src/constants/index.js +12 -0
- package/src/errors/HubSpotAuthError.d.ts +3 -0
- package/src/errors/HubSpotAuthError.js +6 -0
- package/src/errors/cmsFieldsJsErrors.d.ts +9 -0
- package/src/errors/cmsFieldsJsErrors.js +31 -0
- package/src/errors/fileSystemErrors.d.ts +8 -0
- package/src/errors/fileSystemErrors.js +28 -0
- package/src/errors/standardErrors.d.ts +19 -0
- package/src/errors/standardErrors.js +67 -0
- package/src/http/requestOptions.d.ts +20 -0
- package/src/http/requestOptions.js +27 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -0
- package/src/lib/archive.d.ts +7 -0
- package/src/lib/archive.js +111 -0
- package/src/lib/cms/handleFieldsJS.d.ts +32 -0
- package/src/lib/cms/handleFieldsJS.js +143 -0
- package/src/lib/cms/index.d.ts +10 -0
- package/src/lib/cms/index.js +13 -0
- package/src/lib/cms/modules.d.ts +24 -0
- package/src/lib/cms/modules.js +124 -0
- package/src/lib/cms/themes.d.ts +2 -0
- package/src/lib/cms/themes.js +34 -0
- package/src/lib/environment.d.ts +1 -0
- package/src/lib/environment.js +16 -0
- package/src/lib/fs.d.ts +4 -0
- package/src/lib/fs.js +71 -0
- package/src/lib/github.d.ts +17 -0
- package/src/lib/github.js +133 -0
- package/src/lib/gitignore.d.ts +1 -0
- package/src/lib/gitignore.js +76 -0
- package/src/lib/index.d.ts +11 -0
- package/src/lib/index.js +14 -0
- package/src/lib/modules.d.ts +28 -0
- package/src/lib/modules.js +174 -0
- package/src/lib/path.d.ts +10 -0
- package/src/lib/path.js +84 -0
- package/src/lib/text.d.ts +1 -0
- package/src/lib/text.js +16 -0
- package/src/lib/urls.d.ts +2 -0
- package/src/lib/urls.js +20 -0
- package/src/types/Accounts.d.ts +50 -0
- package/src/types/Accounts.js +2 -0
- package/src/types/CLIOptions.d.ts +3 -0
- package/src/types/CLIOptions.js +2 -0
- package/src/types/Config.d.ts +10 -0
- package/src/types/Config.js +2 -0
- package/src/types/Error.d.ts +31 -0
- package/src/types/Error.js +2 -0
- package/src/types/Files.d.ts +8 -0
- package/src/types/Files.js +2 -0
- package/src/types/Github.d.ts +58 -0
- package/src/types/Github.js +2 -0
- package/src/types/LogCallbacks.d.ts +6 -0
- package/src/types/LogCallbacks.js +2 -0
- package/src/types/Modules.d.ts +5 -0
- package/src/types/Modules.js +2 -0
- package/src/types/Utils.d.ts +1 -0
- package/src/types/Utils.js +2 -0
- package/src/utils/encoding.d.ts +1 -0
- package/src/utils/encoding.js +11 -0
- package/src/utils/environment.d.ts +1 -0
- package/src/utils/environment.js +16 -0
- package/src/utils/escapeRegExp.d.ts +1 -0
- package/src/utils/escapeRegExp.js +7 -0
- package/src/utils/fieldsJS.d.ts +3 -0
- package/src/utils/fieldsJS.js +18 -0
- package/src/utils/files.d.ts +3 -0
- package/src/utils/files.js +35 -0
- package/src/utils/fs/read.d.ts +4 -0
- package/src/utils/fs/read.js +55 -0
- package/src/utils/fs/walk.d.ts +2 -0
- package/src/utils/fs/walk.js +44 -0
- package/src/utils/git.d.ts +4 -0
- package/src/utils/git.js +40 -0
- package/src/utils/handleFieldsJS.d.ts +35 -0
- package/src/utils/handleFieldsJS.js +158 -0
- package/src/utils/interpolation.d.ts +5 -0
- package/src/utils/interpolation.js +31 -0
- package/src/utils/lang.d.ts +8 -0
- package/src/utils/lang.js +83 -0
- package/src/utils/logger.d.ts +10 -0
- package/src/utils/logger.js +22 -0
- package/src/utils/modules.d.ts +4 -0
- package/src/utils/modules.js +53 -0
- package/src/utils/text.d.ts +1 -0
- package/src/utils/text.js +16 -0
- package/src/utils/urls.d.ts +2 -0
- package/src/utils/urls.js +20 -0
- package/types/Accounts.d.ts +50 -0
- package/types/Accounts.js +2 -0
- package/types/CLIOptions.d.ts +3 -0
- package/types/CLIOptions.js +2 -0
- package/types/Config.d.ts +10 -0
- package/types/Config.js +2 -0
- package/types/Error.d.ts +38 -0
- package/types/Error.js +2 -0
- package/types/LogCallbacks.d.ts +6 -0
- package/types/LogCallbacks.js +2 -0
- package/types/Utils.d.ts +1 -0
- package/types/Utils.js +2 -0
- package/utils/encoding.d.ts +1 -0
- package/utils/encoding.js +11 -0
- package/utils/environment.d.ts +1 -0
- package/utils/environment.js +16 -0
- package/utils/escapeRegExp.d.ts +1 -0
- package/utils/escapeRegExp.js +7 -0
- package/utils/git.d.ts +3 -0
- package/utils/git.js +104 -0
- package/utils/interpolation.d.ts +5 -0
- package/utils/interpolation.js +31 -0
- package/utils/lang.d.ts +3 -0
- package/utils/lang.js +58 -0
- package/utils/logger.d.ts +10 -0
- package/utils/logger.js +22 -0
- package/utils/text.d.ts +1 -0
- package/utils/text.js +16 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadConfigFromEnvironment = exports.getValidEnv = void 0;
|
|
4
|
+
const logger_1 = require("../utils/logger");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const auth_1 = require("../constants/auth");
|
|
7
|
+
const configUtils_1 = require("./configUtils");
|
|
8
|
+
function getValidEnv(env, useProdDefault = true) {
|
|
9
|
+
if (typeof env === 'string' && env.toLowerCase() === constants_1.ENVIRONMENTS.QA) {
|
|
10
|
+
return constants_1.ENVIRONMENTS.QA;
|
|
11
|
+
}
|
|
12
|
+
return useProdDefault ? constants_1.ENVIRONMENTS.PROD : undefined;
|
|
13
|
+
}
|
|
14
|
+
exports.getValidEnv = getValidEnv;
|
|
15
|
+
function getConfigVariablesFromEnv() {
|
|
16
|
+
const env = process.env;
|
|
17
|
+
return {
|
|
18
|
+
apiKey: env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_API_KEY],
|
|
19
|
+
clientId: env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_CLIENT_ID],
|
|
20
|
+
clientSecret: env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_CLIENT_SECRET],
|
|
21
|
+
personalAccessKey: env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_PERSONAL_ACCESS_KEY],
|
|
22
|
+
accountId: parseInt(env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_ACCOUNT_ID], 10),
|
|
23
|
+
refreshToken: env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_REFRESH_TOKEN],
|
|
24
|
+
env: getValidEnv(env[constants_1.ENVIRONMENT_VARIABLES.HUBSPOT_ENVIRONMENT]),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function loadConfigFromEnvironment() {
|
|
28
|
+
const { apiKey, clientId, clientSecret, personalAccessKey, accountId, refreshToken, env, } = getConfigVariablesFromEnv();
|
|
29
|
+
if (!accountId) {
|
|
30
|
+
(0, logger_1.debug)('environment.loadConfig.missingAccountId');
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (!env) {
|
|
34
|
+
(0, logger_1.debug)('environment.loadConfig.env');
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (personalAccessKey) {
|
|
38
|
+
return (0, configUtils_1.generateConfig)(auth_1.PERSONAL_ACCESS_KEY_AUTH_METHOD.value, {
|
|
39
|
+
accountId,
|
|
40
|
+
personalAccessKey,
|
|
41
|
+
env,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else if (clientId && clientSecret && refreshToken) {
|
|
45
|
+
return (0, configUtils_1.generateConfig)(auth_1.OAUTH_AUTH_METHOD.value, {
|
|
46
|
+
accountId,
|
|
47
|
+
clientId,
|
|
48
|
+
clientSecret,
|
|
49
|
+
refreshToken,
|
|
50
|
+
scopes: auth_1.OAUTH_SCOPES.map((scope) => scope.value),
|
|
51
|
+
env,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else if (apiKey) {
|
|
55
|
+
return (0, configUtils_1.generateConfig)(auth_1.API_KEY_AUTH_METHOD.value, {
|
|
56
|
+
accountId,
|
|
57
|
+
apiKey,
|
|
58
|
+
env,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
(0, logger_1.debug)('environment.loadConfig.unknownAuthType');
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
exports.loadConfigFromEnvironment = loadConfigFromEnvironment;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const API_KEY_AUTH_METHOD: {
|
|
2
|
+
readonly value: "apikey";
|
|
3
|
+
readonly name: "API Key";
|
|
4
|
+
};
|
|
5
|
+
export declare const OAUTH_AUTH_METHOD: {
|
|
6
|
+
readonly value: "oauth2";
|
|
7
|
+
readonly name: "OAuth2";
|
|
8
|
+
};
|
|
9
|
+
export declare const PERSONAL_ACCESS_KEY_AUTH_METHOD: {
|
|
10
|
+
readonly value: "personalaccesskey";
|
|
11
|
+
readonly name: "Personal Access Key";
|
|
12
|
+
};
|
|
13
|
+
export declare const DEFAULT_OAUTH_SCOPES: readonly ["content"];
|
|
14
|
+
export declare const OAUTH_SCOPES: readonly [{
|
|
15
|
+
readonly name: "All CMS APIs, Calendar API, Email and Email Events APIs";
|
|
16
|
+
readonly value: "content";
|
|
17
|
+
readonly checked: true;
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "HubDB API";
|
|
20
|
+
readonly value: "hubdb";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "File Manager API";
|
|
23
|
+
readonly value: "files";
|
|
24
|
+
}];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OAUTH_SCOPES = exports.DEFAULT_OAUTH_SCOPES = exports.PERSONAL_ACCESS_KEY_AUTH_METHOD = exports.OAUTH_AUTH_METHOD = exports.API_KEY_AUTH_METHOD = void 0;
|
|
4
|
+
exports.API_KEY_AUTH_METHOD = {
|
|
5
|
+
value: 'apikey',
|
|
6
|
+
name: 'API Key',
|
|
7
|
+
};
|
|
8
|
+
exports.OAUTH_AUTH_METHOD = {
|
|
9
|
+
value: 'oauth2',
|
|
10
|
+
name: 'OAuth2',
|
|
11
|
+
};
|
|
12
|
+
exports.PERSONAL_ACCESS_KEY_AUTH_METHOD = {
|
|
13
|
+
value: 'personalaccesskey',
|
|
14
|
+
name: 'Personal Access Key',
|
|
15
|
+
};
|
|
16
|
+
exports.DEFAULT_OAUTH_SCOPES = ['content'];
|
|
17
|
+
exports.OAUTH_SCOPES = [
|
|
18
|
+
{
|
|
19
|
+
name: 'All CMS APIs, Calendar API, Email and Email Events APIs',
|
|
20
|
+
value: 'content',
|
|
21
|
+
checked: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'HubDB API',
|
|
25
|
+
value: 'hubdb',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'File Manager API',
|
|
29
|
+
value: 'files',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = "hubspot.config.yml";
|
|
2
|
+
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".hubspot";
|
|
3
|
+
export declare const HUBSPOT_CONFIGURATION_FILE = "config.yml";
|
|
4
|
+
export declare const DEFAULT_MODES: {
|
|
5
|
+
readonly draft: "draft";
|
|
6
|
+
readonly publish: "publish";
|
|
7
|
+
};
|
|
8
|
+
export declare const MIN_HTTP_TIMEOUT = 3000;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MIN_HTTP_TIMEOUT = exports.DEFAULT_MODES = exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = void 0;
|
|
4
|
+
// NOTE this is the legacy config file name (We still need to keep it around though)
|
|
5
|
+
exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = 'hubspot.config.yml';
|
|
6
|
+
exports.HUBSPOT_CONFIGURATION_FOLDER = '.hubspot';
|
|
7
|
+
exports.HUBSPOT_CONFIGURATION_FILE = 'config.yml';
|
|
8
|
+
exports.DEFAULT_MODES = {
|
|
9
|
+
draft: 'draft',
|
|
10
|
+
publish: 'publish',
|
|
11
|
+
};
|
|
12
|
+
exports.MIN_HTTP_TIMEOUT = 3000;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENVIRONMENT_VARIABLES = exports.ENVIRONMENTS = void 0;
|
|
4
|
+
exports.ENVIRONMENTS = {
|
|
5
|
+
PROD: 'prod',
|
|
6
|
+
QA: 'qa',
|
|
7
|
+
};
|
|
8
|
+
exports.ENVIRONMENT_VARIABLES = {
|
|
9
|
+
HUBSPOT_API_KEY: 'HUBSPOT_API_KEY',
|
|
10
|
+
HUBSPOT_CLIENT_ID: 'HUBSPOT_CLIENT_ID',
|
|
11
|
+
HUBSPOT_CLIENT_SECRET: 'HUBSPOT_CLIENT_SECRET',
|
|
12
|
+
HUBSPOT_PERSONAL_ACCESS_KEY: 'HUBSPOT_PERSONAL_ACCESS_KEY',
|
|
13
|
+
HUBSPOT_ACCOUNT_ID: 'HUBSPOT_ACCOUNT_ID',
|
|
14
|
+
HUBSPOT_REFRESH_TOKEN: 'HUBSPOT_REFRESH_TOKEN',
|
|
15
|
+
HUBSPOT_ENVIRONMENT: 'HUBSPOT_ENVIRONMENT',
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ALLOWED_EXTENSIONS: Set<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALLOWED_EXTENSIONS = void 0;
|
|
4
|
+
exports.ALLOWED_EXTENSIONS = new Set([
|
|
5
|
+
'css',
|
|
6
|
+
'js',
|
|
7
|
+
'json',
|
|
8
|
+
'html',
|
|
9
|
+
'txt',
|
|
10
|
+
'md',
|
|
11
|
+
'jpg',
|
|
12
|
+
'jpeg',
|
|
13
|
+
'png',
|
|
14
|
+
'gif',
|
|
15
|
+
'map',
|
|
16
|
+
'svg',
|
|
17
|
+
'eot',
|
|
18
|
+
'ttf',
|
|
19
|
+
'woff',
|
|
20
|
+
'woff2',
|
|
21
|
+
'graphql',
|
|
22
|
+
]);
|
|
@@ -0,0 +1,16 @@
|
|
|
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";
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValueOf } from '../types/Utils';
|
|
2
|
+
import { BaseError } from '../types/Error';
|
|
3
|
+
export declare const FieldErrors: {
|
|
4
|
+
readonly IsNotFunction: "IsNotFunction";
|
|
5
|
+
readonly DoesNotReturnArray: "DoesNotReturnArray";
|
|
6
|
+
};
|
|
7
|
+
export declare function throwFieldsJsError(e: BaseError | ValueOf<typeof FieldErrors>, path: string, info?: {
|
|
8
|
+
returned?: string;
|
|
9
|
+
}): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwFieldsJsError = exports.FieldErrors = void 0;
|
|
4
|
+
const standardErrors_1 = require("./standardErrors");
|
|
5
|
+
const i18nKey = 'errorTypes.cmsFields';
|
|
6
|
+
exports.FieldErrors = {
|
|
7
|
+
IsNotFunction: 'IsNotFunction',
|
|
8
|
+
DoesNotReturnArray: 'DoesNotReturnArray',
|
|
9
|
+
};
|
|
10
|
+
function throwFieldsJsError(e, path, info = {}) {
|
|
11
|
+
if (e instanceof SyntaxError ||
|
|
12
|
+
(typeof e === 'object' && e.code === 'MODULE_NOT_FOUND')) {
|
|
13
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.syntaxError`, { path });
|
|
14
|
+
}
|
|
15
|
+
if (e === exports.FieldErrors.IsNotFunction) {
|
|
16
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.notFunction`, {
|
|
17
|
+
path,
|
|
18
|
+
returned: info.returned || '',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (e === exports.FieldErrors.DoesNotReturnArray) {
|
|
22
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.notReturnArray`, {
|
|
23
|
+
path,
|
|
24
|
+
returned: info.returned || '',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (typeof e === 'object' && e.code === 'ENOENT') {
|
|
28
|
+
(0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.invalidPath`, { path });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.throwFieldsJsError = throwFieldsJsError;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwFileSystemError = void 0;
|
|
4
|
+
const lang_1 = require("../utils/lang");
|
|
5
|
+
const standardErrors_1 = require("./standardErrors");
|
|
6
|
+
const i18nKey = 'errors.errorTypes.fileSystem';
|
|
7
|
+
function throwFileSystemError(error, context) {
|
|
8
|
+
(0, standardErrors_1.debugErrorAndContext)(error, context);
|
|
9
|
+
let fileAction = '';
|
|
10
|
+
if (context.read) {
|
|
11
|
+
fileAction = (0, lang_1.i18n)(`${i18nKey}.readAction`);
|
|
12
|
+
}
|
|
13
|
+
else if (context.write) {
|
|
14
|
+
fileAction = (0, lang_1.i18n)(`${i18nKey}.writeAction`);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
fileAction = (0, lang_1.i18n)(`${i18nKey}.otherAction`);
|
|
18
|
+
}
|
|
19
|
+
const filepath = context.filepath
|
|
20
|
+
? `"${context.filepath}"`
|
|
21
|
+
: (0, lang_1.i18n)(`${i18nKey}.unknownFilepath`);
|
|
22
|
+
const message = [(0, lang_1.i18n)(`${i18nKey}.baseMessage`, { fileAction, filepath })];
|
|
23
|
+
// Many `fs` errors will be `SystemError`s
|
|
24
|
+
if ((0, standardErrors_1.isSystemError)(error)) {
|
|
25
|
+
message.push((0, lang_1.i18n)(`${i18nKey}.baseMessage`, { errorMessage: error.message }));
|
|
26
|
+
}
|
|
27
|
+
throw new Error(message.join(' '));
|
|
28
|
+
}
|
|
29
|
+
exports.throwFileSystemError = throwFileSystemError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorContext } from '../types/Error';
|
|
2
|
+
import { BaseError } from '../types/Error';
|
|
3
|
+
export declare function isSystemError(err: BaseError): boolean;
|
|
4
|
+
export declare function isFatalError(err: BaseError): boolean;
|
|
5
|
+
export declare function debugErrorAndContext(error: BaseError, context?: ErrorContext): void;
|
|
6
|
+
export declare function throwErrorWithMessage(identifier: string, interpolation?: {
|
|
7
|
+
[key: string]: string | number;
|
|
8
|
+
}): never;
|
|
9
|
+
export declare function throwError(error: BaseError, context?: ErrorContext): never;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwError = exports.throwErrorWithMessage = exports.debugErrorAndContext = exports.isFatalError = exports.isSystemError = void 0;
|
|
4
|
+
const HubSpotAuthError_1 = require("./HubSpotAuthError");
|
|
5
|
+
const logger_1 = require("../utils/logger");
|
|
6
|
+
const lang_1 = require("../utils/lang");
|
|
7
|
+
function isSystemError(err) {
|
|
8
|
+
return err.errno != null && err.code != null && err.syscall != null;
|
|
9
|
+
}
|
|
10
|
+
exports.isSystemError = isSystemError;
|
|
11
|
+
function isFatalError(err) {
|
|
12
|
+
return err instanceof HubSpotAuthError_1.HubSpotAuthError;
|
|
13
|
+
}
|
|
14
|
+
exports.isFatalError = isFatalError;
|
|
15
|
+
function debugErrorAndContext(error, context) {
|
|
16
|
+
if (error.name === 'StatusCodeError') {
|
|
17
|
+
const { statusCode, message, response } = error;
|
|
18
|
+
(0, logger_1.debug)('standardErrors.error', {
|
|
19
|
+
error: JSON.stringify({
|
|
20
|
+
statusCode,
|
|
21
|
+
message,
|
|
22
|
+
url: response.request.href,
|
|
23
|
+
method: response.request.method,
|
|
24
|
+
response: response.body,
|
|
25
|
+
headers: response.headers,
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
(0, logger_1.debug)('standardErrors.error', { error: JSON.stringify(error) });
|
|
31
|
+
}
|
|
32
|
+
(0, logger_1.debug)('standardErrors.context', { context: JSON.stringify(context) });
|
|
33
|
+
}
|
|
34
|
+
exports.debugErrorAndContext = debugErrorAndContext;
|
|
35
|
+
function throwErrorWithMessage(identifier, interpolation) {
|
|
36
|
+
throw new Error((0, lang_1.i18n)(`errors.${identifier}`, interpolation));
|
|
37
|
+
}
|
|
38
|
+
exports.throwErrorWithMessage = throwErrorWithMessage;
|
|
39
|
+
function throwSystemError(error, context) {
|
|
40
|
+
debugErrorAndContext(error, context);
|
|
41
|
+
throwErrorWithMessage('errorTypes.standard.system', {
|
|
42
|
+
message: error.message,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// formally logErrorInstance
|
|
46
|
+
function throwError(error, context) {
|
|
47
|
+
debugErrorAndContext(error, context);
|
|
48
|
+
if (isSystemError(error)) {
|
|
49
|
+
throwSystemError(error, context);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// Error or Error subclass
|
|
53
|
+
const name = error.name || 'Error';
|
|
54
|
+
const message = [(0, lang_1.i18n)('errors.errorTypes.standard.generic', { name })];
|
|
55
|
+
[error.message, error.reason].forEach(msg => {
|
|
56
|
+
if (msg) {
|
|
57
|
+
message.push(msg);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
throw new Error(message.join(' '));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.throwError = throwError;
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/lib/archive.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
type CopySourceToDestOptions = {
|
|
3
|
+
sourceDir?: string;
|
|
4
|
+
includesRootDir?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function extractZipArchive(zip: Buffer, name: string, dest: string, { sourceDir, includesRootDir }?: CopySourceToDestOptions): Promise<boolean>;
|
|
7
|
+
export {};
|
package/lib/archive.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
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.extractZipArchive = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const os_1 = require("os");
|
|
10
|
+
const util_1 = require("util");
|
|
11
|
+
const extract_zip_1 = __importDefault(require("extract-zip"));
|
|
12
|
+
const fileSystemErrors_1 = require("../errors/fileSystemErrors");
|
|
13
|
+
const standardErrors_1 = require("../errors/standardErrors");
|
|
14
|
+
const logger_1 = require("../utils/logger");
|
|
15
|
+
const extract = (0, util_1.promisify)(extract_zip_1.default);
|
|
16
|
+
async function extractZip(name, zip) {
|
|
17
|
+
const result = { extractDir: '', tmpDir: '' };
|
|
18
|
+
const TMP_FOLDER_PREFIX = `hubspot-temp-${name}-`;
|
|
19
|
+
(0, logger_1.debug)('archive.extractZip.init');
|
|
20
|
+
// Write zip to disk
|
|
21
|
+
let tmpZipPath = '';
|
|
22
|
+
try {
|
|
23
|
+
result.tmpDir = await fs_extra_1.default.mkdtemp((0, path_1.join)((0, os_1.tmpdir)(), TMP_FOLDER_PREFIX));
|
|
24
|
+
tmpZipPath = (0, path_1.join)(result.tmpDir, 'hubspot-temp.zip');
|
|
25
|
+
await fs_extra_1.default.ensureFile(tmpZipPath);
|
|
26
|
+
await fs_extra_1.default.writeFile(tmpZipPath, zip, {
|
|
27
|
+
mode: 0o777,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
(0, logger_1.debug)('archive.extractZip.writeError');
|
|
32
|
+
if (tmpZipPath || result.tmpDir) {
|
|
33
|
+
(0, fileSystemErrors_1.throwFileSystemError)(err, {
|
|
34
|
+
filepath: tmpZipPath || result.tmpDir,
|
|
35
|
+
write: true,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
(0, standardErrors_1.throwError)(err);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
// Extract zip
|
|
44
|
+
try {
|
|
45
|
+
const tmpExtractPath = (0, path_1.join)(result.tmpDir, 'extracted');
|
|
46
|
+
await extract(tmpZipPath, { dir: tmpExtractPath });
|
|
47
|
+
result.extractDir = tmpExtractPath;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
(0, logger_1.debug)('archive.extractZip.extractError');
|
|
51
|
+
(0, standardErrors_1.throwError)(err);
|
|
52
|
+
}
|
|
53
|
+
(0, logger_1.debug)('archive.extractZip.success');
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
async function copySourceToDest(src, dest, { sourceDir, includesRootDir = true } = {}) {
|
|
57
|
+
try {
|
|
58
|
+
(0, logger_1.debug)('archive.copySourceToDest.init');
|
|
59
|
+
const srcDirPath = [src];
|
|
60
|
+
if (includesRootDir) {
|
|
61
|
+
const files = await fs_extra_1.default.readdir(src);
|
|
62
|
+
const rootDir = files[0];
|
|
63
|
+
if (!rootDir) {
|
|
64
|
+
(0, logger_1.debug)('archive.copySourceToDest.sourceEmpty');
|
|
65
|
+
// Create the dest path if it doesn't already exist
|
|
66
|
+
fs_extra_1.default.ensureDir(dest);
|
|
67
|
+
// No root found so nothing to copy
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
srcDirPath.push(rootDir);
|
|
71
|
+
}
|
|
72
|
+
if (sourceDir) {
|
|
73
|
+
srcDirPath.push(sourceDir);
|
|
74
|
+
}
|
|
75
|
+
const projectSrcDir = (0, path_1.join)(...srcDirPath);
|
|
76
|
+
await fs_extra_1.default.copy(projectSrcDir, dest);
|
|
77
|
+
(0, logger_1.debug)('archive.copySourceToDest.success');
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
(0, logger_1.debug)('archive.copySourceToDest.error', { dest });
|
|
82
|
+
(0, fileSystemErrors_1.throwFileSystemError)(err, {
|
|
83
|
+
filepath: dest,
|
|
84
|
+
write: true,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
function cleanupTempDir(tmpDir) {
|
|
90
|
+
if (!tmpDir)
|
|
91
|
+
return;
|
|
92
|
+
try {
|
|
93
|
+
fs_extra_1.default.remove(tmpDir);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
(0, logger_1.debug)('archive.cleanupTempDir.error', { tmpDir });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function extractZipArchive(zip, name, dest, { sourceDir, includesRootDir } = {}) {
|
|
100
|
+
let success = false;
|
|
101
|
+
if (zip) {
|
|
102
|
+
const { extractDir, tmpDir } = await extractZip(name, zip);
|
|
103
|
+
if (extractDir !== null) {
|
|
104
|
+
success = await copySourceToDest(extractDir, dest, {
|
|
105
|
+
sourceDir,
|
|
106
|
+
includesRootDir,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
cleanupTempDir(tmpDir);
|
|
110
|
+
}
|
|
111
|
+
return success;
|
|
112
|
+
}
|
|
113
|
+
exports.extractZipArchive = extractZipArchive;
|
package/lib/path.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import path from 'path';
|
|
3
|
+
export declare function convertToUnixPath(_path: string): string;
|
|
4
|
+
export declare function convertToImportPath(_path: string): string;
|
|
5
|
+
export declare function convertToLocalFileSystemPath(_path: string): string;
|
|
6
|
+
export declare function splitLocalPath(filepath: string, pathImplementation?: path.PlatformPath): Array<string>;
|
|
7
|
+
export declare function splitHubSpotPath(filepath: string): Array<string>;
|
|
8
|
+
export declare function getCwd(): string;
|
|
9
|
+
export declare function getExt(filepath: string): string;
|
|
10
|
+
export declare const getAllowedExtensions: () => Set<string>;
|
|
11
|
+
export declare function isAllowedExtension(filepath: string): boolean;
|
|
12
|
+
export declare function getAbsoluteFilePath(_path: string): string;
|
|
13
|
+
export declare function isRelativePath(_path: string): boolean;
|
package/lib/path.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
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.isRelativePath = exports.getAbsoluteFilePath = exports.isAllowedExtension = exports.getAllowedExtensions = exports.getExt = exports.getCwd = exports.splitHubSpotPath = exports.splitLocalPath = exports.convertToLocalFileSystemPath = exports.convertToImportPath = exports.convertToUnixPath = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const unixify_1 = __importDefault(require("unixify"));
|
|
9
|
+
const extensions_1 = require("../constants/extensions");
|
|
10
|
+
function convertToUnixPath(_path) {
|
|
11
|
+
return (0, unixify_1.default)(path_1.default.normalize(_path));
|
|
12
|
+
}
|
|
13
|
+
exports.convertToUnixPath = convertToUnixPath;
|
|
14
|
+
function convertToWindowsPath(_path) {
|
|
15
|
+
const rgx = new RegExp(`\\${path_1.default.posix.sep}`, 'g');
|
|
16
|
+
return path_1.default.normalize(_path).replace(rgx, path_1.default.win32.sep);
|
|
17
|
+
}
|
|
18
|
+
// Converts a Win32 path to Posix, retaining the drive letter (ex. 'c:')
|
|
19
|
+
function convertToImportPath(_path) {
|
|
20
|
+
if (path_1.default.sep === path_1.default.win32.sep) {
|
|
21
|
+
return _path.split(path_1.default.win32.sep).join(path_1.default.posix.sep);
|
|
22
|
+
}
|
|
23
|
+
return _path;
|
|
24
|
+
}
|
|
25
|
+
exports.convertToImportPath = convertToImportPath;
|
|
26
|
+
function convertToLocalFileSystemPath(_path) {
|
|
27
|
+
switch (path_1.default.sep) {
|
|
28
|
+
case path_1.default.posix.sep:
|
|
29
|
+
return convertToUnixPath(_path);
|
|
30
|
+
case path_1.default.win32.sep:
|
|
31
|
+
return convertToWindowsPath(_path);
|
|
32
|
+
default:
|
|
33
|
+
return path_1.default.normalize(_path);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.convertToLocalFileSystemPath = convertToLocalFileSystemPath;
|
|
37
|
+
function removeTrailingSlashFromSplits(parts) {
|
|
38
|
+
if (parts.length > 1 && parts[parts.length - 1] === '') {
|
|
39
|
+
return parts.slice(0, parts.length - 1);
|
|
40
|
+
}
|
|
41
|
+
return parts;
|
|
42
|
+
}
|
|
43
|
+
// Splits a filepath for local file system sources.
|
|
44
|
+
function splitLocalPath(filepath, pathImplementation = path_1.default) {
|
|
45
|
+
if (!filepath)
|
|
46
|
+
return [];
|
|
47
|
+
const { sep } = pathImplementation;
|
|
48
|
+
const rgx = new RegExp(`\\${sep}+`, 'g');
|
|
49
|
+
const parts = pathImplementation.normalize(filepath).split(rgx);
|
|
50
|
+
// Restore posix root if present
|
|
51
|
+
if (sep === path_1.default.posix.sep && parts[0] === '') {
|
|
52
|
+
parts[0] = '/';
|
|
53
|
+
}
|
|
54
|
+
return removeTrailingSlashFromSplits(parts);
|
|
55
|
+
}
|
|
56
|
+
exports.splitLocalPath = splitLocalPath;
|
|
57
|
+
// Splits a filepath for remote sources (HubSpot).
|
|
58
|
+
function splitHubSpotPath(filepath) {
|
|
59
|
+
if (!filepath)
|
|
60
|
+
return [];
|
|
61
|
+
const rgx = new RegExp(`\\${path_1.default.posix.sep}+`, 'g');
|
|
62
|
+
const parts = convertToUnixPath(filepath).split(rgx);
|
|
63
|
+
// Restore root if present
|
|
64
|
+
if (parts[0] === '') {
|
|
65
|
+
parts[0] = '/';
|
|
66
|
+
}
|
|
67
|
+
return removeTrailingSlashFromSplits(parts);
|
|
68
|
+
}
|
|
69
|
+
exports.splitHubSpotPath = splitHubSpotPath;
|
|
70
|
+
function getCwd() {
|
|
71
|
+
if (process.env.INIT_CWD) {
|
|
72
|
+
return process.env.INIT_CWD;
|
|
73
|
+
}
|
|
74
|
+
return process.cwd();
|
|
75
|
+
}
|
|
76
|
+
exports.getCwd = getCwd;
|
|
77
|
+
function getExt(filepath) {
|
|
78
|
+
if (typeof filepath !== 'string')
|
|
79
|
+
return '';
|
|
80
|
+
const ext = path_1.default.extname(filepath).trim().toLowerCase();
|
|
81
|
+
return ext[0] === '.' ? ext.slice(1) : ext;
|
|
82
|
+
}
|
|
83
|
+
exports.getExt = getExt;
|
|
84
|
+
const getAllowedExtensions = () => {
|
|
85
|
+
return extensions_1.ALLOWED_EXTENSIONS;
|
|
86
|
+
};
|
|
87
|
+
exports.getAllowedExtensions = getAllowedExtensions;
|
|
88
|
+
function isAllowedExtension(filepath) {
|
|
89
|
+
const ext = getExt(filepath);
|
|
90
|
+
const allowedExtensions = (0, exports.getAllowedExtensions)();
|
|
91
|
+
return allowedExtensions.has(ext);
|
|
92
|
+
}
|
|
93
|
+
exports.isAllowedExtension = isAllowedExtension;
|
|
94
|
+
function getAbsoluteFilePath(_path) {
|
|
95
|
+
return path_1.default.resolve(getCwd(), _path);
|
|
96
|
+
}
|
|
97
|
+
exports.getAbsoluteFilePath = getAbsoluteFilePath;
|
|
98
|
+
function isRelativePath(_path) {
|
|
99
|
+
return !path_1.default.isAbsolute(_path);
|
|
100
|
+
}
|
|
101
|
+
exports.isRelativePath = isRelativePath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/local-dev-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -45,9 +45,6 @@
|
|
|
45
45
|
"ts-jest": "^29.0.5",
|
|
46
46
|
"typescript": "^4.9.5"
|
|
47
47
|
},
|
|
48
|
-
"files": [
|
|
49
|
-
"dist/**/*"
|
|
50
|
-
],
|
|
51
48
|
"exports": {
|
|
52
49
|
".": "./dist/lib/index.js",
|
|
53
50
|
"./cms": "./dist/lib/cms",
|