zephyr-edge-contract 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -7
- package/src/index.d.ts +7 -3
- package/src/index.js +10 -11
- package/src/index.js.map +1 -1
- package/src/lib/plugin-options/ze-webpack-plugin-options.d.ts +32 -0
- package/src/lib/plugin-options/ze-webpack-plugin-options.js +3 -0
- package/src/lib/plugin-options/ze-webpack-plugin-options.js.map +1 -0
- package/src/lib/plugin-options/zephyr-plugin-options.d.ts +8 -0
- package/src/lib/plugin-options/zephyr-plugin-options.js +3 -0
- package/src/lib/plugin-options/zephyr-plugin-options.js.map +1 -0
- package/src/lib/utils/debug.d.ts +6 -0
- package/src/lib/utils/debug.js +15 -0
- package/src/lib/utils/debug.js.map +1 -0
- package/src/lib/utils/ze-http-request.d.ts +3 -0
- package/src/lib/utils/ze-http-request.js +49 -0
- package/src/lib/utils/ze-http-request.js.map +1 -0
- package/src/lib/ze-api/converted-graph.d.ts +20 -0
- package/src/lib/ze-api/converted-graph.js +3 -0
- package/src/lib/ze-api/converted-graph.js.map +1 -0
- package/src/lib/ze-api/local-package-json.d.ts +21 -0
- package/src/lib/ze-api/local-package-json.js +9 -0
- package/src/lib/ze-api/local-package-json.js.map +1 -0
- package/src/lib/zephyr-edge-contract.d.ts +70 -2
- package/src/lib/utils/get-application-configuration.d.ts +0 -6
- package/src/lib/utils/get-application-configuration.js +0 -49
- package/src/lib/utils/get-application-configuration.js.map +0 -1
- package/src/lib/utils/login.d.ts +0 -23
- package/src/lib/utils/login.js +0 -106
- package/src/lib/utils/login.js.map +0 -1
- package/src/lib/utils/websocket.d.ts +0 -13
- package/src/lib/utils/websocket.js +0 -14
- package/src/lib/utils/websocket.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-edge-contract",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "nx build zephyr-edge-contract"
|
|
7
|
+
},
|
|
5
8
|
"dependencies": {
|
|
6
|
-
"jose": "^5.2.4",
|
|
7
9
|
"tslib": "^2.3.0",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"uuid": "8.3.2",
|
|
11
|
-
"socket.io-client": "^4.7.5"
|
|
10
|
+
"debug": "^4.3.4",
|
|
11
|
+
"node-persist": "^4.0.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/node": "^20.11.19"
|
|
14
|
+
"@types/node": "^20.11.19",
|
|
15
|
+
"@types/node-persist": "^3.1.8",
|
|
16
|
+
"@types/debug": "^4.1.12"
|
|
15
17
|
},
|
|
16
18
|
"type": "commonjs",
|
|
17
19
|
"main": "./src/index.js",
|
|
20
|
+
"module": "./src/index.js",
|
|
18
21
|
"typings": "./src/index.d.ts"
|
|
19
22
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -5,8 +5,12 @@ export { ZeApplicationList } from './lib/ze-api/app-list';
|
|
|
5
5
|
export { Snapshot, SnapshotAsset } from './lib/snapshot';
|
|
6
6
|
export { ZeEnvs, ZeUploadBuildStats } from './lib/edge-api/ze-envs-request';
|
|
7
7
|
export * from './lib/zephyr-edge-contract';
|
|
8
|
-
export { type GetPersonalAccessTokenFromWebsocketOptions, type AuthOptions, getPersonalAccessTokenFromWebsocket, getAuthenticationURL, checkAuth, isTokenStillValid, } from './lib/utils/login';
|
|
9
8
|
export { saveToken, getToken, removeToken, cleanTokens, } from './lib/node-persist/token';
|
|
10
|
-
export { ZEPHYR_API_ENDPOINT, v2_api_paths, } from './lib/api-contract-negotiation/get-api-contract';
|
|
11
|
-
export { getApplicationConfiguration } from './lib/utils/get-application-configuration';
|
|
12
9
|
export { ZeApplicationConfig, getAppConfig, remoteAppConfig, saveAppConfig, } from './lib/node-persist/application-configuration';
|
|
10
|
+
export { ZeWebpackPluginOptions } from './lib/plugin-options/ze-webpack-plugin-options';
|
|
11
|
+
export { ZephyrPluginOptions } from './lib/plugin-options/zephyr-plugin-options';
|
|
12
|
+
export { ZEPHYR_API_ENDPOINT, v2_api_paths, } from './lib/api-contract-negotiation/get-api-contract';
|
|
13
|
+
export { ze_log, ze_error, is_debug_enabled } from './lib/utils/debug';
|
|
14
|
+
export { request } from './lib/utils/ze-http-request';
|
|
15
|
+
export { LocalPackageJson } from './lib/ze-api/local-package-json';
|
|
16
|
+
export { ConvertedGraph } from './lib/ze-api/converted-graph';
|
package/src/index.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.request = exports.is_debug_enabled = exports.ze_error = exports.ze_log = exports.v2_api_paths = exports.ZEPHYR_API_ENDPOINT = exports.saveAppConfig = exports.remoteAppConfig = exports.getAppConfig = exports.cleanTokens = exports.removeToken = exports.getToken = exports.saveToken = exports.createSnapshotId = exports.createFullAppName = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var create_full_app_name_1 = require("./lib/utils/create-full-app-name");
|
|
6
6
|
Object.defineProperty(exports, "createFullAppName", { enumerable: true, get: function () { return create_full_app_name_1.createFullAppName; } });
|
|
7
7
|
var create_snapshot_id_1 = require("./lib/utils/create-snapshot-id");
|
|
8
8
|
Object.defineProperty(exports, "createSnapshotId", { enumerable: true, get: function () { return create_snapshot_id_1.createSnapshotId; } });
|
|
9
9
|
tslib_1.__exportStar(require("./lib/zephyr-edge-contract"), exports);
|
|
10
|
-
var login_1 = require("./lib/utils/login");
|
|
11
|
-
Object.defineProperty(exports, "getPersonalAccessTokenFromWebsocket", { enumerable: true, get: function () { return login_1.getPersonalAccessTokenFromWebsocket; } });
|
|
12
|
-
Object.defineProperty(exports, "getAuthenticationURL", { enumerable: true, get: function () { return login_1.getAuthenticationURL; } });
|
|
13
|
-
Object.defineProperty(exports, "checkAuth", { enumerable: true, get: function () { return login_1.checkAuth; } });
|
|
14
|
-
Object.defineProperty(exports, "isTokenStillValid", { enumerable: true, get: function () { return login_1.isTokenStillValid; } });
|
|
15
10
|
var token_1 = require("./lib/node-persist/token");
|
|
16
11
|
Object.defineProperty(exports, "saveToken", { enumerable: true, get: function () { return token_1.saveToken; } });
|
|
17
12
|
Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return token_1.getToken; } });
|
|
18
13
|
Object.defineProperty(exports, "removeToken", { enumerable: true, get: function () { return token_1.removeToken; } });
|
|
19
14
|
Object.defineProperty(exports, "cleanTokens", { enumerable: true, get: function () { return token_1.cleanTokens; } });
|
|
20
|
-
var get_api_contract_1 = require("./lib/api-contract-negotiation/get-api-contract");
|
|
21
|
-
Object.defineProperty(exports, "ZEPHYR_API_ENDPOINT", { enumerable: true, get: function () { return get_api_contract_1.ZEPHYR_API_ENDPOINT; } });
|
|
22
|
-
Object.defineProperty(exports, "v2_api_paths", { enumerable: true, get: function () { return get_api_contract_1.v2_api_paths; } });
|
|
23
|
-
var get_application_configuration_1 = require("./lib/utils/get-application-configuration");
|
|
24
|
-
Object.defineProperty(exports, "getApplicationConfiguration", { enumerable: true, get: function () { return get_application_configuration_1.getApplicationConfiguration; } });
|
|
25
15
|
var application_configuration_1 = require("./lib/node-persist/application-configuration");
|
|
26
16
|
Object.defineProperty(exports, "getAppConfig", { enumerable: true, get: function () { return application_configuration_1.getAppConfig; } });
|
|
27
17
|
Object.defineProperty(exports, "remoteAppConfig", { enumerable: true, get: function () { return application_configuration_1.remoteAppConfig; } });
|
|
28
18
|
Object.defineProperty(exports, "saveAppConfig", { enumerable: true, get: function () { return application_configuration_1.saveAppConfig; } });
|
|
19
|
+
var get_api_contract_1 = require("./lib/api-contract-negotiation/get-api-contract");
|
|
20
|
+
Object.defineProperty(exports, "ZEPHYR_API_ENDPOINT", { enumerable: true, get: function () { return get_api_contract_1.ZEPHYR_API_ENDPOINT; } });
|
|
21
|
+
Object.defineProperty(exports, "v2_api_paths", { enumerable: true, get: function () { return get_api_contract_1.v2_api_paths; } });
|
|
22
|
+
var debug_1 = require("./lib/utils/debug");
|
|
23
|
+
Object.defineProperty(exports, "ze_log", { enumerable: true, get: function () { return debug_1.ze_log; } });
|
|
24
|
+
Object.defineProperty(exports, "ze_error", { enumerable: true, get: function () { return debug_1.ze_error; } });
|
|
25
|
+
Object.defineProperty(exports, "is_debug_enabled", { enumerable: true, get: function () { return debug_1.is_debug_enabled; } });
|
|
26
|
+
var ze_http_request_1 = require("./lib/utils/ze-http-request");
|
|
27
|
+
Object.defineProperty(exports, "request", { enumerable: true, get: function () { return ze_http_request_1.request; } });
|
|
29
28
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/zephyr-edge-contract/src/index.ts"],"names":[],"mappings":";;;;AAAA,yEAAqE;AAA5D,yHAAA,iBAAiB,OAAA;AAC1B,qEAAkE;AAAzD,sHAAA,gBAAgB,OAAA;AAOzB,qEAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/zephyr-edge-contract/src/index.ts"],"names":[],"mappings":";;;;AAAA,yEAAqE;AAA5D,yHAAA,iBAAiB,OAAA;AAC1B,qEAAkE;AAAzD,sHAAA,gBAAgB,OAAA;AAOzB,qEAA2C;AAE3C,kDAKkC;AAJhC,kGAAA,SAAS,OAAA;AACT,iGAAA,QAAQ,OAAA;AACR,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AAGb,0FAKsD;AAHpD,yHAAA,YAAY,OAAA;AACZ,4HAAA,eAAe,OAAA;AACf,0HAAA,aAAa,OAAA;AAMf,oFAGyD;AAFvD,uHAAA,mBAAmB,OAAA;AACnB,gHAAA,YAAY,OAAA;AAGd,2CAAuE;AAA9D,+FAAA,MAAM,OAAA;AAAE,iGAAA,QAAQ,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAC3C,+DAAsD;AAA7C,0GAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ZeWebpackPluginOptions {
|
|
2
|
+
pluginName: string;
|
|
3
|
+
isCI: boolean;
|
|
4
|
+
buildEnv: string;
|
|
5
|
+
username: string;
|
|
6
|
+
zeConfig: {
|
|
7
|
+
edge_url: string;
|
|
8
|
+
user: string;
|
|
9
|
+
buildId: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
application_uid: string;
|
|
12
|
+
app: {
|
|
13
|
+
org: string;
|
|
14
|
+
project: string;
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
};
|
|
18
|
+
git: {
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
branch: string;
|
|
22
|
+
commit: string;
|
|
23
|
+
};
|
|
24
|
+
mfConfig?: {
|
|
25
|
+
name: string;
|
|
26
|
+
filename: string;
|
|
27
|
+
exposes?: Record<string, string>;
|
|
28
|
+
remotes?: Record<string, string>;
|
|
29
|
+
shared?: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
wait_for_index_html?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ze-webpack-plugin-options.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/plugin-options/ze-webpack-plugin-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zephyr-plugin-options.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/plugin-options/zephyr-plugin-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a, _b;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ze_error = exports.ze_log = exports.is_debug_enabled = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const debug_1 = require("debug");
|
|
7
|
+
const process = tslib_1.__importStar(require("node:process"));
|
|
8
|
+
const name = 'zephyr';
|
|
9
|
+
exports.is_debug_enabled = (_b = ((_a = process.env['DEBUG']) !== null && _a !== void 0 ? _a : '')
|
|
10
|
+
.indexOf('zephyr:*') !== -1) !== null && _b !== void 0 ? _b : false;
|
|
11
|
+
exports.ze_log = (0, debug_1.debug)(`${name}:log`);
|
|
12
|
+
exports.ze_error = exports.is_debug_enabled
|
|
13
|
+
? (0, debug_1.debug)(`${name}:error`)
|
|
14
|
+
: console.error.bind(console);
|
|
15
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/utils/debug.ts"],"names":[],"mappings":";;;;;AAAA,iCAA8B;AAC9B,8DAAwC;AAExC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAET,QAAA,gBAAgB,GAAG,MAAA,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAC;KACzD,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,mCAAI,KAAK,CAAC;AAE1B,QAAA,MAAM,GAAG,IAAA,aAAK,EAAC,GAAG,IAAI,MAAM,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAG,wBAAgB;IACtC,CAAC,CAAC,IAAA,aAAK,EAAC,GAAG,IAAI,QAAQ,CAAC;IACxB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.request = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const http = tslib_1.__importStar(require("node:http"));
|
|
6
|
+
const https = tslib_1.__importStar(require("node:https"));
|
|
7
|
+
const debug_1 = require("./debug");
|
|
8
|
+
const token_1 = require("../node-persist/token");
|
|
9
|
+
function request(url, options, data) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const _https = url.protocol !== 'https:' ? http : https;
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
(0, debug_1.ze_log)(`Requesting ${url}`, `with options: ${JSON.stringify(options)}`);
|
|
14
|
+
const req = _https.request(url, options !== null && options !== void 0 ? options : {}, (res) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (res.statusCode === 401 || res.statusCode === 403) {
|
|
16
|
+
yield (0, token_1.cleanTokens)();
|
|
17
|
+
const err = new Error('[zephyr]: auth error, please try to build again');
|
|
18
|
+
err.stack = void 0;
|
|
19
|
+
throw err;
|
|
20
|
+
}
|
|
21
|
+
const response = [];
|
|
22
|
+
res.on('data', (d) => response.push(d));
|
|
23
|
+
res.on('end', () => {
|
|
24
|
+
var _a;
|
|
25
|
+
const _response = (_a = Buffer.concat(response)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
26
|
+
if (_response === 'Not Implemented')
|
|
27
|
+
return reject(`Response for ${url} is ${_response}`);
|
|
28
|
+
(0, debug_1.ze_log)(`Response from ${url}`, _response);
|
|
29
|
+
try {
|
|
30
|
+
resolve(JSON.parse(_response));
|
|
31
|
+
}
|
|
32
|
+
catch (_b) {
|
|
33
|
+
resolve(_response);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}));
|
|
37
|
+
req.on('error', (e) => {
|
|
38
|
+
(0, debug_1.ze_error)(`Failed to request ${url.toString()}`, e);
|
|
39
|
+
reject(e);
|
|
40
|
+
});
|
|
41
|
+
if (data) {
|
|
42
|
+
req.write(data);
|
|
43
|
+
}
|
|
44
|
+
req.end();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
exports.request = request;
|
|
49
|
+
//# sourceMappingURL=ze-http-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ze-http-request.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/utils/ze-http-request.ts"],"names":[],"mappings":";;;;AAAA,wDAAkC;AAClC,0DAAoC;AAEpC,mCAA2C;AAC3C,iDAAoD;AAEpD,SAAsB,OAAO,CAC3B,GAAQ,EACR,OAA2B,EAC3B,IAAc;;QAEd,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,IAAA,cAAM,EAAC,cAAc,GAAG,EAAE,EAAE,iBAAiB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACxE,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CACxB,GAAG,EACH,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,CAAO,GAAyB,EAAE,EAAE;gBAClC,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBACrD,MAAM,IAAA,mBAAW,GAAE,CAAC;oBACpB,MAAM,GAAG,GAAG,IAAI,KAAK,CACnB,iDAAiD,CAClD,CAAC;oBACF,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;oBACnB,MAAM,GAAG,CAAC;gBACZ,CAAC;gBAED,MAAM,QAAQ,GAAa,EAAE,CAAC;gBAC9B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAEhD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;;oBACjB,MAAM,SAAS,GAAG,MAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,0CAAE,QAAQ,EAAE,CAAC;oBACtD,IAAI,SAAS,KAAK,iBAAiB;wBACjC,OAAO,MAAM,CAAC,gBAAgB,GAAG,OAAO,SAAS,EAAE,CAAC,CAAC;oBACvD,IAAA,cAAM,EAAC,iBAAiB,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;oBAC1C,IAAI,CAAC;wBACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;oBACjC,CAAC;oBAAC,WAAM,CAAC;wBACP,OAAO,CAAC,SAAS,CAAC,CAAC;oBACrB,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAA,CACF,CAAC;YAEF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAU,EAAE,EAAE;gBAC7B,IAAA,gBAAQ,EAAC,qBAAqB,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;gBACnD,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC,CAAC,CAAC;YAEH,IAAI,IAAI,EAAE,CAAC;gBACT,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YAED,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAjDD,0BAiDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LocalPackageJson } from './local-package-json';
|
|
2
|
+
export interface ConvertedGraph {
|
|
3
|
+
id?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
remote: unknown;
|
|
7
|
+
metadata: unknown;
|
|
8
|
+
versionData: unknown;
|
|
9
|
+
overrides: unknown[];
|
|
10
|
+
consumes: unknown[];
|
|
11
|
+
modules: unknown[];
|
|
12
|
+
environment: unknown;
|
|
13
|
+
posted: unknown;
|
|
14
|
+
group: unknown;
|
|
15
|
+
sha: unknown;
|
|
16
|
+
buildHash: unknown;
|
|
17
|
+
dependencies?: LocalPackageJson[];
|
|
18
|
+
devDependencies?: LocalPackageJson[];
|
|
19
|
+
optionalDependencies?: LocalPackageJson[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"converted-graph.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/ze-api/converted-graph.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts and returns the license/licenses abbrevations
|
|
3
|
+
* from the respective fields.
|
|
4
|
+
* @param {Object} packageJson The package.json file content as object.
|
|
5
|
+
* @return {String}
|
|
6
|
+
*/
|
|
7
|
+
export interface LocalPackageJson {
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
homepage?: string;
|
|
11
|
+
size?: number;
|
|
12
|
+
license?: {
|
|
13
|
+
type: string;
|
|
14
|
+
} | string;
|
|
15
|
+
licenses?: Array<{
|
|
16
|
+
type: string;
|
|
17
|
+
}> | {
|
|
18
|
+
type: string;
|
|
19
|
+
} | string;
|
|
20
|
+
[key: string]: LocalPackageJson[keyof LocalPackageJson];
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts and returns the license/licenses abbrevations
|
|
4
|
+
* from the respective fields.
|
|
5
|
+
* @param {Object} packageJson The package.json file content as object.
|
|
6
|
+
* @return {String}
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=local-package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-package-json.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/ze-api/local-package-json.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export interface Asset {
|
|
3
|
+
/**
|
|
4
|
+
* the filename of the asset
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* source of the asset
|
|
9
|
+
*/
|
|
10
|
+
source: Source;
|
|
11
|
+
/**
|
|
12
|
+
* info about the asset
|
|
13
|
+
*/
|
|
14
|
+
info: KnownAssetInfo;
|
|
15
|
+
}
|
|
16
|
+
interface KnownAssetInfo {
|
|
17
|
+
/**
|
|
18
|
+
* true, if the asset can be long term cached forever (contains a hash)
|
|
19
|
+
*/
|
|
20
|
+
immutable?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* whether the asset is minimized
|
|
23
|
+
*/
|
|
24
|
+
minimized?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* the value(s) of the full hash used for this asset
|
|
27
|
+
*/
|
|
28
|
+
fullhash?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* the value(s) of the chunk hash used for this asset
|
|
31
|
+
*/
|
|
32
|
+
chunkhash?: string | string[];
|
|
33
|
+
/**
|
|
34
|
+
* the value(s) of the module hash used for this asset
|
|
35
|
+
*/
|
|
36
|
+
modulehash?: string | string[];
|
|
37
|
+
/**
|
|
38
|
+
* the value(s) of the content hash used for this asset
|
|
39
|
+
*/
|
|
40
|
+
contenthash?: string | string[];
|
|
41
|
+
/**
|
|
42
|
+
* when asset was created from a source file (potentially transformed), the original filename relative to compilation context
|
|
43
|
+
*/
|
|
44
|
+
sourceFilename?: string;
|
|
45
|
+
/**
|
|
46
|
+
* size in bytes, only set after asset has been emitted
|
|
47
|
+
*/
|
|
48
|
+
size?: number;
|
|
49
|
+
/**
|
|
50
|
+
* true, when asset is only used for development and doesn't count towards user-facing assets
|
|
51
|
+
*/
|
|
52
|
+
development?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* true, when asset ships data for updating an existing application (HMR)
|
|
55
|
+
*/
|
|
56
|
+
hotModuleReplacement?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* true, when asset is javascript and an ESM
|
|
59
|
+
*/
|
|
60
|
+
javascriptModule?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* object of pointers to other assets, keyed by type of relation (only points from parent to child)
|
|
63
|
+
*/
|
|
64
|
+
related?: Record<string, string | string[]>;
|
|
65
|
+
}
|
|
66
|
+
export interface Source {
|
|
67
|
+
size(): number;
|
|
68
|
+
source(): string | Buffer;
|
|
69
|
+
buffer(): Buffer;
|
|
70
|
+
}
|
|
4
71
|
export interface UploadableAsset {
|
|
5
72
|
path: string;
|
|
6
73
|
extname: string;
|
|
@@ -30,3 +97,4 @@ export interface SnapshotUploadRes {
|
|
|
30
97
|
assets: ZeBuildAsset[];
|
|
31
98
|
message: string;
|
|
32
99
|
}
|
|
100
|
+
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ZeApplicationConfig } from '../node-persist/application-configuration';
|
|
2
|
-
interface GetApplicationConfigurationProps {
|
|
3
|
-
application_uid: string | undefined;
|
|
4
|
-
}
|
|
5
|
-
export declare function getApplicationConfiguration({ application_uid, }: GetApplicationConfigurationProps): Promise<ZeApplicationConfig>;
|
|
6
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getApplicationConfiguration = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const jose = require("jose");
|
|
6
|
-
const token_1 = require("../node-persist/token");
|
|
7
|
-
const get_api_contract_1 = require("../api-contract-negotiation/get-api-contract");
|
|
8
|
-
const application_configuration_1 = require("../node-persist/application-configuration");
|
|
9
|
-
const login_1 = require("./login");
|
|
10
|
-
function loadApplicationConfiguration(_a) {
|
|
11
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ application_uid, }) {
|
|
12
|
-
if (!application_uid) {
|
|
13
|
-
throw new Error(`[zephyr] Critical error: application_uid is missing`);
|
|
14
|
-
}
|
|
15
|
-
const token = yield (0, token_1.getToken)();
|
|
16
|
-
const application_config_url = new URL(get_api_contract_1.v2_api_paths.application_configuration, get_api_contract_1.ZEPHYR_API_ENDPOINT);
|
|
17
|
-
application_config_url.searchParams.append('application-uid', application_uid);
|
|
18
|
-
const req = fetch(application_config_url, {
|
|
19
|
-
headers: { Authorization: 'Bearer ' + token },
|
|
20
|
-
});
|
|
21
|
-
req.catch((v) => console.error(v));
|
|
22
|
-
const response = yield req;
|
|
23
|
-
if (!response.ok && response.status !== 200) {
|
|
24
|
-
yield (0, token_1.cleanTokens)();
|
|
25
|
-
const err = new Error('[zephyr]: auth error, please try to build again');
|
|
26
|
-
err.stack = void 0;
|
|
27
|
-
throw err;
|
|
28
|
-
}
|
|
29
|
-
const result = yield response.json();
|
|
30
|
-
return Object.assign({}, result.value, {
|
|
31
|
-
jwt_decode: jose.decodeJwt(result.value.jwt),
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function getApplicationConfiguration(_a) {
|
|
36
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ application_uid, }) {
|
|
37
|
-
const storedAppConfig = yield (0, application_configuration_1.getAppConfig)();
|
|
38
|
-
if (storedAppConfig && (0, login_1.isTokenStillValid)(storedAppConfig.jwt)) {
|
|
39
|
-
return storedAppConfig;
|
|
40
|
-
}
|
|
41
|
-
const loadedAppConfig = yield loadApplicationConfiguration({
|
|
42
|
-
application_uid,
|
|
43
|
-
});
|
|
44
|
-
yield (0, application_configuration_1.saveAppConfig)(loadedAppConfig);
|
|
45
|
-
return loadedAppConfig;
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
exports.getApplicationConfiguration = getApplicationConfiguration;
|
|
49
|
-
//# sourceMappingURL=get-application-configuration.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-application-configuration.js","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AI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAsB,2BAA2B;iEAAC,EAChD,eAAe,GACkB;QACjC,MAAM,eAAe,GAAG,MAAM,IAAA,wCAAY,GAAE,CAAC;QAC7C,IAAI,eAAe,IAAI,IAAA,yBAAiB,EAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9D,OAAO,eAAe,CAAC;QACzB,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,4BAA4B,CAAC;YACzD,eAAe;SAChB,CAAC,CAAC;QACH,MAAM,IAAA,yCAAa,EAAC,eAAe,CAAC,CAAC;QACrC,OAAO,eAAe,CAAC;IACzB,CAAC;CAAA;AAbD,kEAaC"}
|
package/src/lib/utils/login.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare function generateSessionKey(): string;
|
|
2
|
-
export interface GetPersonalAccessTokenFromWebsocketOptions {
|
|
3
|
-
openBrowser?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare function getPersonalAccessTokenFromWebsocket({ openBrowser }?: GetPersonalAccessTokenFromWebsocketOptions): Promise<string>;
|
|
6
|
-
export interface AuthOptions {
|
|
7
|
-
state: string;
|
|
8
|
-
responseType?: string;
|
|
9
|
-
scope?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function getAuthenticationURL(options: AuthOptions): Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Check if the user is already authenticated. If not, open a browser window to authenticate.
|
|
14
|
-
* Display a message to the console.
|
|
15
|
-
* @return The token as a string.
|
|
16
|
-
*/
|
|
17
|
-
export declare function checkAuth(): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Decides whether the token is still valid based on its expiration time.
|
|
20
|
-
* @param token The token to check.
|
|
21
|
-
* @return boolean indicating if the token is still valid.
|
|
22
|
-
*/
|
|
23
|
-
export declare function isTokenStillValid(token: string): boolean;
|
package/src/lib/utils/login.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTokenStillValid = exports.checkAuth = exports.getAuthenticationURL = exports.getPersonalAccessTokenFromWebsocket = exports.generateSessionKey = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const open = require("open");
|
|
6
|
-
const jose = require("jose");
|
|
7
|
-
const uuid_1 = require("uuid");
|
|
8
|
-
const websocket_1 = require("./websocket");
|
|
9
|
-
const token_1 = require("../node-persist/token");
|
|
10
|
-
const get_api_contract_1 = require("../api-contract-negotiation/get-api-contract");
|
|
11
|
-
function generateSessionKey() {
|
|
12
|
-
return (0, uuid_1.v4)().replace(/-/g, '');
|
|
13
|
-
}
|
|
14
|
-
exports.generateSessionKey = generateSessionKey;
|
|
15
|
-
function getPersonalAccessTokenFromWebsocket() {
|
|
16
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ openBrowser } = {
|
|
17
|
-
openBrowser: true,
|
|
18
|
-
}) {
|
|
19
|
-
const sessionKey = generateSessionKey();
|
|
20
|
-
if (openBrowser) {
|
|
21
|
-
const authUrl = yield getAuthenticationURL({ state: sessionKey });
|
|
22
|
-
yield open(authUrl);
|
|
23
|
-
}
|
|
24
|
-
return yield subscribeToWsEvents(sessionKey);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
exports.getPersonalAccessTokenFromWebsocket = getPersonalAccessTokenFromWebsocket;
|
|
28
|
-
function getAuthenticationURL(options) {
|
|
29
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const { state } = options;
|
|
31
|
-
const loginUrl = new URL(get_api_contract_1.v2_api_paths.authorize_link, get_api_contract_1.ZEPHYR_API_ENDPOINT);
|
|
32
|
-
loginUrl.searchParams.append('state', state);
|
|
33
|
-
return fetch(loginUrl.href).then((res) => res.text());
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
exports.getAuthenticationURL = getAuthenticationURL;
|
|
37
|
-
/**
|
|
38
|
-
* Check if the user is already authenticated. If not, open a browser window to authenticate.
|
|
39
|
-
* Display a message to the console.
|
|
40
|
-
* @return The token as a string.
|
|
41
|
-
*/
|
|
42
|
-
function checkAuth() {
|
|
43
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const token = yield (0, token_1.getToken)();
|
|
45
|
-
if (token) {
|
|
46
|
-
// Check if the token has a valid expiration date.
|
|
47
|
-
if (isTokenStillValid(token)) {
|
|
48
|
-
console.log('[zephyr] You are already logged in');
|
|
49
|
-
return token;
|
|
50
|
-
}
|
|
51
|
-
yield (0, token_1.removeToken)();
|
|
52
|
-
}
|
|
53
|
-
// No valid token found; initiate authentication.
|
|
54
|
-
const newToken = yield authenticateUser();
|
|
55
|
-
console.log('[zephyr] You are logged in');
|
|
56
|
-
return newToken;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
exports.checkAuth = checkAuth;
|
|
60
|
-
/**
|
|
61
|
-
* Decides whether the token is still valid based on its expiration time.
|
|
62
|
-
* @param token The token to check.
|
|
63
|
-
* @return boolean indicating if the token is still valid.
|
|
64
|
-
*/
|
|
65
|
-
function isTokenStillValid(token) {
|
|
66
|
-
const decodedToken = jose.decodeJwt(token);
|
|
67
|
-
if (!decodedToken.exp) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
return new Date(decodedToken.exp * 1000) > new Date();
|
|
71
|
-
}
|
|
72
|
-
exports.isTokenStillValid = isTokenStillValid;
|
|
73
|
-
/**
|
|
74
|
-
* Initiates user authentication and handles token storage.
|
|
75
|
-
* @return The new token as a string.
|
|
76
|
-
*/
|
|
77
|
-
function authenticateUser() {
|
|
78
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const token = yield getPersonalAccessTokenFromWebsocket();
|
|
80
|
-
yield (0, token_1.saveToken)(token);
|
|
81
|
-
return token;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function subscribeToWsEvents(sessionKey) {
|
|
85
|
-
return new Promise((resolve, reject) => {
|
|
86
|
-
const socket = (0, websocket_1.createSocket)(get_api_contract_1.ZEPHYR_API_ENDPOINT);
|
|
87
|
-
const cleanup = () => (0, websocket_1.disposeSocket)(socket);
|
|
88
|
-
socket.on('connect', () => {
|
|
89
|
-
// console.debug('WS Connected');
|
|
90
|
-
});
|
|
91
|
-
socket.on('disconnect', () => cleanup());
|
|
92
|
-
const roomSocket = socket.emit('joinAccessTokenRoom', {
|
|
93
|
-
state: sessionKey,
|
|
94
|
-
});
|
|
95
|
-
roomSocket.on('access-token', (token) => {
|
|
96
|
-
cleanup();
|
|
97
|
-
resolve(token);
|
|
98
|
-
});
|
|
99
|
-
roomSocket.on('access-token-error', (msg) => {
|
|
100
|
-
console.error('ERROR:', msg);
|
|
101
|
-
cleanup();
|
|
102
|
-
reject(new Error(msg));
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=login.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/utils/login.ts"],"names":[],"mappings":";;;;AAAA,6BAA6B;AAC7B,6BAA6B;AAC7B,+BAAoC;AAEpC,2CAA0D;AAC1D,iDAAyE;AACzE,mFAGsD;AAEtD,SAAgB,kBAAkB;IAChC,OAAO,IAAA,SAAM,GAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAFD,gDAEC;AAMD,SAAsB,mCAAmC;iEACvD,EAAE,WAAW,KAAiD;QAC5D,WAAW,EAAE,IAAI;KAClB;QAED,MAAM,UAAU,GAAG,kBAAkB,EAAE,CAAC;QACxC,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,EAAE,KAAK,EAAE,UAAU,EA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AC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Socket } from 'socket.io-client';
|
|
2
|
-
interface ClientToServerEvents {
|
|
3
|
-
joinAccessTokenRoom: (props: {
|
|
4
|
-
state: string;
|
|
5
|
-
}) => void;
|
|
6
|
-
}
|
|
7
|
-
interface ServerToClientEvents {
|
|
8
|
-
'access-token': (token: string) => void;
|
|
9
|
-
'access-token-error': (msg: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function createSocket(endpoint: string): Socket<ServerToClientEvents, ClientToServerEvents>;
|
|
12
|
-
export declare function disposeSocket(socket: Socket): void;
|
|
13
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.disposeSocket = exports.createSocket = void 0;
|
|
4
|
-
const socket_io_client_1 = require("socket.io-client");
|
|
5
|
-
function createSocket(endpoint) {
|
|
6
|
-
return (0, socket_io_client_1.io)(endpoint);
|
|
7
|
-
}
|
|
8
|
-
exports.createSocket = createSocket;
|
|
9
|
-
function disposeSocket(socket) {
|
|
10
|
-
socket.disconnect();
|
|
11
|
-
socket.close();
|
|
12
|
-
}
|
|
13
|
-
exports.disposeSocket = disposeSocket;
|
|
14
|
-
//# sourceMappingURL=websocket.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../../../../libs/zephyr-edge-contract/src/lib/utils/websocket.ts"],"names":[],"mappings":";;;AAAA,uDAA0D;AAW1D,SAAgB,YAAY,CAC1B,QAAgB;IAEhB,OAAO,IAAA,qBAAQ,EAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AAJD,oCAIC;AAED,SAAgB,aAAa,CAAC,MAAc;IAC1C,MAAM,CAAC,UAAU,EAAE,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAHD,sCAGC"}
|