@coalescesoftware/coa 1.0.151 → 1.0.155

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/bin/Plan.js DELETED
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.CreatePlan = void 0;
26
- const Shared = __importStar(require("@coalescesoftware/shared"));
27
- const fs_1 = __importDefault(require("fs"));
28
- const CreatePlan = (path, environmentID, token, message, runtimeParameters) => {
29
- const fsSettings = {
30
- fs: fs_1.default,
31
- dir: path,
32
- };
33
- return Shared.DeployOperations.CreatePlanCLI(environmentID, fsSettings, token, Shared.Templates.PlatformType.snowflake, runtimeParameters)
34
- .then(result => {
35
- const { plan } = result;
36
- plan.gitInfo = { commit: { message: message }, oid: "" };
37
- return result;
38
- });
39
- };
40
- exports.CreatePlan = CreatePlan;
41
- //# sourceMappingURL=Plan.js.map
package/bin/Refresh.js DELETED
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.RefreshWithCLI = void 0;
23
- const Shared = __importStar(require("@coalescesoftware/shared"));
24
- const CommonCLI = __importStar(require("./CommonCLI"));
25
- const CryptoJS = require("crypto-js");
26
- const v8 = require("v8");
27
- Shared.Snowflake.CryptoJS = CryptoJS;
28
- Shared.Snowflake.salt = CryptoJS.lib.WordArray.random(128 / 8);
29
- Shared.Snowflake.v8 = v8;
30
- const LogCLI = Shared.Logging.GetLogger(Shared.Logging.LoggingArea.CLI);
31
- /**
32
- *
33
- * @param token
34
- * @param runInfo
35
- * @returns
36
- */
37
- const RefreshWithCLI = (token, runInfo) => {
38
- let firebase;
39
- let logContext;
40
- let RunSQL, teamDetailsStored;
41
- return Shared.SchedulerOperations.AuthenticateFirebaseTokenAndRetrieveTeamInfoForCLI(token, undefined)
42
- .then((teamInfoAndFirebase) => {
43
- teamDetailsStored = teamInfoAndFirebase;
44
- const { teamInfo: { fbUserID: userID, fbTeamID: teamID } } = teamInfoAndFirebase;
45
- firebase = teamInfoAndFirebase.firebase;
46
- const environmentID = runInfo.runDetails.environmentID;
47
- logContext = Shared.Logging.CreateLogContext(teamID, environmentID, userID);
48
- const connectionCache = new Shared.Snowflake.ConnectionStorageClass();
49
- RunSQL = Shared.SQLExecutorCreators.CreateRunSQLWithoutScheduler(teamInfoAndFirebase, connectionCache);
50
- LogCLI.infoContext(logContext, "Starting refresh (CLI)");
51
- return CommonCLI.GetUserConnectionForCLI(userID, runInfo);
52
- })
53
- .then((connection) => {
54
- return Shared.SchedulerOperations.BECLI_HandleRefresh(runInfo, teamDetailsStored, RunSQL, connection);
55
- })
56
- .then(({ runCounter, runCompletion }) => {
57
- const cleanupPromise = CommonCLI.CleanupCLIJob(runCompletion, firebase, logContext, "Refresh");
58
- return {
59
- runCounter,
60
- runCompletion: cleanupPromise,
61
- logContext,
62
- };
63
- });
64
- };
65
- exports.RefreshWithCLI = RefreshWithCLI;
66
- //# sourceMappingURL=Refresh.js.map
package/bin/RunOutput.js DELETED
@@ -1,86 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.SaveRunOutputToFile = void 0;
23
- const Shared = __importStar(require("@coalescesoftware/shared"));
24
- const CLILogger = Shared.Logging.GetLogger(Shared.Logging.LoggingArea.CLI);
25
- //convert from firestore shape to run output shape
26
- const cleanRunResult = (nodeID, runResult) => {
27
- return {
28
- nodeID,
29
- queryResultSequence: runResult.queryResultSequence
30
- };
31
- };
32
- const GetRunOutputForRunCounter = (firestore, teamID, runID) => {
33
- let runData;
34
- return Shared.Runs.getRun(firestore, teamID, runID).get()
35
- .then((runDataResult /*query snapshot*/) => {
36
- if (!runDataResult.docs.length) {
37
- const errorMessage = `wasnt able to get exactly one run for runID ${runID}`;
38
- CLILogger.emergContext({
39
- orgID: teamID
40
- }, errorMessage);
41
- throw new Error(errorMessage);
42
- }
43
- const runInfo = runDataResult.docs[0].data();
44
- runData = {
45
- runResults: {
46
- runStartTime: runInfo.runStartTime,
47
- runEndTime: runInfo.runEndTime,
48
- runType: runInfo.runType,
49
- runStatus: runInfo.runStatus,
50
- runID: runInfo.id,
51
- runResults: []
52
- }
53
- };
54
- return Shared.Runs.getRunRunResultsCollection(firestore, teamID, runID.toString())
55
- .get().then((queryResult /*querySnapshot*/) => {
56
- let runResults = {};
57
- queryResult.docs.forEach((runResultDoc) => {
58
- const stepCounter = runResultDoc.id;
59
- const runResult = runResultDoc.data();
60
- Shared.RunsTypes.RunResult.check(runResult);
61
- runResults[stepCounter] = cleanRunResult(stepCounter, runResult);
62
- });
63
- const executionSequence = Shared.Runs.GetExecutionSequenceFromRunResults(runResults);
64
- runData.runResults.runResults = executionSequence.map((stepCounter) => {
65
- return runResults[stepCounter];
66
- });
67
- });
68
- }).then(() => {
69
- return runData;
70
- });
71
- };
72
- const SaveRunOutputToFile = (runOutputFileLocation, runIDString, token) => {
73
- return Shared.SchedulerOperations.AuthenticateFirebaseTokenAndRetrieveTeamInfoForCLI(token, undefined).then((authInfo) => {
74
- const { teamInfo, firebase } = authInfo;
75
- const teamID = teamInfo.fbTeamID;
76
- const firestore = firebase.firestore();
77
- const runID = parseInt(runIDString);
78
- return GetRunOutputForRunCounter(firestore, teamID, runID);
79
- }).then((runOutput) => {
80
- Shared.RunsTypes.RRunOutput.check(runOutput);
81
- const runOutputJSON = Shared.Common.StringifyFirestoreObject(runOutput);
82
- return Shared.Common.WriteFile(runOutputFileLocation, runOutputJSON + "\n");
83
- });
84
- };
85
- exports.SaveRunOutputToFile = SaveRunOutputToFile;
86
- //# sourceMappingURL=RunOutput.js.map