@hubspot/local-dev-lib 0.0.8 → 0.0.10

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.
Files changed (68) hide show
  1. package/api/fileMapper.d.ts +2 -0
  2. package/api/fileMapper.js +3 -2
  3. package/config/CLIConfiguration.js +20 -18
  4. package/config/configFile.js +1 -2
  5. package/config/configUtils.js +2 -1
  6. package/config/config_DEPRECATED.d.ts +1 -1
  7. package/config/config_DEPRECATED.js +24 -23
  8. package/config/environment.js +4 -3
  9. package/config/index.d.ts +1 -1
  10. package/constants/ports.d.ts +3 -0
  11. package/constants/ports.js +6 -0
  12. package/errors/apiErrors.js +1 -1
  13. package/errors/fileSystemErrors.d.ts +3 -0
  14. package/errors/fileSystemErrors.js +4 -1
  15. package/errors/standardErrors.d.ts +4 -3
  16. package/errors/standardErrors.js +2 -2
  17. package/http/index.js +7 -4
  18. package/lang/en.json +383 -0
  19. package/lang/lang/en.json +383 -0
  20. package/lib/archive.js +10 -9
  21. package/lib/cms/functions.js +18 -15
  22. package/lib/cms/handleFieldsJS.js +8 -6
  23. package/lib/cms/modules.js +5 -4
  24. package/lib/cms/processFieldsJs.js +6 -8
  25. package/lib/cms/templates.js +10 -5
  26. package/lib/cms/uploadFolder.js +11 -7
  27. package/lib/cms/watch.js +33 -21
  28. package/lib/customObjects.d.ts +4 -4
  29. package/lib/customObjects.js +21 -4
  30. package/lib/environment.js +1 -1
  31. package/lib/fileMapper.js +27 -20
  32. package/lib/github.js +15 -11
  33. package/lib/gitignore.js +2 -1
  34. package/lib/hubdb.js +4 -3
  35. package/lib/logging/git.js +1 -1
  36. package/lib/logging/logger.d.ts +1 -1
  37. package/lib/logging/logger.js +1 -1
  38. package/lib/logging/logs.js +5 -1
  39. package/lib/oauth.js +5 -4
  40. package/lib/personalAccessKey.js +3 -2
  41. package/lib/portManager.d.ts +13 -0
  42. package/lib/portManager.js +45 -0
  43. package/lib/sandboxes.js +7 -7
  44. package/lib/text.d.ts +1 -1
  45. package/lib/trackUsage.d.ts +1 -1
  46. package/lib/trackUsage.js +6 -3
  47. package/lib/validate.js +2 -2
  48. package/models/OAuth2Manager.js +5 -3
  49. package/package.json +6 -1
  50. package/types/Lang.d.ts +7 -0
  51. package/types/Lang.js +2 -0
  52. package/types/PortManager.d.ts +4 -0
  53. package/types/PortManager.js +2 -0
  54. package/types/Schemas.d.ts +18 -33
  55. package/types/Utils.d.ts +5 -0
  56. package/utils/PortManagerServer.d.ts +29 -0
  57. package/utils/PortManagerServer.js +158 -0
  58. package/utils/cms/modules.js +2 -1
  59. package/utils/detectPort.d.ts +1 -0
  60. package/utils/detectPort.js +102 -0
  61. package/utils/lang.d.ts +2 -4
  62. package/utils/lang.js +12 -14
  63. package/utils/logger.d.ts +4 -3
  64. package/utils/logger.js +4 -3
  65. package/utils/notify.js +2 -1
  66. package/utils/objectUtils.d.ts +1 -1
  67. package/utils/objectUtils.js +3 -3
  68. package/lang/en.lyaml +0 -247
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /*
3
+ From https://github.com/node-modules/detect-port/tree/master
4
+
5
+ The MIT License (MIT)
6
+
7
+ Copyright (c) 2014 - present node-modules and other contributors
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
10
+ this software and associated documentation files (the "Software"), to deal in
11
+ the Software without restriction, including without limitation the rights to
12
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13
+ the Software, and to permit persons to whom the Software is furnished to do so,
14
+ subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ */
26
+ var __importDefault = (this && this.__importDefault) || function (mod) {
27
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.detectPort = void 0;
31
+ const net_1 = __importDefault(require("net"));
32
+ const address_1 = require("address");
33
+ const standardErrors_1 = require("../errors/standardErrors");
34
+ const ports_1 = require("../constants/ports");
35
+ const i18nKey = 'utils.detectPort';
36
+ function detectPort(port, exclude = []) {
37
+ if (port && (port < ports_1.MIN_PORT_NUMBER || port > ports_1.MAX_PORT_NUMBER)) {
38
+ (0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.errors.invalidPort`, {
39
+ minPort: ports_1.MIN_PORT_NUMBER,
40
+ maxPort: ports_1.MAX_PORT_NUMBER,
41
+ });
42
+ }
43
+ const portToUse = port || 0;
44
+ const maxPort = Math.min(portToUse + 10, ports_1.MAX_PORT_NUMBER);
45
+ return new Promise(resolve => {
46
+ tryListen(portToUse, maxPort, exclude, (_, resolvedPort) => {
47
+ resolve(resolvedPort);
48
+ });
49
+ });
50
+ }
51
+ exports.detectPort = detectPort;
52
+ function tryListen(port, maxPort, exclude, callback) {
53
+ const shouldGiveUp = port >= maxPort;
54
+ const nextPort = shouldGiveUp ? 0 : port + 1;
55
+ const nextMaxPort = shouldGiveUp ? 0 : maxPort;
56
+ listen(port, undefined, (err, realPort) => {
57
+ // ignore random listening
58
+ if (port === 0) {
59
+ return callback(err, realPort);
60
+ }
61
+ if (exclude.includes(port)) {
62
+ return tryListen(nextPort, nextMaxPort, exclude, callback);
63
+ }
64
+ if (err) {
65
+ return tryListen(nextPort, nextMaxPort, exclude, callback);
66
+ }
67
+ // 2. check 0.0.0.0
68
+ listen(port, '0.0.0.0', err => {
69
+ if (err) {
70
+ return tryListen(nextPort, nextMaxPort, exclude, callback);
71
+ }
72
+ // 3. check localhost
73
+ listen(port, 'localhost', err => {
74
+ if (err && err.code !== 'EADDRNOTAVAIL') {
75
+ return tryListen(nextPort, nextMaxPort, exclude, callback);
76
+ }
77
+ // 4. check current ip
78
+ listen(port, (0, address_1.ip)(), (err, realPort) => {
79
+ if (err) {
80
+ return tryListen(nextPort, nextMaxPort, exclude, callback);
81
+ }
82
+ callback(null, realPort);
83
+ });
84
+ });
85
+ });
86
+ });
87
+ }
88
+ function listen(port, hostname, callback) {
89
+ const server = new net_1.default.Server();
90
+ server.on('error', (err) => {
91
+ server.close();
92
+ if (err.code === 'ENOTFOUND') {
93
+ return callback(null, port);
94
+ }
95
+ return callback(err, 0);
96
+ });
97
+ server.listen(port, hostname, () => {
98
+ const addressInfo = server.address();
99
+ server.close();
100
+ return callback(null, addressInfo.port);
101
+ });
102
+ }
package/utils/lang.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- type LanguageObject = {
2
- [key: string]: LanguageObject | string;
3
- };
1
+ import { LanguageObject, LangKey } from '../types/Lang';
4
2
  type InterpolationData = {
5
3
  [identifier: string]: string | number;
6
4
  };
7
5
  export declare function interpolate(stringValue: string, interpolationData: InterpolationData): string;
8
- export declare function i18n(lookupDotNotation: string, options?: {
6
+ export declare function i18n(lookupDotNotation: LangKey, options?: {
9
7
  [identifier: string]: string | number;
10
8
  }): string;
11
9
  export declare const setLangData: (newLocale: string, newLangObj: LanguageObject) => void;
package/utils/lang.js CHANGED
@@ -1,32 +1,31 @@
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
6
  exports.setLangData = exports.i18n = exports.interpolate = void 0;
4
- const path_1 = require("path");
5
- const fs_extra_1 = require("fs-extra");
6
- const js_yaml_1 = require("js-yaml");
7
+ const en_json_1 = __importDefault(require("../lang/en.json"));
8
+ const LANGUAGES = {
9
+ en: en_json_1.default,
10
+ };
7
11
  const MISSING_LANGUAGE_DATA_PREFIX = '[Missing language data]';
8
- let locale = '';
9
12
  let languageObj;
10
- function loadLanguageFromYaml() {
13
+ function loadLanguageForLocale() {
11
14
  if (languageObj)
12
15
  return;
13
16
  try {
14
17
  const nodeLocale = Intl.DateTimeFormat()
15
18
  .resolvedOptions()
16
19
  .locale.split('-')[0];
17
- const languageFilePath = (0, path_1.join)(__dirname, `../lang/${nodeLocale}.lyaml`);
18
- const languageFileExists = (0, fs_extra_1.existsSync)(languageFilePath);
19
- // Fall back to using the default language file
20
- locale = languageFileExists ? nodeLocale : 'en';
21
- languageObj = (0, js_yaml_1.load)((0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, `../lang/${locale}.lyaml`), 'utf8'));
20
+ languageObj = LANGUAGES[nodeLocale] || LANGUAGES.en;
22
21
  }
23
22
  catch (e) {
24
23
  throw new Error(`Error loading language data: ${e}`);
25
24
  }
26
25
  }
27
26
  function getTextValue(lookupDotNotation) {
28
- const lookupProps = [locale, ...lookupDotNotation.split('.')];
29
- const missingTextData = `${MISSING_LANGUAGE_DATA_PREFIX}: ${lookupProps.join('.')}`;
27
+ const lookupProps = lookupDotNotation.split('.');
28
+ const missingTextData = `${MISSING_LANGUAGE_DATA_PREFIX}: ${lookupDotNotation}`;
30
29
  let textValue = languageObj;
31
30
  let previouslyCheckedProp = lookupProps[0];
32
31
  lookupProps.forEach(prop => {
@@ -73,7 +72,7 @@ function interpolate(stringValue, interpolationData) {
73
72
  exports.interpolate = interpolate;
74
73
  function i18n(lookupDotNotation, options = {}) {
75
74
  if (!languageObj) {
76
- loadLanguageFromYaml();
75
+ loadLanguageForLocale();
77
76
  }
78
77
  if (typeof lookupDotNotation !== 'string') {
79
78
  throw new Error(`i18n must be passed a string value for lookupDotNotation, received ${typeof lookupDotNotation}`);
@@ -84,7 +83,6 @@ function i18n(lookupDotNotation, options = {}) {
84
83
  }
85
84
  exports.i18n = i18n;
86
85
  const setLangData = (newLocale, newLangObj) => {
87
- locale = newLocale;
88
86
  languageObj = newLangObj;
89
87
  };
90
88
  exports.setLangData = setLangData;
package/utils/logger.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { LogCallbacks } from '../types/LogCallbacks';
2
- export declare function log<T extends string>(key: T, callbacks?: LogCallbacks<T>, debugKey?: string, debugInterpolation?: {
2
+ import { LangKey } from '../types/Lang';
3
+ export declare function log<T extends string>(key: T, callbacks?: LogCallbacks<T>, debugKey?: LangKey, debugInterpolation?: {
3
4
  [key: string]: string | number;
4
5
  }): void;
5
- export declare function makeTypedLogger<T extends readonly string[]>(callbacks?: LogCallbacks<T[number]>, debugKey?: string): (key: T[number], debugInterpolation?: {
6
+ export declare function makeTypedLogger<T extends readonly string[]>(callbacks?: LogCallbacks<T[number]>): (key: T[number], debugKey?: LangKey, debugInterpolation?: {
6
7
  [key: string]: string | number;
7
8
  } | undefined) => void;
8
- export declare function debug(identifier: string, interpolation?: {
9
+ export declare function debug(identifier: LangKey, interpolation?: {
9
10
  [key: string]: string | number;
10
11
  }): void;
package/utils/logger.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.debug = exports.makeTypedLogger = exports.log = void 0;
4
4
  const lang_1 = require("./lang");
5
+ const logger_1 = require("../lib/logging/logger");
5
6
  function log(key, callbacks, debugKey, debugInterpolation) {
6
7
  if (callbacks && callbacks[key]) {
7
8
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -12,11 +13,11 @@ function log(key, callbacks, debugKey, debugInterpolation) {
12
13
  }
13
14
  }
14
15
  exports.log = log;
15
- function makeTypedLogger(callbacks, debugKey) {
16
- return (key, debugInterpolation) => log(key, callbacks, `${debugKey}.${key}`, debugInterpolation);
16
+ function makeTypedLogger(callbacks) {
17
+ return (key, debugKey, debugInterpolation) => log(key, callbacks, debugKey, debugInterpolation);
17
18
  }
18
19
  exports.makeTypedLogger = makeTypedLogger;
19
20
  function debug(identifier, interpolation) {
20
- console.debug((0, lang_1.i18n)(`debug.${identifier}`, interpolation));
21
+ logger_1.logger.debug((0, lang_1.i18n)(identifier, interpolation));
21
22
  }
22
23
  exports.debug = debug;
package/utils/notify.js CHANGED
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const moment_1 = __importDefault(require("moment"));
9
9
  const debounce_1 = __importDefault(require("debounce"));
10
10
  const standardErrors_1 = require("../errors/standardErrors");
11
+ const i18nKey = 'utils.notify';
11
12
  const notifyQueue = [];
12
13
  const notifyPromises = [];
13
14
  const debouncedWaitForActionsToCompleteAndWriteQueueToFile = (0, debounce_1.default)(waitForActionsToCompleteAndWriteQueueToFile, 500);
@@ -36,7 +37,7 @@ function notifyFilePath(filePathToNotify, outputToWrite) {
36
37
  fs_1.default.appendFileSync(filePathToNotify, outputToWrite);
37
38
  }
38
39
  catch (e) {
39
- (0, standardErrors_1.throwErrorWithMessage)('utils.notify.filePath', { filePath: filePathToNotify }, e);
40
+ (0, standardErrors_1.throwErrorWithMessage)(`${i18nKey}.errors.filePath`, { filePath: filePathToNotify }, e);
40
41
  }
41
42
  }
42
43
  }
@@ -1,4 +1,4 @@
1
- export declare function isObject(value: object): boolean;
1
+ export declare function isObject(item: any): any;
2
2
  export declare function mergeDeep(target: {
3
3
  [key: string]: any;
4
4
  }, ...sources: Array<{
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mergeDeep = exports.isObject = void 0;
4
- function isObject(value) {
5
- const type = typeof value;
6
- return value != null && (type === 'object' || type === 'function');
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ function isObject(item) {
6
+ return item && typeof item === 'object' && !Array.isArray(item);
7
7
  }
8
8
  exports.isObject = isObject;
9
9
  function mergeDeep(
package/lang/en.lyaml DELETED
@@ -1,247 +0,0 @@
1
- en:
2
- debug:
3
- archive:
4
- extractZip:
5
- init: "Extracting project source..."
6
- success: "Completed project source extraction."
7
- copySourceToDest:
8
- init: "Copying project source..."
9
- sourceEmpty: "Project source is empty"
10
- success: "Completed copying project source."
11
- error: "An error occured copying project source to {{ dest }}."
12
- cleanupTempDir:
13
- error: "Failed to clean up temp dir: {{ tmpDir }}"
14
- github:
15
- fetchJsonFromRepository: "Fetching {{ url }}..."
16
- downloadGithubRepoZip:
17
- fetching: "Fetching {{ releaseType }} with name {{ repoName }}..."
18
- fetchingName: "Fetching {{ name }}..."
19
- completed: "Completed project fetch."
20
- cloneGithubRepo:
21
- success: "Your new {{ type }} has been created in {{ dest }}"
22
- downloadGithubRepoContents:
23
- downloading: "Downloading content piece: {{ contentPiecePath }} from {{ downloadUrl }} to {{ downloadPath }}"
24
- git:
25
- securityIssue: "Security Issue Detected"
26
- configFileTracked: "The HubSpot config file can be tracked by git."
27
- fileName: 'File: "{{ configPath }}"'
28
- remediate: "To remediate:"
29
- moveConfig: "- Move the config file to your home directory: '{{ homeDir }}'"
30
- addGitignore: "- Add gitignore pattern '{{ configPath }}' to a .gitignore file in root of your repository."
31
- noRemote: "- Ensure that the config file has not already been pushed to a remote repository."
32
- checkFailed: "Unable to determine if config file is properly ignored by git."
33
- modules:
34
- createModule:
35
- creatingModule: "Creating module at {{ path }}"
36
- creatingPath: "Creating {{ path }}"
37
- oauth:
38
- writeTokenInfo: "Updating Oauth2 token info for portalId: {{ portalId }}"
39
- addOauthToAccountConfig:
40
- init: "Updating configuration"
41
- success: "Configuration updated"
42
- filemapper:
43
- skippedExisting: "Skipped existing {{ filepath }}"
44
- wroteFolder: "Wrote folder {{ filepath }}"
45
- completedFetch: 'Completed fetch of file "{{ src }}"{{ version }} to "{{ dest }}" from the Design Manager'
46
- folderFetch: 'Fetched "{{ src }}" from account {{ accountId }} from the Design Manager successfully'
47
- completedFolderFetch: 'Completed fetch of folder "{{ src }}"{{ version }} to "{{ dest }}" from the Design Manager'
48
- watch:
49
- notifyOfThemePreview: "To preview this theme, visit: {{ previewUrl }}"
50
- skipUnsupportedExtension: "Skipping {{ file }} due to unsupported extension"
51
- skipIgnoreRule: "Skipping {{ file }} due to an ignore rule"
52
- uploadAttempt: 'Attempting to upload file "{{ file }}" to "{{ dest }}"'
53
- uploadSuccess: "Uploaded file {{ file }} to {{ dest }}"
54
- uploadFailed: "Uploading file {{ file }} to {{ dest }} failed"
55
- uploadRetry: 'Retrying to upload file "{{ file }}" to "{{ dest }}"'
56
- deleteAttempt: "Attempting to delete file {{ remoteFilePath }}"
57
- deleteAttemptWithType: "Attempting to delete {{ type }} {{ remoteFilePath }}"
58
- deleteSuccess: "Deleted file {{ remoteFilePath }}"
59
- deleteSuccessWithType: "Deleted {{ type }} {{ remoteFilePath }}"
60
- deleteFailed: "Deleting file {{ remoteFilePath }} failed"
61
- folderUploadSuccess: "Completed uploading files in {{ src }} to {{ dest }} in {{ accountId }}"
62
- ready: "Watcher is ready and watching {{ src }}. Any changes detected will be automatically uploaded and overwrite the current version in the developer file system."
63
- config:
64
- cliConfiguration:
65
- load:
66
- configFromEnv: "Loaded config from environment variables for {{ accountId }}"
67
- configFromFile: "Loaded config from configuration file."
68
- empty: "The config file was empty. Initializing an empty config."
69
- validate:
70
- noConfig: "Valiation failed: No config was found."
71
- noConfigAccounts: "Valiation failed: config.accounts[] is not defined."
72
- emptyAccountConfig: "Valiation failed: config.accounts[] has an empty entry."
73
- noAccountId: "Valiation failed: config.accounts[] has an entry missing accountId."
74
- duplicateAccountIds: "Valiation failed: config.accounts[] has multiple entries with {{ accountId }}."
75
- duplicateAccountNames: "Valiation failed: config.accounts[] has multiple entries with {{ accountName }}."
76
- nameContainsSpaces: "Valiation failed: config.name {{ accountName }} cannot contain spaces."
77
- updateAccount:
78
- noConfigToUpdate: "No config to update."
79
- updating: "Updating account config for {{ accountId }}"
80
- addingConfigEntry: "Adding account config entry for {{ accountId }}"
81
- removeAccountFromConfig: "Deleting config for {{ accountId }}"
82
- configFile:
83
- errorReading: "Config file could not be read: {{ configPath }}"
84
- writeSuccess: "Successfully wrote updated config data to {{ configPath }}"
85
- errorLoading: "A configuration file could not be found at {{ configPath }}."
86
- configUtils:
87
- unknownType: "Unknown auth type {{ type }}"
88
- environment:
89
- loadConfig:
90
- missingAccountId: "Unable to load config from environment variables: Missing accountId"
91
- missingEnv: "Unable to load config from environment variables: Missing env"
92
- unknownAuthType: "Unable to load config from environment variables: Unknown auth type"
93
- cms:
94
- functions:
95
- updateExistingConfig:
96
- unableToReadFile: "The file {{ configFilePath }} could not be read"
97
- invalidJSON: "The file {{ configFilePath }} is not valid JSON"
98
- couldNotUpdateFile: "The file {{ configFilePath }} could not be updated"
99
- createFunction:
100
- destPathAlreadyExists: "The {{ path }} path already exists"
101
- createdDest: "Created {{ path }}"
102
- failedToCreateFile: "The file {{ configFilePath }} could not be created"
103
- createdFunctionFile: "Created {{ path }}"
104
- createdConfigFile: "Created {{ path }}"
105
- success: "A function for the endpoint '/_hcms/api/{{ endpointPath }}' has been created. Upload {{ folderName }} to try it out"
106
- handleFieldsJs:
107
- convertFieldsJs:
108
- creating: "Creating child process with pid {{ pid }}"
109
- terminating: "Child process with pid {{ pid }} has been terminated"
110
- uploadFolder:
111
- attempt: 'Attempting to upload file "{{ file }}" to "{{ destPath }}"'
112
- success: 'Uploaded file "{{ file}}" to "{{ destPath }}"'
113
- failed: 'Uploading file "{{ file }}" to "{{ destPath }}" failed so scheduled retry'
114
- retry: 'Retrying to upload file "{{ file }}" to "{{ destPath }}"'
115
- retryFailed: 'Uploading file "{{ file }}" to "{{ destPath }}" failed'
116
- models:
117
- OAuth2Manager:
118
- fetchingAccessToken: "Fetching access token for accountId {{ accountId }} for clientId {{ clientId }}"
119
- updatingTokenInfo: "Persisting updated tokenInfo for accountId {{ accountId }} for clientId {{ clientId }}"
120
- refreshingAccessToken: "Waiting for access token for accountId {{ accountId }} for clientId {{ clientId }} to be fetched"
121
- http:
122
- index:
123
- createGetRequestStream:
124
- onWrite: "Wrote file {{ filepath }}"
125
- api:
126
- filemapper:
127
- trackUsage:
128
- invalidEvent: "Usage tracking event {{ eventName }} is not a valid event type."
129
- sendingEventAuthenticated: "Sending usage event to authenticated endpoint"
130
- sendingEventUnauthenticated: "Sending usage event to unauthenticated endpoint"
131
- templates:
132
- debug:
133
- creatingPath: "Making {{ path }} if needed"
134
- logging:
135
- creatingFile: "Creating file at {{ path }}"
136
- processFieldsJs:
137
- converting: 'Converting "{{ src }}" to "{{ dest }}".'
138
- converted: 'Finished converting "{{ src }}" to "{{ dest }}".'
139
- errors:
140
- hubdb:
141
- invalidJsonPath: "The HubDB table file must be a '.json' file"
142
- invalidJsonFile: "The '{{{ src }}' path is not a path to a file"
143
- archive:
144
- extractZip:
145
- write: "An error occured writing temp project source."
146
- extract: "An error occured extracting project source."
147
- errorTypes:
148
- fileSystem:
149
- readAction: "reading from"
150
- writeAction: "writing to"
151
- otherAction: "accessing"
152
- unknownFilepath: "a file or folder"
153
- baseMessage: "An error occurred while {{ fileAction }} {{ filepath }}."
154
- systemErrorMessage: "This is the result of a system error: {{ errorMessage }}"
155
- api:
156
- messageDetail: "{{ request }} in account {{ accountId }}"
157
- unableToUpload: 'Unable to upload "{{ payload }}.'
158
- codes:
159
- 400: "The {{ messageDetail }} was bad."
160
- 401: "The {{ messageDetail }} was unauthorized."
161
- 403MissingScope: "Couldn't run the project command because there are scopes missing in your production account. To update scopes, deactivate your current personal access key for {{ accountId }}, and generate a new one. Then run `hs auth` to update the CLI with the new key."
162
- 403Gating: "The current target account {{ accountId }} does not have access to HubSpot projects. To opt in to the CRM Development Beta and use projects, visit https://app.hubspot.com/l/whats-new/betas?productUpdateId=13860216."
163
- 403: "The {{ messageDetail }} was forbidden."
164
- 404Request: 'The {{ action }} failed because "{{ request }}" was not found in account {{ accountId }}.'
165
- 404: "The {{ messageDetail }} was not found."
166
- 429: "The {{ messageDetail }} surpassed the rate limit. Retry in one minute."
167
- 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."
168
- 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."
169
- 400generic: "The {{ messageDetail }} failed due to a client error."
170
- generic: "The {{ messageDetail }} failed."
171
- cmsFields:
172
- syntax: 'There was an error converting JS file "{{ path }}"'
173
- 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.'
174
- notReturnArray: 'There was an error loading JS file "{{ path }}". Expected type "Array" but received type "{{ returned }}" . Make sure that your function returns an array'
175
- invalidPath: 'The path "{{ path }}" is not a path to a file or folder'
176
- generic: "A {{ name }} has occurred"
177
- filemapper:
178
- invalidNode: "Invalid FileMapperNode: {{ json }}"
179
- invalidFileType: "Invalid file type requested: {{ srcPath }}"
180
- assetTimeout: "HubSpot assets are unavailable at the moment. Please wait a few minutes and try again."
181
- failedToFetchFile: 'Failed fetch of file "{{ src }}" to "{{ dest }}" from the Design Manager'
182
- failedToFetchFolder: 'Failed fetch of folder "{{ src }}" to "{{ dest }}" from the Design Manager'
183
- invalidFetchFolderRequest: 'Invalid request for folder: "{{ src }}"'
184
- incompleteFetch: 'Not all files in folder "{{ src }}" were successfully fetched. Re-run the last command to try again'
185
- github:
186
- downloadGithubRepoContents: "Failed to fetch contents: {{ errorMessage }}"
187
- fetchJsonFromRepository: "An error occured fetching JSON file."
188
- fetchReleaseData: "Failed fetching release data for {{ tag }} project."
189
- downloadGithubRepoZip: "An error occurred fetching the project source."
190
- modules:
191
- throwInvalidPathInput: "Expected Path Input"
192
- writeModuleMeta: "The {{ path }} path already exists"
193
- personalAccessKey:
194
- accountNotFound: "Account with id {{ accountId }} does not exist."
195
- invalidPersonalAccessKey: "Error while retrieving new access token: {{ errorMessage }}"
196
- templates:
197
- fileAnnotations: "Error reading file annotations {{ file }}"
198
- pathExists: "The {{ path }} path already exists"
199
- utils:
200
- git:
201
- configIgnore: "Unable to determine if config file is properly ignored by git."
202
- notify:
203
- filePath: "Unable to notify file '{{ filePath }}'"
204
- config:
205
- cliConfiguration:
206
- noConfigLoaded: "No config loaded."
207
- updateAccount: "An accountId is required to update the config"
208
- updateDefaultAccount: "A 'defaultAccount' with value of number or string is required to update the config."
209
- renameAccount: "Cannot find account with identifier {{ currentName }}"
210
- removeAccountFromConfig: "Unable to find account for {{ nameOrId }}."
211
- updateDefaultMode: "The mode {{ defaultMode }} is invalid. Valid values are {{ validModes }}."
212
- updateHttpTimeout: "The value {{ timeout }} is invalid. The value must be a number greater than {{ minTimeout }}."
213
- updateAllowUsageTracking: "Unable to update allowUsageTracking. The value {{ isEnabled }} is invalid. The value must be a boolean."
214
- configFile:
215
- parsing: "Config file could not be parsed"
216
- models:
217
- OAuth2Manager:
218
- missingRefreshToken: "The account {{ accountId }} has not been authenticated with Oauth2"
219
- auth: "Error while retrieving new token: {{ token }}"
220
- http:
221
- index:
222
- withOauth: "Oauth manager for account {{ accountId }} not found."
223
- withAuth: "Account with id {{ accountId }} not found."
224
- cms:
225
- handleFieldsJs:
226
- convertFieldsJs: "There was an error converting '{{ filePath }}'"
227
- saveOutput: "There was an error saving the json output of {{ path }}"
228
- createTmpDirSync: "An error occured writing temporary project source."
229
- cleanupTmpDirSync: "There was an error deleting the temporary project source"
230
- functions:
231
- updateExistingConfig:
232
- configIsNotObjectError: "The existing {{ configFilePath }} is not an object"
233
- endpointAreadyExistsError: "The endpoint {{ endpointPath }} already exists in {{ configFilePath }}"
234
- createFunction:
235
- nestedConfigError: "Cannot create a functions directory inside '{{ ancestorConfigPath }}'"
236
- jsFileConflictError: "The JavaScript file at '{{ functionFilePath }}'' already exists"
237
- sandboxes:
238
- createSandbox: "There was an error creating your sandbox."
239
- deleteSandbox: "There was an error deleting your sandbox."
240
- getSandboxUsageLimits: "There was an error fetching sandbox usage limits."
241
- initiateSync: "There was an error initiating the sandbox sync."
242
- fetchTaskStatus: "There was an error fetching the task status while syncing sandboxes."
243
- fetchTypes: "There was an error fetching sandbox types."
244
- processFieldsJs:
245
- fieldsJsNotReturnArray: 'There was an error loading JS file "{{ path }}". Expected type "Array". Make sure that your function returns an array'
246
- fieldsJsNotFunction: 'There was an error loading JS file "{{ path }}". Expected type "Function". Make sure that your default export is a function.'
247
- invalidMjsFile: ".mjs files are only supported when using Node 13.2.0+"