@nrwl/nx-cloud 14.3.0-beta.1 → 14.3.0
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/lib/core/api/error-reporter.api.js +1 -36
- package/lib/core/api/run-group.api.js +1 -65
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +1 -156
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -169
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -166
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -79
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +1 -243
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -131
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -206
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +1 -37
- package/lib/core/runners/distributed-execution/task-graph-creator.js +1 -77
- package/lib/utilities/environment.js +2 -3
- package/lib/utilities/environment.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ErrorReporterApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const { output } = require('../../utilities/nx-imports');
|
|
15
|
-
class ErrorReporterApi {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
18
|
-
}
|
|
19
|
-
reportError(message) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
try {
|
|
22
|
-
yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/report-client-error', {
|
|
23
|
-
message,
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
output.warn({
|
|
28
|
-
title: `Unable to record the following error: '${message}'`,
|
|
29
|
-
bodyLines: [e.message],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.ErrorReporterApi = ErrorReporterApi;
|
|
36
|
-
//# sourceMappingURL=error-reporter.api.js.map
|
|
1
|
+
const a0_0x53c2=['apiAxiosInstance','reportError','Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27','warn','next','createApiAxiosInstance','apply','ErrorReporterApi','defineProperty','done','value','__awaiter','../../utilities/nx-imports','axiosMultipleTries'];(function(_0x5cbf57,_0x53c2b3){const _0xb22d31=function(_0x11ee72){while(--_0x11ee72){_0x5cbf57['push'](_0x5cbf57['shift']());}};_0xb22d31(++_0x53c2b3);}(a0_0x53c2,0x1e9));const a0_0xb22d=function(_0x5cbf57,_0x53c2b3){_0x5cbf57=_0x5cbf57-0x0;let _0xb22d31=a0_0x53c2[_0x5cbf57];return _0xb22d31;};'use strict';var __awaiter=this&&this[a0_0xb22d('0xc')]||function(_0x333321,_0x4d1c24,_0x10c4c1,_0xf524a6){function _0x4deed2(_0x482c29){return _0x482c29 instanceof _0x10c4c1?_0x482c29:new _0x10c4c1(function(_0x321b21){_0x321b21(_0x482c29);});}return new(_0x10c4c1||(_0x10c4c1=Promise))(function(_0x346471,_0x181e46){function _0x64ec16(_0x4ba0ae){try{_0x26d580(_0xf524a6[a0_0xb22d('0x5')](_0x4ba0ae));}catch(_0x1c3b45){_0x181e46(_0x1c3b45);}}function _0x1eac04(_0x217a0c){try{_0x26d580(_0xf524a6['throw'](_0x217a0c));}catch(_0x48cf3e){_0x181e46(_0x48cf3e);}}function _0x26d580(_0x2bc449){_0x2bc449[a0_0xb22d('0xa')]?_0x346471(_0x2bc449[a0_0xb22d('0xb')]):_0x4deed2(_0x2bc449[a0_0xb22d('0xb')])['then'](_0x64ec16,_0x1eac04);}_0x26d580((_0xf524a6=_0xf524a6[a0_0xb22d('0x7')](_0x333321,_0x4d1c24||[]))[a0_0xb22d('0x5')]());});};Object[a0_0xb22d('0x9')](exports,'__esModule',{'value':!![]});exports[a0_0xb22d('0x8')]=void 0x0;const axios_1=require('../../utilities/axios');const {output}=require(a0_0xb22d('0xd'));class ErrorReporterApi{constructor(_0x15819c){this['apiAxiosInstance']=(0x0,axios_1[a0_0xb22d('0x6')])(_0x15819c);}[a0_0xb22d('0x2')](_0x4dad97){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1[a0_0xb22d('0x0')])(()=>this[a0_0xb22d('0x1')]['post']('/nx-cloud/report-client-error',{'message':_0x4dad97}));}catch(_0x5a0341){output[a0_0xb22d('0x4')]({'title':a0_0xb22d('0x3')+_0x4dad97+'\x27','bodyLines':[_0x5a0341['message']]});}});}}exports[a0_0xb22d('0x8')]=ErrorReporterApi;
|
|
@@ -1,65 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RunGroupApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const metric_logger_1 = require("../../utilities/metric-logger");
|
|
15
|
-
const { output } = require('../../utilities/nx-imports');
|
|
16
|
-
class RunGroupApi {
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
19
|
-
}
|
|
20
|
-
createRunGroup(branch, runGroup) {
|
|
21
|
-
var _a;
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
|
|
24
|
-
try {
|
|
25
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/create-run-group', {
|
|
26
|
-
branch: branch,
|
|
27
|
-
runGroup: runGroup,
|
|
28
|
-
}));
|
|
29
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
33
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
34
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
35
|
-
output.error({
|
|
36
|
-
title: e.message,
|
|
37
|
-
});
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
completeRunGroup(runGroup) {
|
|
43
|
-
var _a;
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
|
|
46
|
-
try {
|
|
47
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
48
|
-
runGroup: runGroup,
|
|
49
|
-
}));
|
|
50
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
54
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
55
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
56
|
-
output.error({
|
|
57
|
-
title: e.message,
|
|
58
|
-
});
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.RunGroupApi = RunGroupApi;
|
|
65
|
-
//# sourceMappingURL=run-group.api.js.map
|
|
1
|
+
const a1_0xcd02=['error','/nx-cloud/executions/create-run-group','apiAxiosInstance','mapRespToPerfEntry','RunGroupApi','recordMetric','axiosException','then','defineProperty','/nx-cloud/executions/complete-run-group','createMetricRecorder','apply','message','next','post','exit','value','axiosMultipleTries','__awaiter','response','createRunGroup','throw','__esModule','createApiAxiosInstance','done','../../utilities/metric-logger','completeRunGroup'];(function(_0x486779,_0xcd02d){const _0x2ec20e=function(_0x197dd4){while(--_0x197dd4){_0x486779['push'](_0x486779['shift']());}};_0x2ec20e(++_0xcd02d);}(a1_0xcd02,0x194));const a1_0x2ec2=function(_0x486779,_0xcd02d){_0x486779=_0x486779-0x0;let _0x2ec20e=a1_0xcd02[_0x486779];return _0x2ec20e;};'use strict';var __awaiter=this&&this[a1_0x2ec2('0x13')]||function(_0x2e084b,_0x389c52,_0x133683,_0x109411){function _0x520c24(_0x54f762){return _0x54f762 instanceof _0x133683?_0x54f762:new _0x133683(function(_0x3116ff){_0x3116ff(_0x54f762);});}return new(_0x133683||(_0x133683=Promise))(function(_0x4cf62c,_0x130d09){function _0xa1ca07(_0x6596a3){try{_0x15b74a(_0x109411['next'](_0x6596a3));}catch(_0x2f3b45){_0x130d09(_0x2f3b45);}}function _0x34f2d5(_0x47d1c3){try{_0x15b74a(_0x109411[a1_0x2ec2('0x16')](_0x47d1c3));}catch(_0x2fa9c3){_0x130d09(_0x2fa9c3);}}function _0x15b74a(_0x4d9c36){_0x4d9c36[a1_0x2ec2('0x19')]?_0x4cf62c(_0x4d9c36[a1_0x2ec2('0x11')]):_0x520c24(_0x4d9c36[a1_0x2ec2('0x11')])[a1_0x2ec2('0x8')](_0xa1ca07,_0x34f2d5);}_0x15b74a((_0x109411=_0x109411[a1_0x2ec2('0xc')](_0x2e084b,_0x389c52||[]))[a1_0x2ec2('0xe')]());});};Object[a1_0x2ec2('0x9')](exports,a1_0x2ec2('0x17'),{'value':!![]});exports[a1_0x2ec2('0x5')]=void 0x0;const axios_1=require('../../utilities/axios');const metric_logger_1=require(a1_0x2ec2('0x1a'));const {output}=require('../../utilities/nx-imports');class RunGroupApi{constructor(_0x9cac97){this[a1_0x2ec2('0x3')]=(0x0,axios_1[a1_0x2ec2('0x18')])(_0x9cac97);}['createRunGroup'](_0x542b08,_0x168a81){var _0x17c20d;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x2c75ed=(0x0,metric_logger_1[a1_0x2ec2('0xb')])(a1_0x2ec2('0x15'));try{const _0x87ec47=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a1_0x2ec2('0x3')][a1_0x2ec2('0xf')](a1_0x2ec2('0x2'),{'branch':_0x542b08,'runGroup':_0x168a81}));_0x2c75ed[a1_0x2ec2('0x6')]((0x0,metric_logger_1[a1_0x2ec2('0x4')])(_0x87ec47));}catch(_0x4b5c61){_0x2c75ed['recordMetric'](((_0x17c20d=_0x4b5c61===null||_0x4b5c61===void 0x0?void 0x0:_0x4b5c61[a1_0x2ec2('0x7')])===null||_0x17c20d===void 0x0?void 0x0:_0x17c20d[a1_0x2ec2('0x14')])?(0x0,metric_logger_1[a1_0x2ec2('0x4')])(_0x4b5c61['axiosException']['response']):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a1_0x2ec2('0x1')]({'title':_0x4b5c61[a1_0x2ec2('0xd')]});process[a1_0x2ec2('0x10')](0x1);}});}[a1_0x2ec2('0x0')](_0x2ac8ee){var _0xbfe2da;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x3941e5=(0x0,metric_logger_1[a1_0x2ec2('0xb')])(a1_0x2ec2('0x15'));try{const _0xf802d0=yield(0x0,axios_1[a1_0x2ec2('0x12')])(()=>this['apiAxiosInstance']['post'](a1_0x2ec2('0xa'),{'runGroup':_0x2ac8ee}));_0x3941e5[a1_0x2ec2('0x6')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0xf802d0));}catch(_0x5d830a){_0x3941e5[a1_0x2ec2('0x6')](((_0xbfe2da=_0x5d830a===null||_0x5d830a===void 0x0?void 0x0:_0x5d830a['axiosException'])===null||_0xbfe2da===void 0x0?void 0x0:_0xbfe2da['response'])?(0x0,metric_logger_1[a1_0x2ec2('0x4')])(_0x5d830a[a1_0x2ec2('0x7')][a1_0x2ec2('0x14')]):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a1_0x2ec2('0x1')]({'title':_0x5d830a[a1_0x2ec2('0xd')]});process[a1_0x2ec2('0x10')](0x1);}});}}exports[a1_0x2ec2('0x5')]=RunGroupApi;
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloudEnabledLifeCycle = void 0;
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const environment_1 = require("../../../utilities/environment");
|
|
8
|
-
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
9
|
-
const { workspaceRoot } = require('../../../utilities/nx-imports');
|
|
10
|
-
class CloudEnabledLifeCycle {
|
|
11
|
-
constructor(runContext, cacheDirectory, skipNxCache, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
|
|
12
|
-
this.runContext = runContext;
|
|
13
|
-
this.cacheDirectory = cacheDirectory;
|
|
14
|
-
this.skipNxCache = skipNxCache;
|
|
15
|
-
this.collectTerminalOutput = collectTerminalOutput;
|
|
16
|
-
this.cacheableOperations = cacheableOperations;
|
|
17
|
-
this.outputObfuscator = outputObfuscator;
|
|
18
|
-
this.tasks = tasks;
|
|
19
|
-
}
|
|
20
|
-
scheduleTask(task) {
|
|
21
|
-
this.runContext.scheduledTasks.push(task);
|
|
22
|
-
}
|
|
23
|
-
startTask(task) {
|
|
24
|
-
this.tasks.push({
|
|
25
|
-
taskId: task.id,
|
|
26
|
-
startTime: new Date().toISOString(),
|
|
27
|
-
target: task.target.target,
|
|
28
|
-
projectName: task.target.project,
|
|
29
|
-
hash: task.hash,
|
|
30
|
-
hashDetails: this.cleanUpHashDetails(task.hashDetails),
|
|
31
|
-
params: (0, serializer_overrides_1.serializeOverrides)(task),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
// Used for older version for Nx. Remove in Dec 2022
|
|
35
|
-
endTask(task, code) {
|
|
36
|
-
let cacheStatus;
|
|
37
|
-
if (this.runContext.statuses[task.hash]) {
|
|
38
|
-
cacheStatus = this.runContext.statuses[task.hash];
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (this.cacheableOperations.indexOf(task.target.target) > -1 &&
|
|
42
|
-
!this.skipNxCache) {
|
|
43
|
-
cacheStatus = 'local-cache-hit';
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
cacheStatus = 'cache-miss';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
this.updateStartedTask(task, code, cacheStatus);
|
|
50
|
-
}
|
|
51
|
-
endTasks(tasks) {
|
|
52
|
-
for (let t of tasks) {
|
|
53
|
-
let cacheStatus;
|
|
54
|
-
const taskIsRemoteCacheHit = t.status === 'remote-cache';
|
|
55
|
-
const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
|
|
56
|
-
const taskIsLocalCacheHit = t.status === 'local-cache' ||
|
|
57
|
-
t.status === 'local-cache-kept-existing' ||
|
|
58
|
-
taskIsLocalCacheHitPreNx135;
|
|
59
|
-
if (this.runContext.statuses[t.task.hash]) {
|
|
60
|
-
cacheStatus = this.runContext.statuses[t.task.hash];
|
|
61
|
-
}
|
|
62
|
-
else if (taskIsRemoteCacheHit) {
|
|
63
|
-
cacheStatus = 'remote-cache-hit';
|
|
64
|
-
}
|
|
65
|
-
else if (taskIsLocalCacheHit) {
|
|
66
|
-
cacheStatus = 'local-cache-hit';
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
if (this.cacheableOperations.indexOf(t.task.target.target) > -1 &&
|
|
70
|
-
!this.skipNxCache) {
|
|
71
|
-
cacheStatus = 'local-cache-hit';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
cacheStatus = 'cache-miss';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this.updateStartedTask(t.task, t.code, cacheStatus);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
endCommand() { }
|
|
81
|
-
updateStartedTask(task, code, cacheStatus) {
|
|
82
|
-
const startedTask = this.tasks.find((t) => t.taskId === task.id);
|
|
83
|
-
if (!startedTask) {
|
|
84
|
-
throw new Error(`Cannot find task ${task.id}`);
|
|
85
|
-
}
|
|
86
|
-
startedTask.endTime = new Date().toISOString();
|
|
87
|
-
startedTask.status = code;
|
|
88
|
-
startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
|
|
89
|
-
startedTask.cacheStatus = cacheStatus;
|
|
90
|
-
if (this.collectTerminalOutput) {
|
|
91
|
-
startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
getTerminalOutput(hash, cacheStatus, code) {
|
|
95
|
-
let dir;
|
|
96
|
-
if (this.cacheDirectory) {
|
|
97
|
-
if (this.cacheDirectory.startsWith('./')) {
|
|
98
|
-
dir = (0, path_1.join)(workspaceRoot, this.cacheDirectory);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
dir = this.cacheDirectory;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
dir = (0, path_1.join)(workspaceRoot, 'node_modules', '.cache', 'nx');
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const taskOutput = this.readTerminalOutputFile(dir, hash);
|
|
109
|
-
const taskOutputSanitized = this.outputObfuscator.obfuscate(taskOutput);
|
|
110
|
-
if (environment_1.NX_CLOUD_UNLIMITED_OUTPUT)
|
|
111
|
-
return taskOutputSanitized;
|
|
112
|
-
const maxCharacters = cacheStatus === 'cache-miss'
|
|
113
|
-
? code === 0
|
|
114
|
-
? CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK
|
|
115
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK
|
|
116
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK;
|
|
117
|
-
return taskOutputSanitized.length > maxCharacters
|
|
118
|
-
? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
|
|
119
|
-
: taskOutputSanitized;
|
|
120
|
-
}
|
|
121
|
-
catch (e) {
|
|
122
|
-
return '';
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
cleanUpHashDetails(hashDetails) {
|
|
126
|
-
const nodes = {};
|
|
127
|
-
Object.keys(hashDetails.nodes)
|
|
128
|
-
.filter((k) => !k.startsWith('npm:'))
|
|
129
|
-
.forEach((k) => {
|
|
130
|
-
nodes[k] = hashDetails.nodes[k];
|
|
131
|
-
});
|
|
132
|
-
return {
|
|
133
|
-
nodes,
|
|
134
|
-
runtime: hashDetails.runtime,
|
|
135
|
-
implicitDeps: hashDetails.implicitDeps,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
readTerminalOutputFile(dir, hash) {
|
|
139
|
-
try {
|
|
140
|
-
return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
|
|
141
|
-
}
|
|
142
|
-
catch (_a) {
|
|
143
|
-
try {
|
|
144
|
-
return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
|
|
145
|
-
}
|
|
146
|
-
catch (_b) {
|
|
147
|
-
return '';
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
|
|
153
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK = 200000;
|
|
154
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
|
|
155
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK = 20000;
|
|
156
|
-
//# sourceMappingURL=cloud-enabled-life-cycle.js.map
|
|
1
|
+
const a0_0x3fe2=['../../../utilities/nx-imports','runContext','skipNxCache','npm:','cache','cache-miss','updateStartedTask','path','readTerminalOutputFile','CloudEnabledLifeCycle','filter','.cache','remote-cache','endCommand','statuses','remote-cache-hit','forEach','toISOString','local-cache-kept-existing','obfuscate','TRUNCATED\x0a\x0a','indexOf','scheduledTasks','cacheDirectory','../../../utilities/environment','endTasks','MAX_CHARACTERS_CACHED_TASK','tasks','MAX_CHARACTERS_FAILED_TASK','cleanUpHashDetails','status','local-cache-hit','scheduleTask','../../../utilities/serializer-overrides','find','cacheStatus','__esModule','join','taskId','Cannot\x20find\x20task\x20','MAX_CHARACTERS_SUCCESSFUL_TASK','startsWith','outputObfuscator','slice','endTask','endTime','task','getTerminalOutput','keys','nodes','cacheableOperations','code','startTask','hashDetails','toString','target','readFileSync','node_modules','push','hash','length','runtime','terminalOutput','serializeOverrides','defineProperty','params'];(function(_0x5c78cc,_0x3fe207){const _0x3349b1=function(_0x3d2967){while(--_0x3d2967){_0x5c78cc['push'](_0x5c78cc['shift']());}};_0x3349b1(++_0x3fe207);}(a0_0x3fe2,0x1e8));const a0_0x3349=function(_0x5c78cc,_0x3fe207){_0x5c78cc=_0x5c78cc-0x0;let _0x3349b1=a0_0x3fe2[_0x5c78cc];return _0x3349b1;};'use strict';Object[a0_0x3349('0x26')](exports,a0_0x3349('0xa'),{'value':!![]});exports[a0_0x3349('0x31')]=void 0x0;const path=require(a0_0x3349('0x2f'));const path_1=require(a0_0x3349('0x2f'));const fs_1=require('fs');const environment_1=require(a0_0x3349('0x40'));const serializer_overrides_1=require(a0_0x3349('0x7'));const {workspaceRoot}=require(a0_0x3349('0x28'));class CloudEnabledLifeCycle{constructor(_0x208066,_0x382435,_0x40b9d8,_0x3db991,_0x24f6d3,_0x5066f4,_0x104a39){this[a0_0x3349('0x29')]=_0x208066;this[a0_0x3349('0x3f')]=_0x382435;this['skipNxCache']=_0x40b9d8;this['collectTerminalOutput']=_0x3db991;this[a0_0x3349('0x18')]=_0x24f6d3;this[a0_0x3349('0x10')]=_0x5066f4;this[a0_0x3349('0x1')]=_0x104a39;}[a0_0x3349('0x6')](_0x292149){this[a0_0x3349('0x29')][a0_0x3349('0x3e')][a0_0x3349('0x20')](_0x292149);}[a0_0x3349('0x1a')](_0x120b80){this[a0_0x3349('0x1')][a0_0x3349('0x20')]({'taskId':_0x120b80['id'],'startTime':new Date()['toISOString'](),'target':_0x120b80[a0_0x3349('0x1d')][a0_0x3349('0x1d')],'projectName':_0x120b80[a0_0x3349('0x1d')]['project'],'hash':_0x120b80[a0_0x3349('0x21')],'hashDetails':this[a0_0x3349('0x3')](_0x120b80[a0_0x3349('0x1b')]),'params':(0x0,serializer_overrides_1[a0_0x3349('0x25')])(_0x120b80)});}[a0_0x3349('0x12')](_0x564574,_0x1c996d){let _0x77da0e;if(this[a0_0x3349('0x29')]['statuses'][_0x564574[a0_0x3349('0x21')]]){_0x77da0e=this[a0_0x3349('0x29')][a0_0x3349('0x36')][_0x564574[a0_0x3349('0x21')]];}else{if(this['cacheableOperations'][a0_0x3349('0x3d')](_0x564574[a0_0x3349('0x1d')][a0_0x3349('0x1d')])>-0x1&&!this[a0_0x3349('0x2a')]){_0x77da0e=a0_0x3349('0x5');}else{_0x77da0e=a0_0x3349('0x2d');}}this[a0_0x3349('0x2e')](_0x564574,_0x1c996d,_0x77da0e);}[a0_0x3349('0x41')](_0x3a68bf){for(let _0x433a2c of _0x3a68bf){let _0x1494dd;const _0x5b22d9=_0x433a2c[a0_0x3349('0x4')]===a0_0x3349('0x34');const _0x51107d=_0x433a2c['status']===a0_0x3349('0x2c');const _0x1037f3=_0x433a2c[a0_0x3349('0x4')]==='local-cache'||_0x433a2c[a0_0x3349('0x4')]===a0_0x3349('0x3a')||_0x51107d;if(this[a0_0x3349('0x29')][a0_0x3349('0x36')][_0x433a2c[a0_0x3349('0x14')][a0_0x3349('0x21')]]){_0x1494dd=this['runContext'][a0_0x3349('0x36')][_0x433a2c[a0_0x3349('0x14')]['hash']];}else if(_0x5b22d9){_0x1494dd=a0_0x3349('0x37');}else if(_0x1037f3){_0x1494dd=a0_0x3349('0x5');}else{if(this['cacheableOperations'][a0_0x3349('0x3d')](_0x433a2c[a0_0x3349('0x14')][a0_0x3349('0x1d')][a0_0x3349('0x1d')])>-0x1&&!this['skipNxCache']){_0x1494dd=a0_0x3349('0x5');}else{_0x1494dd='cache-miss';}}this[a0_0x3349('0x2e')](_0x433a2c[a0_0x3349('0x14')],_0x433a2c[a0_0x3349('0x19')],_0x1494dd);}}[a0_0x3349('0x35')](){}['updateStartedTask'](_0x4bb8b7,_0x19f35a,_0x4b9f38){const _0x48d009=this[a0_0x3349('0x1')][a0_0x3349('0x8')](_0x3b559f=>_0x3b559f[a0_0x3349('0xc')]===_0x4bb8b7['id']);if(!_0x48d009){throw new Error(a0_0x3349('0xd')+_0x4bb8b7['id']);}_0x48d009[a0_0x3349('0x13')]=new Date()[a0_0x3349('0x39')]();_0x48d009[a0_0x3349('0x4')]=_0x19f35a;_0x48d009[a0_0x3349('0x27')]=this[a0_0x3349('0x10')][a0_0x3349('0x3b')](_0x48d009[a0_0x3349('0x27')]);_0x48d009['cacheStatus']=_0x4b9f38;if(this['collectTerminalOutput']){_0x48d009['terminalOutput']=this[a0_0x3349('0x15')](_0x4bb8b7[a0_0x3349('0x21')],_0x48d009[a0_0x3349('0x9')],_0x19f35a);}}['getTerminalOutput'](_0x207d71,_0x58de4b,_0x2df446){let _0x311905;if(this[a0_0x3349('0x3f')]){if(this['cacheDirectory'][a0_0x3349('0xf')]('./')){_0x311905=(0x0,path_1[a0_0x3349('0xb')])(workspaceRoot,this[a0_0x3349('0x3f')]);}else{_0x311905=this[a0_0x3349('0x3f')];}}else{_0x311905=(0x0,path_1[a0_0x3349('0xb')])(workspaceRoot,a0_0x3349('0x1f'),a0_0x3349('0x33'),'nx');}try{const _0x21cd93=this[a0_0x3349('0x30')](_0x311905,_0x207d71);const _0x5a2e12=this[a0_0x3349('0x10')][a0_0x3349('0x3b')](_0x21cd93);if(environment_1['NX_CLOUD_UNLIMITED_OUTPUT'])return _0x5a2e12;const _0x46b3d2=_0x58de4b===a0_0x3349('0x2d')?_0x2df446===0x0?CloudEnabledLifeCycle[a0_0x3349('0xe')]:CloudEnabledLifeCycle[a0_0x3349('0x2')]:CloudEnabledLifeCycle[a0_0x3349('0x0')];return _0x5a2e12[a0_0x3349('0x22')]>_0x46b3d2?a0_0x3349('0x3c')+_0x5a2e12[a0_0x3349('0x11')](_0x5a2e12['length']-_0x46b3d2):_0x5a2e12;}catch(_0x260349){return'';}}[a0_0x3349('0x3')](_0x205727){const _0x11990a={};Object[a0_0x3349('0x16')](_0x205727[a0_0x3349('0x17')])[a0_0x3349('0x32')](_0x30cd49=>!_0x30cd49[a0_0x3349('0xf')](a0_0x3349('0x2b')))[a0_0x3349('0x38')](_0x442b71=>{_0x11990a[_0x442b71]=_0x205727['nodes'][_0x442b71];});return{'nodes':_0x11990a,'runtime':_0x205727[a0_0x3349('0x23')],'implicitDeps':_0x205727['implicitDeps']};}['readTerminalOutputFile'](_0x464480,_0x62e008){try{return(0x0,fs_1[a0_0x3349('0x1e')])(path[a0_0x3349('0xb')](_0x464480,'terminalOutputs',_0x62e008))[a0_0x3349('0x1c')]();}catch(_0x36b174){try{return(0x0,fs_1[a0_0x3349('0x1e')])(path['join'](_0x464480,_0x62e008,a0_0x3349('0x24')))[a0_0x3349('0x1c')]();}catch(_0x4cf8c8){return'';}}}}exports[a0_0x3349('0x31')]=CloudEnabledLifeCycle;CloudEnabledLifeCycle[a0_0x3349('0x2')]=0x30d40;CloudEnabledLifeCycle[a0_0x3349('0xe')]=0x4e20;CloudEnabledLifeCycle[a0_0x3349('0x0')]=0x4e20;
|
|
@@ -1,169 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.cloudEnabledTasksRunner = void 0;
|
|
13
|
-
const message_reporter_1 = require("../../terminal-output/message-reporter");
|
|
14
|
-
const end_of_run_message_1 = require("../../terminal-output/end-of-run-message");
|
|
15
|
-
const output_obfuscator_1 = require("../../terminal-output/output-obfuscator");
|
|
16
|
-
const cloud_enabled_life_cycle_1 = require("./cloud-enabled-life-cycle");
|
|
17
|
-
const file_storage_1 = require("../../file-storage/file-storage");
|
|
18
|
-
const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
|
|
19
|
-
const environment_1 = require("../../../utilities/environment");
|
|
20
|
-
const cloud_remote_cache_1 = require("./cloud-remote-cache");
|
|
21
|
-
const cloud_run_api_1 = require("./cloud-run.api");
|
|
22
|
-
const fs_1 = require("fs");
|
|
23
|
-
const path = require("path");
|
|
24
|
-
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
25
|
-
const error_reporter_api_1 = require("../../api/error-reporter.api");
|
|
26
|
-
const { tasksRunner, output } = require('../../../utilities/nx-imports');
|
|
27
|
-
function createApi(errors, options, runContext) {
|
|
28
|
-
const machineInfo = (0, environment_1.getMachineInfo)(options);
|
|
29
|
-
return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
|
|
30
|
-
}
|
|
31
|
-
function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
|
|
32
|
-
const hashes = JSON.stringify(taskExecutions.map((t) => ({
|
|
33
|
-
taskId: t.taskId,
|
|
34
|
-
hash: t.hash,
|
|
35
|
-
})));
|
|
36
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
37
|
-
output.note({
|
|
38
|
-
title: `Executed tasks with hashes: ${hashes}`,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
(0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
|
|
42
|
-
}
|
|
43
|
-
function onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const runEndTime = new Date().toISOString();
|
|
46
|
-
if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
|
|
47
|
-
storeTaskHashes(taskExecutions, options.cacheDirectory || './node_modules/.cache/nx', environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID);
|
|
48
|
-
}
|
|
49
|
-
const branch = (0, environment_1.getBranch)();
|
|
50
|
-
const endRequest = yield Promise.all([
|
|
51
|
-
remoteCache.waitForStoreRequestsToComplete(),
|
|
52
|
-
api.endRun({
|
|
53
|
-
command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
|
|
54
|
-
startTime: runStartTime,
|
|
55
|
-
endTime: runEndTime,
|
|
56
|
-
distributedExecutionId: environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID,
|
|
57
|
-
branch: branch,
|
|
58
|
-
scan: true,
|
|
59
|
-
runGroup: (0, environment_1.getRunGroup)(),
|
|
60
|
-
// only set sha if branch is set because we invoke a separate process,
|
|
61
|
-
// which adds a few millis
|
|
62
|
-
sha: branch ? (0, environment_1.extractGitSha)() : undefined,
|
|
63
|
-
inner: inner,
|
|
64
|
-
}, taskExecutions),
|
|
65
|
-
]);
|
|
66
|
-
// this workaround is required because prior to Nx 13.3 we printed
|
|
67
|
-
// the end message after the runner completes, so we need to wait for the
|
|
68
|
-
// message to appear in the right place
|
|
69
|
-
if (versionOfNxBefore133) {
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
messages.printMessages();
|
|
72
|
-
if (!messages.anyErrors && !inner) {
|
|
73
|
-
endOfRunMessage.printCacheHitsMessage();
|
|
74
|
-
}
|
|
75
|
-
}, 0);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
messages.printMessages();
|
|
79
|
-
if (!messages.anyErrors && !inner) {
|
|
80
|
-
endOfRunMessage.printCacheHitsMessage();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
|
|
84
|
-
if (!endRequest[0]) {
|
|
85
|
-
output.error({
|
|
86
|
-
title: `Agent wasn't able to store artifacts`,
|
|
87
|
-
});
|
|
88
|
-
messages.printMessages();
|
|
89
|
-
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
90
|
-
}
|
|
91
|
-
if (!endRequest[1]) {
|
|
92
|
-
output.error({
|
|
93
|
-
title: `Agent wasn't able to record its run`,
|
|
94
|
-
});
|
|
95
|
-
messages.printMessages();
|
|
96
|
-
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function createLifeCycle(runContext, options, outputObfuscator, tasks) {
|
|
103
|
-
const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, options.cacheDirectory, !!options.skipNxCache, options.scan === undefined ? true : options.scan, options.cacheableOperations || [], outputObfuscator, tasks);
|
|
104
|
-
try {
|
|
105
|
-
const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
|
|
106
|
-
if (!CompositeLifeCycle)
|
|
107
|
-
return cloudEnabledLifeCycle;
|
|
108
|
-
return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
return cloudEnabledLifeCycle;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
|
|
115
|
-
const runContext = {
|
|
116
|
-
statuses: {},
|
|
117
|
-
scheduledTasks: [],
|
|
118
|
-
requests: {},
|
|
119
|
-
allTasks: tasks,
|
|
120
|
-
};
|
|
121
|
-
const versionOfNxBefore133 = options.lifeCycle === undefined;
|
|
122
|
-
const taskExecutions = [];
|
|
123
|
-
const messages = new message_reporter_1.MessageReporter(options);
|
|
124
|
-
const api = createApi(messages, options, runContext);
|
|
125
|
-
const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions);
|
|
126
|
-
const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
|
|
127
|
-
const hashes = tasks.map((t) => t.hash).filter((h) => !!h);
|
|
128
|
-
const startRunRequest = api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, hashes);
|
|
129
|
-
hashes.forEach((hash) => {
|
|
130
|
-
runContext.requests[hash] = startRunRequest;
|
|
131
|
-
});
|
|
132
|
-
const runStartTime = new Date().toISOString();
|
|
133
|
-
const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
|
|
134
|
-
const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
|
|
135
|
-
const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
|
|
136
|
-
const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, false);
|
|
137
|
-
const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage);
|
|
138
|
-
// have to reset it so we don't capture inner tasks
|
|
139
|
-
delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
|
|
140
|
-
const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
|
|
141
|
-
// observable -> legacy
|
|
142
|
-
if (res.subscribe) {
|
|
143
|
-
const { Subject } = require('rxjs/internal/Subject');
|
|
144
|
-
const wrappedRes = new Subject();
|
|
145
|
-
res.subscribe({
|
|
146
|
-
next: (value) => wrappedRes.next(value),
|
|
147
|
-
error: (err) => wrappedRes.error(err),
|
|
148
|
-
complete: () => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
150
|
-
wrappedRes.complete();
|
|
151
|
-
}),
|
|
152
|
-
});
|
|
153
|
-
return wrappedRes;
|
|
154
|
-
// promise
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
return res
|
|
158
|
-
.then((r) => __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
160
|
-
return r;
|
|
161
|
-
}))
|
|
162
|
-
.catch((e) => __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
164
|
-
throw e;
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
|
|
169
|
-
//# sourceMappingURL=cloud-enabled.runner.js.map
|
|
1
|
+
const a1_0x12f9=['printCacheHitsMessage','getMachineInfo','__awaiter','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','cacheableOperations','taskId','../../terminal-output/message-reporter','../../../utilities/nx-imports','then','toISOString','exit','EndOfRunMessage','getRunGroup','CloudRunApi','all','cacheDirectory','FileStorage','next','done','assign','hash','encryptionKey','lifeCycle','maskedProperties','env','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','getBranch','AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION','stringify','map','Agent\x20wasn\x27t\x20able\x20to\x20record\x20its\x20run','./node_modules/.cache/nx','throw','ENCRYPTION_KEY','OutputObfuscator','apply','../../terminal-output/end-of-run-message','Agent\x20wasn\x27t\x20able\x20to\x20store\x20artifacts','anyErrors','../../api/error-reporter.api','__esModule','CloudRemoteCache','../../../utilities/metric-logger','E2EEncryption','../../../utilities/environment','error','../../file-storage/file-storage','writeFileSync','./cloud-enabled-life-cycle','ErrorReporterApi','catch','submitRunMetrics','join','subscribe','endRun','MessageReporter','requests','scan','printMessages','cloudEnabledTasksRunner','obfuscate','skipNxCache','CloudEnabledLifeCycle','forEach','note','extractGitSha','parseCommand','path','VERBOSE_LOGGING','rxjs/internal/Subject','filter'];(function(_0x3258ca,_0x12f9fc){const _0x59c385=function(_0x2d6d30){while(--_0x2d6d30){_0x3258ca['push'](_0x3258ca['shift']());}};_0x59c385(++_0x12f9fc);}(a1_0x12f9,0x137));const a1_0x59c3=function(_0x3258ca,_0x12f9fc){_0x3258ca=_0x3258ca-0x0;let _0x59c385=a1_0x12f9[_0x3258ca];return _0x59c385;};'use strict';var __awaiter=this&&this[a1_0x59c3('0x2e')]||function(_0xbbc923,_0x45adef,_0x89a08c,_0x4ea877){function _0x5c0498(_0x5e5252){return _0x5e5252 instanceof _0x89a08c?_0x5e5252:new _0x89a08c(function(_0x122bc2){_0x122bc2(_0x5e5252);});}return new(_0x89a08c||(_0x89a08c=Promise))(function(_0x40341d,_0x465b40){function _0x31e6b7(_0x4dcbfa){try{_0xb970c9(_0x4ea877[a1_0x59c3('0x3d')](_0x4dcbfa));}catch(_0x5b74a4){_0x465b40(_0x5b74a4);}}function _0x46d234(_0x39822b){try{_0xb970c9(_0x4ea877[a1_0x59c3('0x5')](_0x39822b));}catch(_0x265a7d){_0x465b40(_0x265a7d);}}function _0xb970c9(_0x568fe5){_0x568fe5[a1_0x59c3('0x3e')]?_0x40341d(_0x568fe5['value']):_0x5c0498(_0x568fe5['value'])['then'](_0x31e6b7,_0x46d234);}_0xb970c9((_0x4ea877=_0x4ea877[a1_0x59c3('0x8')](_0xbbc923,_0x45adef||[]))[a1_0x59c3('0x3d')]());});};Object['defineProperty'](exports,a1_0x59c3('0xd'),{'value':!![]});exports[a1_0x59c3('0x20')]=void 0x0;const message_reporter_1=require(a1_0x59c3('0x32'));const end_of_run_message_1=require(a1_0x59c3('0x9'));const output_obfuscator_1=require('../../terminal-output/output-obfuscator');const cloud_enabled_life_cycle_1=require(a1_0x59c3('0x15'));const file_storage_1=require(a1_0x59c3('0x13'));const e2e_encryption_1=require('../../file-storage/e2e-encryption');const environment_1=require(a1_0x59c3('0x11'));const cloud_remote_cache_1=require('./cloud-remote-cache');const cloud_run_api_1=require('./cloud-run.api');const fs_1=require('fs');const path=require(a1_0x59c3('0x28'));const metric_logger_1=require(a1_0x59c3('0xf'));const error_reporter_api_1=require(a1_0x59c3('0xc'));const {tasksRunner,output}=require(a1_0x59c3('0x33'));function createApi(_0x185e17,_0x195094,_0x5817f1){const _0x399433=(0x0,environment_1[a1_0x59c3('0x2d')])(_0x195094);return new cloud_run_api_1[(a1_0x59c3('0x39'))](_0x185e17,_0x5817f1,_0x195094,_0x399433);}function storeTaskHashes(_0x201988,_0x388efe,_0x3284a6){const _0x683d60=JSON[a1_0x59c3('0x1')](_0x201988[a1_0x59c3('0x2')](_0x2e2448=>({'taskId':_0x2e2448[a1_0x59c3('0x31')],'hash':_0x2e2448[a1_0x59c3('0x40')]})));if(environment_1[a1_0x59c3('0x29')]){output[a1_0x59c3('0x25')]({'title':'Executed\x20tasks\x20with\x20hashes:\x20'+_0x683d60});}(0x0,fs_1[a1_0x59c3('0x14')])(path[a1_0x59c3('0x19')](_0x388efe,'tasks-hashes-'+_0x3284a6),_0x683d60);}function onComplete(_0x528c12,_0x435109,_0x108a6a,_0x2daaaa,_0x2fe67b,_0x224a85,_0x433bf9,_0x5a739f,_0x5eed90,_0x1a11bf,_0x10ff9d){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x36eb8c=new Date()[a1_0x59c3('0x35')]();if(environment_1[a1_0x59c3('0x0')]){storeTaskHashes(_0x5eed90,_0x435109[a1_0x59c3('0x3b')]||a1_0x59c3('0x4'),environment_1[a1_0x59c3('0x2f')]);}const _0x345bda=(0x0,environment_1[a1_0x59c3('0x46')])();const _0x2c6153=yield Promise[a1_0x59c3('0x3a')]([_0x108a6a['waitForStoreRequestsToComplete'](),_0x2daaaa[a1_0x59c3('0x1b')]({'command':_0x2fe67b[a1_0x59c3('0x21')]((0x0,environment_1[a1_0x59c3('0x27')])()),'startTime':_0x224a85,'endTime':_0x36eb8c,'distributedExecutionId':environment_1[a1_0x59c3('0x2f')],'branch':_0x345bda,'scan':!![],'runGroup':(0x0,environment_1[a1_0x59c3('0x38')])(),'sha':_0x345bda?(0x0,environment_1[a1_0x59c3('0x26')])():undefined,'inner':_0x10ff9d},_0x5eed90)]);if(_0x1a11bf){setTimeout(()=>{_0x433bf9[a1_0x59c3('0x1f')]();if(!_0x433bf9[a1_0x59c3('0xb')]&&!_0x10ff9d){_0x5a739f[a1_0x59c3('0x2c')]();}},0x0);}else{_0x433bf9[a1_0x59c3('0x1f')]();if(!_0x433bf9[a1_0x59c3('0xb')]&&!_0x10ff9d){_0x5a739f[a1_0x59c3('0x2c')]();}}if(environment_1[a1_0x59c3('0x0')]){if(!_0x2c6153[0x0]){output[a1_0x59c3('0x12')]({'title':a1_0x59c3('0xa')});_0x433bf9['printMessages']();process[a1_0x59c3('0x36')](environment_1[a1_0x59c3('0x45')]);}if(!_0x2c6153[0x1]){output['error']({'title':a1_0x59c3('0x3')});_0x433bf9[a1_0x59c3('0x1f')]();process[a1_0x59c3('0x36')](environment_1[a1_0x59c3('0x45')]);}}yield(0x0,metric_logger_1[a1_0x59c3('0x18')])(_0x435109);});}function createLifeCycle(_0x2f7f5a,_0x18b6cf,_0x4efe5a,_0x75ca11){const _0x2548a2=new cloud_enabled_life_cycle_1[(a1_0x59c3('0x23'))](_0x2f7f5a,_0x18b6cf[a1_0x59c3('0x3b')],!!_0x18b6cf[a1_0x59c3('0x22')],_0x18b6cf[a1_0x59c3('0x1e')]===undefined?!![]:_0x18b6cf[a1_0x59c3('0x1e')],_0x18b6cf[a1_0x59c3('0x30')]||[],_0x4efe5a,_0x75ca11);try{const {CompositeLifeCycle}=require(a1_0x59c3('0x33'));if(!CompositeLifeCycle)return _0x2548a2;return new CompositeLifeCycle([_0x18b6cf['lifeCycle'],_0x2548a2]);}catch(_0x51e681){return _0x2548a2;}}function cloudEnabledTasksRunner(_0x163707,_0x239ad0,_0x4ca557,_0x82f994=![]){const _0x4266f0={'statuses':{},'scheduledTasks':[],'requests':{},'allTasks':_0x163707};const _0x2c50c8=_0x239ad0[a1_0x59c3('0x42')]===undefined;const _0x476372=[];const _0x3f0f68=new message_reporter_1[(a1_0x59c3('0x1c'))](_0x239ad0);const _0x4d260b=createApi(_0x3f0f68,_0x239ad0,_0x4266f0);const _0x3feb8c=new end_of_run_message_1[(a1_0x59c3('0x37'))](_0x4266f0,_0x476372);const _0x4e7f44=new output_obfuscator_1[(a1_0x59c3('0x7'))](_0x239ad0[a1_0x59c3('0x43')]);const _0x41e5a7=_0x163707[a1_0x59c3('0x2')](_0x41848c=>_0x41848c['hash'])[a1_0x59c3('0x2b')](_0x13aafa=>!!_0x13aafa);const _0x596db4=_0x4d260b['startRun'](environment_1[a1_0x59c3('0x2f')],_0x41e5a7);_0x41e5a7[a1_0x59c3('0x24')](_0x1eb6b3=>{_0x4266f0[a1_0x59c3('0x1d')][_0x1eb6b3]=_0x596db4;});const _0xa33bb2=new Date()[a1_0x59c3('0x35')]();const _0x4c55af=createLifeCycle(_0x4266f0,_0x239ad0,_0x4e7f44,_0x476372);const _0x21cf81=new e2e_encryption_1[(a1_0x59c3('0x10'))](environment_1[a1_0x59c3('0x6')]||_0x239ad0[a1_0x59c3('0x41')]);const _0xfa39c4=new error_reporter_api_1[(a1_0x59c3('0x16'))](_0x239ad0);const _0x55b46f=new file_storage_1[(a1_0x59c3('0x3c'))](_0x21cf81,_0xfa39c4,![]);const _0x138a93=new cloud_remote_cache_1[(a1_0x59c3('0xe'))](_0x3f0f68,_0x4d260b,_0x4266f0,_0x55b46f);delete process[a1_0x59c3('0x44')][a1_0x59c3('0x2f')];const _0x1ef9e5=tasksRunner(_0x163707,Object[a1_0x59c3('0x3f')](Object['assign']({},_0x239ad0),{'remoteCache':_0x138a93,'lifeCycle':_0x4c55af}),_0x4ca557);if(_0x1ef9e5['subscribe']){const {Subject}=require(a1_0x59c3('0x2a'));const _0x2a99a6=new Subject();_0x1ef9e5[a1_0x59c3('0x1a')]({'next':_0x3d1cf1=>_0x2a99a6[a1_0x59c3('0x3d')](_0x3d1cf1),'error':_0x23269d=>_0x2a99a6[a1_0x59c3('0x12')](_0x23269d),'complete':()=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x4c55af,_0x239ad0,_0x138a93,_0x4d260b,_0x4e7f44,_0xa33bb2,_0x3f0f68,_0x3feb8c,_0x476372,_0x2c50c8,_0x82f994);_0x2a99a6['complete']();})});return _0x2a99a6;}else{return _0x1ef9e5[a1_0x59c3('0x34')](_0x4ae768=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x4c55af,_0x239ad0,_0x138a93,_0x4d260b,_0x4e7f44,_0xa33bb2,_0x3f0f68,_0x3feb8c,_0x476372,_0x2c50c8,_0x82f994);return _0x4ae768;}))[a1_0x59c3('0x17')](_0xe49313=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x4c55af,_0x239ad0,_0x138a93,_0x4d260b,_0x4e7f44,_0xa33bb2,_0x3f0f68,_0x3feb8c,_0x476372,_0x2c50c8,_0x82f994);throw _0xe49313;}));}}exports[a1_0x59c3('0x20')]=cloudEnabledTasksRunner;
|
|
@@ -1,113 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CloudRemoteCache = void 0;
|
|
13
|
-
const environment_1 = require("../../../utilities/environment");
|
|
14
|
-
const { output } = require('../../../utilities/nx-imports');
|
|
15
|
-
class CloudRemoteCache {
|
|
16
|
-
constructor(messages, api, runContext, fileStorage) {
|
|
17
|
-
this.messages = messages;
|
|
18
|
-
this.api = api;
|
|
19
|
-
this.runContext = runContext;
|
|
20
|
-
this.fileStorage = fileStorage;
|
|
21
|
-
this.storeRequests = [];
|
|
22
|
-
}
|
|
23
|
-
retrieve(hash, cacheDirectory) {
|
|
24
|
-
var _a;
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
if (this.messages.cacheError)
|
|
27
|
-
return false;
|
|
28
|
-
const hashUrls = yield this.hashUrls(hash);
|
|
29
|
-
if (!hashUrls || !hashUrls.get) {
|
|
30
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
31
|
-
output.note({ title: `Nx Cloud: Cache miss ${hash}.` });
|
|
32
|
-
}
|
|
33
|
-
this.runContext.statuses[hash] = 'cache-miss';
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
yield this.fileStorage.retrieve(hash, hashUrls.get, cacheDirectory);
|
|
38
|
-
this.runContext.statuses[hash] = 'remote-cache-hit';
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch (ee) {
|
|
42
|
-
const e = (_a = ee.axiosException) !== null && _a !== void 0 ? _a : ee;
|
|
43
|
-
if (e.response && e.response.status === 404) {
|
|
44
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
45
|
-
output.note({ title: `Nx Cloud: Cache miss ${hash}. Status 404.` });
|
|
46
|
-
}
|
|
47
|
-
// cache miss. print nothing
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.messages.cacheError = this.messages.extractErrorMessage(e, 'storage');
|
|
51
|
-
}
|
|
52
|
-
this.runContext.statuses[hash] = 'cache-miss';
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
store(hash, cacheDirectory) {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
if (this.messages.cacheError)
|
|
60
|
-
return false;
|
|
61
|
-
const res = Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
var _a;
|
|
63
|
-
const hashUrls = yield this.hashUrls(hash);
|
|
64
|
-
if (!hashUrls)
|
|
65
|
-
return false;
|
|
66
|
-
if (!hashUrls.put) {
|
|
67
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
68
|
-
output.note({
|
|
69
|
-
title: `Nx Cloud: Skipping storing ${hash}. Read only token is used.`,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
yield this.fileStorage.store(hash, hashUrls.put, cacheDirectory);
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
catch (ee) {
|
|
79
|
-
const e = (_a = ee.axiosException) !== null && _a !== void 0 ? _a : ee;
|
|
80
|
-
this.messages.cacheError = this.messages.extractErrorMessage(e, 'storage');
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
this.storeRequests.push(res);
|
|
85
|
-
return res;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
hashUrls(hash) {
|
|
89
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
if (hash in this.runContext.requests) {
|
|
91
|
-
return (yield this.runContext.requests[hash])[hash];
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
const scheduledTaskHashesWithoutRequests = this.runContext.scheduledTasks
|
|
95
|
-
.filter((t) => !this.runContext.requests[t.hash])
|
|
96
|
-
.map((t) => t.hash);
|
|
97
|
-
if (scheduledTaskHashesWithoutRequests.indexOf(hash) === -1) {
|
|
98
|
-
scheduledTaskHashesWithoutRequests.push(hash);
|
|
99
|
-
}
|
|
100
|
-
const request = this.api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, scheduledTaskHashesWithoutRequests);
|
|
101
|
-
scheduledTaskHashesWithoutRequests.forEach((taskHash) => {
|
|
102
|
-
this.runContext.requests[taskHash] = request;
|
|
103
|
-
});
|
|
104
|
-
return (yield request)[hash];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
waitForStoreRequestsToComplete() {
|
|
109
|
-
return Promise.all(this.storeRequests).then((r) => r.reduce((a, b) => a && b, true));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
exports.CloudRemoteCache = CloudRemoteCache;
|
|
113
|
-
//# sourceMappingURL=cloud-remote-cache.js.map
|
|
1
|
+
const a2_0x7d6d=['cache-miss','CloudRemoteCache','defineProperty','Nx\x20Cloud:\x20Cache\x20miss\x20','../../../utilities/environment','requests','filter','throw','.\x20Read\x20only\x20token\x20is\x20used.','Nx\x20Cloud:\x20Skipping\x20storing\x20','value','runContext','fileStorage','indexOf','retrieve','apply','storeRequests','waitForStoreRequestsToComplete','VERBOSE_LOGGING','store','storage','put','messages','../../../utilities/nx-imports','__awaiter','get','statuses','note','hashUrls','done','then','scheduledTasks','axiosException','cacheError','response','api','all','.\x20Status\x20404.','reduce','push','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','hash','extractErrorMessage','map','startRun','status','next'];(function(_0x4553b1,_0x7d6da9){const _0x532859=function(_0xc8cb95){while(--_0xc8cb95){_0x4553b1['push'](_0x4553b1['shift']());}};_0x532859(++_0x7d6da9);}(a2_0x7d6d,0x187));const a2_0x5328=function(_0x4553b1,_0x7d6da9){_0x4553b1=_0x4553b1-0x0;let _0x532859=a2_0x7d6d[_0x4553b1];return _0x532859;};'use strict';var __awaiter=this&&this[a2_0x5328('0x9')]||function(_0x3418df,_0x111821,_0x4b8ddd,_0x3cf16c){function _0x312472(_0x1c4661){return _0x1c4661 instanceof _0x4b8ddd?_0x1c4661:new _0x4b8ddd(function(_0x4cac5){_0x4cac5(_0x1c4661);});}return new(_0x4b8ddd||(_0x4b8ddd=Promise))(function(_0x1d4651,_0x143ca6){function _0x19c5c2(_0x3d5f7c){try{_0x2f9a49(_0x3cf16c[a2_0x5328('0x1f')](_0x3d5f7c));}catch(_0x33d196){_0x143ca6(_0x33d196);}}function _0x38a87(_0x438cd7){try{_0x2f9a49(_0x3cf16c[a2_0x5328('0x27')](_0x438cd7));}catch(_0x73d9d9){_0x143ca6(_0x73d9d9);}}function _0x2f9a49(_0x8e1280){_0x8e1280[a2_0x5328('0xe')]?_0x1d4651(_0x8e1280['value']):_0x312472(_0x8e1280[a2_0x5328('0x2a')])[a2_0x5328('0xf')](_0x19c5c2,_0x38a87);}_0x2f9a49((_0x3cf16c=_0x3cf16c[a2_0x5328('0x0')](_0x3418df,_0x111821||[]))[a2_0x5328('0x1f')]());});};Object[a2_0x5328('0x22')](exports,'__esModule',{'value':!![]});exports['CloudRemoteCache']=void 0x0;const environment_1=require(a2_0x5328('0x24'));const {output}=require(a2_0x5328('0x8'));class CloudRemoteCache{constructor(_0x376729,_0x220aaf,_0xe99378,_0x516de0){this[a2_0x5328('0x7')]=_0x376729;this['api']=_0x220aaf;this[a2_0x5328('0x2b')]=_0xe99378;this['fileStorage']=_0x516de0;this[a2_0x5328('0x1')]=[];}[a2_0x5328('0x2e')](_0x34c8be,_0x9afe2c){var _0x509000;return __awaiter(this,void 0x0,void 0x0,function*(){if(this[a2_0x5328('0x7')]['cacheError'])return![];const _0x1091b4=yield this[a2_0x5328('0xd')](_0x34c8be);if(!_0x1091b4||!_0x1091b4[a2_0x5328('0xa')]){if(environment_1[a2_0x5328('0x3')]){output['note']({'title':'Nx\x20Cloud:\x20Cache\x20miss\x20'+_0x34c8be+'.'});}this[a2_0x5328('0x2b')][a2_0x5328('0xb')][_0x34c8be]=a2_0x5328('0x20');return![];}try{yield this['fileStorage'][a2_0x5328('0x2e')](_0x34c8be,_0x1091b4[a2_0x5328('0xa')],_0x9afe2c);this[a2_0x5328('0x2b')][a2_0x5328('0xb')][_0x34c8be]='remote-cache-hit';return!![];}catch(_0x15f771){const _0x4f08e1=(_0x509000=_0x15f771[a2_0x5328('0x11')])!==null&&_0x509000!==void 0x0?_0x509000:_0x15f771;if(_0x4f08e1[a2_0x5328('0x13')]&&_0x4f08e1[a2_0x5328('0x13')][a2_0x5328('0x1e')]===0x194){if(environment_1[a2_0x5328('0x3')]){output[a2_0x5328('0xc')]({'title':a2_0x5328('0x23')+_0x34c8be+a2_0x5328('0x16')});}}else{this[a2_0x5328('0x7')][a2_0x5328('0x12')]=this[a2_0x5328('0x7')][a2_0x5328('0x1b')](_0x4f08e1,a2_0x5328('0x5'));}this[a2_0x5328('0x2b')][a2_0x5328('0xb')][_0x34c8be]=a2_0x5328('0x20');return![];}});}['store'](_0x1d5013,_0x5adfe3){return __awaiter(this,void 0x0,void 0x0,function*(){if(this[a2_0x5328('0x7')][a2_0x5328('0x12')])return![];const _0x2abe75=Promise['resolve']()[a2_0x5328('0xf')](()=>__awaiter(this,void 0x0,void 0x0,function*(){var _0x3e38d2;const _0x1d1fc4=yield this[a2_0x5328('0xd')](_0x1d5013);if(!_0x1d1fc4)return![];if(!_0x1d1fc4['put']){if(environment_1[a2_0x5328('0x3')]){output['note']({'title':a2_0x5328('0x29')+_0x1d5013+a2_0x5328('0x28')});}return!![];}try{yield this[a2_0x5328('0x2c')][a2_0x5328('0x4')](_0x1d5013,_0x1d1fc4[a2_0x5328('0x6')],_0x5adfe3);return!![];}catch(_0xaec03d){const _0x4c09c2=(_0x3e38d2=_0xaec03d['axiosException'])!==null&&_0x3e38d2!==void 0x0?_0x3e38d2:_0xaec03d;this['messages'][a2_0x5328('0x12')]=this[a2_0x5328('0x7')][a2_0x5328('0x1b')](_0x4c09c2,a2_0x5328('0x5'));return![];}}));this[a2_0x5328('0x1')][a2_0x5328('0x18')](_0x2abe75);return _0x2abe75;});}[a2_0x5328('0xd')](_0x860f37){return __awaiter(this,void 0x0,void 0x0,function*(){if(_0x860f37 in this[a2_0x5328('0x2b')][a2_0x5328('0x25')]){return(yield this[a2_0x5328('0x2b')]['requests'][_0x860f37])[_0x860f37];}else{const _0x3f2d69=this[a2_0x5328('0x2b')][a2_0x5328('0x10')][a2_0x5328('0x26')](_0x13b967=>!this[a2_0x5328('0x2b')][a2_0x5328('0x25')][_0x13b967[a2_0x5328('0x1a')]])[a2_0x5328('0x1c')](_0x45defb=>_0x45defb[a2_0x5328('0x1a')]);if(_0x3f2d69[a2_0x5328('0x2d')](_0x860f37)===-0x1){_0x3f2d69[a2_0x5328('0x18')](_0x860f37);}const _0x110b72=this[a2_0x5328('0x14')][a2_0x5328('0x1d')](environment_1[a2_0x5328('0x19')],_0x3f2d69);_0x3f2d69['forEach'](_0x2fcd6e=>{this[a2_0x5328('0x2b')][a2_0x5328('0x25')][_0x2fcd6e]=_0x110b72;});return(yield _0x110b72)[_0x860f37];}});}[a2_0x5328('0x2')](){return Promise[a2_0x5328('0x15')](this[a2_0x5328('0x1')])[a2_0x5328('0xf')](_0x16c2c1=>_0x16c2c1[a2_0x5328('0x17')]((_0x52bdd7,_0x1636d5)=>_0x52bdd7&&_0x1636d5,!![]));}}exports[a2_0x5328('0x21')]=CloudRemoteCache;
|