zephyr-agent 0.0.42 → 0.0.43

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 (81) hide show
  1. package/dist/lib/auth/login.js +1 -0
  2. package/dist/lib/auth/login.js.map +1 -1
  3. package/dist/lib/build-context/find-nearest-package-json.js +7 -8
  4. package/dist/lib/build-context/find-nearest-package-json.js.map +1 -1
  5. package/dist/lib/build-context/fs-cache-for-package-json.d.ts +1 -1
  6. package/dist/lib/build-context/git-provider-utils.d.ts +11 -0
  7. package/dist/lib/build-context/git-provider-utils.js +66 -0
  8. package/dist/lib/build-context/git-provider-utils.js.map +1 -0
  9. package/dist/lib/build-context/ze-util-get-git-info.d.ts +1 -1
  10. package/dist/lib/build-context/ze-util-get-git-info.js +14 -14
  11. package/dist/lib/build-context/ze-util-get-git-info.js.map +1 -1
  12. package/dist/lib/build-context/ze-util-read-package-json.d.ts +1 -1
  13. package/dist/lib/build-context/ze-util-read-package-json.js +6 -8
  14. package/dist/lib/build-context/ze-util-read-package-json.js.map +1 -1
  15. package/dist/lib/deployment/cloudflare.strategy.d.ts +1 -1
  16. package/dist/lib/deployment/fastly.strategy.d.ts +1 -1
  17. package/dist/lib/deployment/get-upload-strategy.d.ts +1 -1
  18. package/dist/lib/deployment/get-upload-strategy.js +8 -2
  19. package/dist/lib/deployment/get-upload-strategy.js.map +1 -1
  20. package/dist/lib/deployment/netlify.strategy.d.ts +1 -1
  21. package/dist/lib/deployment/upload-base/upload-assets.d.ts +2 -2
  22. package/dist/lib/deployment/upload-base/upload-build-stats-and-enable-envs.d.ts +2 -2
  23. package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js +4 -1
  24. package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js.map +1 -1
  25. package/dist/lib/edge-actions/ze-upload-assets.d.ts +1 -1
  26. package/dist/lib/edge-actions/ze-upload-snapshot.d.ts +1 -1
  27. package/dist/lib/edge-hash-list/distributed-hash-control.d.ts +1 -1
  28. package/dist/lib/edge-hash-list/get-missing-assets.d.ts +1 -1
  29. package/dist/lib/edge-requests/get-application-configuration.d.ts +1 -1
  30. package/dist/lib/errors/codes.d.ts +1 -1
  31. package/dist/lib/errors/codes.js +5 -1
  32. package/dist/lib/errors/codes.js.map +1 -1
  33. package/dist/lib/errors/zephyr-error.d.ts +2 -2
  34. package/dist/lib/errors/zephyr-error.js +1 -1
  35. package/dist/lib/errors/zephyr-error.js.map +1 -1
  36. package/dist/lib/http/fetch-with-retries.d.ts +1 -1
  37. package/dist/lib/http/fetch-with-retries.js +30 -20
  38. package/dist/lib/http/fetch-with-retries.js.map +1 -1
  39. package/dist/lib/http/upload-envs.d.ts +2 -2
  40. package/dist/lib/http/upload-file.d.ts +1 -1
  41. package/dist/lib/http/upload-snapshot.d.ts +1 -1
  42. package/dist/lib/http/ze-http-request.js +5 -13
  43. package/dist/lib/http/ze-http-request.js.map +1 -1
  44. package/dist/lib/logging/debug.d.ts +0 -17
  45. package/dist/lib/logging/debug.js +1 -26
  46. package/dist/lib/logging/debug.js.map +1 -1
  47. package/dist/lib/logging/ze-log-event.d.ts +1 -1
  48. package/dist/lib/logging/ze-log-event.js +7 -4
  49. package/dist/lib/logging/ze-log-event.js.map +1 -1
  50. package/dist/lib/node-persist/partial-assets-map.d.ts +1 -1
  51. package/dist/lib/transformers/ze-build-assets-map.d.ts +1 -1
  52. package/dist/lib/transformers/ze-build-assets.d.ts +1 -1
  53. package/dist/lib/transformers/ze-build-dash-data.d.ts +2 -2
  54. package/dist/lib/transformers/ze-build-snapshot.d.ts +2 -2
  55. package/dist/lib/transformers/ze-build-snapshot.js +4 -1
  56. package/dist/lib/transformers/ze-build-snapshot.js.map +1 -1
  57. package/dist/package.json +1 -1
  58. package/dist/zephyr-engine/index.d.ts +11 -10
  59. package/dist/zephyr-engine/index.js +31 -22
  60. package/dist/zephyr-engine/index.js.map +1 -1
  61. package/dist/zephyr-engine/resolve_remote_dependency.js +1 -1
  62. package/dist/zephyr-engine/resolve_remote_dependency.js.map +1 -1
  63. package/package.json +2 -2
  64. package/dist/lib/errors/configuration-error.d.ts +0 -3
  65. package/dist/lib/errors/configuration-error.js +0 -18
  66. package/dist/lib/errors/configuration-error.js.map +0 -1
  67. package/dist/lib/errors/package-json-not-found-error.d.ts +0 -4
  68. package/dist/lib/errors/package-json-not-found-error.js +0 -11
  69. package/dist/lib/errors/package-json-not-found-error.js.map +0 -1
  70. package/dist/lib/errors/package-json-not-valid-error.d.ts +0 -4
  71. package/dist/lib/errors/package-json-not-valid-error.js +0 -11
  72. package/dist/lib/errors/package-json-not-valid-error.js.map +0 -1
  73. package/dist/lib/errors/package-not-a-json-error.d.ts +0 -4
  74. package/dist/lib/errors/package-not-a-json-error.js +0 -11
  75. package/dist/lib/errors/package-not-a-json-error.js.map +0 -1
  76. package/dist/lib/logging/error-codes-messages.d.ts +0 -206
  77. package/dist/lib/logging/error-codes-messages.js +0 -203
  78. package/dist/lib/logging/error-codes-messages.js.map +0 -1
  79. package/dist/lib/logging/error-formatted-message.d.ts +0 -5
  80. package/dist/lib/logging/error-formatted-message.js +0 -36
  81. package/dist/lib/logging/error-formatted-message.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zephyr-agent",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Zephyr plugin agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  "socket.io-client": "^4.7.5",
