@hubspot/local-dev-lib 2.1.0 → 2.1.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright 2019 HubSpot, Inc.
2
+ Licensed under the Apache License, Version 2.0 (the "License");
3
+ you may not use this file except in compliance with the License.
4
+ You may obtain a copy of the License at
5
+
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ Unless required by applicable law or agreed to in writing, software
9
+ distributed under the License is distributed on an "AS IS" BASIS,
10
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ See the License for the specific language governing permissions and
12
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # hubspot/local-dev-lib
2
+
3
+ Provides library functionality for HubSpot local development tooling, including the [HubSpot CLI](https://github.com/HubSpot/hubspot-cli).
4
+
5
+ **NOTE:** This library is intended to replace the deprecated [@hubspot/cli-lib](https://github.com/HubSpot/cli-lib) library.
6
+
7
+ ## Overview
8
+
9
+ This library contains utils that facilitate interactions with HubSpot. It is consumed by the [HubSpot CLI](https://github.com/HubSpot/hubspot-cli) as well as other HubSpot development tooling. Major exports include:
10
+
11
+ - Config utils for managing HubSpot account configuration and access keys ([docs](./config/README.md))
12
+ - API utils to interact with HubSpot assets such as Design Manager and Developer Projects ([docs](./api/README.md))
13
+ - Utils to navigate the local filesystem, parse common HubSpot files, interact with common HubSpot objects, and connect with GitHub ([docs](./lib/README.md))
14
+
15
+ ## Contributing
16
+
17
+ For more information on developing, see the [Contributing Guide](CONTRIBUTING.md).
package/config/index.d.ts CHANGED
@@ -30,8 +30,8 @@ export declare function isConfigFlagEnabled(flag: keyof CLIConfig): boolean;
30
30
  export declare function isTrackingAllowed(): boolean;
31
31
  export declare function getEnv(nameOrId?: string | number): import("../types/Config").Environment;
32
32
  export declare function getAccountType(accountType?: AccountType, sandboxAccountType?: string | null): AccountType;
33
- export declare function getDefaultAccount(): string | number | null | undefined;
34
- export declare function getAccounts(): Array<CLIAccount_NEW> | Array<CLIAccount_DEPRECATED> | null | undefined;
33
+ export declare function getConfigDefaultAccount(): string | number | null | undefined;
34
+ export declare function getConfigAccounts(): Array<CLIAccount_NEW> | Array<CLIAccount_DEPRECATED> | null | undefined;
35
35
  export declare function updateDefaultMode(mode: Mode): void | CLIConfig_NEW | null;
36
36
  export declare const getConfigAccountId: typeof config_DEPRECATED.getConfigAccountId;
37
37
  export declare const getOrderedAccount: typeof config_DEPRECATED.getOrderedAccount;
package/config/index.js CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.findConfig = exports.setConfigPath = exports.setConfig = exports.getOrderedConfig = exports.getOrderedAccount = exports.getConfigAccountId = exports.updateDefaultMode = exports.getAccounts = exports.getDefaultAccount = 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;
26
+ exports.findConfig = exports.setConfigPath = exports.setConfig = exports.getOrderedConfig = exports.getOrderedAccount = exports.getConfigAccountId = exports.updateDefaultMode = 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;
27
27
  const config_DEPRECATED = __importStar(require("./config_DEPRECATED"));
28
28
  const CLIConfiguration_1 = require("./CLIConfiguration");
29
29
  const configFile_1 = require("./configFile");
@@ -230,20 +230,20 @@ function getAccountType(accountType, sandboxAccountType) {
230
230
  return config_DEPRECATED.getAccountType(accountType, sandboxAccountType);
231
231
  }
232
232
  exports.getAccountType = getAccountType;
233
- function getDefaultAccount() {
233
+ function getConfigDefaultAccount() {
234
234
  if (CLIConfiguration_1.CLIConfiguration.isActive()) {
235
235
  return CLIConfiguration_1.CLIConfiguration.getDefaultAccount();
236
236
  }
237
237
  return config_DEPRECATED.getConfigDefaultAccount();
238
238
  }
239
- exports.getDefaultAccount = getDefaultAccount;
240
- function getAccounts() {
239
+ exports.getConfigDefaultAccount = getConfigDefaultAccount;
240
+ function getConfigAccounts() {
241
241
  if (CLIConfiguration_1.CLIConfiguration.isActive()) {
242
242
  return CLIConfiguration_1.CLIConfiguration.getConfigAccounts();
243
243
  }
244
244
  return config_DEPRECATED.getConfigAccounts();
245
245
  }
246
- exports.getAccounts = getAccounts;
246
+ exports.getConfigAccounts = getConfigAccounts;
247
247
  function updateDefaultMode(mode) {
248
248
  if (CLIConfiguration_1.CLIConfiguration.isActive()) {
249
249
  return CLIConfiguration_1.CLIConfiguration.updateDefaultMode(mode);
package/lang/en.json CHANGED
@@ -1,389 +1,389 @@
1
1
  {
2
- "lib": {
3
- "trackUsage": {
4
- "invalidEvent": "Usage tracking event {{ eventName }} is not a valid event type.",
5
- "sendingEventAuthenticated": "Sending usage event to authenticated endpoint",
6
- "retryingEventUnauthenticated": "Failed to send the usage event as authenticated. Trying again as unauthenticated.",
7
- "sendingEventUnauthenticated": "Sending usage event to unauthenticated endpoint"
8
- },
9
- "archive": {
10
- "extractZip": {
11
- "init": "Extracting project source...",
12
- "success": "Completed project source extraction.",
13
- "errors": {
14
- "write": "An error occurred writing temp project source.",
15
- "extract": "An error occurred extracting project source."
16
- }
17
- },
18
- "copySourceToDest": {
19
- "init": "Copying project source...",
20
- "sourceEmpty": "Project source is empty",
21
- "success": "Completed copying project source.",
22
- "error": "An error occurred copying project source to {{ dest }}."
23
- },
24
- "cleanupTempDir": {
25
- "error": "Failed to clean up temp dir: {{ tmpDir }}"
26
- }
27
- },
28
- "gitignore": {
29
- "errors": {
30
- "configIgnore": "Unable to determine if config file is properly ignored by git."
31
- }
32
- },
33
- "github": {
34
- "fetchFileFromRepository": {
35
- "fetching": "Fetching {{ path }}...",
36
- "errors": {
37
- "fetchFail": "An error occurred fetching JSON file."
38
- }
39
- },
40
- "fetchReleaseData": {
41
- "errors": {
42
- "fetchFail": "Failed fetching release data for {{ tag }} project."
43
- }
44
- },
45
- "downloadGithubRepoZip": {
46
- "fetching": "Fetching repository with name {{ repoPath }}...",
47
- "fetchingName": "Fetching {{ name }}...",
48
- "completed": "Completed project fetch.",
49
- "errors": {
50
- "fetchFail": "An error occurred fetching the project source."
51
- }
52
- },
53
- "cloneGithubRepo": {
54
- "success": "Your new {{ type }} has been created in {{ dest }}"
55
- },
56
- "downloadGithubRepoContents": {
57
- "downloading": "Downloading content piece: {{ contentPiecePath }} from {{ downloadUrl }} to {{ downloadPath }}",
58
- "errors": {
59
- "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
60
- }
61
- },
62
- "listGitHubRepoContents": {
63
- "errors": {
64
- "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
65
- }
66
- }
67
- },
68
- "hubdb": {
69
- "errors": {
70
- "invalidJsonPath": "The HubDB table file must be a '.json' file",
71
- "invalidJsonFile": "The '{{{ src }}' path is not a path to a file"
72
- }
73
- },
74
- "personalAccessKey": {
75
- "errors": {
76
- "accountNotFound": "Account with id {{ accountId }} does not exist.",
77
- "invalidPersonalAccessKey": "Error while retrieving new access token: {{ errorMessage }}"
78
- }
79
- },
80
- "cms": {
81
- "modules": {
82
- "createModule": {
83
- "creatingModule": "Creating module at {{ path }}",
84
- "creatingPath": "Creating {{ path }}",
85
- "errors": {
86
- "pathExists": "The {{ path }} path already exists",
87
- "fileUpdateFailure": "There was a problem updating the modules files at {{ path }}: {{ errorMessage }}"
88
- }
89
- },
90
- "retrieveDefaultModule": {
91
- "errors": {
92
- "pathExists": "Folder already exists at \"{{ path }}\""
93
- }
94
- }
95
- },
96
- "functions": {
97
- "updateExistingConfig": {
98
- "unableToReadFile": "The file {{ configFilePath }} could not be read",
99
- "invalidJSON": "The file {{ configFilePath }} is not valid JSON",
100
- "couldNotUpdateFile": "The file {{ configFilePath }} could not be updated",
101
- "errors": {
102
- "configIsNotObjectError": "The existing {{ configFilePath }} is not an object",
103
- "endpointAreadyExistsError": "The endpoint {{ endpointPath }} already exists in {{ configFilePath }}"
104
- }
105
- },
106
- "createFunction": {
107
- "destPathAlreadyExists": "The {{ path }} path already exists",
108
- "createdDest": "Created {{ path }}",
109
- "failedToCreateFile": "The file {{ configFilePath }} could not be created",
110
- "createdFunctionFile": "Created {{ path }}",
111
- "createdConfigFile": "Created {{ path }}",
112
- "success": "A function for the endpoint '/_hcms/api/{{ endpointPath }}' has been created. Upload {{ folderName }} to try it out",
113
- "errors": {
114
- "nestedConfigError": "Cannot create a functions directory inside '{{ ancestorConfigPath }}'",
115
- "jsFileConflictError": "The JavaScript file at '{{ functionFilePath }}'' already exists"
116
- }
117
- }
118
- },
119
- "handleFieldsJs": {
120
- "convertFieldsJs": {
121
- "creating": "Creating child process with pid {{ pid }}",
122
- "terminating": "Child process with pid {{ pid }} has been terminated",
123
- "errors": {
124
- "errorConverting": "There was an error converting '{{ filePath }}'"
125
- }
126
- },
127
- "saveOutput": {
128
- "errors": {
129
- "saveFailed": "There was an error saving the json output of {{ path }}"
130
- }
131
- },
132
- "createTmpDirSync": {
133
- "errors": {
134
- "writeFailed": "An error occurred writing temporary project source."
135
- }
136
- },
137
- "cleanupTmpDirSync": {
138
- "errors": {
139
- "deleteFailed": "There was an error deleting the temporary project source"
140
- }
141
- }
142
- },
143
- "uploadFolder": {
144
- "uploadFolder": {
145
- "success": "Uploaded file \"{{ file}}\" to \"{{ destPath }}\"",
146
- "attempt": "Attempting to upload file \"{{ file }}\" to \"{{ destPath }}\"",
147
- "failed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed so scheduled retry",
148
- "retry": "Retrying to upload file \"{{ file }}\" to \"{{ destPath }}\"",
149
- "retryFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed"
150
- }
151
- },
152
- "templates": {
153
- "createTemplate": {
154
- "creatingFile": "Creating file at {{ path }}",
155
- "creatingPath": "Making {{ path }} if needed",
156
- "errors": {
157
- "pathExists": "The {{ path }} path already exists"
158
- }
159
- }
160
- },
161
- "processFieldsJs": {
162
- "converting": "Converting \"{{ src }}\" to \"{{ dest }}\".",
163
- "converted": "Finished converting \"{{ src }}\" to \"{{ dest }}\".",
164
- "errors": {
165
- "invalidMjsFile": ".mjs files are only supported when using Node 13.2.0+",
166
- "notFunction": "There was an error loading JS file \"{{ path }}\". Expected type \"Function\" but received type \"{{ returned }}\". Make sure that your default export is a function.",
167
- "notArray": "There was an error loading JS file \"{{ path }}\". Expected type \"Array\" but received type \"{{ returned }}\" . Make sure that your function returns an array"
168
- }
169
- },
170
- "watch": {
171
- "notifyOfThemePreview": "To preview this theme, visit: {{ previewUrl }}",
172
- "skipUnsupportedExtension": "Skipping {{ file }} due to unsupported extension",
173
- "skipIgnoreRule": "Skipping {{ file }} due to an ignore rule",
174
- "uploadAttempt": "Attempting to upload file \"{{ file }}\" to \"{{ dest }}\"",
175
- "uploadSuccess": "Uploaded file {{ file }} to {{ dest }}",
176
- "uploadFailed": "Uploading file {{ file }} to {{ dest }} failed",
177
- "uploadRetry": "Retrying to upload file \"{{ file }}\" to \"{{ dest }}\"",
178
- "deleteAttempt": "Attempting to delete file {{ remoteFilePath }}",
179
- "deleteAttemptWithType": "Attempting to delete {{ type }} {{ remoteFilePath }}",
180
- "deleteSuccess": "Deleted file {{ remoteFilePath }}",
181
- "deleteSuccessWithType": "Deleted {{ type }} {{ remoteFilePath }}",
182
- "deleteFailed": "Deleting file {{ remoteFilePath }} failed",
183
- "folderUploadSuccess": "Completed uploading files in {{ src }} to {{ dest }} in {{ accountId }}",
184
- "ready": "Watcher is ready and watching {{ src }}. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system."
185
- }
186
- },
187
- "oauth": {
188
- "writeTokenInfo": "Updating Oauth2 token info for portalId: {{ portalId }}",
189
- "addOauthToAccountConfig": {
190
- "init": "Updating configuration",
191
- "success": "Configuration updated"
192
- }
193
- },
194
- "fileManager": {
195
- "uploadStarted": "Uploading files from \"{{ file }}\" to \"{{ destPath }}\" in the File Manager of account {{ accountId }}",
196
- "uploadSuccess": "Uploaded file \"{{ file }}\" to \"{{ destPath }}\"",
197
- "skippedExisting": "Skipped existing {{ filepath }}",
198
- "fetchingFiles": "Fetching {{ fileCount }} files from remote folder: {{ folderName }}",
199
- "fetchFolderStarted": "Fetching folder from \"{{ src }}\" to \"{{ path }}\" in the File Manager of account {{ accountId }}",
200
- "fetchFolderSuccess": "Completed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
201
- "fetchFileStarted": "Fetching file from \"{{ src }}\" to \"{{ dest }}\" in the File Manager of account {{ accountId }}",
202
- "fetchFileSuccess": "Completed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
203
- "errors": {
204
- "uploadFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed",
205
- "archivedFile": "\"{{ src }} \" in the File Manager is an archived file. Try fetching again with the \"--include-archived\" flag",
206
- "hiddenFile": "\"{{ src }}\" in the File Manager is a hidden file."
207
- }
208
- },
209
- "fileMapper": {
210
- "skippedExisting": "Skipped existing {{ filepath }}",
211
- "wroteFolder": "Wrote folder {{ filepath }}",
212
- "completedFetch": "Completed fetch of file \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
213
- "folderFetch": "Fetched \"{{ src }}\" from account {{ accountId }} from the Design Manager successfully",
214
- "completedFolderFetch": "Completed fetch of folder \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
215
- "errors": {
216
- "invalidRequest": "Invalid request for file: {{ src }}",
217
- "invalidNode": "Invalid FileMapperNode: {{ json }}",
218
- "invalidFileType": "Invalid file type requested: {{ srcPath }}",
219
- "assetTimeout": "HubSpot assets are unavailable at the moment. Please wait a few minutes and try again.",
220
- "failedToFetchFile": "Failed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
221
- "failedToFetchFolder": "Failed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
222
- "invalidFetchFolderRequest": "Invalid request for folder: \"{{ src }}\"",
223
- "incompleteFetch": "Not all files in folder \"{{ src }}\" were successfully fetched. Re-run the last command to try again"
224
- }
225
- },
226
- "accountTypes": {
227
- "developmentSandbox": "dev sandbox",
228
- "standardSandbox": "standard sandbox",
229
- "developerTest": "test account",
230
- "appDeveloper": "dev account",
231
- "standard": "standard"
232
- }
2
+ "lib": {
3
+ "trackUsage": {
4
+ "invalidEvent": "Usage tracking event {{ eventName }} is not a valid event type.",
5
+ "sendingEventAuthenticated": "Sending usage event to authenticated endpoint",
6
+ "retryingEventUnauthenticated": "Failed to send the usage event as authenticated. Trying again as unauthenticated.",
7
+ "sendingEventUnauthenticated": "Sending usage event to unauthenticated endpoint"
233
8
  },
234
- "config": {
235
- "cliConfiguration": {
236
- "errors": {
237
- "noConfigLoaded": "No config loaded."
238
- },
239
- "load": {
240
- "configFromEnv": "Loaded config from environment variables for {{ accountId }}",
241
- "configFromFile": "Loaded config from configuration file.",
242
- "empty": "The config file was empty. Initializing an empty config."
243
- },
244
- "validate": {
245
- "noConfig": "Valiation failed: No config was found.",
246
- "noConfigAccounts": "Valiation failed: config.accounts[] is not defined.",
247
- "emptyAccountConfig": "Valiation failed: config.accounts[] has an empty entry.",
248
- "noAccountId": "Valiation failed: config.accounts[] has an entry missing accountId.",
249
- "duplicateAccountIds": "Valiation failed: config.accounts[] has multiple entries with {{ accountId }}.",
250
- "duplicateAccountNames": "Valiation failed: config.accounts[] has multiple entries with {{ accountName }}.",
251
- "nameContainsSpaces": "Valiation failed: config.name {{ accountName }} cannot contain spaces."
252
- },
253
- "updateAccount": {
254
- "noConfigToUpdate": "No config to update.",
255
- "updating": "Updating account config for {{ accountId }}",
256
- "addingConfigEntry": "Adding account config entry for {{ accountId }}",
257
- "errors": {
258
- "accountIdRequired": "An accountId is required to update the config"
259
- }
260
- },
261
- "updateDefaultAccount": {
262
- "errors": {
263
- "invalidInput": "A 'defaultAccount' with value of number or string is required to update the config."
264
- }
265
- },
266
- "renameAccount": {
267
- "errors": {
268
- "invalidName": "Cannot find account with identifier {{ currentName }}"
269
- }
270
- },
271
- "removeAccountFromConfig": {
272
- "deleting": "Deleting config for {{ accountId }}",
273
- "errors": {
274
- "invalidId": "Unable to find account for {{ nameOrId }}."
275
- }
276
- },
277
- "updateDefaultMode": {
278
- "errors": {
279
- "invalidMode": "The mode {{ defaultMode }} is invalid. Valid values are {{ validModes }}."
280
- }
281
- },
282
- "updateHttpTimeout": {
283
- "errors": {
284
- "invalidTimeout": "The value {{ timeout }} is invalid. The value must be a number greater than {{ minTimeout }}."
285
- }
286
- },
287
- "updateAllowUsageTracking": {
288
- "errors": {
289
- "invalidInput": "Unable to update allowUsageTracking. The value {{ isEnabled }} is invalid. The value must be a boolean."
290
- }
291
- }
292
- },
293
- "configFile": {
294
- "errorReading": "Config file could not be read: {{ configPath }}",
295
- "writeSuccess": "Successfully wrote updated config data to {{ configPath }}",
296
- "errorLoading": "A configuration file could not be found at {{ configPath }}.",
297
- "errors": {
298
- "parsing": "Config file could not be parsed"
299
- }
300
- },
301
- "configUtils": {
302
- "unknownType": "Unknown auth type {{ type }}"
303
- },
304
- "environment": {
305
- "loadConfig": {
306
- "missingAccountId": "Unable to load config from environment variables: Missing accountId",
307
- "missingEnv": "Unable to load config from environment variables: Missing env",
308
- "unknownAuthType": "Unable to load config from environment variables: Unknown auth type"
309
- }
9
+ "archive": {
10
+ "extractZip": {
11
+ "init": "Extracting project source...",
12
+ "success": "Completed project source extraction.",
13
+ "errors": {
14
+ "write": "An error occurred writing temp project source.",
15
+ "extract": "An error occurred extracting project source."
310
16
  }
17
+ },
18
+ "copySourceToDest": {
19
+ "init": "Copying project source...",
20
+ "sourceEmpty": "Project source is empty",
21
+ "success": "Completed copying project source.",
22
+ "error": "An error occurred copying project source to {{ dest }}."
23
+ },
24
+ "cleanupTempDir": {
25
+ "error": "Failed to clean up temp dir: {{ tmpDir }}"
26
+ }
27
+ },
28
+ "gitignore": {
29
+ "errors": {
30
+ "configIgnore": "Unable to determine if config file is properly ignored by git."
31
+ }
311
32
  },
312
- "models": {
313
- "OAuth2Manager": {
314
- "fetchingAccessToken": "Fetching access token for accountId {{ accountId }} for clientId {{ clientId }}",
315
- "updatingTokenInfo": "Persisting updated tokenInfo for accountId {{ accountId }} for clientId {{ clientId }}",
316
- "refreshingAccessToken": "Waiting for access token for accountId {{ accountId }} for clientId {{ clientId }} to be fetched",
317
- "errors": {
318
- "missingRefreshToken": "The account {{ accountId }} has not been authenticated with Oauth2",
319
- "auth": "Error while retrieving new token: {{ token }}"
320
- }
33
+ "github": {
34
+ "fetchFileFromRepository": {
35
+ "fetching": "Fetching {{ path }}...",
36
+ "errors": {
37
+ "fetchFail": "An error occurred fetching JSON file."
38
+ }
39
+ },
40
+ "fetchReleaseData": {
41
+ "errors": {
42
+ "fetchFail": "Failed fetching release data for {{ tag }} project."
43
+ }
44
+ },
45
+ "downloadGithubRepoZip": {
46
+ "fetching": "Fetching repository with name {{ repoPath }}...",
47
+ "fetchingName": "Fetching {{ name }}...",
48
+ "completed": "Completed project fetch.",
49
+ "errors": {
50
+ "fetchFail": "An error occurred fetching the project source."
51
+ }
52
+ },
53
+ "cloneGithubRepo": {
54
+ "success": "Your new {{ type }} has been created in {{ dest }}"
55
+ },
56
+ "downloadGithubRepoContents": {
57
+ "downloading": "Downloading content piece: {{ contentPiecePath }} from {{ downloadUrl }} to {{ downloadPath }}",
58
+ "errors": {
59
+ "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
60
+ }
61
+ },
62
+ "listGitHubRepoContents": {
63
+ "errors": {
64
+ "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
321
65
  }
66
+ }
322
67
  },
323
- "utils": {
324
- "notify": {
325
- "errors": {
326
- "filePath": "Unable to notify file '{{ filePath }}'"
327
- }
68
+ "hubdb": {
69
+ "errors": {
70
+ "invalidJsonPath": "The HubDB table file must be a '.json' file",
71
+ "invalidJsonFile": "The '{{{ src }}' path is not a path to a file"
72
+ }
73
+ },
74
+ "personalAccessKey": {
75
+ "errors": {
76
+ "accountNotFound": "Account with id {{ accountId }} does not exist.",
77
+ "invalidPersonalAccessKey": "Error while retrieving new access token: {{ errorMessage }}"
78
+ }
79
+ },
80
+ "cms": {
81
+ "modules": {
82
+ "createModule": {
83
+ "creatingModule": "Creating module at {{ path }}",
84
+ "creatingPath": "Creating {{ path }}",
85
+ "errors": {
86
+ "pathExists": "The {{ path }} path already exists",
87
+ "fileUpdateFailure": "There was a problem updating the modules files at {{ path }}: {{ errorMessage }}"
88
+ }
89
+ },
90
+ "retrieveDefaultModule": {
91
+ "errors": {
92
+ "pathExists": "Folder already exists at \"{{ path }}\""
93
+ }
94
+ }
95
+ },
96
+ "functions": {
97
+ "updateExistingConfig": {
98
+ "unableToReadFile": "The file {{ configFilePath }} could not be read",
99
+ "invalidJSON": "The file {{ configFilePath }} is not valid JSON",
100
+ "couldNotUpdateFile": "The file {{ configFilePath }} could not be updated",
101
+ "errors": {
102
+ "configIsNotObjectError": "The existing {{ configFilePath }} is not an object",
103
+ "endpointAreadyExistsError": "The endpoint {{ endpointPath }} already exists in {{ configFilePath }}"
104
+ }
105
+ },
106
+ "createFunction": {
107
+ "destPathAlreadyExists": "The {{ path }} path already exists",
108
+ "createdDest": "Created {{ path }}",
109
+ "failedToCreateFile": "The file {{ configFilePath }} could not be created",
110
+ "createdFunctionFile": "Created {{ path }}",
111
+ "createdConfigFile": "Created {{ path }}",
112
+ "success": "A function for the endpoint '/_hcms/api/{{ endpointPath }}' has been created. Upload {{ folderName }} to try it out",
113
+ "errors": {
114
+ "nestedConfigError": "Cannot create a functions directory inside '{{ ancestorConfigPath }}'",
115
+ "jsFileConflictError": "The JavaScript file at '{{ functionFilePath }}'' already exists"
116
+ }
117
+ }
118
+ },
119
+ "handleFieldsJs": {
120
+ "convertFieldsJs": {
121
+ "creating": "Creating child process with pid {{ pid }}",
122
+ "terminating": "Child process with pid {{ pid }} has been terminated",
123
+ "errors": {
124
+ "errorConverting": "There was an error converting '{{ filePath }}'"
125
+ }
328
126
  },
329
- "cms": {
330
- "modules": {
331
- "throwInvalidPathInput": "Expected Path Input"
332
- }
127
+ "saveOutput": {
128
+ "errors": {
129
+ "saveFailed": "There was an error saving the json output of {{ path }}"
130
+ }
333
131
  },
334
- "detectPort": {
335
- "errors": {
336
- "invalidPort": "Port must be between {{ minPort }} and {{ maxPort }}"
337
- }
132
+ "createTmpDirSync": {
133
+ "errors": {
134
+ "writeFailed": "An error occurred writing temporary project source."
135
+ }
338
136
  },
339
- "PortManagerServer": {
340
- "started": "PortManagerServer running on port {{ port }}",
341
- "setPort": "Server with instanceId {{ instanceId }} assigned to port {{ port }}",
342
- "deletedPort": "Server with instanceId {{ instanceId }} unassigned from port {{ port }}",
343
- "close": "PortManagerServer shutting down.",
344
- "errors": {
345
- "portInUse": "Failed to start PortManagerServer. Port {{ port }} is already in use.",
346
- "duplicateInstance": "Failed to start PortManagerServer. An instance of PortManagerServer is already running.",
347
- "404": "Could not find a server with instanceId {{ instanceId }}",
348
- "409": "Failed to assign port. Server with instanceId {{ instanceId }} is already running on port {{ port }}",
349
- "400": "Invalid port requested. Port must be between {{ minPort }} and {{ maxPort }}."
350
- }
137
+ "cleanupTmpDirSync": {
138
+ "errors": {
139
+ "deleteFailed": "There was an error deleting the temporary project source"
140
+ }
351
141
  }
352
- },
353
- "http": {
354
- "index": {
355
- "createGetRequestStream": {
356
- "onWrite": "Wrote file {{ filepath }}"
357
- },
358
- "errors": {
359
- "withOauth": "Oauth manager for account {{ accountId }} not found.",
360
- "withAuth": "Account with id {{ accountId }} not found."
361
- }
142
+ },
143
+ "uploadFolder": {
144
+ "uploadFolder": {
145
+ "success": "Uploaded file \"{{ file}}\" to \"{{ destPath }}\"",
146
+ "attempt": "Attempting to upload file \"{{ file }}\" to \"{{ destPath }}\"",
147
+ "failed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed so scheduled retry",
148
+ "retry": "Retrying to upload file \"{{ file }}\" to \"{{ destPath }}\"",
149
+ "retryFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed"
150
+ }
151
+ },
152
+ "templates": {
153
+ "createTemplate": {
154
+ "creatingFile": "Creating file at {{ path }}",
155
+ "creatingPath": "Making {{ path }} if needed",
156
+ "errors": {
157
+ "pathExists": "The {{ path }} path already exists"
158
+ }
362
159
  }
160
+ },
161
+ "processFieldsJs": {
162
+ "converting": "Converting \"{{ src }}\" to \"{{ dest }}\".",
163
+ "converted": "Finished converting \"{{ src }}\" to \"{{ dest }}\".",
164
+ "errors": {
165
+ "invalidMjsFile": ".mjs files are only supported when using Node 13.2.0+",
166
+ "notFunction": "There was an error loading JS file \"{{ path }}\". Expected type \"Function\" but received type \"{{ returned }}\". Make sure that your default export is a function.",
167
+ "notArray": "There was an error loading JS file \"{{ path }}\". Expected type \"Array\" but received type \"{{ returned }}\" . Make sure that your function returns an array"
168
+ }
169
+ },
170
+ "watch": {
171
+ "notifyOfThemePreview": "To preview this theme, visit: {{ previewUrl }}",
172
+ "skipUnsupportedExtension": "Skipping {{ file }} due to unsupported extension",
173
+ "skipIgnoreRule": "Skipping {{ file }} due to an ignore rule",
174
+ "uploadAttempt": "Attempting to upload file \"{{ file }}\" to \"{{ dest }}\"",
175
+ "uploadSuccess": "Uploaded file {{ file }} to {{ dest }}",
176
+ "uploadFailed": "Uploading file {{ file }} to {{ dest }} failed",
177
+ "uploadRetry": "Retrying to upload file \"{{ file }}\" to \"{{ dest }}\"",
178
+ "deleteAttempt": "Attempting to delete file {{ remoteFilePath }}",
179
+ "deleteAttemptWithType": "Attempting to delete {{ type }} {{ remoteFilePath }}",
180
+ "deleteSuccess": "Deleted file {{ remoteFilePath }}",
181
+ "deleteSuccessWithType": "Deleted {{ type }} {{ remoteFilePath }}",
182
+ "deleteFailed": "Deleting file {{ remoteFilePath }} failed",
183
+ "folderUploadSuccess": "Completed uploading files in {{ src }} to {{ dest }} in {{ accountId }}",
184
+ "ready": "Watcher is ready and watching {{ src }}. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system."
185
+ }
363
186
  },
364
- "errors": {
365
- "fileSystemErrors": {
366
- "readAction": "reading from",
367
- "writeAction": "writing to",
368
- "otherAction": "accessing",
369
- "unknownFilepath": "a file or folder",
370
- "baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
371
- },
372
- "apiErrors": {
373
- "messageDetail": "{{ requestName }} in account {{ accountId }}",
374
- "genericMessageDetail": "request",
375
- "unableToUpload": "Unable to upload \"{{ payload }}.",
376
- "codes": {
377
- "400": "The {{ messageDetail }} was bad.",
378
- "401": "The {{ messageDetail }} was unauthorized.",
379
- "403": "The {{ messageDetail }} was forbidden.",
380
- "404": "The {{ messageDetail }} was not found.",
381
- "429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
382
- "503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
383
- "500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
384
- "400Generic": "The {{ messageDetail }} failed due to a client error.",
385
- "generic": "The {{ messageDetail }} failed."
386
- }
187
+ "oauth": {
188
+ "writeTokenInfo": "Updating Oauth2 token info for portalId: {{ portalId }}",
189
+ "addOauthToAccountConfig": {
190
+ "init": "Updating configuration",
191
+ "success": "Configuration updated"
192
+ }
193
+ },
194
+ "fileManager": {
195
+ "uploadStarted": "Uploading files from \"{{ file }}\" to \"{{ destPath }}\" in the File Manager of account {{ accountId }}",
196
+ "uploadSuccess": "Uploaded file \"{{ file }}\" to \"{{ destPath }}\"",
197
+ "skippedExisting": "Skipped existing {{ filepath }}",
198
+ "fetchingFiles": "Fetching {{ fileCount }} files from remote folder: {{ folderName }}",
199
+ "fetchFolderStarted": "Fetching folder from \"{{ src }}\" to \"{{ path }}\" in the File Manager of account {{ accountId }}",
200
+ "fetchFolderSuccess": "Completed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
201
+ "fetchFileStarted": "Fetching file from \"{{ src }}\" to \"{{ dest }}\" in the File Manager of account {{ accountId }}",
202
+ "fetchFileSuccess": "Completed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
203
+ "errors": {
204
+ "uploadFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed",
205
+ "archivedFile": "\"{{ src }} \" in the File Manager is an archived file. Try fetching again with the \"--include-archived\" flag",
206
+ "hiddenFile": "\"{{ src }}\" in the File Manager is a hidden file."
207
+ }
208
+ },
209
+ "fileMapper": {
210
+ "skippedExisting": "Skipped existing {{ filepath }}",
211
+ "wroteFolder": "Wrote folder {{ filepath }}",
212
+ "completedFetch": "Completed fetch of file \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
213
+ "folderFetch": "Fetched \"{{ src }}\" from account {{ accountId }} from the Design Manager successfully",
214
+ "completedFolderFetch": "Completed fetch of folder \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
215
+ "errors": {
216
+ "invalidRequest": "Invalid request for file: {{ src }}",
217
+ "invalidNode": "Invalid FileMapperNode: {{ json }}",
218
+ "invalidFileType": "Invalid file type requested: {{ srcPath }}",
219
+ "assetTimeout": "HubSpot assets are unavailable at the moment. Please wait a few minutes and try again.",
220
+ "failedToFetchFile": "Failed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
221
+ "failedToFetchFolder": "Failed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
222
+ "invalidFetchFolderRequest": "Invalid request for folder: \"{{ src }}\"",
223
+ "incompleteFetch": "Not all files in folder \"{{ src }}\" were successfully fetched. Re-run the last command to try again"
224
+ }
225
+ },
226
+ "accountTypes": {
227
+ "developmentSandbox": "dev sandbox",
228
+ "standardSandbox": "standard sandbox",
229
+ "developerTest": "test account",
230
+ "appDeveloper": "dev account",
231
+ "standard": "standard"
232
+ }
233
+ },
234
+ "config": {
235
+ "cliConfiguration": {
236
+ "errors": {
237
+ "noConfigLoaded": "No config loaded."
238
+ },
239
+ "load": {
240
+ "configFromEnv": "Loaded config from environment variables for {{ accountId }}",
241
+ "configFromFile": "Loaded config from configuration file.",
242
+ "empty": "The config file was empty. Initializing an empty config."
243
+ },
244
+ "validate": {
245
+ "noConfig": "Valiation failed: No config was found.",
246
+ "noConfigAccounts": "Valiation failed: config.accounts[] is not defined.",
247
+ "emptyAccountConfig": "Valiation failed: config.accounts[] has an empty entry.",
248
+ "noAccountId": "Valiation failed: config.accounts[] has an entry missing accountId.",
249
+ "duplicateAccountIds": "Valiation failed: config.accounts[] has multiple entries with {{ accountId }}.",
250
+ "duplicateAccountNames": "Valiation failed: config.accounts[] has multiple entries with {{ accountName }}.",
251
+ "nameContainsSpaces": "Valiation failed: config.name {{ accountName }} cannot contain spaces."
252
+ },
253
+ "updateAccount": {
254
+ "noConfigToUpdate": "No config to update.",
255
+ "updating": "Updating account config for {{ accountId }}",
256
+ "addingConfigEntry": "Adding account config entry for {{ accountId }}",
257
+ "errors": {
258
+ "accountIdRequired": "An accountId is required to update the config"
259
+ }
260
+ },
261
+ "updateDefaultAccount": {
262
+ "errors": {
263
+ "invalidInput": "A 'defaultAccount' with value of number or string is required to update the config."
264
+ }
265
+ },
266
+ "renameAccount": {
267
+ "errors": {
268
+ "invalidName": "Cannot find account with identifier {{ currentName }}"
269
+ }
270
+ },
271
+ "removeAccountFromConfig": {
272
+ "deleting": "Deleting config for {{ accountId }}",
273
+ "errors": {
274
+ "invalidId": "Unable to find account for {{ nameOrId }}."
275
+ }
276
+ },
277
+ "updateDefaultMode": {
278
+ "errors": {
279
+ "invalidMode": "The mode {{ defaultMode }} is invalid. Valid values are {{ validModes }}."
280
+ }
281
+ },
282
+ "updateHttpTimeout": {
283
+ "errors": {
284
+ "invalidTimeout": "The value {{ timeout }} is invalid. The value must be a number greater than {{ minTimeout }}."
387
285
  }
286
+ },
287
+ "updateAllowUsageTracking": {
288
+ "errors": {
289
+ "invalidInput": "Unable to update allowUsageTracking. The value {{ isEnabled }} is invalid. The value must be a boolean."
290
+ }
291
+ }
292
+ },
293
+ "configFile": {
294
+ "errorReading": "Config file could not be read: {{ configPath }}",
295
+ "writeSuccess": "Successfully wrote updated config data to {{ configPath }}",
296
+ "errorLoading": "A configuration file could not be found at {{ configPath }}.",
297
+ "errors": {
298
+ "parsing": "Config file could not be parsed"
299
+ }
300
+ },
301
+ "configUtils": {
302
+ "unknownType": "Unknown auth type {{ type }}"
303
+ },
304
+ "environment": {
305
+ "loadConfig": {
306
+ "missingAccountId": "Unable to load config from environment variables: Missing accountId",
307
+ "missingEnv": "Unable to load config from environment variables: Missing env",
308
+ "unknownAuthType": "Unable to load config from environment variables: Unknown auth type"
309
+ }
310
+ }
311
+ },
312
+ "models": {
313
+ "OAuth2Manager": {
314
+ "fetchingAccessToken": "Fetching access token for accountId {{ accountId }} for clientId {{ clientId }}",
315
+ "updatingTokenInfo": "Persisting updated tokenInfo for accountId {{ accountId }} for clientId {{ clientId }}",
316
+ "refreshingAccessToken": "Waiting for access token for accountId {{ accountId }} for clientId {{ clientId }} to be fetched",
317
+ "errors": {
318
+ "missingRefreshToken": "The account {{ accountId }} has not been authenticated with Oauth2",
319
+ "auth": "Error while retrieving new token: {{ token }}"
320
+ }
321
+ }
322
+ },
323
+ "utils": {
324
+ "notify": {
325
+ "errors": {
326
+ "filePath": "Unable to notify file '{{ filePath }}'"
327
+ }
328
+ },
329
+ "cms": {
330
+ "modules": {
331
+ "throwInvalidPathInput": "Expected Path Input"
332
+ }
333
+ },
334
+ "detectPort": {
335
+ "errors": {
336
+ "invalidPort": "Port must be between {{ minPort }} and {{ maxPort }}"
337
+ }
338
+ },
339
+ "PortManagerServer": {
340
+ "started": "PortManagerServer running on port {{ port }}",
341
+ "setPort": "Server with instanceId {{ instanceId }} assigned to port {{ port }}",
342
+ "deletedPort": "Server with instanceId {{ instanceId }} unassigned from port {{ port }}",
343
+ "close": "PortManagerServer shutting down.",
344
+ "errors": {
345
+ "portInUse": "Failed to start PortManagerServer. Port {{ port }} is already in use.",
346
+ "duplicateInstance": "Failed to start PortManagerServer. An instance of PortManagerServer is already running.",
347
+ "404": "Could not find a server with instanceId {{ instanceId }}",
348
+ "409": "Failed to assign port. Server with instanceId {{ instanceId }} is already running on port {{ port }}",
349
+ "400": "Invalid port requested. Port must be between {{ minPort }} and {{ maxPort }}."
350
+ }
351
+ }
352
+ },
353
+ "http": {
354
+ "index": {
355
+ "createGetRequestStream": {
356
+ "onWrite": "Wrote file {{ filepath }}"
357
+ },
358
+ "errors": {
359
+ "withOauth": "Oauth manager for account {{ accountId }} not found.",
360
+ "withAuth": "Account with id {{ accountId }} not found."
361
+ }
362
+ }
363
+ },
364
+ "errors": {
365
+ "fileSystemErrors": {
366
+ "readAction": "reading from",
367
+ "writeAction": "writing to",
368
+ "otherAction": "accessing",
369
+ "unknownFilepath": "a file or folder",
370
+ "baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
371
+ },
372
+ "apiErrors": {
373
+ "messageDetail": "{{ requestName }} in account {{ accountId }}",
374
+ "genericMessageDetail": "request",
375
+ "unableToUpload": "Unable to upload \"{{ payload }}.",
376
+ "codes": {
377
+ "400": "The {{ messageDetail }} was bad.",
378
+ "401": "The {{ messageDetail }} was unauthorized.",
379
+ "403": "The {{ messageDetail }} was forbidden.",
380
+ "404": "The {{ messageDetail }} was not found.",
381
+ "429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
382
+ "503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
383
+ "500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
384
+ "400Generic": "The {{ messageDetail }} failed due to a client error.",
385
+ "generic": "The {{ messageDetail }} failed."
386
+ }
388
387
  }
388
+ }
389
389
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "2.1.0",
3
+ "version": "2.1.2-beta.0",
4
4
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -12,22 +12,16 @@
12
12
  "access": "public"
13
13
  },
14
14
  "scripts": {
15
- "build": "rm -rf ./dist/ && tsc --rootDir . --outdir dist && yarn copy-files && yarn clear-postinstall",
16
- "check-main": "branch=$(git rev-parse --abbrev-ref HEAD) && [ $branch = main ] || (echo 'Error: New release can only be published on main branch' && exit 1)",
17
- "clear-postinstall": "cd dist && npm pkg delete scripts.postinstall",
18
- "copy-files": "cp -r lang dist/lang",
15
+ "build": "ts-node ./scripts/build.ts",
19
16
  "lint": "eslint --max-warnings=0 . && prettier . --check",
20
17
  "local-dev": "yarn build && cd dist && yarn link && cd .. && tsc --watch --rootDir . --outdir dist",
21
18
  "prettier:write": "prettier . --write",
22
- "pub": "cd dist && npm publish --tag latest && cd ..",
23
- "push": "git push --atomic origin main v$npm_package_version",
24
- "release:major": "yarn check-main && yarn version --major && yarn build && yarn pub && yarn push",
25
- "release:minor": "yarn check-main && yarn version --minor && yarn build && yarn pub && yarn push",
26
- "release:patch": "yarn check-main && yarn version --patch && yarn build && yarn pub && yarn push",
19
+ "release": "ts-node ./scripts/release.ts release",
27
20
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ./node_modules/.bin/jest"
28
21
  },
29
22
  "license": "Apache-2.0",
30
23
  "devDependencies": {
24
+ "@inquirer/prompts": "^7.0.1",
31
25
  "@types/content-disposition": "^0.5.5",
32
26
  "@types/cors": "^2.8.15",
33
27
  "@types/debounce": "^1.2.1",
@@ -45,7 +39,9 @@
45
39
  "husky": "^8.0.0",
46
40
  "jest": "^29.5.0",
47
41
  "ts-jest": "^29.0.5",
48
- "typescript": "^4.9.5"
42
+ "ts-node": "^10.9.2",
43
+ "typescript": "^4.9.5",
44
+ "yargs": "^17.7.2"
49
45
  },
50
46
  "exports": {
51
47
  "./*": "./lib/*.js",
package/lang/lang/en.json DELETED
@@ -1,389 +0,0 @@
1
- {
2
- "lib": {
3
- "trackUsage": {
4
- "invalidEvent": "Usage tracking event {{ eventName }} is not a valid event type.",
5
- "sendingEventAuthenticated": "Sending usage event to authenticated endpoint",
6
- "retryingEventUnauthenticated": "Failed to send the usage event as authenticated. Trying again as unauthenticated.",
7
- "sendingEventUnauthenticated": "Sending usage event to unauthenticated endpoint"
8
- },
9
- "archive": {
10
- "extractZip": {
11
- "init": "Extracting project source...",
12
- "success": "Completed project source extraction.",
13
- "errors": {
14
- "write": "An error occurred writing temp project source.",
15
- "extract": "An error occurred extracting project source."
16
- }
17
- },
18
- "copySourceToDest": {
19
- "init": "Copying project source...",
20
- "sourceEmpty": "Project source is empty",
21
- "success": "Completed copying project source.",
22
- "error": "An error occurred copying project source to {{ dest }}."
23
- },
24
- "cleanupTempDir": {
25
- "error": "Failed to clean up temp dir: {{ tmpDir }}"
26
- }
27
- },
28
- "gitignore": {
29
- "errors": {
30
- "configIgnore": "Unable to determine if config file is properly ignored by git."
31
- }
32
- },
33
- "github": {
34
- "fetchFileFromRepository": {
35
- "fetching": "Fetching {{ path }}...",
36
- "errors": {
37
- "fetchFail": "An error occurred fetching JSON file."
38
- }
39
- },
40
- "fetchReleaseData": {
41
- "errors": {
42
- "fetchFail": "Failed fetching release data for {{ tag }} project."
43
- }
44
- },
45
- "downloadGithubRepoZip": {
46
- "fetching": "Fetching repository with name {{ repoPath }}...",
47
- "fetchingName": "Fetching {{ name }}...",
48
- "completed": "Completed project fetch.",
49
- "errors": {
50
- "fetchFail": "An error occurred fetching the project source."
51
- }
52
- },
53
- "cloneGithubRepo": {
54
- "success": "Your new {{ type }} has been created in {{ dest }}"
55
- },
56
- "downloadGithubRepoContents": {
57
- "downloading": "Downloading content piece: {{ contentPiecePath }} from {{ downloadUrl }} to {{ downloadPath }}",
58
- "errors": {
59
- "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
60
- }
61
- },
62
- "listGitHubRepoContents": {
63
- "errors": {
64
- "fetchFail": "Failed to fetch contents: {{ errorMessage }}"
65
- }
66
- }
67
- },
68
- "hubdb": {
69
- "errors": {
70
- "invalidJsonPath": "The HubDB table file must be a '.json' file",
71
- "invalidJsonFile": "The '{{{ src }}' path is not a path to a file"
72
- }
73
- },
74
- "personalAccessKey": {
75
- "errors": {
76
- "accountNotFound": "Account with id {{ accountId }} does not exist.",
77
- "invalidPersonalAccessKey": "Error while retrieving new access token: {{ errorMessage }}"
78
- }
79
- },
80
- "cms": {
81
- "modules": {
82
- "createModule": {
83
- "creatingModule": "Creating module at {{ path }}",
84
- "creatingPath": "Creating {{ path }}",
85
- "errors": {
86
- "pathExists": "The {{ path }} path already exists",
87
- "fileUpdateFailure": "There was a problem updating the modules files at {{ path }}: {{ errorMessage }}"
88
- }
89
- },
90
- "retrieveDefaultModule": {
91
- "errors": {
92
- "pathExists": "Folder already exists at \"{{ path }}\""
93
- }
94
- }
95
- },
96
- "functions": {
97
- "updateExistingConfig": {
98
- "unableToReadFile": "The file {{ configFilePath }} could not be read",
99
- "invalidJSON": "The file {{ configFilePath }} is not valid JSON",
100
- "couldNotUpdateFile": "The file {{ configFilePath }} could not be updated",
101
- "errors": {
102
- "configIsNotObjectError": "The existing {{ configFilePath }} is not an object",
103
- "endpointAreadyExistsError": "The endpoint {{ endpointPath }} already exists in {{ configFilePath }}"
104
- }
105
- },
106
- "createFunction": {
107
- "destPathAlreadyExists": "The {{ path }} path already exists",
108
- "createdDest": "Created {{ path }}",
109
- "failedToCreateFile": "The file {{ configFilePath }} could not be created",
110
- "createdFunctionFile": "Created {{ path }}",
111
- "createdConfigFile": "Created {{ path }}",
112
- "success": "A function for the endpoint '/_hcms/api/{{ endpointPath }}' has been created. Upload {{ folderName }} to try it out",
113
- "errors": {
114
- "nestedConfigError": "Cannot create a functions directory inside '{{ ancestorConfigPath }}'",
115
- "jsFileConflictError": "The JavaScript file at '{{ functionFilePath }}'' already exists"
116
- }
117
- }
118
- },
119
- "handleFieldsJs": {
120
- "convertFieldsJs": {
121
- "creating": "Creating child process with pid {{ pid }}",
122
- "terminating": "Child process with pid {{ pid }} has been terminated",
123
- "errors": {
124
- "errorConverting": "There was an error converting '{{ filePath }}'"
125
- }
126
- },
127
- "saveOutput": {
128
- "errors": {
129
- "saveFailed": "There was an error saving the json output of {{ path }}"
130
- }
131
- },
132
- "createTmpDirSync": {
133
- "errors": {
134
- "writeFailed": "An error occurred writing temporary project source."
135
- }
136
- },
137
- "cleanupTmpDirSync": {
138
- "errors": {
139
- "deleteFailed": "There was an error deleting the temporary project source"
140
- }
141
- }
142
- },
143
- "uploadFolder": {
144
- "uploadFolder": {
145
- "success": "Uploaded file \"{{ file}}\" to \"{{ destPath }}\"",
146
- "attempt": "Attempting to upload file \"{{ file }}\" to \"{{ destPath }}\"",
147
- "failed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed so scheduled retry",
148
- "retry": "Retrying to upload file \"{{ file }}\" to \"{{ destPath }}\"",
149
- "retryFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed"
150
- }
151
- },
152
- "templates": {
153
- "createTemplate": {
154
- "creatingFile": "Creating file at {{ path }}",
155
- "creatingPath": "Making {{ path }} if needed",
156
- "errors": {
157
- "pathExists": "The {{ path }} path already exists"
158
- }
159
- }
160
- },
161
- "processFieldsJs": {
162
- "converting": "Converting \"{{ src }}\" to \"{{ dest }}\".",
163
- "converted": "Finished converting \"{{ src }}\" to \"{{ dest }}\".",
164
- "errors": {
165
- "invalidMjsFile": ".mjs files are only supported when using Node 13.2.0+",
166
- "notFunction": "There was an error loading JS file \"{{ path }}\". Expected type \"Function\" but received type \"{{ returned }}\". Make sure that your default export is a function.",
167
- "notArray": "There was an error loading JS file \"{{ path }}\". Expected type \"Array\" but received type \"{{ returned }}\" . Make sure that your function returns an array"
168
- }
169
- },
170
- "watch": {
171
- "notifyOfThemePreview": "To preview this theme, visit: {{ previewUrl }}",
172
- "skipUnsupportedExtension": "Skipping {{ file }} due to unsupported extension",
173
- "skipIgnoreRule": "Skipping {{ file }} due to an ignore rule",
174
- "uploadAttempt": "Attempting to upload file \"{{ file }}\" to \"{{ dest }}\"",
175
- "uploadSuccess": "Uploaded file {{ file }} to {{ dest }}",
176
- "uploadFailed": "Uploading file {{ file }} to {{ dest }} failed",
177
- "uploadRetry": "Retrying to upload file \"{{ file }}\" to \"{{ dest }}\"",
178
- "deleteAttempt": "Attempting to delete file {{ remoteFilePath }}",
179
- "deleteAttemptWithType": "Attempting to delete {{ type }} {{ remoteFilePath }}",
180
- "deleteSuccess": "Deleted file {{ remoteFilePath }}",
181
- "deleteSuccessWithType": "Deleted {{ type }} {{ remoteFilePath }}",
182
- "deleteFailed": "Deleting file {{ remoteFilePath }} failed",
183
- "folderUploadSuccess": "Completed uploading files in {{ src }} to {{ dest }} in {{ accountId }}",
184
- "ready": "Watcher is ready and watching {{ src }}. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system."
185
- }
186
- },
187
- "oauth": {
188
- "writeTokenInfo": "Updating Oauth2 token info for portalId: {{ portalId }}",
189
- "addOauthToAccountConfig": {
190
- "init": "Updating configuration",
191
- "success": "Configuration updated"
192
- }
193
- },
194
- "fileManager": {
195
- "uploadStarted": "Uploading files from \"{{ file }}\" to \"{{ destPath }}\" in the File Manager of account {{ accountId }}",
196
- "uploadSuccess": "Uploaded file \"{{ file }}\" to \"{{ destPath }}\"",
197
- "skippedExisting": "Skipped existing {{ filepath }}",
198
- "fetchingFiles": "Fetching {{ fileCount }} files from remote folder: {{ folderName }}",
199
- "fetchFolderStarted": "Fetching folder from \"{{ src }}\" to \"{{ path }}\" in the File Manager of account {{ accountId }}",
200
- "fetchFolderSuccess": "Completed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
201
- "fetchFileStarted": "Fetching file from \"{{ src }}\" to \"{{ dest }}\" in the File Manager of account {{ accountId }}",
202
- "fetchFileSuccess": "Completed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the File Manager",
203
- "errors": {
204
- "uploadFailed": "Uploading file \"{{ file }}\" to \"{{ destPath }}\" failed",
205
- "archivedFile": "\"{{ src }} \" in the File Manager is an archived file. Try fetching again with the \"--include-archived\" flag",
206
- "hiddenFile": "\"{{ src }}\" in the File Manager is a hidden file."
207
- }
208
- },
209
- "fileMapper": {
210
- "skippedExisting": "Skipped existing {{ filepath }}",
211
- "wroteFolder": "Wrote folder {{ filepath }}",
212
- "completedFetch": "Completed fetch of file \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
213
- "folderFetch": "Fetched \"{{ src }}\" from account {{ accountId }} from the Design Manager successfully",
214
- "completedFolderFetch": "Completed fetch of folder \"{{ src }}\"{{ version }} to \"{{ dest }}\" from the Design Manager",
215
- "errors": {
216
- "invalidRequest": "Invalid request for file: {{ src }}",
217
- "invalidNode": "Invalid FileMapperNode: {{ json }}",
218
- "invalidFileType": "Invalid file type requested: {{ srcPath }}",
219
- "assetTimeout": "HubSpot assets are unavailable at the moment. Please wait a few minutes and try again.",
220
- "failedToFetchFile": "Failed fetch of file \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
221
- "failedToFetchFolder": "Failed fetch of folder \"{{ src }}\" to \"{{ dest }}\" from the Design Manager",
222
- "invalidFetchFolderRequest": "Invalid request for folder: \"{{ src }}\"",
223
- "incompleteFetch": "Not all files in folder \"{{ src }}\" were successfully fetched. Re-run the last command to try again"
224
- }
225
- },
226
- "accountTypes": {
227
- "developmentSandbox": "dev sandbox",
228
- "standardSandbox": "standard sandbox",
229
- "developerTest": "test account",
230
- "appDeveloper": "dev account",
231
- "standard": "standard"
232
- }
233
- },
234
- "config": {
235
- "cliConfiguration": {
236
- "errors": {
237
- "noConfigLoaded": "No config loaded."
238
- },
239
- "load": {
240
- "configFromEnv": "Loaded config from environment variables for {{ accountId }}",
241
- "configFromFile": "Loaded config from configuration file.",
242
- "empty": "The config file was empty. Initializing an empty config."
243
- },
244
- "validate": {
245
- "noConfig": "Valiation failed: No config was found.",
246
- "noConfigAccounts": "Valiation failed: config.accounts[] is not defined.",
247
- "emptyAccountConfig": "Valiation failed: config.accounts[] has an empty entry.",
248
- "noAccountId": "Valiation failed: config.accounts[] has an entry missing accountId.",
249
- "duplicateAccountIds": "Valiation failed: config.accounts[] has multiple entries with {{ accountId }}.",
250
- "duplicateAccountNames": "Valiation failed: config.accounts[] has multiple entries with {{ accountName }}.",
251
- "nameContainsSpaces": "Valiation failed: config.name {{ accountName }} cannot contain spaces."
252
- },
253
- "updateAccount": {
254
- "noConfigToUpdate": "No config to update.",
255
- "updating": "Updating account config for {{ accountId }}",
256
- "addingConfigEntry": "Adding account config entry for {{ accountId }}",
257
- "errors": {
258
- "accountIdRequired": "An accountId is required to update the config"
259
- }
260
- },
261
- "updateDefaultAccount": {
262
- "errors": {
263
- "invalidInput": "A 'defaultAccount' with value of number or string is required to update the config."
264
- }
265
- },
266
- "renameAccount": {
267
- "errors": {
268
- "invalidName": "Cannot find account with identifier {{ currentName }}"
269
- }
270
- },
271
- "removeAccountFromConfig": {
272
- "deleting": "Deleting config for {{ accountId }}",
273
- "errors": {
274
- "invalidId": "Unable to find account for {{ nameOrId }}."
275
- }
276
- },
277
- "updateDefaultMode": {
278
- "errors": {
279
- "invalidMode": "The mode {{ defaultMode }} is invalid. Valid values are {{ validModes }}."
280
- }
281
- },
282
- "updateHttpTimeout": {
283
- "errors": {
284
- "invalidTimeout": "The value {{ timeout }} is invalid. The value must be a number greater than {{ minTimeout }}."
285
- }
286
- },
287
- "updateAllowUsageTracking": {
288
- "errors": {
289
- "invalidInput": "Unable to update allowUsageTracking. The value {{ isEnabled }} is invalid. The value must be a boolean."
290
- }
291
- }
292
- },
293
- "configFile": {
294
- "errorReading": "Config file could not be read: {{ configPath }}",
295
- "writeSuccess": "Successfully wrote updated config data to {{ configPath }}",
296
- "errorLoading": "A configuration file could not be found at {{ configPath }}.",
297
- "errors": {
298
- "parsing": "Config file could not be parsed"
299
- }
300
- },
301
- "configUtils": {
302
- "unknownType": "Unknown auth type {{ type }}"
303
- },
304
- "environment": {
305
- "loadConfig": {
306
- "missingAccountId": "Unable to load config from environment variables: Missing accountId",
307
- "missingEnv": "Unable to load config from environment variables: Missing env",
308
- "unknownAuthType": "Unable to load config from environment variables: Unknown auth type"
309
- }
310
- }
311
- },
312
- "models": {
313
- "OAuth2Manager": {
314
- "fetchingAccessToken": "Fetching access token for accountId {{ accountId }} for clientId {{ clientId }}",
315
- "updatingTokenInfo": "Persisting updated tokenInfo for accountId {{ accountId }} for clientId {{ clientId }}",
316
- "refreshingAccessToken": "Waiting for access token for accountId {{ accountId }} for clientId {{ clientId }} to be fetched",
317
- "errors": {
318
- "missingRefreshToken": "The account {{ accountId }} has not been authenticated with Oauth2",
319
- "auth": "Error while retrieving new token: {{ token }}"
320
- }
321
- }
322
- },
323
- "utils": {
324
- "notify": {
325
- "errors": {
326
- "filePath": "Unable to notify file '{{ filePath }}'"
327
- }
328
- },
329
- "cms": {
330
- "modules": {
331
- "throwInvalidPathInput": "Expected Path Input"
332
- }
333
- },
334
- "detectPort": {
335
- "errors": {
336
- "invalidPort": "Port must be between {{ minPort }} and {{ maxPort }}"
337
- }
338
- },
339
- "PortManagerServer": {
340
- "started": "PortManagerServer running on port {{ port }}",
341
- "setPort": "Server with instanceId {{ instanceId }} assigned to port {{ port }}",
342
- "deletedPort": "Server with instanceId {{ instanceId }} unassigned from port {{ port }}",
343
- "close": "PortManagerServer shutting down.",
344
- "errors": {
345
- "portInUse": "Failed to start PortManagerServer. Port {{ port }} is already in use.",
346
- "duplicateInstance": "Failed to start PortManagerServer. An instance of PortManagerServer is already running.",
347
- "404": "Could not find a server with instanceId {{ instanceId }}",
348
- "409": "Failed to assign port. Server with instanceId {{ instanceId }} is already running on port {{ port }}",
349
- "400": "Invalid port requested. Port must be between {{ minPort }} and {{ maxPort }}."
350
- }
351
- }
352
- },
353
- "http": {
354
- "index": {
355
- "createGetRequestStream": {
356
- "onWrite": "Wrote file {{ filepath }}"
357
- },
358
- "errors": {
359
- "withOauth": "Oauth manager for account {{ accountId }} not found.",
360
- "withAuth": "Account with id {{ accountId }} not found."
361
- }
362
- }
363
- },
364
- "errors": {
365
- "fileSystemErrors": {
366
- "readAction": "reading from",
367
- "writeAction": "writing to",
368
- "otherAction": "accessing",
369
- "unknownFilepath": "a file or folder",
370
- "baseMessage": "An error occurred while {{ fileAction }} {{ filepath }}."
371
- },
372
- "apiErrors": {
373
- "messageDetail": "{{ requestName }} in account {{ accountId }}",
374
- "genericMessageDetail": "request",
375
- "unableToUpload": "Unable to upload \"{{ payload }}.",
376
- "codes": {
377
- "400": "The {{ messageDetail }} was bad.",
378
- "401": "The {{ messageDetail }} was unauthorized.",
379
- "403": "The {{ messageDetail }} was forbidden.",
380
- "404": "The {{ messageDetail }} was not found.",
381
- "429": "The {{ messageDetail }} surpassed the rate limit. Retry in one minute.",
382
- "503": "The {{ messageDetail }} could not be handled at this time. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
383
- "500Generic": "The {{ messageDetail }} failed due to a server error. Please try again or visit https://help.hubspot.com/ to submit a ticket or contact HubSpot Support if the issue persists.",
384
- "400Generic": "The {{ messageDetail }} failed due to a client error.",
385
- "generic": "The {{ messageDetail }} failed."
386
- }
387
- }
388
- }
389
- }