zephyr-agent 0.0.42 → 0.0.44

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 (85) 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-package-json.type.d.ts +6 -0
  10. package/dist/lib/build-context/ze-util-get-git-info.d.ts +1 -1
  11. package/dist/lib/build-context/ze-util-get-git-info.js +14 -14
  12. package/dist/lib/build-context/ze-util-get-git-info.js.map +1 -1
  13. package/dist/lib/build-context/ze-util-parse-ze-dependencies.d.ts +22 -0
  14. package/dist/lib/build-context/ze-util-parse-ze-dependencies.js +44 -0
  15. package/dist/lib/build-context/ze-util-parse-ze-dependencies.js.map +1 -0
  16. package/dist/lib/build-context/ze-util-read-package-json.d.ts +13 -1
  17. package/dist/lib/build-context/ze-util-read-package-json.js +94 -26
  18. package/dist/lib/build-context/ze-util-read-package-json.js.map +1 -1
  19. package/dist/lib/deployment/cloudflare.strategy.d.ts +1 -1
  20. package/dist/lib/deployment/fastly.strategy.d.ts +1 -1
  21. package/dist/lib/deployment/get-upload-strategy.d.ts +1 -1
  22. package/dist/lib/deployment/get-upload-strategy.js +8 -2
  23. package/dist/lib/deployment/get-upload-strategy.js.map +1 -1
  24. package/dist/lib/deployment/netlify.strategy.d.ts +1 -1
  25. package/dist/lib/deployment/upload-base/upload-assets.d.ts +2 -2
  26. package/dist/lib/deployment/upload-base/upload-build-stats-and-enable-envs.d.ts +2 -2
  27. package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js +4 -1
  28. package/dist/lib/edge-actions/ze-enable-snapshot-on-pages.js.map +1 -1
  29. package/dist/lib/edge-actions/ze-upload-assets.d.ts +1 -1
  30. package/dist/lib/edge-actions/ze-upload-snapshot.d.ts +1 -1
  31. package/dist/lib/edge-hash-list/distributed-hash-control.d.ts +1 -1
  32. package/dist/lib/edge-hash-list/get-missing-assets.d.ts +1 -1
  33. package/dist/lib/edge-requests/get-application-configuration.d.ts +1 -1
  34. package/dist/lib/errors/codes.d.ts +1 -1
  35. package/dist/lib/errors/codes.js +5 -1
  36. package/dist/lib/errors/codes.js.map +1 -1
  37. package/dist/lib/errors/zephyr-error.d.ts +2 -2
  38. package/dist/lib/errors/zephyr-error.js +1 -1
  39. package/dist/lib/errors/zephyr-error.js.map +1 -1
  40. package/dist/lib/http/fetch-with-retries.d.ts +1 -1
  41. package/dist/lib/http/fetch-with-retries.js +30 -20
  42. package/dist/lib/http/fetch-with-retries.js.map +1 -1
  43. package/dist/lib/http/upload-envs.d.ts +2 -2
  44. package/dist/lib/http/upload-file.d.ts +1 -1
  45. package/dist/lib/http/upload-snapshot.d.ts +1 -1
  46. package/dist/lib/http/ze-http-request.js +5 -13
  47. package/dist/lib/http/ze-http-request.js.map +1 -1
  48. package/dist/lib/logging/debug.d.ts +0 -17
  49. package/dist/lib/logging/debug.js +1 -26
  50. package/dist/lib/logging/debug.js.map +1 -1
  51. package/dist/lib/logging/ze-log-event.d.ts +1 -1
  52. package/dist/lib/logging/ze-log-event.js +7 -4
  53. package/dist/lib/logging/ze-log-event.js.map +1 -1
  54. package/dist/lib/node-persist/partial-assets-map.d.ts +1 -1
  55. package/dist/lib/transformers/ze-build-assets-map.d.ts +1 -1
  56. package/dist/lib/transformers/ze-build-assets.d.ts +1 -1
  57. package/dist/lib/transformers/ze-build-dash-data.d.ts +2 -2
  58. package/dist/lib/transformers/ze-build-snapshot.d.ts +2 -2
  59. package/dist/lib/transformers/ze-build-snapshot.js +4 -1
  60. package/dist/lib/transformers/ze-build-snapshot.js.map +1 -1
  61. package/dist/package.json +1 -1
  62. package/dist/zephyr-engine/index.d.ts +12 -11
  63. package/dist/zephyr-engine/index.js +42 -28
  64. package/dist/zephyr-engine/index.js.map +1 -1
  65. package/dist/zephyr-engine/resolve_remote_dependency.js +1 -1
  66. package/dist/zephyr-engine/resolve_remote_dependency.js.map +1 -1
  67. package/package.json +2 -2
  68. package/dist/lib/errors/configuration-error.d.ts +0 -3
  69. package/dist/lib/errors/configuration-error.js +0 -18
  70. package/dist/lib/errors/configuration-error.js.map +0 -1
  71. package/dist/lib/errors/package-json-not-found-error.d.ts +0 -4
  72. package/dist/lib/errors/package-json-not-found-error.js +0 -11
  73. package/dist/lib/errors/package-json-not-found-error.js.map +0 -1
  74. package/dist/lib/errors/package-json-not-valid-error.d.ts +0 -4
  75. package/dist/lib/errors/package-json-not-valid-error.js +0 -11
  76. package/dist/lib/errors/package-json-not-valid-error.js.map +0 -1
  77. package/dist/lib/errors/package-not-a-json-error.d.ts +0 -4
  78. package/dist/lib/errors/package-not-a-json-error.js +0 -11
  79. package/dist/lib/errors/package-not-a-json-error.js.map +0 -1
  80. package/dist/lib/logging/error-codes-messages.d.ts +0 -206
  81. package/dist/lib/logging/error-codes-messages.js +0 -203
  82. package/dist/lib/logging/error-codes-messages.js.map +0 -1
  83. package/dist/lib/logging/error-formatted-message.d.ts +0 -5
  84. package/dist/lib/logging/error-formatted-message.js +0 -36
  85. package/dist/lib/logging/error-formatted-message.js.map +0 -1
@@ -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,kBA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-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,IAAI,CACuC,CAAC;IAE1D,uEAAuE;IACvE,oEAAoE;IAEpE,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAExD,OAAO,KAAK,YAAY,GAAG,QAA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