zephyr-edge-contract 0.0.15 → 0.0.17
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/dist/index.d.ts +18 -19
- package/dist/index.js +22 -22
- package/dist/index.js.map +1 -1
- package/dist/lib/api-contract-negotiation/get-api-contract.js +1 -1
- package/dist/lib/api-contract-negotiation/get-api-contract.js.map +1 -1
- package/dist/lib/edge-api/publish-request.d.ts +6 -7
- package/dist/lib/node-persist/application-configuration.d.ts +1 -23
- package/dist/lib/node-persist/application-configuration.js.map +1 -1
- package/dist/lib/node-persist/secret-token.d.ts +2 -1
- package/dist/lib/node-persist/secret-token.js +6 -5
- package/dist/lib/node-persist/secret-token.js.map +1 -1
- package/dist/lib/node-persist/token.js +1 -1
- package/dist/lib/node-persist/token.js.map +1 -1
- package/dist/lib/node-persist/upload-provider-options.d.ts +12 -10
- package/dist/lib/node-persist/upload-provider-options.js.map +1 -1
- package/dist/lib/plugin-options/zephyr-plugin-options.d.ts +3 -3
- package/dist/lib/utils/create-snapshot-id.d.ts +1 -1
- package/dist/lib/utils/debug.d.ts +13 -4
- package/dist/lib/utils/debug.js +15 -4
- package/dist/lib/utils/debug.js.map +1 -1
- package/dist/lib/utils/error-codes-messages.d.ts +216 -0
- package/dist/lib/utils/error-codes-messages.js +213 -0
- package/dist/lib/utils/error-codes-messages.js.map +1 -0
- package/dist/lib/utils/error-formatted-message.d.ts +5 -0
- package/dist/lib/utils/error-formatted-message.js +36 -0
- package/dist/lib/utils/error-formatted-message.js.map +1 -0
- package/dist/lib/utils/ze-http-request.js +5 -10
- package/dist/lib/utils/ze-http-request.js.map +1 -1
- package/dist/lib/zephyr-build-stats.d.ts +44 -2
- package/dist/lib/zephyr-build-stats.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/utils/error-types.d.ts +0 -27
- package/dist/lib/utils/error-types.js +0 -69
- package/dist/lib/utils/error-types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { ZeAppVersion, ZeAppVersionResponse } from './lib/ze-api/app-version';
|
|
4
|
-
export { ZeApplicationList } from './lib/ze-api/app-list';
|
|
5
|
-
export { Snapshot, SnapshotAsset, SnapshotMetadata } from './lib/snapshot';
|
|
1
|
+
export { ZEPHYR_API_ENDPOINT, ZE_API_ENDPOINT, ze_api_gateway } from './lib/api-contract-negotiation/get-api-contract';
|
|
2
|
+
export { PublishRequest, StageZeroPublishRequest } from './lib/edge-api/publish-request';
|
|
6
3
|
export { ZeEnvs, ZeUploadBuildStats } from './lib/edge-api/ze-envs-request';
|
|
7
|
-
export * from './lib/
|
|
8
|
-
export
|
|
4
|
+
export * as appDeployResultCache from './lib/node-persist/app-deploy-result-cache';
|
|
5
|
+
export { getAppConfig, remoteAppConfig, saveAppConfig } from './lib/node-persist/application-configuration';
|
|
9
6
|
export * as _fs_cache from './lib/node-persist/fs-cache';
|
|
10
|
-
export
|
|
11
|
-
export * from './lib/utils/picocolor';
|
|
7
|
+
export * as _hash_cache from './lib/node-persist/hash-cache';
|
|
12
8
|
export { getPartialAssetMap, removePartialAssetMap, savePartialAssetMap } from './lib/node-persist/partial-assets-map';
|
|
13
|
-
export { getSecretToken } from './lib/node-persist/secret-token';
|
|
14
|
-
export {
|
|
9
|
+
export { getSecretToken, hasSecretToken } from './lib/node-persist/secret-token';
|
|
10
|
+
export { cleanTokens, getToken, removeToken, saveToken } from './lib/node-persist/token';
|
|
11
|
+
export * from './lib/node-persist/upload-provider-options';
|
|
15
12
|
export { ZephyrPluginOptions } from './lib/plugin-options/zephyr-plugin-options';
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
13
|
+
export { Snapshot, SnapshotAsset, SnapshotMetadata } from './lib/snapshot';
|
|
14
|
+
export { createApplicationUID } from './lib/utils/create-application-u-i-d';
|
|
15
|
+
export { createSnapshotId } from './lib/utils/create-snapshot-id';
|
|
16
|
+
export { brightBlueBgName, brightGreenBgName, brightRedBgName, brightYellowBgName, dimmedName, ze_error, ze_log } from './lib/utils/debug';
|
|
18
17
|
export * from './lib/utils/debug-enabled';
|
|
19
|
-
export
|
|
18
|
+
export * from './lib/utils/picocolor';
|
|
19
|
+
export * as color from './lib/utils/picocolor';
|
|
20
20
|
export { safe_json_parse } from './lib/utils/safe-json-parse';
|
|
21
21
|
export { request } from './lib/utils/ze-http-request';
|
|
22
|
-
export
|
|
23
|
-
export {
|
|
22
|
+
export { ZeApplicationList } from './lib/ze-api/app-list';
|
|
23
|
+
export { ZeAppVersion, ZeAppVersionResponse } from './lib/ze-api/app-version';
|
|
24
24
|
export { ConvertedGraph } from './lib/ze-api/converted-graph';
|
|
25
|
-
export
|
|
26
|
-
export * as appDeployResultCache from './lib/node-persist/app-deploy-result-cache';
|
|
25
|
+
export { LocalPackageJson } from './lib/ze-api/local-package-json';
|
|
27
26
|
export { ZephyrBuildStats } from './lib/zephyr-build-stats';
|
|
28
|
-
export {
|
|
27
|
+
export { Asset, SnapshotUploadRes, Source, UploadableAsset, ZeBuildAsset, ZeBuildAssetsMap, ZeUploadAssetsOptions, } from './lib/zephyr-edge-contract';
|
package/dist/index.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.request = exports.safe_json_parse = exports.color = exports.ze_log = exports.ze_error = exports.dimmedName = exports.brightYellowBgName = exports.brightRedBgName = exports.brightGreenBgName = exports.brightBlueBgName = exports.createSnapshotId = exports.createApplicationUID = exports.saveToken = exports.removeToken = exports.getToken = exports.cleanTokens = exports.hasSecretToken = exports.getSecretToken = exports.savePartialAssetMap = exports.removePartialAssetMap = exports.getPartialAssetMap = exports._hash_cache = exports._fs_cache = exports.saveAppConfig = exports.remoteAppConfig = exports.getAppConfig = exports.appDeployResultCache = exports.ze_api_gateway = exports.ZE_API_ENDPOINT = exports.ZEPHYR_API_ENDPOINT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "
|
|
9
|
-
tslib_1.
|
|
10
|
-
exports._hash_cache = tslib_1.__importStar(require("./lib/node-persist/hash-cache"));
|
|
11
|
-
exports._fs_cache = tslib_1.__importStar(require("./lib/node-persist/fs-cache"));
|
|
5
|
+
var get_api_contract_1 = require("./lib/api-contract-negotiation/get-api-contract");
|
|
6
|
+
Object.defineProperty(exports, "ZEPHYR_API_ENDPOINT", { enumerable: true, get: function () { return get_api_contract_1.ZEPHYR_API_ENDPOINT; } });
|
|
7
|
+
Object.defineProperty(exports, "ZE_API_ENDPOINT", { enumerable: true, get: function () { return get_api_contract_1.ZE_API_ENDPOINT; } });
|
|
8
|
+
Object.defineProperty(exports, "ze_api_gateway", { enumerable: true, get: function () { return get_api_contract_1.ze_api_gateway; } });
|
|
9
|
+
exports.appDeployResultCache = tslib_1.__importStar(require("./lib/node-persist/app-deploy-result-cache"));
|
|
12
10
|
var application_configuration_1 = require("./lib/node-persist/application-configuration");
|
|
13
11
|
Object.defineProperty(exports, "getAppConfig", { enumerable: true, get: function () { return application_configuration_1.getAppConfig; } });
|
|
14
12
|
Object.defineProperty(exports, "remoteAppConfig", { enumerable: true, get: function () { return application_configuration_1.remoteAppConfig; } });
|
|
15
13
|
Object.defineProperty(exports, "saveAppConfig", { enumerable: true, get: function () { return application_configuration_1.saveAppConfig; } });
|
|
16
|
-
tslib_1.
|
|
14
|
+
exports._fs_cache = tslib_1.__importStar(require("./lib/node-persist/fs-cache"));
|
|
15
|
+
exports._hash_cache = tslib_1.__importStar(require("./lib/node-persist/hash-cache"));
|
|
17
16
|
var partial_assets_map_1 = require("./lib/node-persist/partial-assets-map");
|
|
18
17
|
Object.defineProperty(exports, "getPartialAssetMap", { enumerable: true, get: function () { return partial_assets_map_1.getPartialAssetMap; } });
|
|
19
18
|
Object.defineProperty(exports, "removePartialAssetMap", { enumerable: true, get: function () { return partial_assets_map_1.removePartialAssetMap; } });
|
|
20
19
|
Object.defineProperty(exports, "savePartialAssetMap", { enumerable: true, get: function () { return partial_assets_map_1.savePartialAssetMap; } });
|
|
21
20
|
var secret_token_1 = require("./lib/node-persist/secret-token");
|
|
22
21
|
Object.defineProperty(exports, "getSecretToken", { enumerable: true, get: function () { return secret_token_1.getSecretToken; } });
|
|
22
|
+
Object.defineProperty(exports, "hasSecretToken", { enumerable: true, get: function () { return secret_token_1.hasSecretToken; } });
|
|
23
23
|
var token_1 = require("./lib/node-persist/token");
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "cleanTokens", { enumerable: true, get: function () { return token_1.cleanTokens; } });
|
|
25
25
|
Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return token_1.getToken; } });
|
|
26
26
|
Object.defineProperty(exports, "removeToken", { enumerable: true, get: function () { return token_1.removeToken; } });
|
|
27
|
-
Object.defineProperty(exports, "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "
|
|
31
|
-
|
|
32
|
-
exports
|
|
33
|
-
tslib_1.__exportStar(require("./lib/utils/debug-enabled"), exports);
|
|
27
|
+
Object.defineProperty(exports, "saveToken", { enumerable: true, get: function () { return token_1.saveToken; } });
|
|
28
|
+
tslib_1.__exportStar(require("./lib/node-persist/upload-provider-options"), exports);
|
|
29
|
+
var create_application_u_i_d_1 = require("./lib/utils/create-application-u-i-d");
|
|
30
|
+
Object.defineProperty(exports, "createApplicationUID", { enumerable: true, get: function () { return create_application_u_i_d_1.createApplicationUID; } });
|
|
31
|
+
var create_snapshot_id_1 = require("./lib/utils/create-snapshot-id");
|
|
32
|
+
Object.defineProperty(exports, "createSnapshotId", { enumerable: true, get: function () { return create_snapshot_id_1.createSnapshotId; } });
|
|
34
33
|
var debug_1 = require("./lib/utils/debug");
|
|
35
|
-
Object.defineProperty(exports, "ze_log", { enumerable: true, get: function () { return debug_1.ze_log; } });
|
|
36
|
-
Object.defineProperty(exports, "ze_error", { enumerable: true, get: function () { return debug_1.ze_error; } });
|
|
37
34
|
Object.defineProperty(exports, "brightBlueBgName", { enumerable: true, get: function () { return debug_1.brightBlueBgName; } });
|
|
35
|
+
Object.defineProperty(exports, "brightGreenBgName", { enumerable: true, get: function () { return debug_1.brightGreenBgName; } });
|
|
38
36
|
Object.defineProperty(exports, "brightRedBgName", { enumerable: true, get: function () { return debug_1.brightRedBgName; } });
|
|
39
37
|
Object.defineProperty(exports, "brightYellowBgName", { enumerable: true, get: function () { return debug_1.brightYellowBgName; } });
|
|
40
38
|
Object.defineProperty(exports, "dimmedName", { enumerable: true, get: function () { return debug_1.dimmedName; } });
|
|
39
|
+
Object.defineProperty(exports, "ze_error", { enumerable: true, get: function () { return debug_1.ze_error; } });
|
|
40
|
+
Object.defineProperty(exports, "ze_log", { enumerable: true, get: function () { return debug_1.ze_log; } });
|
|
41
|
+
tslib_1.__exportStar(require("./lib/utils/debug-enabled"), exports);
|
|
42
|
+
tslib_1.__exportStar(require("./lib/utils/picocolor"), exports);
|
|
43
|
+
exports.color = tslib_1.__importStar(require("./lib/utils/picocolor"));
|
|
41
44
|
var safe_json_parse_1 = require("./lib/utils/safe-json-parse");
|
|
42
45
|
Object.defineProperty(exports, "safe_json_parse", { enumerable: true, get: function () { return safe_json_parse_1.safe_json_parse; } });
|
|
43
46
|
var ze_http_request_1 = require("./lib/utils/ze-http-request");
|
|
44
47
|
Object.defineProperty(exports, "request", { enumerable: true, get: function () { return ze_http_request_1.request; } });
|
|
45
|
-
exports.colors = tslib_1.__importStar(require("./lib/utils/picocolor"));
|
|
46
|
-
tslib_1.__exportStar(require("./lib/node-persist/upload-provider-options"), exports);
|
|
47
|
-
exports.appDeployResultCache = tslib_1.__importStar(require("./lib/node-persist/app-deploy-result-cache"));
|
|
48
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oFAAuH;AAA9G,uHAAA,mBAAmB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAAE,kHAAA,cAAc,OAAA;AAG7D,2GAAmF;AACnF,0FAA4G;AAAnG,yHAAA,YAAY,OAAA;AAAE,4HAAA,eAAe,OAAA;AAAE,0HAAA,aAAa,OAAA;AACrD,iFAAyD;AACzD,qFAA6D;AAC7D,4EAAuH;AAA9G,wHAAA,kBAAkB,OAAA;AAAE,2HAAA,qBAAqB,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AACvE,gEAAiF;AAAxE,8GAAA,cAAc,OAAA;AAAE,8GAAA,cAAc,OAAA;AACvC,kDAAyF;AAAhF,oGAAA,WAAW,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,kGAAA,SAAS,OAAA;AACtD,qFAA2D;AAG3D,iFAA4E;AAAnE,gIAAA,oBAAoB,OAAA;AAC7B,qEAAkE;AAAzD,sHAAA,gBAAgB,OAAA;AACzB,2CAA2I;AAAlI,yGAAA,gBAAgB,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAAE,wGAAA,eAAe,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAAE,mGAAA,UAAU,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAAE,+FAAA,MAAM,OAAA;AAC/G,oEAA0C;AAC1C,gEAAsC;AACtC,uEAA+C;AAC/C,+DAA8D;AAArD,kHAAA,eAAe,OAAA;AACxB,+DAAsD;AAA7C,0GAAA,OAAO,OAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ze_api_gateway = exports.ZE_API_ENDPOINT = exports.ZEPHYR_API_ENDPOINT = void 0;
|
|
4
4
|
const ZEPHYR_API_ENDPOINT = () => { var _a; return (_a = process.env['ZE_API']) !== null && _a !== void 0 ? _a : 'https://api.zephyr-cloud.io'; };
|
|
5
5
|
exports.ZEPHYR_API_ENDPOINT = ZEPHYR_API_ENDPOINT;
|
|
6
|
-
const ZE_API_ENDPOINT = () => { var _a; return (_a = process.env['ZE_API_GATE']) !== null && _a !== void 0 ? _a : 'https://zeapi.
|
|
6
|
+
const ZE_API_ENDPOINT = () => { var _a; return (_a = process.env['ZE_API_GATE']) !== null && _a !== void 0 ? _a : 'https://zeapi.zephyrcloud.app'; };
|
|
7
7
|
exports.ZE_API_ENDPOINT = ZE_API_ENDPOINT;
|
|
8
8
|
exports.ze_api_gateway = {
|
|
9
9
|
logs: '/logs',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-api-contract.js","sourceRoot":"","sources":["../../../src/lib/api-contract-negotiation/get-api-contract.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,GAAG,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,mCAAI,6BAA6B,CAAA,EAAA,CAAC;AAAnF,QAAA,mBAAmB,uBAAgE;AAEzF,MAAM,eAAe,GAAG,GAAG,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,
|
|
1
|
+
{"version":3,"file":"get-api-contract.js","sourceRoot":"","sources":["../../../src/lib/api-contract-negotiation/get-api-contract.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,GAAG,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,mCAAI,6BAA6B,CAAA,EAAA,CAAC;AAAnF,QAAA,mBAAmB,uBAAgE;AAEzF,MAAM,eAAe,GAAG,GAAG,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,+BAA+B,CAAA,EAAA,CAAC;AAAtF,QAAA,eAAe,mBAAuE;AAEtF,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,cAAc;IAC3B,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IACnB,kBAAkB,EAAE,qBAAqB;CAC1C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface PublishTarget {
|
|
1
|
+
export interface PublishTarget {
|
|
2
2
|
url: string;
|
|
3
3
|
hostname: string;
|
|
4
4
|
}
|
|
@@ -13,16 +13,15 @@ export interface PublishRequest {
|
|
|
13
13
|
username: string;
|
|
14
14
|
can_write: boolean;
|
|
15
15
|
targets: {
|
|
16
|
-
version
|
|
17
|
-
tags
|
|
18
|
-
|
|
19
|
-
cnames
|
|
16
|
+
version: PublishTarget;
|
|
17
|
+
tags: PublishTarget[];
|
|
18
|
+
envs: PublishTarget[];
|
|
19
|
+
cnames: PublishTarget[];
|
|
20
20
|
};
|
|
21
21
|
jwt: string;
|
|
22
22
|
}
|
|
23
23
|
export interface StageZeroPublishRequest {
|
|
24
24
|
application_uid: string;
|
|
25
25
|
snapshot_id: string;
|
|
26
|
-
|
|
26
|
+
targets: PublishTarget[];
|
|
27
27
|
}
|
|
28
|
-
export {};
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface NetlifyIntegrationConfig {
|
|
3
|
-
api_token: string;
|
|
4
|
-
site_id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ZeApplicationConfig {
|
|
7
|
-
user_uuid: string;
|
|
8
|
-
username: string;
|
|
9
|
-
email: string;
|
|
10
|
-
AUTH0_CLIENT_ID: string;
|
|
11
|
-
AUTH0_DOMAIN: string;
|
|
12
|
-
BUILD_ID_ENDPOINT: string;
|
|
13
|
-
EDGE_URL: string;
|
|
14
|
-
DOMAIN?: string;
|
|
15
|
-
INTEGRATION_CONFIG?: NetlifyIntegrationConfig & {
|
|
16
|
-
type?: 'worker' | 'pages';
|
|
17
|
-
};
|
|
18
|
-
PLATFORM: 'cloudflare' | 'netlify';
|
|
19
|
-
jwt: string;
|
|
20
|
-
uploadConfig: UploadProviderConfig;
|
|
21
|
-
application_uid: string;
|
|
22
|
-
fetched_at?: number;
|
|
23
|
-
}
|
|
1
|
+
import type { ZeApplicationConfig } from './upload-provider-options';
|
|
24
2
|
export declare function saveAppConfig(application_uid: string, json: ZeApplicationConfig): Promise<void>;
|
|
25
3
|
export declare function getAppConfig(application_uid: string): Promise<ZeApplicationConfig | undefined>;
|
|
26
4
|
export declare function remoteAppConfig(application_uid: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-configuration.js","sourceRoot":"","sources":["../../../src/lib/node-persist/application-configuration.ts"],"names":[],"mappings":";;;;AAAA,+CAAkE;AAClE,qCAAkC;AAClC,yCAAiC;
|
|
1
|
+
{"version":3,"file":"application-configuration.js","sourceRoot":"","sources":["../../../src/lib/node-persist/application-configuration.ts"],"names":[],"mappings":";;;;AAAA,+CAAkE;AAClE,qCAAkC;AAClC,yCAAiC;AACjC,iDAAsD;AAGtD,MAAM,OAAO,GAAG,IAAA,mBAAI,EAAC;IACnB,GAAG,EAAE,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,sBAAO,CAAC;CAC9B,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,eAAuB;IACtC,OAAO,uEAAkC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,SAAsB,aAAa,CAAC,eAAuB,EAAE,IAAyB;;QACpF,MAAM,OAAO,CAAC;QACd,KAAK,CAAC,MAAM,IAAA,sBAAO,EAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/E,CAAC;CAAA;AAHD,sCAGC;AAED,SAAsB,YAAY,CAAC,eAAuB;;QACxD,MAAM,OAAO,CAAC;QACd,OAAO,IAAA,sBAAO,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAC3C,CAAC;CAAA;AAHD,oCAGC;AAED,SAAsB,eAAe,CAAC,eAAuB;;QAC3D,MAAM,OAAO,CAAC;QACd,MAAM,IAAA,yBAAU,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAC7C,CAAC;CAAA;AAHD,0CAGC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare function getSecretToken():
|
|
1
|
+
export declare function getSecretToken(): string | undefined;
|
|
2
|
+
export declare function hasSecretToken(): boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSecretToken = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
3
|
+
exports.hasSecretToken = exports.getSecretToken = void 0;
|
|
5
4
|
function getSecretToken() {
|
|
6
|
-
return
|
|
7
|
-
return process.env["ZE_SECRET_TOKEN" /* StorageKeys.ze_secret_token */];
|
|
8
|
-
});
|
|
5
|
+
return process.env["ZE_SECRET_TOKEN" /* StorageKeys.ze_secret_token */];
|
|
9
6
|
}
|
|
10
7
|
exports.getSecretToken = getSecretToken;
|
|
8
|
+
function hasSecretToken() {
|
|
9
|
+
return !!getSecretToken();
|
|
10
|
+
}
|
|
11
|
+
exports.hasSecretToken = hasSecretToken;
|
|
11
12
|
//# sourceMappingURL=secret-token.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-token.js","sourceRoot":"","sources":["../../../src/lib/node-persist/secret-token.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secret-token.js","sourceRoot":"","sources":["../../../src/lib/node-persist/secret-token.ts"],"names":[],"mappings":";;;AAEA,SAAgB,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,qDAA6B,CAAC;AAClD,CAAC;AAFD,wCAEC;AAED,SAAgB,cAAc;IAC5B,OAAO,CAAC,CAAC,cAAc,EAAE,CAAC;AAC5B,CAAC;AAFD,wCAEC"}
|
|
@@ -13,7 +13,7 @@ const storage = (0, node_persist_1.init)({
|
|
|
13
13
|
function saveToken(token) {
|
|
14
14
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
15
|
yield storage;
|
|
16
|
-
|
|
16
|
+
yield (0, node_persist_1.setItem)("ze-auth-token" /* StorageKeys.ze_auth_token */, token);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
exports.saveToken = saveToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/lib/node-persist/token.ts"],"names":[],"mappings":";;;;AAAA,+CAAyE;AACzE,qCAAkC;AAClC,yCAAiC;AACjC,iDAAsD;AACtD,iDAAgD;AAEhD,MAAM,OAAO,GAAG,IAAA,mBAAI,EAAC;IACnB,GAAG,EAAE,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,sBAAO,CAAC;CAC9B,CAAC,CAAC;AAEH,SAAsB,SAAS,CAAC,KAAa;;QAC3C,MAAM,OAAO,CAAC;QACd,
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/lib/node-persist/token.ts"],"names":[],"mappings":";;;;AAAA,+CAAyE;AACzE,qCAAkC;AAClC,yCAAiC;AACjC,iDAAsD;AACtD,iDAAgD;AAEhD,MAAM,OAAO,GAAG,IAAA,mBAAI,EAAC;IACnB,GAAG,EAAE,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,sBAAO,CAAC;CAC9B,CAAC,CAAC;AAEH,SAAsB,SAAS,CAAC,KAAa;;QAC3C,MAAM,OAAO,CAAC;QACd,MAAM,IAAA,sBAAO,mDAA4B,KAAK,CAAC,CAAC;IAClD,CAAC;CAAA;AAHD,8BAGC;AAED,SAAsB,QAAQ;;QAC5B,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAc,GAAE,CAAC;QAC5C,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,MAAM,OAAO,CAAC;QACd,OAAO,IAAA,sBAAO,kDAA2B,CAAC;IAC5C,CAAC;CAAA;AAPD,4BAOC;AAED,SAAsB,WAAW;;QAC/B,MAAM,OAAO,CAAC;QACd,MAAM,IAAA,yBAAU,kDAA2B,CAAC;IAC9C,CAAC;CAAA;AAHD,kCAGC;AAED,SAAsB,WAAW;;QAC/B,MAAM,OAAO,CAAC;QACd,MAAM,IAAA,oBAAK,GAAE,CAAC;IAChB,CAAC;CAAA;AAHD,kCAGC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export interface ZeApplicationConfig {
|
|
2
|
+
application_uid: string;
|
|
3
|
+
AUTH0_CLIENT_ID: string;
|
|
4
|
+
AUTH0_DOMAIN: string;
|
|
5
|
+
BUILD_ID_ENDPOINT: string;
|
|
6
|
+
EDGE_URL: string;
|
|
7
|
+
email: string;
|
|
8
|
+
fetched_at?: number;
|
|
9
|
+
jwt: string;
|
|
10
|
+
PLATFORM: UploadProviderType;
|
|
11
|
+
user_uuid: string;
|
|
12
|
+
username: string;
|
|
4
13
|
}
|
|
5
14
|
export declare enum UploadProviderType {
|
|
6
15
|
CLOUDFLARE = "cloudflare",
|
|
@@ -9,10 +18,3 @@ export declare enum UploadProviderType {
|
|
|
9
18
|
AZURE = "azure",
|
|
10
19
|
GCP = "gcp"
|
|
11
20
|
}
|
|
12
|
-
export interface CloudflareOptions {
|
|
13
|
-
edgeUrl: string;
|
|
14
|
-
api_token: string;
|
|
15
|
-
accountId: string;
|
|
16
|
-
projectName?: string;
|
|
17
|
-
}
|
|
18
|
-
export type IntegrationConfig = CloudflareOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-provider-options.js","sourceRoot":"","sources":["../../../src/lib/node-persist/upload-provider-options.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"upload-provider-options.js","sourceRoot":"","sources":["../../../src/lib/node-persist/upload-provider-options.ts"],"names":[],"mappings":";;;AAeA,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iCAAW,CAAA;IACX,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,iCAAW,CAAA;AACb,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B"}
|
|
@@ -6,7 +6,7 @@ export interface ZephyrPluginOptions {
|
|
|
6
6
|
zeConfig: {
|
|
7
7
|
edge_url: string;
|
|
8
8
|
user: string;
|
|
9
|
-
buildId: string
|
|
9
|
+
buildId: string;
|
|
10
10
|
};
|
|
11
11
|
application_uid: string;
|
|
12
12
|
app: {
|
|
@@ -16,8 +16,8 @@ export interface ZephyrPluginOptions {
|
|
|
16
16
|
version: string;
|
|
17
17
|
};
|
|
18
18
|
git: {
|
|
19
|
-
name
|
|
20
|
-
email
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
21
|
branch: string;
|
|
22
22
|
commit: string;
|
|
23
23
|
};
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { Errors } from './error-codes-messages';
|
|
1
2
|
export declare const dimmedName: string;
|
|
2
3
|
export declare const brightBlueBgName: string;
|
|
3
4
|
export declare const brightYellowBgName: string;
|
|
5
|
+
export declare const brightGreenBgName: string;
|
|
4
6
|
export declare const brightRedBgName: string;
|
|
7
|
+
declare function print_error_with_docs<K extends keyof typeof Errors>(errMsg?: K, ...args: unknown[]): void;
|
|
5
8
|
export declare const ze_log: import("debug").Debugger;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/** `ze_error` is used widely to debug our local build and deployment. You can turn on debug mode or having it work normally to attached documentation with our error codes in [errors](./error-types.ts). We have added unknown class to the error object.
|
|
10
|
+
* If this is an error we haven't defined yet, you will need to do
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* ze_error('ERR_UNKNOWN', `Error creating dist folder: ${(error as Error).message}`);
|
|
14
|
+
* ```
|
|
15
|
+
* to specify this is an undefined error at the front.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ze_error: typeof print_error_with_docs;
|
|
18
|
+
export {};
|
package/dist/lib/utils/debug.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ze_error = exports.ze_log = exports.brightRedBgName = exports.brightYellowBgName = exports.brightBlueBgName = exports.dimmedName = void 0;
|
|
3
|
+
exports.ze_error = exports.ze_log = exports.brightRedBgName = exports.brightGreenBgName = exports.brightYellowBgName = exports.brightBlueBgName = exports.dimmedName = void 0;
|
|
4
4
|
// light weight utils for decorated console.error + able to toggle different parts of whole module's logging result
|
|
5
5
|
const debug_1 = require("debug");
|
|
6
6
|
const picocolor_1 = require("./picocolor");
|
|
7
7
|
const debug_enabled_1 = require("./debug-enabled");
|
|
8
|
+
const error_formatted_message_1 = require("./error-formatted-message");
|
|
8
9
|
//TODO: this should be traced and logged into new relic
|
|
9
10
|
//TODO: print different colors to it + Capitalize maybe?
|
|
10
11
|
const name = ' ZEPHYR ';
|
|
11
12
|
exports.dimmedName = (0, picocolor_1.dim)(name);
|
|
12
13
|
exports.brightBlueBgName = (0, picocolor_1.bold)((0, picocolor_1.bgCyanBright)((0, picocolor_1.black)(name)));
|
|
13
14
|
exports.brightYellowBgName = (0, picocolor_1.bold)((0, picocolor_1.bgYellowBright)((0, picocolor_1.black)(name)));
|
|
15
|
+
exports.brightGreenBgName = (0, picocolor_1.bold)((0, picocolor_1.bgGreenBright)((0, picocolor_1.black)(name)));
|
|
14
16
|
exports.brightRedBgName = (0, picocolor_1.bold)((0, picocolor_1.bgRedBright)((0, picocolor_1.black)(name)));
|
|
17
|
+
function print_error_with_docs(errMsg, ...args) {
|
|
18
|
+
errMsg ? console.log(`${exports.brightRedBgName} ${(0, error_formatted_message_1.err)(errMsg)} ${args} \n`) : console.log(exports.brightRedBgName, (0, picocolor_1.redBright)('Unknown error'), args);
|
|
19
|
+
}
|
|
15
20
|
exports.ze_log = (0, debug_1.debug)('zephyr:log');
|
|
16
21
|
// If debug mode is not enabled just print whatever console output is
|
|
17
22
|
// If debug mode is enabled print the error from our end
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/** `ze_error` is used widely to debug our local build and deployment. You can turn on debug mode or having it work normally to attached documentation with our error codes in [errors](./error-types.ts). We have added unknown class to the error object.
|
|
24
|
+
* If this is an error we haven't defined yet, you will need to do
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* ze_error('ERR_UNKNOWN', `Error creating dist folder: ${(error as Error).message}`);
|
|
28
|
+
* ```
|
|
29
|
+
* to specify this is an undefined error at the front.
|
|
30
|
+
*/
|
|
31
|
+
exports.ze_error = debug_enabled_1.is_debug_enabled ? (0, debug_1.debug)('zephyr:error') : print_error_with_docs;
|
|
21
32
|
//# sourceMappingURL=debug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/lib/utils/debug.ts"],"names":[],"mappings":";;;AAAA,mHAAmH;AACnH,iCAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/lib/utils/debug.ts"],"names":[],"mappings":";;;AAAA,mHAAmH;AACnH,iCAA8B;AAC9B,2CAAoH;AACpH,mDAAmD;AACnD,uEAAgD;AAGhD,uDAAuD;AACvD,wDAAwD;AACxD,MAAM,IAAI,GAAG,UAAU,CAAC;AAEX,QAAA,UAAU,GAAG,IAAA,eAAG,EAAC,IAAI,CAAC,CAAC;AAEvB,QAAA,gBAAgB,GAAG,IAAA,gBAAI,EAAC,IAAA,wBAAY,EAAC,IAAA,iBAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnD,QAAA,kBAAkB,GAAG,IAAA,gBAAI,EAAC,IAAA,0BAAc,EAAC,IAAA,iBAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEvD,QAAA,iBAAiB,GAAG,IAAA,gBAAI,EAAC,IAAA,yBAAa,EAAC,IAAA,iBAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAErD,QAAA,eAAe,GAAG,IAAA,gBAAI,EAAC,IAAA,uBAAW,EAAC,IAAA,iBAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAE9D,SAAS,qBAAqB,CAAgC,MAAU,EAAE,GAAG,IAAe;IAC1F,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,uBAAe,IAAI,IAAA,6BAAG,EAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAe,EAAE,IAAA,qBAAS,EAAC,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;AACxI,CAAC;AAEY,QAAA,MAAM,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAC1C,qEAAqE;AACrE,wDAAwD;AACxD;;;;;;;GAOG;AACU,QAAA,QAAQ,GAAG,gCAAgB,CAAC,CAAC,CAAC,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC,CAAC,CAAE,qBAAsD,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Categories for all error codes.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ErrorCategories: {
|
|
5
|
+
readonly unknown: "00";
|
|
6
|
+
readonly build: "10";
|
|
7
|
+
readonly deploy: "20";
|
|
8
|
+
readonly browser: "30";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A collection of error types and the error code during local/build stage
|
|
12
|
+
* @description if you are searching for an error globally, if it is a build related error, it starts with `ZE10`, if it's a deployment related error, search for `ZE20` and then followed with their ID.
|
|
13
|
+
* - `ZE` at the front is a constant
|
|
14
|
+
* - two digits at the middle PP (`10` for build error or `20` for deployment error) is their categories,
|
|
15
|
+
* - last three digits is their ID.
|
|
16
|
+
*
|
|
17
|
+
* For example, if you have a `SNAPSHOT_NOT_FOUND` error, search for `ZE20023`, if you see an error showing up on terminal or application, the last three numbers are their IDs.
|
|
18
|
+
* We might extend to have more errors in the future. */
|
|
19
|
+
export declare const Errors: {
|
|
20
|
+
readonly ERR_UNKNOWN: {
|
|
21
|
+
readonly id: "000";
|
|
22
|
+
readonly message: "Unknown error. Tell us about it in Discord https://zephyr-cloud.io/discord if you see this error";
|
|
23
|
+
readonly kind: "unknown";
|
|
24
|
+
};
|
|
25
|
+
/** package.json not found error */
|
|
26
|
+
readonly ERR_PACKAGE_JSON_NOT_FOUND: {
|
|
27
|
+
readonly id: "010";
|
|
28
|
+
readonly message: "Package.json not found";
|
|
29
|
+
readonly kind: "build";
|
|
30
|
+
};
|
|
31
|
+
/** Package.json is not in a valid json format*/
|
|
32
|
+
readonly ERR_PACKAGE_JSON_NOT_VALID: {
|
|
33
|
+
readonly id: "011";
|
|
34
|
+
readonly message: "Package.json is not in a valid json format.";
|
|
35
|
+
readonly kind: "build";
|
|
36
|
+
};
|
|
37
|
+
/** Webpack config error*/
|
|
38
|
+
readonly ERR_WEBPACK_CONFIG: {
|
|
39
|
+
readonly id: "012";
|
|
40
|
+
readonly message: "Webpack config error.";
|
|
41
|
+
readonly kind: "build";
|
|
42
|
+
};
|
|
43
|
+
/** Package.json must have a name and version field. */
|
|
44
|
+
readonly ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION: {
|
|
45
|
+
readonly id: "013";
|
|
46
|
+
readonly message: "Package.json must have a name and version field.";
|
|
47
|
+
readonly kind: "build";
|
|
48
|
+
};
|
|
49
|
+
/** Git remote origin is not configured properly.*/
|
|
50
|
+
readonly ERR_GIT_REMOTE_ORIGIN: {
|
|
51
|
+
readonly id: "014";
|
|
52
|
+
readonly message: "Git remote origin is not configured properly.";
|
|
53
|
+
readonly kind: "build";
|
|
54
|
+
};
|
|
55
|
+
/** Git username or email is not configured. */
|
|
56
|
+
readonly ERR_NO_GIT_USERNAME_EMAIL: {
|
|
57
|
+
readonly id: "015";
|
|
58
|
+
readonly message: "Git username or email is not configured.";
|
|
59
|
+
readonly kind: "build";
|
|
60
|
+
};
|
|
61
|
+
/** Could not get git info */
|
|
62
|
+
readonly ERR_NO_GIT_INFO: {
|
|
63
|
+
readonly id: "016";
|
|
64
|
+
readonly message: "Could not get git info.";
|
|
65
|
+
readonly kind: "build";
|
|
66
|
+
};
|
|
67
|
+
/** Build error application_uid missing. */
|
|
68
|
+
readonly ERR_MISSING_APPLICATION_UID: {
|
|
69
|
+
readonly id: "017";
|
|
70
|
+
readonly message: "`application_uid` missing.";
|
|
71
|
+
readonly kind: "build";
|
|
72
|
+
};
|
|
73
|
+
/** Auth error */
|
|
74
|
+
readonly ERR_AUTH_ERROR: {
|
|
75
|
+
readonly id: "018";
|
|
76
|
+
readonly message: "Auth error.";
|
|
77
|
+
readonly kind: "build";
|
|
78
|
+
};
|
|
79
|
+
/** Could not get build id. */
|
|
80
|
+
readonly ERR_GET_BUILD_ID: {
|
|
81
|
+
readonly id: "019";
|
|
82
|
+
readonly message: "Could not get build id.";
|
|
83
|
+
readonly kind: "build";
|
|
84
|
+
};
|
|
85
|
+
/**Could not initialize Zephyr Agent. */
|
|
86
|
+
readonly ERR_INITIALIZE_ZEPHYR_AGENT: {
|
|
87
|
+
readonly id: "020";
|
|
88
|
+
readonly message: "Could not initialize Zephyr Agent.";
|
|
89
|
+
readonly kind: "build";
|
|
90
|
+
};
|
|
91
|
+
/** Cloudflare specific error */
|
|
92
|
+
readonly ERR_UNABLE_CREATE_DIST_FOLDER: {
|
|
93
|
+
readonly id: "021";
|
|
94
|
+
readonly message: "Error creating dist folder.";
|
|
95
|
+
readonly kind: "build";
|
|
96
|
+
};
|
|
97
|
+
/** Deployment error, assets not found */
|
|
98
|
+
readonly ERR_ASSETS_NOT_FOUND: {
|
|
99
|
+
readonly id: "010";
|
|
100
|
+
readonly message: "Assets not found.";
|
|
101
|
+
readonly kind: "deploy";
|
|
102
|
+
};
|
|
103
|
+
/** assets not found in snapshot */
|
|
104
|
+
readonly ERR_ASSETS_NOT_FOUND_IN_SNAPSHOT: {
|
|
105
|
+
readonly id: "011";
|
|
106
|
+
readonly message: "Assets not found in snapshot.";
|
|
107
|
+
readonly kind: "deploy";
|
|
108
|
+
};
|
|
109
|
+
/** application_uid missing */
|
|
110
|
+
readonly ERR_DEPLOY_MISSING_APPLICATION_UID: {
|
|
111
|
+
readonly id: "012";
|
|
112
|
+
readonly message: "`application_uid` is required.";
|
|
113
|
+
readonly kind: "deploy";
|
|
114
|
+
};
|
|
115
|
+
readonly ERR_MISSING_FILE_HASH: {
|
|
116
|
+
readonly id: "013";
|
|
117
|
+
readonly message: "Missing file hash.";
|
|
118
|
+
readonly kind: "deploy";
|
|
119
|
+
};
|
|
120
|
+
/** Failed to load application configuration. */
|
|
121
|
+
readonly ERR_LOAD_APP_CONFIG: {
|
|
122
|
+
readonly id: "014";
|
|
123
|
+
readonly message: "Failed to load application configuration.";
|
|
124
|
+
readonly kind: "deploy";
|
|
125
|
+
};
|
|
126
|
+
/**Failed to upload build stats. */
|
|
127
|
+
readonly ERR_FAILED_UPLOAD_BUILD_STATS: {
|
|
128
|
+
readonly id: "015";
|
|
129
|
+
readonly message: "Failed to upload build stats.";
|
|
130
|
+
readonly kind: "deploy";
|
|
131
|
+
};
|
|
132
|
+
/** Did not receive envs from build stats upload */
|
|
133
|
+
readonly ERR_NOT_RECEIVE_ENVS_FROM_BUILD_STATS: {
|
|
134
|
+
readonly id: "016";
|
|
135
|
+
readonly message: "Did not receive envs from build stats upload.";
|
|
136
|
+
readonly kind: "deploy";
|
|
137
|
+
};
|
|
138
|
+
/** Failed to upload assets. */
|
|
139
|
+
readonly ERR_FAILED_UPLOAD_ASSETS: {
|
|
140
|
+
readonly id: "017";
|
|
141
|
+
readonly message: "Failed to upload assets.";
|
|
142
|
+
readonly kind: "deploy";
|
|
143
|
+
};
|
|
144
|
+
/** Failed to upload snapshots. */
|
|
145
|
+
readonly ERR_FAILED_UPLOAD_SNAPSHOTS: {
|
|
146
|
+
readonly id: "018";
|
|
147
|
+
readonly message: "Failed to upload snapshots.";
|
|
148
|
+
readonly kind: "deploy";
|
|
149
|
+
};
|
|
150
|
+
/** Snapshot uploads gave no results. */
|
|
151
|
+
readonly ERR_SNAPSHOT_UPLOADS_NO_RESULTS: {
|
|
152
|
+
readonly id: "019";
|
|
153
|
+
readonly message: "Snapshot uploads gave no results.";
|
|
154
|
+
readonly kind: "deploy";
|
|
155
|
+
};
|
|
156
|
+
/**Failed to get application hash list */
|
|
157
|
+
readonly ERR_GET_APPLICATION_HASH_LIST: {
|
|
158
|
+
readonly id: "020";
|
|
159
|
+
readonly message: "Failed to get application hash list.";
|
|
160
|
+
readonly kind: "deploy";
|
|
161
|
+
};
|
|
162
|
+
/** Could not resolve ${name} with verson ${version} */
|
|
163
|
+
readonly ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION: {
|
|
164
|
+
readonly id: "021";
|
|
165
|
+
readonly message: "Could not resolve application name with version.";
|
|
166
|
+
readonly kind: "deploy";
|
|
167
|
+
};
|
|
168
|
+
readonly ERR_SNAPSHOT_ID_NOT_FOUND: {
|
|
169
|
+
readonly id: "022";
|
|
170
|
+
readonly message: "`snapshot_id` not found.";
|
|
171
|
+
readonly kind: "deploy";
|
|
172
|
+
};
|
|
173
|
+
readonly ERR_SNAPSHOT_NOT_FOUND: {
|
|
174
|
+
readonly id: "023";
|
|
175
|
+
readonly message: "Snapshot not found.";
|
|
176
|
+
readonly kind: "deploy";
|
|
177
|
+
};
|
|
178
|
+
readonly ERR_DEPLOY_LOCAL_BUILD: {
|
|
179
|
+
readonly id: "024";
|
|
180
|
+
readonly message: "Failed to deploy local build.";
|
|
181
|
+
readonly kind: "deploy";
|
|
182
|
+
};
|
|
183
|
+
/** Cloudflare specific error */
|
|
184
|
+
readonly ERR_WRANGLER_DEPENDENCY: {
|
|
185
|
+
readonly id: "025";
|
|
186
|
+
readonly message: "Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.";
|
|
187
|
+
readonly kind: "deploy";
|
|
188
|
+
};
|
|
189
|
+
readonly ERR_CONVERT_GRAPH_TO_DASHBOARD: {
|
|
190
|
+
readonly id: "026";
|
|
191
|
+
readonly message: "Failed to convert graph to dashboard data.";
|
|
192
|
+
readonly kind: "browser";
|
|
193
|
+
};
|
|
194
|
+
readonly ERR_UPLOAD_TO_CLOUDFLARE_PAGES: {
|
|
195
|
+
readonly id: "027";
|
|
196
|
+
readonly message: "Error upload to cloudflare pages.";
|
|
197
|
+
readonly kind: "deploy";
|
|
198
|
+
};
|
|
199
|
+
readonly ERR_NO_WRANGLER: {
|
|
200
|
+
readonly id: "028";
|
|
201
|
+
readonly message: "Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.";
|
|
202
|
+
readonly kind: "build";
|
|
203
|
+
};
|
|
204
|
+
readonly ERR_CREATE_DIST_FOLDER: {
|
|
205
|
+
readonly id: "029";
|
|
206
|
+
readonly message: "Error creating dist folder.";
|
|
207
|
+
readonly kind: "build";
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
export type ZeErrors = {
|
|
211
|
+
[K in keyof Errors]: ZeError<Categories[Errors[K]['kind']], Errors[K]['id']>;
|
|
212
|
+
}[keyof Errors];
|
|
213
|
+
type Errors = typeof Errors;
|
|
214
|
+
type Categories = typeof ErrorCategories;
|
|
215
|
+
type ZeError<Category extends string, Code extends string> = `ZE${Category}${Code}`;
|
|
216
|
+
export {};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Errors = exports.ErrorCategories = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Categories for all error codes.
|
|
6
|
+
*/
|
|
7
|
+
exports.ErrorCategories = {
|
|
8
|
+
unknown: '00',
|
|
9
|
+
build: '10',
|
|
10
|
+
deploy: '20',
|
|
11
|
+
browser: '30',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A collection of error types and the error code during local/build stage
|
|
15
|
+
* @description if you are searching for an error globally, if it is a build related error, it starts with `ZE10`, if it's a deployment related error, search for `ZE20` and then followed with their ID.
|
|
16
|
+
* - `ZE` at the front is a constant
|
|
17
|
+
* - two digits at the middle PP (`10` for build error or `20` for deployment error) is their categories,
|
|
18
|
+
* - last three digits is their ID.
|
|
19
|
+
*
|
|
20
|
+
* For example, if you have a `SNAPSHOT_NOT_FOUND` error, search for `ZE20023`, if you see an error showing up on terminal or application, the last three numbers are their IDs.
|
|
21
|
+
* We might extend to have more errors in the future. */
|
|
22
|
+
exports.Errors = {
|
|
23
|
+
ERR_UNKNOWN: {
|
|
24
|
+
id: '000',
|
|
25
|
+
message: 'Unknown error. Tell us about it in Discord https://zephyr-cloud.io/discord if you see this error',
|
|
26
|
+
kind: 'unknown',
|
|
27
|
+
},
|
|
28
|
+
/** package.json not found error */
|
|
29
|
+
ERR_PACKAGE_JSON_NOT_FOUND: {
|
|
30
|
+
id: '010',
|
|
31
|
+
message: 'Package.json not found',
|
|
32
|
+
kind: 'build',
|
|
33
|
+
},
|
|
34
|
+
/** Package.json is not in a valid json format*/
|
|
35
|
+
ERR_PACKAGE_JSON_NOT_VALID: {
|
|
36
|
+
id: '011',
|
|
37
|
+
message: 'Package.json is not in a valid json format.',
|
|
38
|
+
kind: 'build',
|
|
39
|
+
},
|
|
40
|
+
/** Webpack config error*/
|
|
41
|
+
ERR_WEBPACK_CONFIG: {
|
|
42
|
+
id: '012',
|
|
43
|
+
message: 'Webpack config error.',
|
|
44
|
+
kind: 'build',
|
|
45
|
+
}, // TODO: we don't detect this error yet, will we be able to separate them?
|
|
46
|
+
/** Package.json must have a name and version field. */
|
|
47
|
+
ERR_PACKAGE_JSON_MUST_HAVE_NAME_VERSION: {
|
|
48
|
+
id: '013',
|
|
49
|
+
message: 'Package.json must have a name and version field.',
|
|
50
|
+
kind: 'build',
|
|
51
|
+
},
|
|
52
|
+
/** Git remote origin is not configured properly.*/
|
|
53
|
+
ERR_GIT_REMOTE_ORIGIN: {
|
|
54
|
+
id: '014',
|
|
55
|
+
message: 'Git remote origin is not configured properly.',
|
|
56
|
+
kind: 'build',
|
|
57
|
+
},
|
|
58
|
+
/** Git username or email is not configured. */
|
|
59
|
+
ERR_NO_GIT_USERNAME_EMAIL: {
|
|
60
|
+
id: '015',
|
|
61
|
+
message: 'Git username or email is not configured.',
|
|
62
|
+
kind: 'build',
|
|
63
|
+
},
|
|
64
|
+
/** Could not get git info */
|
|
65
|
+
ERR_NO_GIT_INFO: {
|
|
66
|
+
id: '016',
|
|
67
|
+
message: 'Could not get git info.',
|
|
68
|
+
kind: 'build',
|
|
69
|
+
},
|
|
70
|
+
/** Build error application_uid missing. */
|
|
71
|
+
ERR_MISSING_APPLICATION_UID: {
|
|
72
|
+
id: '017',
|
|
73
|
+
message: '`application_uid` missing.',
|
|
74
|
+
kind: 'build',
|
|
75
|
+
},
|
|
76
|
+
/** Auth error */
|
|
77
|
+
ERR_AUTH_ERROR: {
|
|
78
|
+
id: '018',
|
|
79
|
+
message: 'Auth error.',
|
|
80
|
+
kind: 'build',
|
|
81
|
+
},
|
|
82
|
+
/** Could not get build id. */
|
|
83
|
+
ERR_GET_BUILD_ID: {
|
|
84
|
+
id: '019',
|
|
85
|
+
message: 'Could not get build id.',
|
|
86
|
+
kind: 'build',
|
|
87
|
+
},
|
|
88
|
+
/**Could not initialize Zephyr Agent. */
|
|
89
|
+
ERR_INITIALIZE_ZEPHYR_AGENT: {
|
|
90
|
+
id: '020',
|
|
91
|
+
message: 'Could not initialize Zephyr Agent.',
|
|
92
|
+
kind: 'build',
|
|
93
|
+
},
|
|
94
|
+
/** Cloudflare specific error */
|
|
95
|
+
ERR_UNABLE_CREATE_DIST_FOLDER: {
|
|
96
|
+
id: '021',
|
|
97
|
+
message: 'Error creating dist folder.',
|
|
98
|
+
kind: 'build',
|
|
99
|
+
},
|
|
100
|
+
/** Deployment error, assets not found */
|
|
101
|
+
ERR_ASSETS_NOT_FOUND: {
|
|
102
|
+
id: '010',
|
|
103
|
+
message: 'Assets not found.',
|
|
104
|
+
kind: 'deploy',
|
|
105
|
+
},
|
|
106
|
+
/** assets not found in snapshot */
|
|
107
|
+
ERR_ASSETS_NOT_FOUND_IN_SNAPSHOT: {
|
|
108
|
+
id: '011',
|
|
109
|
+
message: 'Assets not found in snapshot.',
|
|
110
|
+
kind: 'deploy',
|
|
111
|
+
},
|
|
112
|
+
/** application_uid missing */
|
|
113
|
+
ERR_DEPLOY_MISSING_APPLICATION_UID: {
|
|
114
|
+
id: '012',
|
|
115
|
+
message: '`application_uid` is required.',
|
|
116
|
+
kind: 'deploy',
|
|
117
|
+
},
|
|
118
|
+
ERR_MISSING_FILE_HASH: {
|
|
119
|
+
id: '013',
|
|
120
|
+
message: 'Missing file hash.',
|
|
121
|
+
kind: 'deploy',
|
|
122
|
+
},
|
|
123
|
+
/** Failed to load application configuration. */
|
|
124
|
+
ERR_LOAD_APP_CONFIG: {
|
|
125
|
+
id: '014',
|
|
126
|
+
message: 'Failed to load application configuration.',
|
|
127
|
+
kind: 'deploy',
|
|
128
|
+
},
|
|
129
|
+
/**Failed to upload build stats. */
|
|
130
|
+
ERR_FAILED_UPLOAD_BUILD_STATS: {
|
|
131
|
+
id: '015',
|
|
132
|
+
message: 'Failed to upload build stats.',
|
|
133
|
+
kind: 'deploy',
|
|
134
|
+
},
|
|
135
|
+
/** Did not receive envs from build stats upload */
|
|
136
|
+
ERR_NOT_RECEIVE_ENVS_FROM_BUILD_STATS: {
|
|
137
|
+
id: '016',
|
|
138
|
+
message: 'Did not receive envs from build stats upload.',
|
|
139
|
+
kind: 'deploy',
|
|
140
|
+
},
|
|
141
|
+
/** Failed to upload assets. */
|
|
142
|
+
ERR_FAILED_UPLOAD_ASSETS: {
|
|
143
|
+
id: '017',
|
|
144
|
+
message: 'Failed to upload assets.',
|
|
145
|
+
kind: 'deploy',
|
|
146
|
+
},
|
|
147
|
+
/** Failed to upload snapshots. */
|
|
148
|
+
ERR_FAILED_UPLOAD_SNAPSHOTS: {
|
|
149
|
+
id: '018',
|
|
150
|
+
message: 'Failed to upload snapshots.',
|
|
151
|
+
kind: 'deploy',
|
|
152
|
+
},
|
|
153
|
+
/** Snapshot uploads gave no results. */
|
|
154
|
+
ERR_SNAPSHOT_UPLOADS_NO_RESULTS: {
|
|
155
|
+
id: '019',
|
|
156
|
+
message: 'Snapshot uploads gave no results.',
|
|
157
|
+
kind: 'deploy',
|
|
158
|
+
},
|
|
159
|
+
/**Failed to get application hash list */
|
|
160
|
+
ERR_GET_APPLICATION_HASH_LIST: {
|
|
161
|
+
id: '020',
|
|
162
|
+
message: 'Failed to get application hash list.',
|
|
163
|
+
kind: 'deploy',
|
|
164
|
+
},
|
|
165
|
+
/** Could not resolve ${name} with verson ${version} */
|
|
166
|
+
ERR_NOT_RESOLVE_APP_NAME_WITH_VERSION: {
|
|
167
|
+
id: '021',
|
|
168
|
+
message: 'Could not resolve application name with version.',
|
|
169
|
+
kind: 'deploy',
|
|
170
|
+
},
|
|
171
|
+
ERR_SNAPSHOT_ID_NOT_FOUND: {
|
|
172
|
+
id: '022',
|
|
173
|
+
message: '`snapshot_id` not found.',
|
|
174
|
+
kind: 'deploy',
|
|
175
|
+
},
|
|
176
|
+
ERR_SNAPSHOT_NOT_FOUND: {
|
|
177
|
+
id: '023',
|
|
178
|
+
message: 'Snapshot not found.',
|
|
179
|
+
kind: 'deploy',
|
|
180
|
+
},
|
|
181
|
+
ERR_DEPLOY_LOCAL_BUILD: {
|
|
182
|
+
id: '024',
|
|
183
|
+
message: 'Failed to deploy local build.',
|
|
184
|
+
kind: 'deploy',
|
|
185
|
+
},
|
|
186
|
+
/** Cloudflare specific error */
|
|
187
|
+
ERR_WRANGLER_DEPENDENCY: {
|
|
188
|
+
id: '025',
|
|
189
|
+
message: 'Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.',
|
|
190
|
+
kind: 'deploy',
|
|
191
|
+
},
|
|
192
|
+
ERR_CONVERT_GRAPH_TO_DASHBOARD: {
|
|
193
|
+
id: '026',
|
|
194
|
+
message: 'Failed to convert graph to dashboard data.',
|
|
195
|
+
kind: 'browser',
|
|
196
|
+
},
|
|
197
|
+
ERR_UPLOAD_TO_CLOUDFLARE_PAGES: {
|
|
198
|
+
id: '027',
|
|
199
|
+
message: 'Error upload to cloudflare pages.',
|
|
200
|
+
kind: 'deploy',
|
|
201
|
+
},
|
|
202
|
+
ERR_NO_WRANGLER: {
|
|
203
|
+
id: '028',
|
|
204
|
+
message: 'Wrangler dependency is needed for Cloudflare deployment. Please install dependencies without --no-optional flag.',
|
|
205
|
+
kind: 'build',
|
|
206
|
+
},
|
|
207
|
+
ERR_CREATE_DIST_FOLDER: {
|
|
208
|
+
id: '029',
|
|
209
|
+
message: 'Error creating dist folder.',
|
|
210
|
+
kind: 'build',
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=error-codes-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes-messages.js","sourceRoot":"","sources":["../../../src/lib/utils/error-codes-messages.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;CAGd,CAAC;AAEF;;;;;;;;wDAQwD;AAC3C,QAAA,MAAM,GAAG;IACpB,WAAW,EAAE;QACX,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,kGAAkG;QAC3G,IAAI,EAAE,SAAS;KAChB;IACD,mCAA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AAE,QAAQ;KACf;IACD,yCAAyC;IACzC,6BAA6B,EAAE;QAC7B,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,sCAAsC;QAC/C,IAAI,EAAE,QAAQ;KACf;IACD,uDAAuD;IACvD,qCAAqC,EAAE;QACrC,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,kDAAkD;QAC3D,IAAI,EAAE,QAAQ;KACf;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,0BAA0B;QACnC,IAAI,EAAE,QAAQ;KACf;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,qBAAqB;QAC9B,IAAI,EAAE,QAAQ;KACf;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,+BAA+B;QACxC,IAAI,EAAE,QAAQ;KACf;IACD,gCAAgC;IAChC,uBAAuB,EAAE;QACvB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,kHAAkH;QAC3H,IAAI,EAAE,QAAQ;KACf;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,4CAA4C;QACrD,IAAI,EAAE,SAAS;KAChB;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,mCAAmC;QAC5C,IAAI,EAAE,QAAQ;KACf;IACD,eAAe,EAAE;QACf,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,kHAAkH;QAC3H,IAAI,EAAE,OAAO;KACd;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE,OAAO;KACd;CAOF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.err = exports.errMsg = exports.errCode = exports.docsPrefix = void 0;
|
|
4
|
+
// ! 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
|
|
5
|
+
const picocolor_1 = require("./picocolor");
|
|
6
|
+
const error_codes_messages_1 = require("./error-codes-messages");
|
|
7
|
+
exports.docsPrefix = 'https://docs.zephyr-cloud.io/errors';
|
|
8
|
+
function errCode(err) {
|
|
9
|
+
const id = error_codes_messages_1.Errors[err].id;
|
|
10
|
+
const prefix = error_codes_messages_1.ErrorCategories[error_codes_messages_1.Errors[err].kind];
|
|
11
|
+
// we have less categories and more errors, so make sense to be ZEPPIII
|
|
12
|
+
// where ZE is a constant, PP is the category, and I is the error id
|
|
13
|
+
const paddedId = id.toString().padStart(3, '0');
|
|
14
|
+
const paddedPrefix = prefix.toString().padStart(2, '0');
|
|
15
|
+
return `ZE${paddedPrefix}${paddedId}`;
|
|
16
|
+
}
|
|
17
|
+
exports.errCode = errCode;
|
|
18
|
+
function errMsg(err) {
|
|
19
|
+
return error_codes_messages_1.Errors[err].message;
|
|
20
|
+
}
|
|
21
|
+
exports.errMsg = errMsg;
|
|
22
|
+
function err(err) {
|
|
23
|
+
const id = error_codes_messages_1.Errors[err].id;
|
|
24
|
+
const prefix = error_codes_messages_1.ErrorCategories[error_codes_messages_1.Errors[err].kind];
|
|
25
|
+
// we have less categories and more errors, so make sense to be ZEPPIII
|
|
26
|
+
// where ZE is a constant, PP is the category, and I is the error id
|
|
27
|
+
const paddedId = id.toString().padStart(3, '0');
|
|
28
|
+
const paddedPrefix = prefix.toString().padStart(2, '0');
|
|
29
|
+
const errorCode = `ZE${paddedPrefix}${paddedId}`;
|
|
30
|
+
const errorMsg = error_codes_messages_1.Errors[err].message;
|
|
31
|
+
const errorDoc = `See potential workaround and how to debug this error in our documentation ${exports.docsPrefix}/${errorCode.toLowerCase()}`;
|
|
32
|
+
const fullMsg = (0, picocolor_1.redBright)(`Error code: ${errorCode}. ${errorMsg} \n ${errorDoc}`);
|
|
33
|
+
return fullMsg;
|
|
34
|
+
}
|
|
35
|
+
exports.err = err;
|
|
36
|
+
//# sourceMappingURL=error-formatted-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-formatted-message.js","sourceRoot":"","sources":["../../../src/lib/utils/error-formatted-message.ts"],"names":[],"mappings":";;;AAAA,kJAAkJ;AAClJ,2CAAwC;AACxC,iEAAiE;AACpD,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,CAAC,6BAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAyD,CAAC;IAEzG,uEAAuE;IACvE,oEAAoE;IAE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_redact(str) {
|
|
13
13
|
if (!str)
|
|
14
14
|
return '';
|
|
15
|
-
return str
|
|
16
|
-
.replace(/Bearer ([^"|']+)/gi, 'Bearer [REDACTED]')
|
|
17
|
-
.replace(/"?jwt"?:["|\W']{0,2}([^"|']+)(["|'])/gi, 'jwt: [REDACTED]');
|
|
15
|
+
return str.replace(/Bearer ([^"|']+)/gi, 'Bearer [REDACTED]').replace(/"?jwt"?:["|\W']{0,2}([^"|']+)(["|'])/gi, 'jwt: [REDACTED]');
|
|
18
16
|
}
|
|
19
17
|
function request(url, options, data) {
|
|
20
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -25,7 +23,7 @@ function request(url, options, data) {
|
|
|
25
23
|
const req = _https.request(url, options !== null && options !== void 0 ? options : {}, (res) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
24
|
if (res.statusCode === 401 || res.statusCode === 403) {
|
|
27
25
|
yield (0, token_1.cleanTokens)();
|
|
28
|
-
const err = new Error(`${debug_2.brightRedBgName} ${(0, picocolor_1.red)(`Error [ZE10018]: auth error, please sign in to https://app.zephyr-cloud.io then try to build again. See documentation https://docs.zephyr-cloud.io/
|
|
26
|
+
const err = new Error(`${debug_2.brightRedBgName} ${(0, picocolor_1.red)(`Error [ZE10018]: auth error, please sign in to https://app.zephyr-cloud.io then try to build again. See documentation https://docs.zephyr-cloud.io/errors/ze10018`)}`);
|
|
29
27
|
err.stack = void 0;
|
|
30
28
|
throw err;
|
|
31
29
|
}
|
|
@@ -35,17 +33,14 @@ function request(url, options, data) {
|
|
|
35
33
|
var _a, _b, _c, _d;
|
|
36
34
|
const _response = (_a = Buffer.concat(response)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
37
35
|
const message = _redact(`[${(options === null || options === void 0 ? void 0 : options.method) || 'GET'}][${url}]: ${Date.now() - req_start}ms` +
|
|
38
|
-
((data === null || data === void 0 ? void 0 : data.length)
|
|
39
|
-
? ` - ${(((_b = data.length) !== null && _b !== void 0 ? _b : 0) / 1024).toFixed(2)}kb`
|
|
40
|
-
: '') +
|
|
36
|
+
((data === null || data === void 0 ? void 0 : data.length) ? ` - ${(((_b = data.length) !== null && _b !== void 0 ? _b : 0) / 1024).toFixed(2)}kb` : '') +
|
|
41
37
|
(_response ? `\n response: ${_response}` : '') +
|
|
42
38
|
(_options_str ? `\n options: ${_options_str}` : ''));
|
|
43
39
|
if (_response === 'Not Implemented')
|
|
44
40
|
return reject(message);
|
|
45
41
|
const parsed_response = (0, safe_json_parse_1.safe_json_parse)(_response);
|
|
46
42
|
if ((typeof res.statusCode === 'number' && res.statusCode > 299) ||
|
|
47
|
-
(typeof (parsed_response === null || parsed_response === void 0 ? void 0 : parsed_response.status) === 'number' &&
|
|
48
|
-
(parsed_response === null || parsed_response === void 0 ? void 0 : parsed_response.status) > 299)) {
|
|
43
|
+
(typeof (parsed_response === null || parsed_response === void 0 ? void 0 : parsed_response.status) === 'number' && (parsed_response === null || parsed_response === void 0 ? void 0 : parsed_response.status) > 299)) {
|
|
49
44
|
return reject(`${debug_2.brightRedBgName} Error from ${url}: \n ${(_c = parsed_response === null || parsed_response === void 0 ? void 0 : parsed_response.message) !== null && _c !== void 0 ? _c : _response}`);
|
|
50
45
|
}
|
|
51
46
|
if (url.pathname.indexOf('application/logs') === -1)
|
|
@@ -54,7 +49,7 @@ function request(url, options, data) {
|
|
|
54
49
|
});
|
|
55
50
|
}));
|
|
56
51
|
req.on('error', (e) => {
|
|
57
|
-
(0, debug_1.ze_error)('', `[${(options === null || options === void 0 ? void 0 : options.method) || 'GET'}][${url}]: ${Date.now() - req_start}ms \n ${_options_str} \n ${e}`);
|
|
52
|
+
(0, debug_1.ze_error)('ERR_UNKNOWN', `[${(options === null || options === void 0 ? void 0 : options.method) || 'GET'}][${url}]: ${Date.now() - req_start}ms \n ${_options_str} \n ${e}`);
|
|
58
53
|
reject(e);
|
|
59
54
|
});
|
|
60
55
|
if (data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ze-http-request.js","sourceRoot":"","sources":["../../../src/lib/utils/ze-http-request.ts"],"names":[],"mappings":";;;;AACA,wDAAkC;AAClC,0DAAoC;AACpC,mCAA2C;AAC3C,iDAAoD;AACpD,uDAAoD;AACpD,mCAA0C;AAC1C,2CAAkC;AAElC,SAAS,OAAO,CAAC,GAAuB;IACtC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"ze-http-request.js","sourceRoot":"","sources":["../../../src/lib/utils/ze-http-request.ts"],"names":[],"mappings":";;;;AACA,wDAAkC;AAClC,0DAAoC;AACpC,mCAA2C;AAC3C,iDAAoD;AACpD,uDAAoD;AACpD,mCAA0C;AAC1C,2CAAkC;AAElC,SAAS,OAAO,CAAC,GAAuB;IACtC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,OAAO,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC,OAAO,CAAC,wCAAwC,EAAE,iBAAiB,CAAC,CAAC;AACrI,CAAC;AAED,SAAsB,OAAO,CAC3B,GAAQ,EACR,OAA2B,EAC3B,IAA+C;;QAE/C,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QACxD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC7B,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YAEtD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EAAE,CAAO,GAAyB,EAAE,EAAE;gBACjF,IAAI,GAAG,CAAC,UAAU,KA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,CAAC,CAAC;IACL,CAAC;CAAA;AA7DD,0BA6DC"}
|
|
@@ -1,45 +1,87 @@
|
|
|
1
1
|
export interface ZephyrBuildStats {
|
|
2
|
+
/** */
|
|
2
3
|
project: string;
|
|
4
|
+
/** @description application_uid */
|
|
3
5
|
id: string;
|
|
6
|
+
/** */
|
|
4
7
|
name: string;
|
|
8
|
+
/** */
|
|
5
9
|
version: string;
|
|
10
|
+
/** */
|
|
6
11
|
environment: string;
|
|
12
|
+
/** */
|
|
7
13
|
posted?: Date;
|
|
14
|
+
/** @description default to `remoteEntry.js` unless user defines it
|
|
15
|
+
*/
|
|
8
16
|
remote: string | undefined;
|
|
17
|
+
/** */
|
|
9
18
|
metadata: unknown;
|
|
19
|
+
/** @description this is for understanding what dependencies are being shared and created by the remote
|
|
20
|
+
* @question how are we going to use it in the future ?
|
|
21
|
+
*/
|
|
10
22
|
overrides: ApplicationOverride[];
|
|
23
|
+
/** @description the remotes this app is consuming */
|
|
11
24
|
consumes: ApplicationConsumes[];
|
|
25
|
+
/**
|
|
26
|
+
* @description this is the component this app is exposing, includes the component name and file name
|
|
27
|
+
*/
|
|
12
28
|
modules: ApplicationModule[];
|
|
29
|
+
/** */
|
|
13
30
|
tags: string[];
|
|
31
|
+
/** @description dependencies in package.json */
|
|
14
32
|
dependencies?: RawDependency[];
|
|
33
|
+
/** @description optionalDependencies in package.json */
|
|
15
34
|
optionalDependencies?: RawDependency[];
|
|
35
|
+
/** @description peerDependencies in package.json */
|
|
16
36
|
peerDependencies?: RawDependency[];
|
|
37
|
+
/** @description devDependencies in package.json */
|
|
17
38
|
devDependencies?: RawDependency[];
|
|
39
|
+
/** What does this default means and what it indicates? */
|
|
18
40
|
default?: boolean;
|
|
41
|
+
/** @description if this is a host app all the remotes goes into here from the mFConfig*/
|
|
19
42
|
remotes?: string[];
|
|
20
43
|
app: {
|
|
44
|
+
/** @description name field from package.json */
|
|
21
45
|
name: string;
|
|
46
|
+
/** @description version field form package.json */
|
|
22
47
|
version: string;
|
|
48
|
+
/** @description if the repository's git remote url is https://github.com/ZephyrCloudIO/zephyr-mono, ZephyrCloudIO would be the org field here */
|
|
23
49
|
org: string;
|
|
50
|
+
/** @description if the repository's git remote url is https://github.com/ZephyrCloudIO/zephyr-mono, zephyr-mono would be the project field here */
|
|
24
51
|
project: string;
|
|
25
|
-
|
|
52
|
+
/** @description this is the user's uuid */
|
|
53
|
+
buildId: string;
|
|
26
54
|
};
|
|
27
55
|
git: {
|
|
56
|
+
/** @required To build a successfully through Zephyr user must have this field
|
|
57
|
+
@description if the local git configuration sets a username this `git.name` would be the `git user.name`, see [ze-util-get-git-info] in zephyr-agent */
|
|
28
58
|
name: string;
|
|
59
|
+
/** @required To build a successfully through Zephyr user must have this field
|
|
60
|
+
@description if the email of local git config is set this email is the `git user.email` */
|
|
29
61
|
email: string;
|
|
62
|
+
/** @required To build a successfully through Zephyr user must have this field
|
|
63
|
+
@description if the branch of this repository is set this would be the result after running `git rev-parse --abbrev-ref HEAD` */
|
|
30
64
|
branch: string;
|
|
65
|
+
/** @requires To build a successfully through Zephyr user must have this field
|
|
66
|
+
@description if there has been commit of this repo, this would be the result of `git rev-parse HEAD` */
|
|
31
67
|
commit: string;
|
|
32
68
|
};
|
|
33
69
|
context: {
|
|
34
|
-
|
|
70
|
+
/** */
|
|
71
|
+
/** */
|
|
72
|
+
username?: string;
|
|
35
73
|
isCI: boolean;
|
|
36
74
|
};
|
|
75
|
+
/** @description become the first part of `remote_host` and `remote_entry_url` in database in `ApplicationTag` table
|
|
76
|
+
*/
|
|
37
77
|
edge: {
|
|
38
78
|
url: string;
|
|
39
79
|
versionUrl?: string;
|
|
40
80
|
};
|
|
81
|
+
/** */
|
|
41
82
|
domain?: string | undefined;
|
|
42
83
|
platform?: DeploymentIntegrationPlatform | undefined;
|
|
84
|
+
/** */
|
|
43
85
|
type: unknown;
|
|
44
86
|
}
|
|
45
87
|
declare enum DeploymentIntegrationPlatform {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zephyr-build-stats.js","sourceRoot":"","sources":["../../src/lib/zephyr-build-stats.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"zephyr-build-stats.js","sourceRoot":"","sources":["../../src/lib/zephyr-build-stats.ts"],"names":[],"mappings":";;AA4FA,IAAK,6BAMJ;AAND,WAAK,6BAA6B;IAChC,0DAAyB,CAAA;IACzB,4CAAW,CAAA;IACX,oDAAmB,CAAA;IACnB,gDAAe,CAAA;IACf,4CAAW,CAAA;AACb,CAAC,EANI,6BAA6B,KAA7B,6BAA6B,QAMjC"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare const docsPrefix = "https://docs.zephyr-cloud.io/guide/error";
|
|
2
|
-
export type Prefix = 'ZE';
|
|
3
|
-
export type BuildErrorCode = `${Prefix}100${number}`;
|
|
4
|
-
export type DeployErrorCode = `${Prefix}200${number}`;
|
|
5
|
-
export type RuntimeErrorCode = `${Prefix}300${number}`;
|
|
6
|
-
type BuildErrorMessageType = {
|
|
7
|
-
[T in BuildErrorCode]: string;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* A collection of error types and the error code during local/build stage*/
|
|
11
|
-
export declare const buildErrorMessages: BuildErrorMessageType;
|
|
12
|
-
export type DeployErrorMessageType = {
|
|
13
|
-
[T in DeployErrorCode]: string;
|
|
14
|
-
};
|
|
15
|
-
/** Happens when users are able to "deploy" -> there'd be edge url show up in their terminal. but when they click on that link it will show them this error. */
|
|
16
|
-
export declare const deployErrorMessages: DeployErrorMessageType;
|
|
17
|
-
export type RuntimeErrorMessageType = {
|
|
18
|
-
[T in RuntimeErrorCode]: string;
|
|
19
|
-
};
|
|
20
|
-
export declare const runtimeErrorMessages: RuntimeErrorMessageType;
|
|
21
|
-
export type ErrorMessageMap = {
|
|
22
|
-
buildErrorMessages: BuildErrorMessageType;
|
|
23
|
-
deployErrorMessages: DeployErrorMessageType;
|
|
24
|
-
runtimeErrorMessages: RuntimeErrorMessageType;
|
|
25
|
-
};
|
|
26
|
-
export declare const errorMessages: ErrorMessageMap;
|
|
27
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.errorMessages = exports.runtimeErrorMessages = exports.deployErrorMessages = exports.buildErrorMessages = exports.docsPrefix = void 0;
|
|
4
|
-
// ! 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
|
|
5
|
-
exports.docsPrefix = 'https://docs.zephyr-cloud.io/guide/error';
|
|
6
|
-
/**
|
|
7
|
-
* A collection of error types and the error code during local/build stage*/
|
|
8
|
-
exports.buildErrorMessages = {
|
|
9
|
-
/** package.json not found error */
|
|
10
|
-
ZE10010: 'Package.json not found',
|
|
11
|
-
/** Package.json is not in a valid json format*/
|
|
12
|
-
ZE10011: 'Package.json is not in a valid json format.',
|
|
13
|
-
/** Webpack config error*/
|
|
14
|
-
ZE10012: 'Webpack config error.', // TODO: we don't detect this error yet, will we be able to separate them?
|
|
15
|
-
/** Package.json must have a name and version field. */
|
|
16
|
-
ZE10013: 'Package.json must have a name and version field.',
|
|
17
|
-
/** Git remote origin is not configured properly.*/
|
|
18
|
-
ZE10014: 'Git remote origin is not configured properly.',
|
|
19
|
-
/** Git username or email is not configured. */
|
|
20
|
-
ZE10015: 'Git username or email is not configured.',
|
|
21
|
-
/** Could not get git info */
|
|
22
|
-
ZE10016: 'Could not get git info.',
|
|
23
|
-
/** application_uid missing. */
|
|
24
|
-
ZE10017: '`application_uid` missing.',
|
|
25
|
-
/** Auth error */
|
|
26
|
-
ZE10018: 'Auth error.',
|
|
27
|
-
/** Could not get build id. */
|
|
28
|
-
ZE10019: 'Could not get build id.',
|
|
29
|
-
/**Could not initialize Zephyr Agent. */
|
|
30
|
-
ZE10020: 'Could not initialize Zephyr Agent.',
|
|
31
|
-
/**Failed to get application hash list. */
|
|
32
|
-
ZE10021: 'Failed to get application hash list.',
|
|
33
|
-
};
|
|
34
|
-
/** Happens when users are able to "deploy" -> there'd be edge url show up in their terminal. but when they click on that link it will show them this error. */
|
|
35
|
-
exports.deployErrorMessages = {
|
|
36
|
-
/** Assets not found. */
|
|
37
|
-
ZE20010: 'Assets not found.',
|
|
38
|
-
/** Assets not found in snapshot. */
|
|
39
|
-
ZE20011: 'Assets not found in snapshot.',
|
|
40
|
-
/** `application_uid` is required. */
|
|
41
|
-
ZE20012: '`application_uid` is required.',
|
|
42
|
-
/** Missing file hash */
|
|
43
|
-
ZE20013: 'Missing file hash.',
|
|
44
|
-
/** Failed to load application configuration. */
|
|
45
|
-
ZE20014: 'Failed to load application configuration.',
|
|
46
|
-
/**Failed to upload build stats. */
|
|
47
|
-
ZE20015: 'Failed to upload build stats.',
|
|
48
|
-
/** Did not receive envs from build stats upload */
|
|
49
|
-
ZE20016: 'Did not receive envs from build stats upload.',
|
|
50
|
-
/** Failed to upload assets. */
|
|
51
|
-
ZE20017: 'Failed to upload assets.',
|
|
52
|
-
/** Failed to upload snapshots. */
|
|
53
|
-
ZE20018: 'Failed to upload snapshots.',
|
|
54
|
-
/** Snapshot uploads gave no results. */
|
|
55
|
-
ZE20019: 'Snapshot uploads gave no results.',
|
|
56
|
-
/**Failed to get application hash list */
|
|
57
|
-
ZE20020: 'Failed to get application hash list.',
|
|
58
|
-
/** Could not resolve ${name} with verson ${version} */
|
|
59
|
-
ZE20021: 'Could not resolve application name with version.',
|
|
60
|
-
/** Could not get build id */
|
|
61
|
-
ZE20022: 'Could not get build id.',
|
|
62
|
-
};
|
|
63
|
-
exports.runtimeErrorMessages = {};
|
|
64
|
-
exports.errorMessages = {
|
|
65
|
-
buildErrorMessages: exports.buildErrorMessages,
|
|
66
|
-
deployErrorMessages: exports.deployErrorMessages,
|
|
67
|
-
runtimeErrorMessages: exports.runtimeErrorMessages,
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=error-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-types.js","sourceRoot":"","sources":["../../../src/lib/utils/error-types.ts"],"names":[],"mappings":";;;AAAA,kJAAkJ;AACrI,QAAA,UAAU,GAAG,0CAA0C,CAAC;AAWrE;4EAC4E;AAC/D,QAAA,kBAAkB,GAA0B;IACvD,mCAAmC;IACnC,OAAO,EAAE,wBAAwB;IACjC,gDAAgD;IAChD,OAAO,EAAE,6CAA6C;IACtD,0BAA0B;IAC1B,OAAO,EAAE,uBAAuB,EAAE,0EAA0E;IAC5G,uDAAuD;IACvD,OAAO,EAAE,kDAAkD;IAC3D,mDAAmD;IACnD,OAAO,EAAE,+CAA+C;IACxD,+CAA+C;IAC/C,OAAO,EAAE,0CAA0C;IACnD,6BAA6B;IAC7B,OAAO,EAAE,yBAAyB;IAClC,+BAA+B;IAC/B,OAAO,EAAE,4BAA4B;IACrC,iBAAiB;IACjB,OAAO,EAAE,aAAa;IACtB,8BAA8B;IAC9B,OAAO,EAAE,yBAAyB;IAClC,wCAAwC;IACxC,OAAO,EAAE,oCAAoC;IAC7C,0CAA0C;IAC1C,OAAO,EAAE,sCAAsC;CAChD,CAAC;AAMF,+JAA+J;AAClJ,QAAA,mBAAmB,GAA2B;IACzD,wBAAwB;IACxB,OAAO,EAAE,mBAAmB;IAC5B,oCAAoC;IACpC,OAAO,EAAE,+BAA+B;IACxC,qCAAqC;IACrC,OAAO,EAAE,gCAAgC;IACzC,wBAAwB;IACxB,OAAO,EAAE,oBAAoB;IAC7B,gDAAgD;IAChD,OAAO,EAAE,2CAA2C;IACpD,mCAAmC;IACnC,OAAO,EAAE,+BAA+B;IACxC,mDAAmD;IACnD,OAAO,EAAE,+CAA+C;IACxD,+BAA+B;IAC/B,OAAO,EAAE,0BAA0B;IACnC,kCAAkC;IAClC,OAAO,EAAE,6BAA6B;IACtC,wCAAwC;IACxC,OAAO,EAAE,mCAAmC;IAC5C,yCAAyC;IACzC,OAAO,EAAE,sCAAsC;IAC/C,uD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