zephyr-edge-contract 0.0.14 → 0.0.16
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 +11 -6
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-contract-negotiation/get-api-contract.d.ts +7 -6
- package/dist/lib/api-contract-negotiation/get-api-contract.js +9 -7
- package/dist/lib/api-contract-negotiation/get-api-contract.js.map +1 -1
- package/dist/lib/edge-api/publish-request.d.ts +28 -0
- package/dist/lib/edge-api/publish-request.js +3 -0
- package/dist/lib/edge-api/publish-request.js.map +1 -0
- package/dist/lib/node-persist/app-deploy-result-cache.d.ts +7 -0
- package/dist/lib/node-persist/app-deploy-result-cache.js +33 -0
- package/dist/lib/node-persist/app-deploy-result-cache.js.map +1 -0
- package/dist/lib/node-persist/application-configuration.js +1 -1
- package/dist/lib/node-persist/application-configuration.js.map +1 -1
- package/dist/lib/node-persist/hash-cache.js.map +1 -1
- package/dist/lib/node-persist/storage-keys.d.ts +2 -1
- package/dist/lib/node-persist/token.js +5 -0
- package/dist/lib/node-persist/token.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-enabled.d.ts +1 -0
- package/dist/lib/utils/debug-enabled.js +9 -0
- package/dist/lib/utils/debug-enabled.js.map +1 -0
- package/dist/lib/utils/debug.d.ts +11 -23
- package/dist/lib/utils/debug.js +21 -56
- 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/picocolor.js +23 -21
- package/dist/lib/utils/picocolor.js.map +1 -1
- 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 +122 -0
- package/dist/lib/zephyr-build-stats.js +11 -0
- package/dist/lib/zephyr-build-stats.js.map +1 -0
- package/dist/lib/zephyr-edge-contract.d.ts +3 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/lib/utils/error-types.d.ts +0 -38
- package/dist/lib/utils/error-types.js +0 -69
- package/dist/lib/utils/error-types.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export interface ZephyrBuildStats {
|
|
2
|
+
/** */
|
|
3
|
+
project: string;
|
|
4
|
+
/** @description application_uid */
|
|
5
|
+
id: string;
|
|
6
|
+
/** */
|
|
7
|
+
name: string;
|
|
8
|
+
/** */
|
|
9
|
+
version: string;
|
|
10
|
+
/** */
|
|
11
|
+
environment: string;
|
|
12
|
+
/** */
|
|
13
|
+
posted?: Date;
|
|
14
|
+
/** @description default to `remoteEntry.js` unless user defines it
|
|
15
|
+
*/
|
|
16
|
+
remote: string | undefined;
|
|
17
|
+
/** */
|
|
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
|
+
*/
|
|
22
|
+
overrides: ApplicationOverride[];
|
|
23
|
+
/** @description the remotes this app is consuming */
|
|
24
|
+
consumes: ApplicationConsumes[];
|
|
25
|
+
/**
|
|
26
|
+
* @description this is the component this app is exposing, includes the component name and file name
|
|
27
|
+
*/
|
|
28
|
+
modules: ApplicationModule[];
|
|
29
|
+
/** */
|
|
30
|
+
tags: string[];
|
|
31
|
+
/** @description dependencies in package.json */
|
|
32
|
+
dependencies?: RawDependency[];
|
|
33
|
+
/** @description optionalDependencies in package.json */
|
|
34
|
+
optionalDependencies?: RawDependency[];
|
|
35
|
+
/** @description peerDependencies in package.json */
|
|
36
|
+
peerDependencies?: RawDependency[];
|
|
37
|
+
/** @description devDependencies in package.json */
|
|
38
|
+
devDependencies?: RawDependency[];
|
|
39
|
+
/** What does this default means and what it indicates? */
|
|
40
|
+
default?: boolean;
|
|
41
|
+
/** @description if this is a host app all the remotes goes into here from the mFConfig*/
|
|
42
|
+
remotes?: string[];
|
|
43
|
+
app: {
|
|
44
|
+
/** @description name field from package.json */
|
|
45
|
+
name: string;
|
|
46
|
+
/** @description version field form package.json */
|
|
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 */
|
|
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 */
|
|
51
|
+
project: string;
|
|
52
|
+
/** @description this is the user's uuid */
|
|
53
|
+
buildId: string;
|
|
54
|
+
};
|
|
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 */
|
|
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` */
|
|
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` */
|
|
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` */
|
|
67
|
+
commit: string;
|
|
68
|
+
};
|
|
69
|
+
context: {
|
|
70
|
+
/** */
|
|
71
|
+
/** */
|
|
72
|
+
username?: string;
|
|
73
|
+
isCI: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** @description become the first part of `remote_host` and `remote_entry_url` in database in `ApplicationTag` table
|
|
76
|
+
*/
|
|
77
|
+
edge: {
|
|
78
|
+
url: string;
|
|
79
|
+
versionUrl?: string;
|
|
80
|
+
};
|
|
81
|
+
/** */
|
|
82
|
+
domain?: string | undefined;
|
|
83
|
+
platform?: DeploymentIntegrationPlatform | undefined;
|
|
84
|
+
/** */
|
|
85
|
+
type: unknown;
|
|
86
|
+
}
|
|
87
|
+
declare enum DeploymentIntegrationPlatform {
|
|
88
|
+
CLOUDFLARE = "cloudflare",
|
|
89
|
+
AWS = "aws",
|
|
90
|
+
NETLIFY = "netlify",
|
|
91
|
+
AZURE = "azure",
|
|
92
|
+
GCP = "gcp"
|
|
93
|
+
}
|
|
94
|
+
export interface RawDependency {
|
|
95
|
+
name: string;
|
|
96
|
+
version: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ApplicationModule {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
applicationID: string;
|
|
102
|
+
requires: string[];
|
|
103
|
+
file: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ApplicationOverride {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
version: string;
|
|
109
|
+
location: string;
|
|
110
|
+
applicationID: string;
|
|
111
|
+
}
|
|
112
|
+
export interface ApplicationConsumes {
|
|
113
|
+
consumingApplicationID: string;
|
|
114
|
+
applicationID: string;
|
|
115
|
+
name: string;
|
|
116
|
+
usedIn: UsedIn[];
|
|
117
|
+
}
|
|
118
|
+
export interface UsedIn {
|
|
119
|
+
file: string;
|
|
120
|
+
url: string;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var DeploymentIntegrationPlatform;
|
|
4
|
+
(function (DeploymentIntegrationPlatform) {
|
|
5
|
+
DeploymentIntegrationPlatform["CLOUDFLARE"] = "cloudflare";
|
|
6
|
+
DeploymentIntegrationPlatform["AWS"] = "aws";
|
|
7
|
+
DeploymentIntegrationPlatform["NETLIFY"] = "netlify";
|
|
8
|
+
DeploymentIntegrationPlatform["AZURE"] = "azure";
|
|
9
|
+
DeploymentIntegrationPlatform["GCP"] = "gcp";
|
|
10
|
+
})(DeploymentIntegrationPlatform || (DeploymentIntegrationPlatform = {}));
|
|
11
|
+
//# sourceMappingURL=zephyr-build-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,38 +0,0 @@
|
|
|
1
|
-
export declare const docsPrefix = "https://docs.zephyr-cloud.io/guide/error";
|
|
2
|
-
export declare enum ErrorCategories {
|
|
3
|
-
/** "BU" is the prefix for errors happen during local development. This list will grow as we go. */
|
|
4
|
-
Build = "BU",
|
|
5
|
-
/** "DE" is the prefix for errors happen during deployment. */
|
|
6
|
-
Deploy = "DE",
|
|
7
|
-
/** "RT" is the prefix for errors happen in runtime - sometimes they are not related to us and the debugging, error handling might be living in other framework, bundler, github issues etc.
|
|
8
|
-
*
|
|
9
|
-
* keeping it here to attach 'issues not related to us but it'd be nice of us to send them the potential workaround in the terminal.
|
|
10
|
-
*
|
|
11
|
-
* For now we haven't seen enough of this error reporting back. Unless we have the statistics from user, otherwise our docs related to this part would be empty*/
|
|
12
|
-
Runtime = "RT"
|
|
13
|
-
}
|
|
14
|
-
export type BuildErrorCode = `${ErrorCategories.Build}100${number}`;
|
|
15
|
-
export type DeployErrorCode = `${ErrorCategories.Deploy}200${number}`;
|
|
16
|
-
export type RuntimeErrorCode = `${ErrorCategories.Runtime}300${number}`;
|
|
17
|
-
type BuildErrorMessageType = {
|
|
18
|
-
[T in BuildErrorCode]: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* A collection of error types and the error code during local/build stage*/
|
|
22
|
-
export declare const buildErrorMessages: BuildErrorMessageType;
|
|
23
|
-
export type DeployErrorMessageType = {
|
|
24
|
-
[T in DeployErrorCode]: string;
|
|
25
|
-
};
|
|
26
|
-
/** 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. */
|
|
27
|
-
export declare const deployErrorMessages: DeployErrorMessageType;
|
|
28
|
-
export type RuntimeErrorMessageType = {
|
|
29
|
-
[T in RuntimeErrorCode]: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const runtimeErrorMessages: RuntimeErrorMessageType;
|
|
32
|
-
export type ErrorMessageMap = {
|
|
33
|
-
buildErrorMessages: BuildErrorMessageType;
|
|
34
|
-
deployErrorMessages: DeployErrorMessageType;
|
|
35
|
-
runtimeErrorMessages: RuntimeErrorMessageType;
|
|
36
|
-
};
|
|
37
|
-
export declare const errorMessages: ErrorMessageMap;
|
|
38
|
-
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
|
-
BU10010: "Package.json not found",
|
|
11
|
-
/** Package.json is not in a valid json format*/
|
|
12
|
-
BU10011: "Package.json is not in a valid json format.",
|
|
13
|
-
/** Webpack config error*/
|
|
14
|
-
BU10012: "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
|
-
BU10013: "Package.json must have a name and version field.",
|
|
17
|
-
/** Git remote origin is not configured properly.*/
|
|
18
|
-
BU10014: "Git remote origin is not configured properly.",
|
|
19
|
-
/** Git username or email is not configured. */
|
|
20
|
-
BU10015: "Git username or email is not configured.",
|
|
21
|
-
/** Could not get git info */
|
|
22
|
-
BU10016: "Could not get git info.",
|
|
23
|
-
/** application_uid missing. */
|
|
24
|
-
BU10017: "`application_uid` missing.",
|
|
25
|
-
/** Auth error */
|
|
26
|
-
BU10018: "Auth error.",
|
|
27
|
-
/** Could not get build id. */
|
|
28
|
-
BU10019: "Could not get build id.",
|
|
29
|
-
/**Could not initialize Zephyr Agent. */
|
|
30
|
-
BU10020: "Could not initialize Zephyr Agent.",
|
|
31
|
-
/**Failed to get application hash list. */
|
|
32
|
-
BU10021: "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
|
-
DE20010: "Assets not found.",
|
|
38
|
-
/** Assets not found in snapshot. */
|
|
39
|
-
DE20011: "Assets not found in snapshot.",
|
|
40
|
-
/** `application_uid` is required. */
|
|
41
|
-
DE20012: "`application_uid` is required.",
|
|
42
|
-
/** Missing file hash */
|
|
43
|
-
DE20013: "Missing file hash.",
|
|
44
|
-
/** Failed to load application configuration. */
|
|
45
|
-
DE20014: "Failed to load application configuration.",
|
|
46
|
-
/**Failed to upload build stats. */
|
|
47
|
-
DE20015: "Failed to upload build stats.",
|
|
48
|
-
/** Did not receive envs from build stats upload */
|
|
49
|
-
DE20016: "Did not receive envs from build stats upload.",
|
|
50
|
-
/** Failed to upload assets. */
|
|
51
|
-
DE20017: "Failed to upload assets.",
|
|
52
|
-
/** Failed to upload snapshots. */
|
|
53
|
-
DE20018: "Failed to upload snapshots.",
|
|
54
|
-
/** Snapshot uploads gave no results. */
|
|
55
|
-
DE20019: "Snapshot uploads gave no results.",
|
|
56
|
-
/**Failed to get application hash list */
|
|
57
|
-
DE20020: "Failed to get application hash list.",
|
|
58
|
-
/** Could not resolve ${name} with verson ${version} */
|
|
59
|
-
DE20021: "Could not resolve application name with version.",
|
|
60
|
-
/** Could not get build id */
|
|
61
|
-
DE20022: "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":";;;AACA,kJAAkJ;AACrI,QAAA,UAAU,GAAG,0CAA0C,CAAA;AAyBpE;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;CAGhD,CAAA;AAOD,+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,uDAAuD;IACvD,OAAO,EAAE,kDAAkD;IAC3D,6BAA6B;IAC7B,OAAO,EAAE,yBAAyB;CACnC,CAAA;AAQY,QAAA,oBAAoB,GAA4B,EAE5D,CAAA;AAQY,QAAA,aAAa,GAAoB;IAC5C,kBAAkB,EAAlB,0BAAkB;IAClB,mBAAmB,EAAnB,2BAAmB;IACnB,oBAAoB,EAApB,4BAAoB;CACrB,CAAA"}
|