@hubspot/local-dev-lib 0.2.3 → 0.2.4-experimental.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/LICENSE +12 -0
- package/README.md +17 -0
- package/api/appsDev.d.ts +6 -0
- package/api/appsDev.js +29 -0
- package/api/customObjects.d.ts +8 -7
- package/api/customObjects.js +13 -16
- package/api/designManager.d.ts +4 -13
- package/api/designManager.js +6 -9
- package/api/developerTestAccounts.d.ts +7 -0
- package/api/developerTestAccounts.js +48 -0
- package/api/fileManager.d.ts +5 -4
- package/api/fileManager.js +11 -11
- package/api/fileMapper.d.ts +8 -7
- package/api/fileMapper.js +16 -16
- package/api/fileTransport.d.ts +4 -0
- package/api/fileTransport.js +39 -0
- package/api/functions.d.ts +7 -7
- package/api/functions.js +13 -16
- package/api/github.d.ts +7 -9
- package/api/github.js +31 -13
- package/api/hubdb.d.ts +11 -10
- package/api/hubdb.js +28 -22
- package/api/lighthouseScore.d.ts +4 -4
- package/api/lighthouseScore.js +9 -12
- package/api/localDevAuth.d.ts +8 -16
- package/api/localDevAuth.js +34 -13
- package/api/marketplaceValidation.d.ts +4 -4
- package/api/marketplaceValidation.js +8 -11
- package/api/projects.d.ts +31 -24
- package/api/projects.js +163 -43
- package/api/sandboxHubs.d.ts +6 -4
- package/api/sandboxHubs.js +10 -11
- package/api/sandboxSync.d.ts +4 -4
- package/api/sandboxSync.js +4 -13
- package/api/secrets.d.ts +6 -8
- package/api/secrets.js +9 -12
- package/api/validateHubl.d.ts +2 -1
- package/api/validateHubl.js +3 -6
- package/config/CLIConfiguration.d.ts +15 -11
- package/config/CLIConfiguration.js +175 -90
- package/config/configFile.js +13 -21
- package/config/configUtils.d.ts +2 -21
- package/config/configUtils.js +5 -4
- package/config/config_DEPRECATED.d.ts +6 -8
- package/config/config_DEPRECATED.js +79 -25
- package/config/environment.js +5 -4
- package/config/getAccountIdentifier.d.ts +2 -0
- package/config/getAccountIdentifier.js +15 -0
- package/config/index.d.ts +13 -8
- package/config/index.js +97 -57
- package/config/migrate.d.ts +22 -0
- package/config/migrate.js +166 -0
- package/constants/config.d.ts +26 -1
- package/constants/config.js +33 -3
- package/constants/environments.d.ts +1 -0
- package/constants/environments.js +1 -0
- package/constants/extensions.d.ts +2 -0
- package/constants/extensions.js +3 -1
- package/constants/files.d.ts +2 -2
- package/constants/files.js +3 -3
- package/errors/errors_DEPRECATED.d.ts +1 -5
- 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 +6 -3
- package/http/getAxiosConfig.js +49 -6
- package/http/index.d.ts +11 -12
- package/http/index.js +35 -41
- package/http/unauthed.d.ts +14 -0
- package/http/unauthed.js +38 -0
- package/lang/en.json +384 -386
- package/lib/archive.d.ts +2 -8
- package/lib/archive.js +34 -30
- package/lib/cms/functions.d.ts +7 -12
- package/lib/cms/functions.js +49 -51
- package/lib/cms/handleFieldsJS.js +16 -14
- package/lib/cms/modules.d.ts +4 -15
- package/lib/cms/modules.js +81 -78
- package/lib/cms/processFieldsJs.js +10 -33
- package/lib/cms/templates.d.ts +43 -3
- package/lib/cms/templates.js +53 -11
- package/lib/cms/uploadFolder.d.ts +3 -14
- package/lib/cms/uploadFolder.js +58 -42
- package/lib/cms/validate.js +1 -1
- package/lib/cms/watch.d.ts +2 -18
- package/lib/cms/watch.js +63 -68
- package/lib/customObjects.js +4 -15
- package/lib/fileManager.d.ts +2 -6
- package/lib/fileManager.js +54 -65
- package/lib/fileMapper.d.ts +4 -15
- package/lib/fileMapper.js +67 -88
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +10 -6
- package/lib/github.d.ts +12 -14
- package/lib/github.js +70 -35
- package/lib/gitignore.d.ts +2 -0
- package/lib/gitignore.js +21 -4
- package/lib/hubdb.d.ts +3 -2
- package/lib/hubdb.js +11 -9
- package/{utils → lib}/notify.js +2 -2
- package/lib/oauth.d.ts +2 -5
- package/lib/oauth.js +14 -25
- package/lib/path.d.ts +3 -0
- package/lib/path.js +46 -1
- package/lib/personalAccessKey.d.ts +8 -11
- package/lib/personalAccessKey.js +75 -38
- package/lib/portManager.d.ts +3 -5
- package/lib/portManager.js +18 -6
- package/lib/trackUsage.js +18 -11
- package/lib/urls.js +5 -1
- 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 +5 -27
- package/models/OAuth2Manager.js +41 -64
- package/package.json +35 -35
- package/types/Accounts.d.ts +103 -3
- package/types/Apps.d.ts +77 -0
- package/types/Archive.d.ts +9 -0
- package/types/Archive.js +2 -0
- package/types/Build.d.ts +4 -2
- package/types/ComponentStructure.d.ts +30 -10
- package/types/Config.d.ts +19 -2
- package/types/Deploy.d.ts +3 -2
- package/types/DesignManager.d.ts +10 -0
- package/types/DesignManager.js +2 -0
- package/types/Error.d.ts +9 -5
- package/types/FieldsJS.d.ts +1 -0
- package/types/FieldsJS.js +2 -0
- package/types/FileManager.d.ts +1 -1
- package/types/Files.d.ts +43 -4
- package/types/Functions.d.ts +52 -0
- package/types/Github.d.ts +13 -0
- package/types/Http.d.ts +12 -12
- package/types/Hubdb.d.ts +9 -0
- package/types/MarketplaceValidation.d.ts +7 -3
- package/types/Migration.d.ts +28 -0
- package/types/Migration.js +10 -0
- package/types/Modules.d.ts +11 -0
- package/types/PortManager.d.ts +7 -0
- package/types/Project.d.ts +30 -0
- package/types/ProjectLog.d.ts +9 -0
- package/types/ProjectLog.js +2 -0
- package/types/Sandbox.d.ts +37 -47
- package/types/Schemas.d.ts +56 -0
- package/types/Secrets.d.ts +3 -0
- package/types/Secrets.js +2 -0
- package/types/developerTestAccounts.d.ts +13 -0
- package/types/developerTestAccounts.js +2 -0
- package/utils/PortManagerServer.d.ts +6 -7
- package/utils/PortManagerServer.js +22 -16
- package/utils/{getAccountIdentifier.d.ts → accounts.d.ts} +0 -6
- package/utils/{getAccountIdentifier.js → accounts.js} +1 -13
- package/utils/cms/fieldsJS.d.ts +1 -2
- package/utils/cms/modules.js +2 -2
- package/utils/detectPort.js +3 -3
- package/utils/git.d.ts +1 -7
- package/utils/git.js +2 -18
- package/errors/apiErrors.d.ts +0 -16
- 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 -21
- package/errors/standardErrors.js +0 -52
- package/lang/lang/en.json +0 -401
- package/lib/logging/git.d.ts +0 -2
- package/lib/logging/git.js +0 -54
- package/lib/logging/logs.d.ts +0 -22
- package/lib/logging/logs.js +0 -86
- package/lib/logging/table.d.ts +0 -3
- package/lib/logging/table.js +0 -47
- package/lib/sandboxes.d.ts +0 -14
- package/lib/sandboxes.js +0 -71
- package/models/HubSpotAuthError.d.ts +0 -12
- package/models/HubSpotAuthError.js +0 -20
- package/types/LogCallbacks.d.ts +0 -7
- package/utils/logger.d.ts +0 -5
- package/utils/logger.js +0 -23
- package/utils/objectUtils.d.ts +0 -8
- package/utils/objectUtils.js +0 -33
- /package/{utils → lib}/escapeRegExp.d.ts +0 -0
- /package/{utils → lib}/escapeRegExp.js +0 -0
- /package/lib/{logging/logger.d.ts → logger.d.ts} +0 -0
- /package/lib/{logging/logger.js → logger.js} +0 -0
- /package/{utils → lib}/notify.d.ts +0 -0
- /package/types/{LogCallbacks.js → Apps.js} +0 -0
package/config/index.js
CHANGED
|
@@ -22,48 +22,45 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
26
|
+
exports.findConfig = exports.setConfigPath = exports.setConfig = exports.getOrderedConfig = exports.getOrderedAccount = exports.getConfigAccountId = exports.getDefaultAccountOverrideFilePath = exports.getCWDAccountOverride = exports.updateDefaultCmsPublishMode = exports.getConfigAccounts = exports.getConfigDefaultAccount = exports.getAccountType = exports.getEnv = exports.isTrackingAllowed = exports.isConfigFlagEnabled = exports.deleteConfigFile = exports.updateAllowUsageTracking = exports.updateHttpTimeout = exports.deleteAccount = exports.removeSandboxAccountFromConfig = exports.getAccountId = exports.renameAccount = exports.updateDefaultAccount = exports.updateAccountConfig = exports.accountNameExistsInConfig = exports.getAccountConfig = exports.configFileExists = exports.getConfigPath = exports.writeConfig = exports.getConfig = exports.deleteEmptyConfigFile = exports.createEmptyConfigFile = exports.loadConfigFromEnvironment = exports.validateConfig = exports.getAndLoadConfigIfNeeded = exports.loadConfig = void 0;
|
|
30
27
|
const config_DEPRECATED = __importStar(require("./config_DEPRECATED"));
|
|
31
|
-
const CLIConfiguration_1 =
|
|
28
|
+
const CLIConfiguration_1 = require("./CLIConfiguration");
|
|
32
29
|
const configFile_1 = require("./configFile");
|
|
33
|
-
const getAccountIdentifier_1 = require("
|
|
30
|
+
const getAccountIdentifier_1 = require("./getAccountIdentifier");
|
|
34
31
|
// Use new config if it exists
|
|
35
32
|
function loadConfig(path, options = {}) {
|
|
36
33
|
// Attempt to load the root config
|
|
37
34
|
if ((0, configFile_1.configFileExists)()) {
|
|
38
|
-
return CLIConfiguration_1.
|
|
35
|
+
return CLIConfiguration_1.CLIConfiguration.init(options);
|
|
39
36
|
}
|
|
40
37
|
return config_DEPRECATED.loadConfig(path, options);
|
|
41
38
|
}
|
|
42
39
|
exports.loadConfig = loadConfig;
|
|
43
40
|
function getAndLoadConfigIfNeeded(options) {
|
|
44
|
-
if (CLIConfiguration_1.
|
|
45
|
-
return CLIConfiguration_1.
|
|
41
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
42
|
+
return CLIConfiguration_1.CLIConfiguration.config;
|
|
46
43
|
}
|
|
47
44
|
return config_DEPRECATED.getAndLoadConfigIfNeeded(options);
|
|
48
45
|
}
|
|
49
46
|
exports.getAndLoadConfigIfNeeded = getAndLoadConfigIfNeeded;
|
|
50
47
|
function validateConfig() {
|
|
51
|
-
if (CLIConfiguration_1.
|
|
52
|
-
return CLIConfiguration_1.
|
|
48
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
49
|
+
return CLIConfiguration_1.CLIConfiguration.validate();
|
|
53
50
|
}
|
|
54
51
|
return config_DEPRECATED.validateConfig();
|
|
55
52
|
}
|
|
56
53
|
exports.validateConfig = validateConfig;
|
|
57
54
|
function loadConfigFromEnvironment() {
|
|
58
|
-
if (CLIConfiguration_1.
|
|
59
|
-
return CLIConfiguration_1.
|
|
55
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
56
|
+
return CLIConfiguration_1.CLIConfiguration.useEnvConfig;
|
|
60
57
|
}
|
|
61
58
|
return Boolean(config_DEPRECATED.loadConfigFromEnvironment());
|
|
62
59
|
}
|
|
63
60
|
exports.loadConfigFromEnvironment = loadConfigFromEnvironment;
|
|
64
|
-
function createEmptyConfigFile(options = {},
|
|
65
|
-
if (
|
|
66
|
-
CLIConfiguration_1.
|
|
61
|
+
function createEmptyConfigFile(options = {}, useHiddenConfig = false) {
|
|
62
|
+
if (useHiddenConfig) {
|
|
63
|
+
CLIConfiguration_1.CLIConfiguration.write({ accounts: [] });
|
|
67
64
|
}
|
|
68
65
|
else {
|
|
69
66
|
return config_DEPRECATED.createEmptyConfigFile(options);
|
|
@@ -71,56 +68,62 @@ function createEmptyConfigFile(options = {}, useRootConfig = false) {
|
|
|
71
68
|
}
|
|
72
69
|
exports.createEmptyConfigFile = createEmptyConfigFile;
|
|
73
70
|
function deleteEmptyConfigFile() {
|
|
74
|
-
if (CLIConfiguration_1.
|
|
75
|
-
return CLIConfiguration_1.
|
|
71
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
72
|
+
return CLIConfiguration_1.CLIConfiguration.delete();
|
|
76
73
|
}
|
|
77
74
|
return config_DEPRECATED.deleteEmptyConfigFile();
|
|
78
75
|
}
|
|
79
76
|
exports.deleteEmptyConfigFile = deleteEmptyConfigFile;
|
|
80
77
|
function getConfig() {
|
|
81
|
-
if (CLIConfiguration_1.
|
|
82
|
-
return CLIConfiguration_1.
|
|
78
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
79
|
+
return CLIConfiguration_1.CLIConfiguration.config;
|
|
83
80
|
}
|
|
84
81
|
return config_DEPRECATED.getConfig();
|
|
85
82
|
}
|
|
86
83
|
exports.getConfig = getConfig;
|
|
87
84
|
function writeConfig(options = {}) {
|
|
88
|
-
if (CLIConfiguration_1.
|
|
85
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
89
86
|
const config = options.source
|
|
90
87
|
? JSON.parse(options.source)
|
|
91
88
|
: undefined;
|
|
92
|
-
CLIConfiguration_1.
|
|
89
|
+
CLIConfiguration_1.CLIConfiguration.write(config);
|
|
93
90
|
}
|
|
94
91
|
else {
|
|
95
92
|
config_DEPRECATED.writeConfig(options);
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
exports.writeConfig = writeConfig;
|
|
99
|
-
function getConfigPath(path) {
|
|
100
|
-
if (CLIConfiguration_1.
|
|
96
|
+
function getConfigPath(path, useHiddenConfig = false) {
|
|
97
|
+
if (useHiddenConfig || CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
101
98
|
return (0, configFile_1.getConfigFilePath)();
|
|
102
99
|
}
|
|
103
100
|
return config_DEPRECATED.getConfigPath(path);
|
|
104
101
|
}
|
|
105
102
|
exports.getConfigPath = getConfigPath;
|
|
103
|
+
function configFileExists(useHiddenConfig) {
|
|
104
|
+
return useHiddenConfig
|
|
105
|
+
? (0, configFile_1.configFileExists)()
|
|
106
|
+
: Boolean(config_DEPRECATED.getConfigPath());
|
|
107
|
+
}
|
|
108
|
+
exports.configFileExists = configFileExists;
|
|
106
109
|
function getAccountConfig(accountId) {
|
|
107
|
-
if (CLIConfiguration_1.
|
|
108
|
-
return CLIConfiguration_1.
|
|
110
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
111
|
+
return CLIConfiguration_1.CLIConfiguration.getConfigForAccount(accountId);
|
|
109
112
|
}
|
|
110
113
|
return config_DEPRECATED.getAccountConfig(accountId) || null;
|
|
111
114
|
}
|
|
112
115
|
exports.getAccountConfig = getAccountConfig;
|
|
113
116
|
function accountNameExistsInConfig(name) {
|
|
114
|
-
if (CLIConfiguration_1.
|
|
115
|
-
return CLIConfiguration_1.
|
|
117
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
118
|
+
return CLIConfiguration_1.CLIConfiguration.isAccountInConfig(name);
|
|
116
119
|
}
|
|
117
120
|
return config_DEPRECATED.accountNameExistsInConfig(name);
|
|
118
121
|
}
|
|
119
122
|
exports.accountNameExistsInConfig = accountNameExistsInConfig;
|
|
120
123
|
function updateAccountConfig(configOptions) {
|
|
121
124
|
const accountIdentifier = (0, getAccountIdentifier_1.getAccountIdentifier)(configOptions);
|
|
122
|
-
if (CLIConfiguration_1.
|
|
123
|
-
return CLIConfiguration_1.
|
|
125
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
126
|
+
return CLIConfiguration_1.CLIConfiguration.addOrUpdateAccount({
|
|
124
127
|
...configOptions,
|
|
125
128
|
accountId: accountIdentifier,
|
|
126
129
|
});
|
|
@@ -132,8 +135,8 @@ function updateAccountConfig(configOptions) {
|
|
|
132
135
|
}
|
|
133
136
|
exports.updateAccountConfig = updateAccountConfig;
|
|
134
137
|
function updateDefaultAccount(nameOrId) {
|
|
135
|
-
if (CLIConfiguration_1.
|
|
136
|
-
CLIConfiguration_1.
|
|
138
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
139
|
+
CLIConfiguration_1.CLIConfiguration.updateDefaultAccount(nameOrId);
|
|
137
140
|
}
|
|
138
141
|
else {
|
|
139
142
|
config_DEPRECATED.updateDefaultAccount(nameOrId);
|
|
@@ -141,40 +144,40 @@ function updateDefaultAccount(nameOrId) {
|
|
|
141
144
|
}
|
|
142
145
|
exports.updateDefaultAccount = updateDefaultAccount;
|
|
143
146
|
async function renameAccount(currentName, newName) {
|
|
144
|
-
if (CLIConfiguration_1.
|
|
145
|
-
CLIConfiguration_1.
|
|
147
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
148
|
+
return CLIConfiguration_1.CLIConfiguration.renameAccount(currentName, newName);
|
|
146
149
|
}
|
|
147
150
|
else {
|
|
148
|
-
config_DEPRECATED.renameAccount(currentName, newName);
|
|
151
|
+
return config_DEPRECATED.renameAccount(currentName, newName);
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
exports.renameAccount = renameAccount;
|
|
152
155
|
function getAccountId(nameOrId) {
|
|
153
|
-
if (CLIConfiguration_1.
|
|
154
|
-
return CLIConfiguration_1.
|
|
156
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
157
|
+
return CLIConfiguration_1.CLIConfiguration.getAccountId(nameOrId);
|
|
155
158
|
}
|
|
156
159
|
return config_DEPRECATED.getAccountId(nameOrId) || null;
|
|
157
160
|
}
|
|
158
161
|
exports.getAccountId = getAccountId;
|
|
159
162
|
function removeSandboxAccountFromConfig(nameOrId) {
|
|
160
|
-
if (CLIConfiguration_1.
|
|
161
|
-
return CLIConfiguration_1.
|
|
163
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
164
|
+
return CLIConfiguration_1.CLIConfiguration.removeAccountFromConfig(nameOrId);
|
|
162
165
|
}
|
|
163
166
|
return config_DEPRECATED.removeSandboxAccountFromConfig(nameOrId);
|
|
164
167
|
}
|
|
165
168
|
exports.removeSandboxAccountFromConfig = removeSandboxAccountFromConfig;
|
|
166
169
|
async function deleteAccount(accountName) {
|
|
167
|
-
if (CLIConfiguration_1.
|
|
168
|
-
CLIConfiguration_1.
|
|
170
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
171
|
+
return CLIConfiguration_1.CLIConfiguration.removeAccountFromConfig(accountName);
|
|
169
172
|
}
|
|
170
173
|
else {
|
|
171
|
-
config_DEPRECATED.deleteAccount(accountName);
|
|
174
|
+
return config_DEPRECATED.deleteAccount(accountName);
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
exports.deleteAccount = deleteAccount;
|
|
175
178
|
function updateHttpTimeout(timeout) {
|
|
176
|
-
if (CLIConfiguration_1.
|
|
177
|
-
CLIConfiguration_1.
|
|
179
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
180
|
+
CLIConfiguration_1.CLIConfiguration.updateHttpTimeout(timeout);
|
|
178
181
|
}
|
|
179
182
|
else {
|
|
180
183
|
config_DEPRECATED.updateHttpTimeout(timeout);
|
|
@@ -182,8 +185,8 @@ function updateHttpTimeout(timeout) {
|
|
|
182
185
|
}
|
|
183
186
|
exports.updateHttpTimeout = updateHttpTimeout;
|
|
184
187
|
function updateAllowUsageTracking(isEnabled) {
|
|
185
|
-
if (CLIConfiguration_1.
|
|
186
|
-
CLIConfiguration_1.
|
|
188
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
189
|
+
CLIConfiguration_1.CLIConfiguration.updateAllowUsageTracking(isEnabled);
|
|
187
190
|
}
|
|
188
191
|
else {
|
|
189
192
|
config_DEPRECATED.updateAllowUsageTracking(isEnabled);
|
|
@@ -191,7 +194,7 @@ function updateAllowUsageTracking(isEnabled) {
|
|
|
191
194
|
}
|
|
192
195
|
exports.updateAllowUsageTracking = updateAllowUsageTracking;
|
|
193
196
|
function deleteConfigFile() {
|
|
194
|
-
if (CLIConfiguration_1.
|
|
197
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
195
198
|
(0, configFile_1.deleteConfigFile)();
|
|
196
199
|
}
|
|
197
200
|
else {
|
|
@@ -200,33 +203,70 @@ function deleteConfigFile() {
|
|
|
200
203
|
}
|
|
201
204
|
exports.deleteConfigFile = deleteConfigFile;
|
|
202
205
|
function isConfigFlagEnabled(flag) {
|
|
203
|
-
if (CLIConfiguration_1.
|
|
204
|
-
return CLIConfiguration_1.
|
|
206
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
207
|
+
return CLIConfiguration_1.CLIConfiguration.isConfigFlagEnabled(flag);
|
|
205
208
|
}
|
|
206
209
|
return config_DEPRECATED.isConfigFlagEnabled(flag);
|
|
207
210
|
}
|
|
208
211
|
exports.isConfigFlagEnabled = isConfigFlagEnabled;
|
|
209
212
|
function isTrackingAllowed() {
|
|
210
|
-
if (CLIConfiguration_1.
|
|
211
|
-
return CLIConfiguration_1.
|
|
213
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
214
|
+
return CLIConfiguration_1.CLIConfiguration.isTrackingAllowed();
|
|
212
215
|
}
|
|
213
216
|
return config_DEPRECATED.isTrackingAllowed();
|
|
214
217
|
}
|
|
215
218
|
exports.isTrackingAllowed = isTrackingAllowed;
|
|
216
219
|
function getEnv(nameOrId) {
|
|
217
|
-
if (CLIConfiguration_1.
|
|
218
|
-
return CLIConfiguration_1.
|
|
220
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
221
|
+
return CLIConfiguration_1.CLIConfiguration.getEnv(nameOrId);
|
|
219
222
|
}
|
|
220
223
|
return config_DEPRECATED.getEnv(nameOrId);
|
|
221
224
|
}
|
|
222
225
|
exports.getEnv = getEnv;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
function getAccountType(accountType, sandboxAccountType) {
|
|
227
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
228
|
+
return CLIConfiguration_1.CLIConfiguration.getAccountType(accountType, sandboxAccountType);
|
|
229
|
+
}
|
|
230
|
+
return config_DEPRECATED.getAccountType(accountType, sandboxAccountType);
|
|
231
|
+
}
|
|
232
|
+
exports.getAccountType = getAccountType;
|
|
233
|
+
function getConfigDefaultAccount() {
|
|
234
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
235
|
+
return CLIConfiguration_1.CLIConfiguration.getDefaultAccount();
|
|
236
|
+
}
|
|
237
|
+
return config_DEPRECATED.getConfigDefaultAccount();
|
|
238
|
+
}
|
|
239
|
+
exports.getConfigDefaultAccount = getConfigDefaultAccount;
|
|
240
|
+
function getConfigAccounts() {
|
|
241
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
242
|
+
return CLIConfiguration_1.CLIConfiguration.getConfigAccounts();
|
|
243
|
+
}
|
|
244
|
+
return config_DEPRECATED.getConfigAccounts();
|
|
245
|
+
}
|
|
246
|
+
exports.getConfigAccounts = getConfigAccounts;
|
|
247
|
+
function updateDefaultCmsPublishMode(cmsPublishMode) {
|
|
248
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
249
|
+
return CLIConfiguration_1.CLIConfiguration.updateDefaultCmsPublishMode(cmsPublishMode);
|
|
250
|
+
}
|
|
251
|
+
return config_DEPRECATED.updateDefaultCmsPublishMode(cmsPublishMode);
|
|
252
|
+
}
|
|
253
|
+
exports.updateDefaultCmsPublishMode = updateDefaultCmsPublishMode;
|
|
254
|
+
function getCWDAccountOverride() {
|
|
255
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
256
|
+
return CLIConfiguration_1.CLIConfiguration.getCWDAccountOverride();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
exports.getCWDAccountOverride = getCWDAccountOverride;
|
|
260
|
+
function getDefaultAccountOverrideFilePath() {
|
|
261
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
262
|
+
return CLIConfiguration_1.CLIConfiguration.getDefaultAccountOverrideFilePath();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
exports.getDefaultAccountOverrideFilePath = getDefaultAccountOverrideFilePath;
|
|
266
|
+
// These functions are not supported with the new config setup
|
|
226
267
|
exports.getConfigAccountId = config_DEPRECATED.getConfigAccountId;
|
|
227
268
|
exports.getOrderedAccount = config_DEPRECATED.getOrderedAccount;
|
|
228
269
|
exports.getOrderedConfig = config_DEPRECATED.getOrderedConfig;
|
|
229
270
|
exports.setConfig = config_DEPRECATED.setConfig;
|
|
230
271
|
exports.setConfigPath = config_DEPRECATED.setConfigPath;
|
|
231
272
|
exports.findConfig = config_DEPRECATED.findConfig;
|
|
232
|
-
exports.updateDefaultMode = config_DEPRECATED.updateDefaultMode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CLIConfig_DEPRECATED, CLIConfig_NEW, Environment } from '../types/Config';
|
|
2
|
+
import { CmsPublishMode } from '../types/Files';
|
|
3
|
+
export declare function getDeprecatedConfig(configPath?: string): CLIConfig_DEPRECATED | null;
|
|
4
|
+
export declare function getGlobalConfig(): CLIConfig_NEW | null;
|
|
5
|
+
export declare function configFileExists(useHiddenConfig?: boolean, configPath?: string): boolean;
|
|
6
|
+
export declare function getConfigPath(configPath?: string, useHiddenConfig?: boolean): string | null;
|
|
7
|
+
export declare function migrateConfig(deprecatedConfig: CLIConfig_DEPRECATED | null): void;
|
|
8
|
+
type ConflictValue = boolean | string | number | CmsPublishMode | Environment;
|
|
9
|
+
export type ConflictProperty = {
|
|
10
|
+
property: keyof CLIConfig_NEW;
|
|
11
|
+
oldValue: ConflictValue;
|
|
12
|
+
newValue: ConflictValue;
|
|
13
|
+
};
|
|
14
|
+
export declare function mergeConfigProperties(globalConfig: CLIConfig_NEW, deprecatedConfig: CLIConfig_DEPRECATED, force?: boolean): {
|
|
15
|
+
initialConfig: CLIConfig_NEW;
|
|
16
|
+
conflicts: Array<ConflictProperty>;
|
|
17
|
+
};
|
|
18
|
+
export declare function mergeExistingConfigs(globalConfig: CLIConfig_NEW, deprecatedConfig: CLIConfig_DEPRECATED): {
|
|
19
|
+
finalConfig: CLIConfig_NEW;
|
|
20
|
+
skippedAccountIds: Array<string | number>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.mergeExistingConfigs = exports.mergeConfigProperties = exports.migrateConfig = exports.getConfigPath = exports.configFileExists = exports.getGlobalConfig = exports.getDeprecatedConfig = void 0;
|
|
30
|
+
const fs_1 = __importDefault(require("fs"));
|
|
31
|
+
const config_DEPRECATED = __importStar(require("./config_DEPRECATED"));
|
|
32
|
+
const CLIConfiguration_1 = require("./CLIConfiguration");
|
|
33
|
+
const index_1 = require("./index");
|
|
34
|
+
const configFile_1 = require("./configFile");
|
|
35
|
+
const config_1 = require("../constants/config");
|
|
36
|
+
const lang_1 = require("../utils/lang");
|
|
37
|
+
const i18nKey = 'config.migrate';
|
|
38
|
+
function getDeprecatedConfig(configPath) {
|
|
39
|
+
return config_DEPRECATED.loadConfig(configPath);
|
|
40
|
+
}
|
|
41
|
+
exports.getDeprecatedConfig = getDeprecatedConfig;
|
|
42
|
+
function getGlobalConfig() {
|
|
43
|
+
if (CLIConfiguration_1.CLIConfiguration.isActive()) {
|
|
44
|
+
return CLIConfiguration_1.CLIConfiguration.config;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
exports.getGlobalConfig = getGlobalConfig;
|
|
49
|
+
function configFileExists(useHiddenConfig = false, configPath) {
|
|
50
|
+
return useHiddenConfig
|
|
51
|
+
? (0, configFile_1.configFileExists)()
|
|
52
|
+
: Boolean(configPath && fs_1.default.existsSync(configPath)) ||
|
|
53
|
+
Boolean(config_DEPRECATED.loadConfig(configPath));
|
|
54
|
+
}
|
|
55
|
+
exports.configFileExists = configFileExists;
|
|
56
|
+
function getConfigPath(configPath, useHiddenConfig = false) {
|
|
57
|
+
if (useHiddenConfig) {
|
|
58
|
+
return (0, configFile_1.getConfigFilePath)();
|
|
59
|
+
}
|
|
60
|
+
return config_DEPRECATED.getConfigPath(configPath);
|
|
61
|
+
}
|
|
62
|
+
exports.getConfigPath = getConfigPath;
|
|
63
|
+
function writeGlobalConfigFile(updatedConfig, isMigrating = false) {
|
|
64
|
+
const updatedConfigJson = JSON.stringify(updatedConfig);
|
|
65
|
+
if (isMigrating) {
|
|
66
|
+
(0, index_1.createEmptyConfigFile)({}, true);
|
|
67
|
+
}
|
|
68
|
+
(0, index_1.loadConfig)('');
|
|
69
|
+
try {
|
|
70
|
+
(0, index_1.writeConfig)({ source: updatedConfigJson });
|
|
71
|
+
config_DEPRECATED.deleteConfigFile();
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
(0, index_1.deleteEmptyConfigFile)();
|
|
75
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.writeConfig`, { configPath: config_1.GLOBAL_CONFIG_PATH }), { cause: error });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function migrateConfig(deprecatedConfig) {
|
|
79
|
+
if (!deprecatedConfig) {
|
|
80
|
+
throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.noDeprecatedConfig`));
|
|
81
|
+
}
|
|
82
|
+
const { defaultPortal, portals, ...rest } = deprecatedConfig;
|
|
83
|
+
const updatedConfig = {
|
|
84
|
+
...rest,
|
|
85
|
+
defaultAccount: defaultPortal,
|
|
86
|
+
accounts: portals
|
|
87
|
+
.filter(({ portalId }) => portalId !== undefined)
|
|
88
|
+
.map(({ portalId, ...rest }) => ({
|
|
89
|
+
...rest,
|
|
90
|
+
accountId: portalId,
|
|
91
|
+
})),
|
|
92
|
+
};
|
|
93
|
+
writeGlobalConfigFile(updatedConfig, true);
|
|
94
|
+
}
|
|
95
|
+
exports.migrateConfig = migrateConfig;
|
|
96
|
+
function mergeConfigProperties(globalConfig, deprecatedConfig, force) {
|
|
97
|
+
const propertiesToCheck = [
|
|
98
|
+
config_1.DEFAULT_CMS_PUBLISH_MODE,
|
|
99
|
+
config_1.HTTP_TIMEOUT,
|
|
100
|
+
config_1.ENV,
|
|
101
|
+
config_1.HTTP_USE_LOCALHOST,
|
|
102
|
+
config_1.ALLOW_USAGE_TRACKING,
|
|
103
|
+
];
|
|
104
|
+
const conflicts = [];
|
|
105
|
+
propertiesToCheck.forEach(prop => {
|
|
106
|
+
if (prop in globalConfig && prop in deprecatedConfig) {
|
|
107
|
+
if (force || globalConfig[prop] === deprecatedConfig[prop]) {
|
|
108
|
+
// @ts-expect-error Cannot reconcile CLIConfig_NEW and CLIConfig_DEPRECATED types
|
|
109
|
+
globalConfig[prop] = deprecatedConfig[prop];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
conflicts.push({
|
|
113
|
+
property: prop,
|
|
114
|
+
oldValue: deprecatedConfig[prop],
|
|
115
|
+
newValue: globalConfig[prop],
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
if (config_1.DEFAULT_ACCOUNT in globalConfig &&
|
|
121
|
+
config_1.DEFAULT_PORTAL in deprecatedConfig &&
|
|
122
|
+
globalConfig.defaultAccount !== deprecatedConfig.defaultPortal) {
|
|
123
|
+
conflicts.push({
|
|
124
|
+
property: config_1.DEFAULT_ACCOUNT,
|
|
125
|
+
oldValue: deprecatedConfig.defaultPortal,
|
|
126
|
+
newValue: globalConfig.defaultAccount,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else if (config_1.DEFAULT_PORTAL in deprecatedConfig) {
|
|
130
|
+
globalConfig.defaultAccount = deprecatedConfig.defaultPortal;
|
|
131
|
+
}
|
|
132
|
+
return { initialConfig: globalConfig, conflicts };
|
|
133
|
+
}
|
|
134
|
+
exports.mergeConfigProperties = mergeConfigProperties;
|
|
135
|
+
function mergeAccounts(globalConfig, deprecatedConfig) {
|
|
136
|
+
let existingAccountIds = [];
|
|
137
|
+
const skippedAccountIds = [];
|
|
138
|
+
if (globalConfig.accounts && deprecatedConfig.portals) {
|
|
139
|
+
existingAccountIds = globalConfig.accounts.map(account => account.accountId);
|
|
140
|
+
const newAccounts = deprecatedConfig.portals
|
|
141
|
+
.filter(portal => {
|
|
142
|
+
const isExisting = existingAccountIds.includes(portal.portalId);
|
|
143
|
+
if (isExisting) {
|
|
144
|
+
skippedAccountIds.push(portal.portalId);
|
|
145
|
+
}
|
|
146
|
+
return !isExisting;
|
|
147
|
+
})
|
|
148
|
+
.map(({ portalId, ...rest }) => ({
|
|
149
|
+
...rest,
|
|
150
|
+
accountId: portalId,
|
|
151
|
+
}));
|
|
152
|
+
if (newAccounts.length > 0) {
|
|
153
|
+
globalConfig.accounts.push(...newAccounts);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
finalConfig: globalConfig,
|
|
158
|
+
skippedAccountIds,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function mergeExistingConfigs(globalConfig, deprecatedConfig) {
|
|
162
|
+
const { finalConfig, skippedAccountIds } = mergeAccounts(globalConfig, deprecatedConfig);
|
|
163
|
+
writeGlobalConfigFile(finalConfig);
|
|
164
|
+
return { finalConfig, skippedAccountIds };
|
|
165
|
+
}
|
|
166
|
+
exports.mergeExistingConfigs = mergeExistingConfigs;
|
package/constants/config.d.ts
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
export declare const DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = "hubspot.config.yml";
|
|
2
|
-
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".
|
|
2
|
+
export declare const HUBSPOT_CONFIGURATION_FOLDER = ".hscli";
|
|
3
3
|
export declare const HUBSPOT_CONFIGURATION_FILE = "config.yml";
|
|
4
|
+
export declare const GLOBAL_CONFIG_PATH: string;
|
|
5
|
+
export declare const DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = ".hsaccount";
|
|
6
|
+
export declare const DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = "DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID";
|
|
7
|
+
export declare const DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = "DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND";
|
|
8
|
+
export declare const DEFAULT_CMS_PUBLISH_MODE = "defaultCmsPublishMode";
|
|
9
|
+
export declare const HTTP_TIMEOUT = "httpTimeout";
|
|
10
|
+
export declare const ENV = "env";
|
|
11
|
+
export declare const HTTP_USE_LOCALHOST = "httpUseLocalhost";
|
|
12
|
+
export declare const ALLOW_USAGE_TRACKING = "allowUsageTracking";
|
|
13
|
+
export declare const DEFAULT_ACCOUNT = "defaultAccount";
|
|
14
|
+
export declare const DEFAULT_PORTAL = "defaultPortal";
|
|
4
15
|
export declare const MIN_HTTP_TIMEOUT = 3000;
|
|
16
|
+
export declare const HUBSPOT_ACCOUNT_TYPES: {
|
|
17
|
+
readonly DEVELOPMENT_SANDBOX: "DEVELOPMENT_SANDBOX";
|
|
18
|
+
readonly DEVELOPER_TEST: "DEVELOPER_TEST";
|
|
19
|
+
readonly APP_DEVELOPER: "APP_DEVELOPER";
|
|
20
|
+
readonly STANDARD_SANDBOX: "STANDARD_SANDBOX";
|
|
21
|
+
readonly STANDARD: "STANDARD";
|
|
22
|
+
};
|
|
23
|
+
export declare const HUBSPOT_ACCOUNT_TYPE_STRINGS: {
|
|
24
|
+
readonly DEVELOPMENT_SANDBOX: string;
|
|
25
|
+
readonly STANDARD_SANDBOX: string;
|
|
26
|
+
readonly DEVELOPER_TEST: string;
|
|
27
|
+
readonly APP_DEVELOPER: string;
|
|
28
|
+
readonly STANDARD: string;
|
|
29
|
+
};
|
package/constants/config.js
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MIN_HTTP_TIMEOUT = exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = void 0;
|
|
4
|
-
|
|
6
|
+
exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = exports.HUBSPOT_ACCOUNT_TYPES = exports.MIN_HTTP_TIMEOUT = exports.DEFAULT_PORTAL = exports.DEFAULT_ACCOUNT = exports.ALLOW_USAGE_TRACKING = exports.HTTP_USE_LOCALHOST = exports.ENV = exports.HTTP_TIMEOUT = exports.DEFAULT_CMS_PUBLISH_MODE = exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = exports.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = exports.GLOBAL_CONFIG_PATH = exports.HUBSPOT_CONFIGURATION_FILE = exports.HUBSPOT_CONFIGURATION_FOLDER = exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = void 0;
|
|
7
|
+
const lang_1 = require("../utils/lang");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
5
10
|
exports.DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME = 'hubspot.config.yml';
|
|
6
|
-
exports.HUBSPOT_CONFIGURATION_FOLDER = '.
|
|
11
|
+
exports.HUBSPOT_CONFIGURATION_FOLDER = '.hscli';
|
|
7
12
|
exports.HUBSPOT_CONFIGURATION_FILE = 'config.yml';
|
|
13
|
+
exports.GLOBAL_CONFIG_PATH = path_1.default.join(os_1.default.homedir(), exports.HUBSPOT_CONFIGURATION_FOLDER, exports.HUBSPOT_CONFIGURATION_FILE);
|
|
14
|
+
exports.DEFAULT_ACCOUNT_OVERRIDE_FILE_NAME = '.hsaccount';
|
|
15
|
+
exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID = 'DEFAULT_ACCOUNT_OVERRIDE_ERROR_INVALID_ID';
|
|
16
|
+
exports.DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND = 'DEFAULT_ACCOUNT_OVERRIDE_ERROR_ACCOUNT_NOT_FOUND';
|
|
17
|
+
exports.DEFAULT_CMS_PUBLISH_MODE = 'defaultCmsPublishMode';
|
|
18
|
+
exports.HTTP_TIMEOUT = 'httpTimeout';
|
|
19
|
+
exports.ENV = 'env';
|
|
20
|
+
exports.HTTP_USE_LOCALHOST = 'httpUseLocalhost';
|
|
21
|
+
exports.ALLOW_USAGE_TRACKING = 'allowUsageTracking';
|
|
22
|
+
exports.DEFAULT_ACCOUNT = 'defaultAccount';
|
|
23
|
+
exports.DEFAULT_PORTAL = 'defaultPortal';
|
|
8
24
|
exports.MIN_HTTP_TIMEOUT = 3000;
|
|
25
|
+
exports.HUBSPOT_ACCOUNT_TYPES = {
|
|
26
|
+
DEVELOPMENT_SANDBOX: 'DEVELOPMENT_SANDBOX',
|
|
27
|
+
DEVELOPER_TEST: 'DEVELOPER_TEST',
|
|
28
|
+
APP_DEVELOPER: 'APP_DEVELOPER',
|
|
29
|
+
STANDARD_SANDBOX: 'STANDARD_SANDBOX',
|
|
30
|
+
STANDARD: 'STANDARD',
|
|
31
|
+
};
|
|
32
|
+
exports.HUBSPOT_ACCOUNT_TYPE_STRINGS = {
|
|
33
|
+
DEVELOPMENT_SANDBOX: (0, lang_1.i18n)('lib.accountTypes.developmentSandbox'),
|
|
34
|
+
STANDARD_SANDBOX: (0, lang_1.i18n)('lib.accountTypes.standardSandbox'),
|
|
35
|
+
DEVELOPER_TEST: (0, lang_1.i18n)('lib.accountTypes.developerTest'),
|
|
36
|
+
APP_DEVELOPER: (0, lang_1.i18n)('lib.accountTypes.appDeveloper'),
|
|
37
|
+
STANDARD: (0, lang_1.i18n)('lib.accountTypes.standard'),
|
|
38
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const ALLOWED_EXTENSIONS: Set<string>;
|
|
2
|
+
export declare const JSR_ALLOWED_EXTENSIONS: Set<string>;
|
|
2
3
|
export declare const HUBL_EXTENSIONS: Set<string>;
|
|
3
4
|
export declare const MODULE_EXTENSION = "module";
|
|
4
5
|
export declare const FUNCTIONS_EXTENSION = "functions";
|
|
6
|
+
export declare const FOLDER_DOT_EXTENSIONS: string[];
|
package/constants/extensions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FUNCTIONS_EXTENSION = exports.MODULE_EXTENSION = exports.HUBL_EXTENSIONS = exports.ALLOWED_EXTENSIONS = void 0;
|
|
3
|
+
exports.FOLDER_DOT_EXTENSIONS = exports.FUNCTIONS_EXTENSION = exports.MODULE_EXTENSION = exports.HUBL_EXTENSIONS = exports.JSR_ALLOWED_EXTENSIONS = exports.ALLOWED_EXTENSIONS = void 0;
|
|
4
4
|
exports.ALLOWED_EXTENSIONS = new Set([
|
|
5
5
|
'css',
|
|
6
6
|
'js',
|
|
@@ -21,6 +21,8 @@ exports.ALLOWED_EXTENSIONS = new Set([
|
|
|
21
21
|
'woff2',
|
|
22
22
|
'graphql',
|
|
23
23
|
]);
|
|
24
|
+
exports.JSR_ALLOWED_EXTENSIONS = new Set(['jsx', 'tsx', 'ts']);
|
|
24
25
|
exports.HUBL_EXTENSIONS = new Set(['css', 'html', 'js']);
|
|
25
26
|
exports.MODULE_EXTENSION = 'module';
|
|
26
27
|
exports.FUNCTIONS_EXTENSION = 'functions';
|
|
28
|
+
exports.FOLDER_DOT_EXTENSIONS = [exports.FUNCTIONS_EXTENSION, exports.MODULE_EXTENSION];
|
package/constants/files.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export declare const STAT_TYPES: {
|
|
|
3
3
|
readonly SYMBOLIC_LINK: "symlink";
|
|
4
4
|
readonly DIRECTORY: "dir";
|
|
5
5
|
};
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const CMS_PUBLISH_MODE: {
|
|
7
7
|
readonly draft: "draft";
|
|
8
8
|
readonly publish: "publish";
|
|
9
9
|
};
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const DEFAULT_CMS_PUBLISH_MODE: "publish";
|
|
11
11
|
export declare const FILE_UPLOAD_RESULT_TYPES: {
|
|
12
12
|
readonly SUCCESS: "SUCCESS";
|
|
13
13
|
readonly FAILURE: "FAILURE";
|
package/constants/files.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FILE_TYPES = exports.FILE_UPLOAD_RESULT_TYPES = exports.
|
|
3
|
+
exports.FILE_TYPES = exports.FILE_UPLOAD_RESULT_TYPES = exports.DEFAULT_CMS_PUBLISH_MODE = exports.CMS_PUBLISH_MODE = exports.STAT_TYPES = void 0;
|
|
4
4
|
exports.STAT_TYPES = {
|
|
5
5
|
FILE: 'file',
|
|
6
6
|
SYMBOLIC_LINK: 'symlink',
|
|
7
7
|
DIRECTORY: 'dir',
|
|
8
8
|
};
|
|
9
|
-
exports.
|
|
9
|
+
exports.CMS_PUBLISH_MODE = {
|
|
10
10
|
draft: 'draft',
|
|
11
11
|
publish: 'publish',
|
|
12
12
|
};
|
|
13
|
-
exports.
|
|
13
|
+
exports.DEFAULT_CMS_PUBLISH_MODE = exports.CMS_PUBLISH_MODE.publish;
|
|
14
14
|
exports.FILE_UPLOAD_RESULT_TYPES = {
|
|
15
15
|
SUCCESS: 'SUCCESS',
|
|
16
16
|
FAILURE: 'FAILURE',
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { BaseError, FileSystemErrorContext } from '../types/Error';
|
|
2
|
-
type ErrorContext = {
|
|
3
|
-
accountId?: number;
|
|
4
|
-
};
|
|
1
|
+
import { BaseError, FileSystemErrorContext, ErrorContext } from '../types/Error';
|
|
5
2
|
export declare function logErrorInstance(error: BaseError, context?: ErrorContext): void;
|
|
6
3
|
export declare function logFileSystemErrorInstance(error: BaseError, context: FileSystemErrorContext): void;
|
|
7
|
-
export {};
|