39
39
  "tslib": "^2.8.1",
40
40
  "uuid": "^8.3.2",
41
- "zephyr-edge-contract": "0.0.42"
41
+ "zephyr-edge-contract": "0.0.43"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@jest/globals": "^29.7.0",
@@ -1,3 +0,0 @@
1
- export declare class ConfigurationError extends Error {
2
- constructor(code: string, message: string, level?: 'normal' | 'critical');
3
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConfigurationError = void 0;
4
- const debug_1 = require("../logging/debug");
5
- class ConfigurationError extends Error {
6
- // link to wherever documentation is
7
- // docs usually locate at this address
8
- constructor(code, message, level) {
9
- super(`${debug_1.brightRedBgName} ${level === 'critical' ? `Critical error` : `Error`} [${code}]: ${message} \n ${code ? `See documentation on how to debug this error: https://docs.zephyr-cloud.io/errors/${code.toLowerCase()}` : ''}`);
10
- this.name = 'ConfigurationError';
11
- // looks weird right? but vite build logger prints only stack trace,
12
- // so this is how we ended up with this.
13
- this._stack = this.stack;
14
- this.stack = this.message;
15
- }
16
- }
17
- exports.ConfigurationError = ConfigurationError;
18
- //# sourceMappingURL=configuration-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration-error.js","sourceRoot":"","sources":["../../../src/lib/errors/configuration-error.ts"],"names":[],"mappings":";;;AAAA,4CAAmD;AAEnD,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,qCAAqC;IACrC,sCAAsC;IACtC,YAAY,IAAY,EAAE,OAAe,EAAE,KAA6B;QACtE,KAAK,CACH,GAAG,uBAAe,IAAI,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,MAAM,OAAO,OAAO,IAAI,CAAC,CAAC,CAAC,qFAAqF,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC5N,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,oEAAoE;QACpE,wCAAwC;QACvC,IAA4B,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;IAC5B,CAAC;CACF;AAbD,gDAaC"}
@@ -1,4 +0,0 @@
1
- import { ConfigurationError } from './configuration-error';
2
- export declare class PackageJsonNotFoundError extends ConfigurationError {
3
- constructor(context: string | undefined);
4
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageJsonNotFoundError = void 0;
4
- const configuration_error_1 = require("./configuration-error");
5
- class PackageJsonNotFoundError extends configuration_error_1.ConfigurationError {
6
- constructor(context) {
7
- super(`ZE10010`, `package.json not found from '${context}'`);
8
- }
9
- }
10
- exports.PackageJsonNotFoundError = PackageJsonNotFoundError;
11
- //# sourceMappingURL=package-json-not-found-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-json-not-found-error.js","sourceRoot":"","sources":["../../../src/lib/errors/package-json-not-found-error.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAE3D,MAAa,wBAAyB,SAAQ,wCAAkB;IAC9D,YAAY,OAA2B;QACrC,KAAK,CAAC,SAAS,EAAE,gCAAgC,OAAO,GAAG,CAAC,CAAC;IAC/D,CAAC;CACF;AAJD,4DAIC"}
@@ -1,4 +0,0 @@
1
- import { ConfigurationError } from './configuration-error';
2
- export declare class PackageJsonNotValidError extends ConfigurationError {
3
- constructor(path: string | undefined);
4
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageJsonNotValidError = void 0;
4
- const configuration_error_1 = require("./configuration-error");
5
- class PackageJsonNotValidError extends configuration_error_1.ConfigurationError {
6
- constructor(path) {
7
- super(`ZE10013`, `package json in ('${path}') must have a 'name' and a 'version' properties`);
8
- }
9
- }
10
- exports.PackageJsonNotValidError = PackageJsonNotValidError;
11
- //# sourceMappingURL=package-json-not-valid-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-json-not-valid-error.js","sourceRoot":"","sources":["../../../src/lib/errors/package-json-not-valid-error.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAE3D,MAAa,wBAAyB,SAAQ,wCAAkB;IAC9D,YAAY,IAAwB;QAClC,KAAK,CACH,SAAS,EACT,qBAAqB,IAAI,kDAAkD,CAC5E,CAAC;IACJ,CAAC;CACF;AAPD,4DAOC"}
@@ -1,4 +0,0 @@
1
- import { ConfigurationError } from './configuration-error';
2
- export declare class PackageNotAJsonError extends ConfigurationError {
3
- constructor(path: string | undefined);
4
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageNotAJsonError = void 0;
4
- const configuration_error_1 = require("./configuration-error");
5
- class PackageNotAJsonError extends configuration_error_1.ConfigurationError {
6
- constructor(path) {
7
- super(`ZE10011`, `package.json '${path}' is in valid json format.`);
8
- }
9
- }
10
- exports.PackageNotAJsonError = PackageNotAJsonError;
11
- //# sourceMappingURL=package-not-a-json-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-not-a-json-error.js","sourceRoot":"","sources":["../../../src/lib/errors/package-not-a-json-error.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAE3D,MAAa,oBAAqB,SAAQ,wCAAkB;IAC1D,YAAY,IAAwB;QAClC,KAAK,CAAC,SAAS,EAAE,iBAAiB,IAAI,4BAA4B,CAAC,CAAC;IACtE,CAAC;CACF;AAJD,oDAIC"}
@@ -1,206 +0,0 @@
1
- /** Categories for all error codes. */
2
- export declare const ErrorCategories: {
3
- readonly unknown: "00";
4
- readonly build: "10";
5
- readonly deploy: "20";
6
- readonly browser: "30";
7
- };
8
- /** @deprecated */
9
- export declare const Errors: {
10
- readonly ERR_UNKNOWN: {
11
- readonly id: "000";
12
- readonly message: "Unknown error. Tell us about it in Discord https://zephyr-cloud.io/discord if you see this error";
13
- readonly kind: "unknown";
14
- };
15
- /** Package.json not found error */
16
- readonly ERR_PACKAGE_JSON_NOT_FOUND: {
17
- readonly id: "010";
18
- readonly message: "Package.json not found";
19
- readonly kind: "build";
20
- };
21
- /** Package.json is not in a valid json format */
22
- readonly ERR_PACKAGE_JSON_NOT_VALID: {
23
- readonly id: "011";
24
- readonly message: "Package.json is not in a valid json format.";
25
- readonly kind: "build";
26
- };
27
- /** Webpack config error */
28
- readonly ERR_WEBPACK_CONFIG: {
29
- readonly id: "012";
30
- readonly message: "Webpack config error.";
31
- readonly kind: "build";
32
- };
33
- /** Package.json must have a name and version field. */
34
- readonly ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION: {
35
- readonly id: "013";
36
- readonly message: "Package.json must have a name and version field.";
37
- readonly kind: "build";
38
- };
39
- /** Git remote origin is not configured properly. */
40
- readonly ERR_GIT_REMOTE_ORIGIN: {
41
- readonly id: "014";
42
- readonly message: "Git remote origin is not configured properly.";
43
- readonly kind: "build";
44
- };
45
- /** Git username or email is not configured. */
46
- readonly ERR_NO_GIT_USERNAME_EMAIL: {
47
- readonly id: "015";
48
- readonly message: "Git username or email is not configured.";
49
- readonly kind: "build";
50
- };
51
- /** Could not get git info */
52
- readonly ERR_NO_GIT_INFO: {
53
- readonly id: "016";
54
- readonly message: "Could not get git info.";
55
- readonly kind: "build";
56
- };
57
- /** Build error application_uid missing. */
58
- readonly ERR_MISSING_APPLICATION_UID: {
59
- readonly id: "017";
60
- readonly message: "`application_uid` missing.";
61
- readonly kind: "build";
62
- };
63
- /** Auth error */
64
- readonly ERR_AUTH_ERROR: {
65
- readonly id: "018";
66
- readonly message: "Auth error.";
67
- readonly kind: "build";
68
- };
69
- /** Could not get build id. */
70
- readonly ERR_GET_BUILD_ID: {
71
- readonly id: "019";
72
- readonly message: "Could not get build id.";
73
- readonly kind: "build";
74
- };
75
- /** Could not initialize Zephyr Agent. */
76
- readonly ERR_INITIALIZE_ZEPHYR_AGENT: {
77
- readonly id: "020";
78
- readonly message: "Could not initialize Zephyr Agent.";
79
- readonly kind: "build";
80
- };
81
- /** Cloudflare specific error */
82
- readonly ERR_UNABLE_CREATE_DIST_FOLDER: {
83
- readonly id: "021";
84
- readonly message: "Error creating dist folder.";
85
- readonly kind: "build";
86
- };
87
- /** Deployment error, assets not found */
88
- readonly ERR_ASSETS_NOT_FOUND: {
89
- readonly id: "010";
90
- readonly message: "Assets not found.";
91
- readonly kind: "deploy";
92
- };
93
- /** Assets not found in snapshot */
94
- readonly ERR_ASSETS_NOT_FOUND_IN_SNAPSHOT: {
95
- readonly id: "011";
96
- readonly message: "Assets not found in snapshot.";
97
- readonly kind: "deploy";
98
- };
99
- /** Application_uid missing */
100
- readonly ERR_DEPLOY_MISSING_APPLICATION_UID: {
101
- readonly id: "012";
102
- readonly message: "`application_uid` is required.";
103
- readonly kind: "deploy";
104
- };
105
- readonly ERR_MISSING_FILE_HASH: {
106
- readonly id: "013";
107
- readonly message: "Missing file hash.";
108
- readonly kind: "deploy";
109
- };
110
- /** Failed to load application configuration. */
111
- readonly ERR_LOAD_APP_CONFIG: {
112
- readonly id: "014";
113
- readonly message: "Failed to load application configuration.";
114
- readonly kind: "deploy";
115
- };
116
- /** Failed to upload build stats. */
117
- readonly ERR_FAILED_UPLOAD_BUILD_STATS: {
118
- readonly id: "015";
119
- readonly message: "Failed to upload build stats.";
120
- readonly kind: "deploy";
121
- };
122
- /** Did not receive envs from build stats upload */
123
- readonly ERR_NOT_RECEIVE_ENVS_FROM_BUILD_STATS: {
124
- readonly id: "016";
125
- readonly message: "Did not receive envs from build stats upload.";
126
- readonly kind: "deploy";
127
- };
128
- /** Failed to upload assets. */
129
- readonly ERR_FAILED_UPLOAD_ASSETS: {
130
- readonly id: "017";
131
- readonly message: "Failed to upload assets.";
132
- readonly kind: "deploy";
133
- };
134
- /** Failed to upload snapshots. */
135
- readonly ERR_FAILED_UPLOAD_SNAPSHOTS: {
136
- readonly id: "018";
137
- readonly message: "Failed to upload snapshots.";
138
- readonly kind: "deploy";
139
- };
140
- /** Snapshot uploads gave no results. */
141
- readonly ERR_SNAPSHOT_UPLOADS_NO_RESULTS: {
142
- readonly id: "019";
143
- readonly message: "Snapshot uploads gave no results.";
144
- readonly kind: "deploy";
145
- };
146
- /** Failed to get application hash list */
147
- readonly ERR_GET_APPLICATION_HASH_LIST: {
148
- readonly id: "020";
149
- readonly message: "Failed to get application hash list.";
150
- readonly kind: "deploy";
151
- };
152
- /** Could not resolve ${name} with verson ${version} */
153
- readonly ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION: {
154
- readonly id: "021";
155
- readonly message: "Could not resolve application name with version.";
156
- readonly kind: "deploy";
157
- };
158
- readonly ERR_SNAPSHOT_ID_NOT_FOUND: {
159
- readonly id: "022";
160
- readonly message: "`snapshot_id` not found.";
161
- readonly kind: "deploy";
162
- };
163
- readonly ERR_SNAPSHOT_NOT_FOUND: {
164
- readonly id: "023";
165
- readonly message: "Snapshot not found.";
166
- readonly kind: "deploy";
167
- };
168
- readonly ERR_DEPLOY_LOCAL_BUILD: {
169
- readonly id: "024";
170
- readonly message: "Failed to deploy local build.";
171
- readonly kind: "deploy";
172
- };
173
- /** Cloudflare specific error */
174
- readonly ERR_WRANGLER_DEPENDENCY: {
175
- readonly id: "025";
176
- readonly message: "Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.";
177
- readonly kind: "deploy";
178
- };
179
- readonly ERR_CONVERT_GRAPH_TO_DASHBOARD: {
180
- readonly id: "026";
181
- readonly message: "Failed to convert graph to dashboard data.";
182
- readonly kind: "browser";
183
- };
184
- readonly ERR_UPLOAD_TO_CLOUDFLARE_PAGES: {
185
- readonly id: "027";
186
- readonly message: "Error upload to cloudflare pages.";
187
- readonly kind: "deploy";
188
- };
189
- readonly ERR_NO_WRANGLER: {
190
- readonly id: "028";
191
- readonly message: "Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.";
192
- readonly kind: "build";
193
- };
194
- readonly ERR_CREATE_DIST_FOLDER: {
195
- readonly id: "029";
196
- readonly message: "Error creating dist folder.";
197
- readonly kind: "build";
198
- };
199
- };
200
- export type ZeErrors = {
201
- [K in keyof Errors]: ZeError<Categories[Errors[K]['kind']], Errors[K]['id']>;
202
- }[keyof Errors];
203
- type Errors = typeof Errors;
204
- type Categories = typeof ErrorCategories;
205
- type ZeError<Category extends string, Code extends string> = `ZE${Category}${Code}`;
206
- export {};
@@ -1,203 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Errors = exports.ErrorCategories = void 0;
4
- /** Categories for all error codes. */
5
- exports.ErrorCategories = {
6
- unknown: '00',
7
- build: '10',
8
- deploy: '20',
9
- browser: '30',
10
- };
11
- /** @deprecated */
12
- exports.Errors = {
13
- ERR_UNKNOWN: {
14
- id: '000',
15
- message: 'Unknown error. Tell us about it in Discord https://zephyr-cloud.io/discord if you see this error',
16
- kind: 'unknown',
17
- },
18
- /** Package.json not found error */
19
- ERR_PACKAGE_JSON_NOT_FOUND: {
20
- id: '010',
21
- message: 'Package.json not found',
22
- kind: 'build',
23
- },
24
- /** Package.json is not in a valid json format */
25
- ERR_PACKAGE_JSON_NOT_VALID: {
26
- id: '011',
27
- message: 'Package.json is not in a valid json format.',
28
- kind: 'build',
29
- },
30
- /** Webpack config error */
31
- ERR_WEBPACK_CONFIG: {
32
- id: '012',
33
- message: 'Webpack config error.',
34
- kind: 'build',
35
- }, // TODO: we don't detect this error yet, will we be able to separate them?
36
- /** Package.json must have a name and version field. */
37
- ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION: {
38
- id: '013',
39
- message: 'Package.json must have a name and version field.',
40
- kind: 'build',
41
- },
42
- /** Git remote origin is not configured properly. */
43
- ERR_GIT_REMOTE_ORIGIN: {
44
- id: '014',
45
- message: 'Git remote origin is not configured properly.',
46
- kind: 'build',
47
- },
48
- /** Git username or email is not configured. */
49
- ERR_NO_GIT_USERNAME_EMAIL: {
50
- id: '015',
51
- message: 'Git username or email is not configured.',
52
- kind: 'build',
53
- },
54
- /** Could not get git info */
55
- ERR_NO_GIT_INFO: {
56
- id: '016',
57
- message: 'Could not get git info.',
58
- kind: 'build',
59
- },
60
- /** Build error application_uid missing. */
61
- ERR_MISSING_APPLICATION_UID: {
62
- id: '017',
63
- message: '`application_uid` missing.',
64
- kind: 'build',
65
- },
66
- /** Auth error */
67
- ERR_AUTH_ERROR: {
68
- id: '018',
69
- message: 'Auth error.',
70
- kind: 'build',
71
- },
72
- /** Could not get build id. */
73
- ERR_GET_BUILD_ID: {
74
- id: '019',
75
- message: 'Could not get build id.',
76
- kind: 'build',
77
- },
78
- /** Could not initialize Zephyr Agent. */
79
- ERR_INITIALIZE_ZEPHYR_AGENT: {
80
- id: '020',
81
- message: 'Could not initialize Zephyr Agent.',
82
- kind: 'build',
83
- },
84
- /** Cloudflare specific error */
85
- ERR_UNABLE_CREATE_DIST_FOLDER: {
86
- id: '021',
87
- message: 'Error creating dist folder.',
88
- kind: 'build',
89
- },
90
- /** Deployment error, assets not found */
91
- ERR_ASSETS_NOT_FOUND: {
92
- id: '010',
93
- message: 'Assets not found.',
94
- kind: 'deploy',
95
- },
96
- /** Assets not found in snapshot */
97
- ERR_ASSETS_NOT_FOUND_IN_SNAPSHOT: {
98
- id: '011',
99
- message: 'Assets not found in snapshot.',
100
- kind: 'deploy',
101
- },
102
- /** Application_uid missing */
103
- ERR_DEPLOY_MISSING_APPLICATION_UID: {
104
- id: '012',
105
- message: '`application_uid` is required.',
106
- kind: 'deploy',
107
- },
108
- ERR_MISSING_FILE_HASH: {
109
- id: '013',
110
- message: 'Missing file hash.',
111
- kind: 'deploy',
112
- },
113
- /** Failed to load application configuration. */
114
- ERR_LOAD_APP_CONFIG: {
115
- id: '014',
116
- message: 'Failed to load application configuration.',
117
- kind: 'deploy',
118
- },
119
- /** Failed to upload build stats. */
120
- ERR_FAILED_UPLOAD_BUILD_STATS: {
121
- id: '015',
122
- message: 'Failed to upload build stats.',
123
- kind: 'deploy',
124
- },
125
- /** Did not receive envs from build stats upload */
126
- ERR_NOT_RECEIVE_ENVS_FROM_BUILD_STATS: {
127
- id: '016',
128
- message: 'Did not receive envs from build stats upload.',
129
- kind: 'deploy',
130
- },
131
- /** Failed to upload assets. */
132
- ERR_FAILED_UPLOAD_ASSETS: {
133
- id: '017',
134
- message: 'Failed to upload assets.',
135
- kind: 'deploy',
136
- },
137
- /** Failed to upload snapshots. */
138
- ERR_FAILED_UPLOAD_SNAPSHOTS: {
139
- id: '018',
140
- message: 'Failed to upload snapshots.',
141
- kind: 'deploy',
142
- },
143
- /** Snapshot uploads gave no results. */
144
- ERR_SNAPSHOT_UPLOADS_NO_RESULTS: {
145
- id: '019',
146
- message: 'Snapshot uploads gave no results.',
147
- kind: 'deploy',
148
- },
149
- /** Failed to get application hash list */
150
- ERR_GET_APPLICATION_HASH_LIST: {
151
- id: '020',
152
- message: 'Failed to get application hash list.',
153
- kind: 'deploy',
154
- },
155
- /** Could not resolve ${name} with verson ${version} */
156
- ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION: {
157
- id: '021',
158
- message: 'Could not resolve application name with version.',
159
- kind: 'deploy',
160
- },
161
- ERR_SNAPSHOT_ID_NOT_FOUND: {
162
- id: '022',
163
- message: '`snapshot_id` not found.',
164
- kind: 'deploy',
165
- },
166
- ERR_SNAPSHOT_NOT_FOUND: {
167
- id: '023',
168
- message: 'Snapshot not found.',
169
- kind: 'deploy',
170
- },
171
- ERR_DEPLOY_LOCAL_BUILD: {
172
- id: '024',
173
- message: 'Failed to deploy local build.',
174
- kind: 'deploy',
175
- },
176
- /** Cloudflare specific error */
177
- ERR_WRANGLER_DEPENDENCY: {
178
- id: '025',
179
- message: 'Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.',
180
- kind: 'deploy',
181
- },
182
- ERR_CONVERT_GRAPH_TO_DASHBOARD: {
183
- id: '026',
184
- message: 'Failed to convert graph to dashboard data.',
185
- kind: 'browser',
186
- },
187
- ERR_UPLOAD_TO_CLOUDFLARE_PAGES: {
188
- id: '027',
189
- message: 'Error upload to cloudflare pages.',
190
- kind: 'deploy',
191
- },
192
- ERR_NO_WRANGLER: {
193
- id: '028',
194
- message: 'Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.',
195
- kind: 'build',
196
- },
197
- ERR_CREATE_DIST_FOLDER: {
198
- id: '029',
199
- message: 'Error creating dist folder.',
200
- kind: 'build',
201
- },
202
- };
203
- //# sourceMappingURL=error-codes-messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-codes-messages.js","sourceRoot":"","sources":["../../../src/lib/logging/error-codes-messages.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACzB,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;CAGd,CAAC;AAEF,kBAAkB;AACL,QAAA,MAAM,GAAG;IACpB,WAAW,EAAE;QACX,EAAE,EAAE,KAAK;QACT,OAAO,EACL,kGAAkG;QACpG,IAAI,EAAE,SAAS;KAChB;IACD,mCAAmC;IACnC,0BAA0B,EAAE;QAC1B,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,wBAAwB;QACjC,IAAI,EAAE,OAAO;KACd;IACD,iDAAiD;IACjD,0BAA0B,EAAE;QAC1B,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,6CAA6C;QACtD,IAAI,EAAE,OAAO;KACd;IACD,2BAA2B;IAC3B,kBAAkB,EAAE;QAClB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,OAAO;KACd,EAAE,0EAA0E;IAC7E,uDAAuD;IACvD,uCAAuC,EAAE;QACvC,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,kDAAkD;QAC3D,IAAI,EAAE,OAAO;KACd;IACD,oDAAoD;IACpD,qBAAqB,EAAE;QACrB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,+CAA+C;QACxD,IAAI,EAAE,OAAO;KACd;IACD,+CAA+C;IAC/C,yBAAyB,EAAE;QACzB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,0CAA0C;QACnD,IAAI,EAAE,OAAO;KACd;IACD,6BAA6B;IAC7B,eAAe,EAAE;QACf,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,yBAAyB;QAClC,IAAI,EAAE,OAAO;KACd;IACD,2CAA2C;IAC3C,2BA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mCAAmC;QAC5C,IAAI,EAAE,QAAQ;KACf;IACD,eAAe,EAAE;QACf,EAAE,EAAE,KAAK;QACT,OAAO,EACL,kHAAkH;QACpH,IAAI,EAAE,OAAO;KACd;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE,OAAO;KACd;CAOF,CAAC"}
@@ -1,5 +0,0 @@
1
- import { Errors } from './error-codes-messages';
2
- export declare const docsPrefix = "https://docs.zephyr-cloud.io/errors";
3
- export declare function errCode<K extends keyof typeof Errors>(err: K): `ZE${string}${string}`;
4
- export declare function errMsg<K extends keyof typeof Errors>(err: K): "Unknown error. Tell us about it in Discord https://zephyr-cloud.io/discord if you see this error" | "Package.json not found" | "Package.json is not in a valid json format." | "Webpack config error." | "Package.json must have a name and version field." | "Git remote origin is not configured properly." | "Git username or email is not configured." | "Could not get git info." | "`application_uid` missing." | "Auth error." | "Could not get build id." | "Could not initialize Zephyr Agent." | "Error creating dist folder." | "Assets not found." | "Assets not found in snapshot." | "`application_uid` is required." | "Missing file hash." | "Failed to load application configuration." | "Failed to upload build stats." | "Did not receive envs from build stats upload." | "Failed to upload assets." | "Failed to upload snapshots." | "Snapshot uploads gave no results." | "Failed to get application hash list." | "Could not resolve application name with version." | "`snapshot_id` not found." | "Snapshot not found." | "Failed to deploy local build." | "Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag." | "Failed to convert graph to dashboard data." | "Error upload to cloudflare pages.";
5
- export declare function err<K extends keyof typeof Errors>(err: K): string;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.docsPrefix = void 0;
4
- exports.errCode = errCode;
5
- exports.errMsg = errMsg;
6
- exports.err = err;
7
- // ! If anyone is adding new errors to this file please make sure the description and debugging for users are sync with documentation's error page
8
- const picocolor_1 = require("./picocolor");
9
- const error_codes_messages_1 = require("./error-codes-messages");
10
- exports.docsPrefix = 'https://docs.zephyr-cloud.io/errors';
11
- function errCode(err) {
12
- const id = error_codes_messages_1.Errors[err].id;
13
- const prefix = error_codes_messages_1.ErrorCategories[error_codes_messages_1.Errors[err].kind];
14
- // we have less categories and more errors, so make sense to be ZEPPIII
15
- // where ZE is a constant, PP is the category, and I is the error id
16
- const paddedId = id.toString().padStart(3, '0');
17
- const paddedPrefix = prefix.toString().padStart(2, '0');
18
- return `ZE${paddedPrefix}${paddedId}`;
19
- }
20
- function errMsg(err) {
21
- return error_codes_messages_1.Errors[err].message;
22
- }
23
- function err(err) {
24
- const id = error_codes_messages_1.Errors[err].id;
25
- const prefix = error_codes_messages_1.ErrorCategories[error_codes_messages_1.Errors[err].kind];
26
- // we have less categories and more errors, so make sense to be ZEPPIII
27
- // where ZE is a constant, PP is the category, and I is the error id
28
- const paddedId = id.toString().padStart(3, '0');
29
- const paddedPrefix = prefix.toString().padStart(2, '0');
30
- const errorCode = `ZE${paddedPrefix}${paddedId}`;
31
- const errorMsg = error_codes_messages_1.Errors[err].message;
32
- const errorDoc = `See potential workaround and how to debug this error in our documentation ${exports.docsPrefix}/${errorCode.toLowerCase()}`;
33
- const fullMsg = (0, picocolor_1.redBright)(`Error code: ${errorCode}. ${errorMsg} \n ${errorDoc}`);
34
- return fullMsg;
35
- }
36
- //# sourceMappingURL=error-formatted-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-formatted-message.js","sourceRoot":"","sources":["../../../src/lib/logging/error-formatted-message.ts"],"names":[],"mappings":";;;AAMA,0BAaC;AAED,wBAEC;AAED,kBAkBC;AA3CD,kJAAkJ;AAClJ,2CAAwC;AACxC,iEAAiE;AAEpD,QAAA,UAAU,GAAG,qCAAqC,CAAC;AAEhE,SAAgB,OAAO,CAAgC,GAAM;IAC3D,MAAM,EAAE,GAAG,6BAAM,CAAC,GAAG,CAAC,CAAC,EAA8B,CAAC;IACtD,MAAM,MAAM,GAAG,sCAAe,CAC5B,6BAAM,CAAC,GAAG,CAAC,CAAC,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