@sasjs/cli 4.20.1 → 4.20.2
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/build/cli.js +4 -5
- package/build/cli.spec.js +19 -9
- package/build/commands/add/addCommand.js +2 -2
- package/build/commands/add/addCredential.js +2 -2
- package/build/commands/add/addTarget.js +13 -14
- package/build/commands/add/internal/input.js +14 -14
- package/build/commands/add/internal/saveConfig.js +3 -4
- package/build/commands/add/spec/addCommand.spec.js +19 -9
- package/build/commands/add/spec/addCredential.spec.js +19 -9
- package/build/commands/add/spec/addTarget.spec.js +19 -9
- package/build/commands/auth/authCommand.js +8 -8
- package/build/commands/auth/login.js +40 -14
- package/build/commands/auth/spec/authCommand.spec.js +19 -9
- package/build/commands/auth/spec/login.spec.js +19 -9
- package/build/commands/build/build.js +25 -26
- package/build/commands/build/buildCommand.js +2 -2
- package/build/commands/build/compileBuildCommand.js +3 -3
- package/build/commands/build/internal/config.js +2 -2
- package/build/commands/build/spec/build.spec.js +2 -2
- package/build/commands/build/spec/buildCommand.spec.js +19 -9
- package/build/commands/build/spec/cb.spec.server.viya.js +2 -2
- package/build/commands/build/spec/compileBuildCommand.spec.js +19 -9
- package/build/commands/compile/compile.js +29 -20
- package/build/commands/compile/compileCommand.js +2 -2
- package/build/commands/compile/compileSingleFile.js +15 -15
- package/build/commands/compile/internal/checkCompileStatus.js +3 -4
- package/build/commands/compile/internal/compareFolders.js +2 -2
- package/build/commands/compile/internal/compileFile.js +6 -7
- package/build/commands/compile/internal/compileTestFile.js +17 -13
- package/build/commands/compile/internal/copySyncFolder.js +2 -2
- package/build/commands/compile/internal/getAllFolders.js +3 -3
- package/build/commands/compile/internal/identifySasFile.js +2 -2
- package/build/commands/compile/internal/loadDependencies.js +10 -10
- package/build/commands/compile/internal/spec/compileTestFile.spec.js +2 -2
- package/build/commands/compile/internal/spec/getAllFolders.spec.js +19 -9
- package/build/commands/compile/spec/compareFolders.spec.js +3 -3
- package/build/commands/compile/spec/compile.spec.js +19 -9
- package/build/commands/compile/spec/compileCommand.spec.js +19 -9
- package/build/commands/compile/spec/compileFile.spec.js +19 -9
- package/build/commands/compile/spec/compileSingleFile.spec.js +19 -9
- package/build/commands/compile/spec/copyFilesToBuildFolder.spec.js +20 -10
- package/build/commands/compile/spec/loadDependencies.spec.js +19 -9
- package/build/commands/context/contextCommand.js +3 -3
- package/build/commands/context/create.js +4 -5
- package/build/commands/context/delete.js +4 -5
- package/build/commands/context/edit.js +4 -5
- package/build/commands/context/export.js +4 -5
- package/build/commands/context/internal/parseConfig.js +1 -2
- package/build/commands/context/internal/validateConfigPath.js +3 -4
- package/build/commands/context/list.js +4 -5
- package/build/commands/context/spec/contextCommand.spec.js +19 -9
- package/build/commands/context/spec/create.spec.js +2 -2
- package/build/commands/context/spec/delete.spec.js +2 -2
- package/build/commands/context/spec/edit.spec.js +2 -2
- package/build/commands/context/spec/export.spec.js +19 -9
- package/build/commands/context/spec/list.spec.js +2 -2
- package/build/commands/create/create.js +4 -5
- package/build/commands/create/createCommand.js +2 -2
- package/build/commands/create/createTemplate.js +1 -1
- package/build/commands/create/internal/createReadme.js +3 -4
- package/build/commands/create/spec/create.spec.js +2 -2
- package/build/commands/create/spec/createCommand.spec.js +19 -9
- package/build/commands/db/db.js +8 -9
- package/build/commands/db/dbCommand.js +2 -2
- package/build/commands/db/spec/db.spec.js +2 -2
- package/build/commands/db/spec/dbCommand.spec.js +19 -9
- package/build/commands/deploy/compileBuildDeployCommand.js +8 -8
- package/build/commands/deploy/deploy.js +4 -5
- package/build/commands/deploy/deployCommand.js +2 -2
- package/build/commands/deploy/internal/deployToSASJSWithServicePack.js +11 -12
- package/build/commands/deploy/internal/executeDeployScript.js +3 -4
- package/build/commands/deploy/internal/executeDeployScriptSas9.js +10 -11
- package/build/commands/deploy/internal/executeDeployScriptSasViya.js +11 -12
- package/build/commands/deploy/internal/executeDeployScriptSasjs.js +12 -13
- package/build/commands/deploy/internal/executeNonSasScript.js +4 -5
- package/build/commands/deploy/internal/executeSasScript.js +5 -6
- package/build/commands/deploy/internal/getDeployScripts.js +4 -5
- package/build/commands/deploy/spec/cbd.spec.js +19 -9
- package/build/commands/deploy/spec/cbd.spec.server.viya.js +19 -9
- package/build/commands/deploy/spec/compileBuildDeployCommand.spec.js +19 -9
- package/build/commands/deploy/spec/deploy.spec.js +19 -9
- package/build/commands/deploy/spec/deployCommand.spec.js +19 -9
- package/build/commands/deploy/spec/getDeployScripts.spec.js +2 -2
- package/build/commands/deploy/spec/utils.js +41 -8
- package/build/commands/docs/docsCommand.js +2 -2
- package/build/commands/docs/generateDocs.js +11 -12
- package/build/commands/docs/generateDot.js +3 -4
- package/build/commands/docs/initDocs.js +3 -4
- package/build/commands/docs/internal/createDotFiles.js +4 -5
- package/build/commands/docs/internal/getDocConfig.d.ts +8 -8
- package/build/commands/docs/internal/getDocConfig.js +1 -2
- package/build/commands/docs/internal/getDotFileContent.js +3 -4
- package/build/commands/docs/internal/getFileInputs.js +1 -2
- package/build/commands/docs/internal/getFileOutputs.js +1 -2
- package/build/commands/docs/internal/getFoldersForDocs.js +1 -2
- package/build/commands/docs/internal/populateNodeDictionary.js +1 -2
- package/build/commands/docs/internal/populateParamNodeTypes.js +21 -22
- package/build/commands/docs/spec/docsCommand.spec.js +19 -9
- package/build/commands/docs/spec/generateDocs.spec.js +2 -2
- package/build/commands/docs/spec/generateDot.spec.js +2 -2
- package/build/commands/docs/spec/getDocConfig.spec.js +2 -2
- package/build/commands/docs/spec/initDocs.spec.js +2 -2
- package/build/commands/flow/execute.js +6 -7
- package/build/commands/flow/flowCommand.js +2 -2
- package/build/commands/flow/internal/executeFlow.js +2 -2
- package/build/commands/flow/internal/saveLog.js +34 -5
- package/build/commands/flow/internal/saveToCsv.js +2 -2
- package/build/commands/flow/internal/spec/executeFlow.spec.js +19 -9
- package/build/commands/flow/internal/spec/saveToCsv.spec.js +2 -2
- package/build/commands/flow/internal/spec/validateParams.spec.js +19 -9
- package/build/commands/flow/internal/validateParams.d.ts +4 -4
- package/build/commands/flow/internal/validateParams.js +2 -2
- package/build/commands/flow/spec/flow.spec.js +19 -9
- package/build/commands/flow/spec/flow.spec.server.viya.js +2 -2
- package/build/commands/flow/spec/flowCommand.spec.js +19 -9
- package/build/commands/folder/create.js +2 -2
- package/build/commands/folder/delete.js +2 -2
- package/build/commands/folder/folderCommand.js +13 -13
- package/build/commands/folder/list.js +2 -2
- package/build/commands/folder/move.js +2 -2
- package/build/commands/folder/spec/folder.spec.server.viya.js +2 -2
- package/build/commands/folder/spec/folderCommand.spec.js +19 -9
- package/build/commands/fs/fsCommand.js +34 -36
- package/build/commands/fs/internal/executeCode.js +2 -2
- package/build/commands/fs/spec/executeCode.spec.js +19 -9
- package/build/commands/fs/spec/fsCommand.spec.js +19 -9
- package/build/commands/help/help.js +3 -4
- package/build/commands/help/helpCommand.js +2 -2
- package/build/commands/help/spec/help.spec.js +2 -2
- package/build/commands/help/spec/helpCommand.spec.js +19 -9
- package/build/commands/index.js +1 -1
- package/build/commands/init/init.js +5 -5
- package/build/commands/init/initCommand.js +2 -2
- package/build/commands/init/spec/init.spec.js +2 -2
- package/build/commands/init/spec/initCommand.spec.js +19 -9
- package/build/commands/job/internal/execute/sas9.js +3 -4
- package/build/commands/job/internal/execute/sasjs.js +4 -5
- package/build/commands/job/internal/execute/viya.js +9 -10
- package/build/commands/job/internal/utils.js +2 -2
- package/build/commands/job/jobCommand.js +19 -19
- package/build/commands/job/spec/execute.spec.js +19 -9
- package/build/commands/job/spec/getContextName.spec.js +2 -2
- package/build/commands/job/spec/job.spec.server.viya.js +24 -16
- package/build/commands/job/spec/jobCommand.spec.js +19 -9
- package/build/commands/lint/initLint.js +3 -4
- package/build/commands/lint/lintCommand.js +2 -2
- package/build/commands/lint/processLint.js +13 -14
- package/build/commands/lint/spec/lintCommand.spec.js +19 -9
- package/build/commands/request/request.js +3 -4
- package/build/commands/request/requestCommand.js +2 -2
- package/build/commands/request/spec/request.spec.server.sas9.js +19 -9
- package/build/commands/request/spec/request.spec.server.viya.js +19 -9
- package/build/commands/request/spec/requestCommand.spec.js +19 -9
- package/build/commands/request/spec/utils.js +2 -2
- package/build/commands/run/run.js +29 -30
- package/build/commands/run/runCommand.js +2 -2
- package/build/commands/run/spec/run.spec.js +19 -9
- package/build/commands/run/spec/run.spec.server.sas9.js +2 -2
- package/build/commands/run/spec/run.spec.server.sasjs.js +2 -2
- package/build/commands/run/spec/run.spec.server.viya.js +4 -4
- package/build/commands/run/spec/runCommand.spec.js +19 -9
- package/build/commands/servicepack/deploy.js +7 -8
- package/build/commands/servicepack/servicePackCommand.js +7 -7
- package/build/commands/servicepack/spec/servicepack.spec.server.viya.js +2 -2
- package/build/commands/servicepack/spec/servicepackCommand.spec.js +19 -9
- package/build/commands/shared/createConfigFile.js +2 -2
- package/build/commands/shared/createFileStructure.js +2 -2
- package/build/commands/shared/createLintConfigFile.js +2 -2
- package/build/commands/shared/deployToSasViyaWithServicePack.js +6 -7
- package/build/commands/shared/fetchLogFileContent.js +2 -2
- package/build/commands/shared/spec/deployToSasViyaWithServicePack.spec.js +19 -9
- package/build/commands/snippets/snippets.js +3 -4
- package/build/commands/snippets/snippetsCommand.js +2 -2
- package/build/commands/snippets/spec/snippets.spec.js +2 -2
- package/build/commands/snippets/spec/snippetsCommand.spec.js +19 -9
- package/build/commands/testing/internal/saveOutput.js +23 -15
- package/build/commands/testing/spec/testCommand.spec.js +19 -9
- package/build/commands/testing/spec/testing.spec.js +19 -9
- package/build/commands/testing/test.js +14 -14
- package/build/commands/testing/testCommand.js +2 -2
- package/build/commands/version/spec/version.spec.js +2 -2
- package/build/commands/version/spec/versionCommand.spec.js +19 -9
- package/build/commands/version/version.js +4 -5
- package/build/commands/version/versionCommand.js +2 -2
- package/build/commands/web/internal/createAssetServices.js +39 -41
- package/build/commands/web/internal/sas9/createClickMeService.js +2 -2
- package/build/commands/web/internal/sas9/generateAssetService.js +2 -2
- package/build/commands/web/internal/sas9/getWebServiceContent.js +34 -5
- package/build/commands/web/internal/sasViya/createClickMeFile.js +2 -2
- package/build/commands/web/internal/spec/updateSasjstag.spec.js +2 -2
- package/build/commands/web/internal/spec/updateScriptTag.spec.js +2 -2
- package/build/commands/web/internal/spec/updateStyleTag.spec.js +2 -2
- package/build/commands/web/internal/updateAllTags.js +86 -88
- package/build/commands/web/internal/updateLinkTag.d.ts +1 -1
- package/build/commands/web/internal/updateScriptTag.js +2 -2
- package/build/commands/web/internal/updateStyleTag.js +2 -2
- package/build/commands/web/spec/web.spec.js +2 -2
- package/build/commands/web/spec/webCommand.spec.js +19 -9
- package/build/commands/web/web.js +10 -11
- package/build/commands/web/webCommand.js +2 -2
- package/build/types/command/commandAliases.d.ts +1 -1
- package/build/types/command/commandBase.js +2 -2
- package/build/types/command/commandFactory.d.ts +1 -1
- package/build/types/command/returnCode.js +1 -1
- package/build/types/command/spec/commandBase.spec.js +2 -2
- package/build/types/command/spec/targetCommand.spec.js +19 -9
- package/build/types/command/targetCommand.js +2 -2
- package/build/types/flow.js +1 -1
- package/build/types/targetScope.js +1 -1
- package/build/types/testing.js +3 -3
- package/build/utils/auth.js +8 -8
- package/build/utils/compressAndSave.js +2 -2
- package/build/utils/config.js +82 -84
- package/build/utils/displayResult.js +2 -3
- package/build/utils/file.js +13 -13
- package/build/utils/loadEnvVariables.js +4 -5
- package/build/utils/parseSourceFile.js +3 -4
- package/build/utils/saveLog.js +34 -5
- package/build/utils/setConstants.js +34 -5
- package/build/utils/setProjectDir.js +2 -2
- package/build/utils/spec/auth.spec.js +2 -2
- package/build/utils/spec/config.spec.js +19 -9
- package/build/utils/spec/file.spec.js +2 -2
- package/build/utils/spec/saveLog.spec.js +2 -2
- package/build/utils/spec/setConstants.spec.js +20 -10
- package/build/utils/spec/utils.spec.js +2 -2
- package/build/utils/test.d.ts +2 -3
- package/build/utils/test.js +103 -40
- package/build/utils/utils.js +22 -22
- package/package.json +32 -32
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -78,47 +78,45 @@ var sas9_1 = require("./sas9");
|
|
|
78
78
|
* @param {StreamConfig} streamConfig stream configuration to be used.
|
|
79
79
|
* @returns {AssetPathMap[]} list of all the sources specified along server based paths.
|
|
80
80
|
*/
|
|
81
|
-
var createAssetServices = function (target, destinationPath,
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.warn("Assets path '".concat(fullAssetPath, "' present in 'streamConfig' doesn't exist."));
|
|
105
|
-
return [2 /*return*/];
|
|
106
|
-
}
|
|
107
|
-
return [4 /*yield*/, createAssetsServicesNested(target, streamWebFolder, fullAssetPath, destinationPath)];
|
|
108
|
-
case 2:
|
|
109
|
-
assetPathMapNested = _b.sent();
|
|
110
|
-
assetPathMap.push.apply(assetPathMap, __spreadArray([], __read(assetPathMapNested), false));
|
|
81
|
+
var createAssetServices = function (target_1, destinationPath_1, _a) { return __awaiter(void 0, [target_1, destinationPath_1, _a], void 0, function (target, destinationPath, _b) {
|
|
82
|
+
var assetPathMap;
|
|
83
|
+
var webSourcePath = _b.webSourcePath, streamWebFolder = _b.streamWebFolder, assetPaths = _b.assetPaths;
|
|
84
|
+
return __generator(this, function (_c) {
|
|
85
|
+
switch (_c.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
assetPathMap = [];
|
|
88
|
+
return [4 /*yield*/, (0, utils_1.asyncForEach)(__spreadArray([path_1.default.join(process.projectDir, webSourcePath)], __read((assetPaths !== null && assetPaths !== void 0 ? assetPaths : [])), false), function (assetPath) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
|
+
var fullAssetPath, assetPathExists, assetPathMapNested;
|
|
90
|
+
var _a;
|
|
91
|
+
return __generator(this, function (_b) {
|
|
92
|
+
switch (_b.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
fullAssetPath = path_1.default.isAbsolute(assetPath)
|
|
95
|
+
? assetPath
|
|
96
|
+
: path_1.default.isAbsolute(webSourcePath)
|
|
97
|
+
? path_1.default.join(webSourcePath, assetPath)
|
|
98
|
+
: path_1.default.join(process.projectDir, webSourcePath, assetPath);
|
|
99
|
+
return [4 /*yield*/, (0, utils_1.folderExists)(fullAssetPath)];
|
|
100
|
+
case 1:
|
|
101
|
+
assetPathExists = _b.sent();
|
|
102
|
+
if (!assetPathExists) {
|
|
103
|
+
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.warn("Assets path '".concat(fullAssetPath, "' present in 'streamConfig' doesn't exist."));
|
|
111
104
|
return [2 /*return*/];
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
}
|
|
106
|
+
return [4 /*yield*/, createAssetsServicesNested(target, streamWebFolder, fullAssetPath, destinationPath)];
|
|
107
|
+
case 2:
|
|
108
|
+
assetPathMapNested = _b.sent();
|
|
109
|
+
assetPathMap.push.apply(assetPathMap, __spreadArray([], __read(assetPathMapNested), false));
|
|
110
|
+
return [2 /*return*/];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}); })];
|
|
114
|
+
case 1:
|
|
115
|
+
_c.sent();
|
|
116
|
+
return [2 /*return*/, (0, lodash_uniqby_1.default)(assetPathMap, 'source')];
|
|
117
|
+
}
|
|
120
118
|
});
|
|
121
|
-
};
|
|
119
|
+
}); };
|
|
122
120
|
exports.createAssetServices = createAssetServices;
|
|
123
121
|
/**
|
|
124
122
|
* Creates all the asset services for web streaming for a specific folder.
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -35,6 +35,31 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
38
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
64
|
exports.getWebServiceContent = void 0;
|
|
40
65
|
var utils_1 = require("@sasjs/utils");
|
|
@@ -45,10 +70,14 @@ var sasjsout_1 = require("../sasjsout");
|
|
|
45
70
|
* @param {string} type extension of source code's file in uppercase.
|
|
46
71
|
* @returns {string} service contents of provided source code.
|
|
47
72
|
*/
|
|
48
|
-
var getWebServiceContent = function (
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
var getWebServiceContent = function (contentBase64_1) {
|
|
74
|
+
var args_1 = [];
|
|
75
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
76
|
+
args_1[_i - 1] = arguments[_i];
|
|
77
|
+
}
|
|
78
|
+
return __awaiter(void 0, __spreadArray([contentBase64_1], __read(args_1), false), void 0, function (contentBase64, type) {
|
|
51
79
|
var lines, typesToEncode, serviceContent;
|
|
80
|
+
if (type === void 0) { type = 'JS'; }
|
|
52
81
|
return __generator(this, function (_a) {
|
|
53
82
|
lines = [contentBase64];
|
|
54
83
|
typesToEncode = {
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -12,8 +12,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g =
|
|
15
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
16
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
17
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
18
|
function step(op) {
|
|
19
19
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -12,8 +12,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g =
|
|
15
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
16
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
17
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
18
|
function step(op) {
|
|
19
19
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -12,8 +12,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g =
|
|
15
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
16
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
17
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
18
|
function step(op) {
|
|
19
19
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -73,93 +73,91 @@ var updateSasjsTag_1 = require("./updateSasjsTag");
|
|
|
73
73
|
* Also updates contents to update included asset references
|
|
74
74
|
* @param {JSDOM} parsedHtml- DOMWindow for index.html
|
|
75
75
|
*/
|
|
76
|
-
var updateAllTags = function (parsedHtml, target,
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
var updateAllTags = function (parsedHtml_1, target_1, _a) { return __awaiter(void 0, [parsedHtml_1, target_1, _a], void 0, function (parsedHtml, target, _b) {
|
|
77
|
+
var assetsNotFound, sasjsTags, scriptTags, modulePreloadTags, styleExternalTags, styleInPageTags, styleTags, faviconTags, manifestTags, imgTags, sourceTags, srcTags, notFoundErrors;
|
|
78
|
+
var webSourcePathFull = _b.webSourcePathFull, destinationPath = _b.destinationPath, serverType = _b.serverType, assetPathMap = _b.assetPathMap;
|
|
79
|
+
return __generator(this, function (_c) {
|
|
80
|
+
switch (_c.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
assetsNotFound = [];
|
|
83
|
+
sasjsTags = (0, getTags_1.getSasjsTags)(parsedHtml);
|
|
84
|
+
if (sasjsTags.length) {
|
|
85
|
+
(0, updateSasjsTag_1.updateSasjsTag)(sasjsTags[0], target);
|
|
86
|
+
}
|
|
87
|
+
scriptTags = (0, getTags_1.getScriptTags)(parsedHtml);
|
|
88
|
+
return [4 /*yield*/, (0, utils_1.asyncForEach)(scriptTags, function (tag) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0: return [4 /*yield*/, (0, updateScriptTag_1.updateScriptTag)(tag, webSourcePathFull, destinationPath, serverType, assetPathMap).catch(function (e) { return assetsNotFound.push(e); })];
|
|
92
|
+
case 1:
|
|
93
|
+
_a.sent();
|
|
94
|
+
return [2 /*return*/];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); })];
|
|
98
|
+
case 1:
|
|
99
|
+
_c.sent();
|
|
100
|
+
modulePreloadTags = (0, getTags_1.getModulePreload)(parsedHtml);
|
|
101
|
+
modulePreloadTags.forEach(function (tag) {
|
|
102
|
+
try {
|
|
103
|
+
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
87
104
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return __generator(this, function (_a) {
|
|
91
|
-
switch (_a.label) {
|
|
92
|
-
case 0: return [4 /*yield*/, (0, updateScriptTag_1.updateScriptTag)(tag, webSourcePathFull, destinationPath, serverType, assetPathMap).catch(function (e) { return assetsNotFound.push(e); })];
|
|
93
|
-
case 1:
|
|
94
|
-
_a.sent();
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); })];
|
|
99
|
-
case 1:
|
|
100
|
-
_b.sent();
|
|
101
|
-
modulePreloadTags = (0, getTags_1.getModulePreload)(parsedHtml);
|
|
102
|
-
modulePreloadTags.forEach(function (tag) {
|
|
103
|
-
try {
|
|
104
|
-
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
assetsNotFound.push(error);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
styleExternalTags = (0, getTags_1.getStyleTags)(parsedHtml);
|
|
111
|
-
styleInPageTags = (0, getTags_1.getStyleInPageTags)(parsedHtml);
|
|
112
|
-
styleTags = __spreadArray(__spreadArray([], __read(styleExternalTags), false), __read(styleInPageTags), false);
|
|
113
|
-
return [4 /*yield*/, (0, utils_1.asyncForEach)(styleTags, function (tag) { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
-
return __generator(this, function (_a) {
|
|
115
|
-
switch (_a.label) {
|
|
116
|
-
case 0: return [4 /*yield*/, (0, updateStyleTag_1.updateStyleTag)(tag, webSourcePathFull, destinationPath, serverType, assetPathMap).catch(function (e) { return assetsNotFound.push(e); })];
|
|
117
|
-
case 1:
|
|
118
|
-
_a.sent();
|
|
119
|
-
return [2 /*return*/];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}); })];
|
|
123
|
-
case 2:
|
|
124
|
-
_b.sent();
|
|
125
|
-
faviconTags = (0, getTags_1.getFaviconTags)(parsedHtml);
|
|
126
|
-
faviconTags.forEach(function (tag) {
|
|
127
|
-
try {
|
|
128
|
-
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
assetsNotFound.push(error);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
manifestTags = (0, getTags_1.getManifestTags)(parsedHtml);
|
|
135
|
-
manifestTags.forEach(function (tag) {
|
|
136
|
-
try {
|
|
137
|
-
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
assetsNotFound.push(error);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
imgTags = (0, getTags_1.getImgTags)(parsedHtml);
|
|
144
|
-
sourceTags = (0, getTags_1.getSourceTags)(parsedHtml);
|
|
145
|
-
srcTags = __spreadArray(__spreadArray([], __read(imgTags), false), __read(sourceTags), false);
|
|
146
|
-
srcTags.forEach(function (tag) {
|
|
147
|
-
try {
|
|
148
|
-
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap, 'src');
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
assetsNotFound.push(error);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
if (assetsNotFound.length) {
|
|
155
|
-
notFoundErrors = assetsNotFound
|
|
156
|
-
.map(function (e) { return "- ".concat(e.message, "\n"); })
|
|
157
|
-
.join('');
|
|
158
|
-
throw new Error("Error(s) while preparing stream app:\n".concat(notFoundErrors));
|
|
105
|
+
catch (error) {
|
|
106
|
+
assetsNotFound.push(error);
|
|
159
107
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
108
|
+
});
|
|
109
|
+
styleExternalTags = (0, getTags_1.getStyleTags)(parsedHtml);
|
|
110
|
+
styleInPageTags = (0, getTags_1.getStyleInPageTags)(parsedHtml);
|
|
111
|
+
styleTags = __spreadArray(__spreadArray([], __read(styleExternalTags), false), __read(styleInPageTags), false);
|
|
112
|
+
return [4 /*yield*/, (0, utils_1.asyncForEach)(styleTags, function (tag) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, (0, updateStyleTag_1.updateStyleTag)(tag, webSourcePathFull, destinationPath, serverType, assetPathMap).catch(function (e) { return assetsNotFound.push(e); })];
|
|
116
|
+
case 1:
|
|
117
|
+
_a.sent();
|
|
118
|
+
return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}); })];
|
|
122
|
+
case 2:
|
|
123
|
+
_c.sent();
|
|
124
|
+
faviconTags = (0, getTags_1.getFaviconTags)(parsedHtml);
|
|
125
|
+
faviconTags.forEach(function (tag) {
|
|
126
|
+
try {
|
|
127
|
+
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
assetsNotFound.push(error);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
manifestTags = (0, getTags_1.getManifestTags)(parsedHtml);
|
|
134
|
+
manifestTags.forEach(function (tag) {
|
|
135
|
+
try {
|
|
136
|
+
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
assetsNotFound.push(error);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
imgTags = (0, getTags_1.getImgTags)(parsedHtml);
|
|
143
|
+
sourceTags = (0, getTags_1.getSourceTags)(parsedHtml);
|
|
144
|
+
srcTags = __spreadArray(__spreadArray([], __read(imgTags), false), __read(sourceTags), false);
|
|
145
|
+
srcTags.forEach(function (tag) {
|
|
146
|
+
try {
|
|
147
|
+
(0, updateLinkTag_1.updateLinkTag)(tag, assetPathMap, 'src');
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
assetsNotFound.push(error);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
if (assetsNotFound.length) {
|
|
154
|
+
notFoundErrors = assetsNotFound
|
|
155
|
+
.map(function (e) { return "- ".concat(e.message, "\n"); })
|
|
156
|
+
.join('');
|
|
157
|
+
throw new Error("Error(s) while preparing stream app:\n".concat(notFoundErrors));
|
|
158
|
+
}
|
|
159
|
+
return [2 /*return*/];
|
|
160
|
+
}
|
|
163
161
|
});
|
|
164
|
-
};
|
|
162
|
+
}); };
|
|
165
163
|
exports.updateAllTags = updateAllTags;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AssetPathMap } from './createAssetServices';
|
|
2
|
-
export declare const updateLinkTag: (linkTag: HTMLLinkElement | HTMLSourceElement | HTMLImageElement, assetPathMap: AssetPathMap[], tagType?:
|
|
2
|
+
export declare const updateLinkTag: (linkTag: HTMLLinkElement | HTMLSourceElement | HTMLImageElement, assetPathMap: AssetPathMap[], tagType?: "link" | "src") => void;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,8 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
42
|
});
|
|
33
43
|
};
|
|
34
44
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g =
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
47
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
48
|
function step(op) {
|
|
39
49
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.createWebAppServices =
|
|
42
|
+
exports.createWebAppServices = createWebAppServices;
|
|
43
43
|
var utils_1 = require("@sasjs/utils");
|
|
44
44
|
var config_1 = require("../../utils/config");
|
|
45
45
|
var path_1 = __importDefault(require("path"));
|
|
@@ -56,9 +56,9 @@ var exampleStreamConfig = {
|
|
|
56
56
|
streamServiceName: 'clickme'
|
|
57
57
|
};
|
|
58
58
|
function createWebAppServices(target) {
|
|
59
|
-
var _a, _b;
|
|
60
59
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var buildDestinationServicesFolder, streamConfig,
|
|
60
|
+
var buildDestinationServicesFolder, streamConfig, _a, webSourcePathFull, indexHtmlPath, destinationPath, assetPathMap, indexHtml, _b;
|
|
61
|
+
var _c, _d;
|
|
62
62
|
return __generator(this, function (_e) {
|
|
63
63
|
switch (_e.label) {
|
|
64
64
|
case 0:
|
|
@@ -68,7 +68,7 @@ function createWebAppServices(target) {
|
|
|
68
68
|
streamConfig = _e.sent();
|
|
69
69
|
return [4 /*yield*/, validateStreamConfig(streamConfig)];
|
|
70
70
|
case 2:
|
|
71
|
-
|
|
71
|
+
_a = _e.sent(), webSourcePathFull = _a.webSourcePathFull, indexHtmlPath = _a.indexHtmlPath;
|
|
72
72
|
return [4 /*yield*/, createBuildDestinationFolder()];
|
|
73
73
|
case 3:
|
|
74
74
|
_e.sent();
|
|
@@ -80,13 +80,13 @@ function createWebAppServices(target) {
|
|
|
80
80
|
case 4:
|
|
81
81
|
_e.sent();
|
|
82
82
|
if (!(target.serverType === utils_1.ServerType.Sasjs)) return [3 /*break*/, 6];
|
|
83
|
-
(
|
|
83
|
+
(_c = process.logger) === null || _c === void 0 ? void 0 : _c.info("Copying web app files for target ".concat(target.name, "..."));
|
|
84
84
|
return [4 /*yield*/, (0, utils_1.copy)(webSourcePathFull, destinationPath)];
|
|
85
85
|
case 5:
|
|
86
86
|
_e.sent();
|
|
87
87
|
return [2 /*return*/];
|
|
88
88
|
case 6:
|
|
89
|
-
(
|
|
89
|
+
(_d = process.logger) === null || _d === void 0 ? void 0 : _d.info("Compiling web app services for target ".concat(target.name, "..."));
|
|
90
90
|
return [4 /*yield*/, (0, createAssetServices_1.createAssetServices)(target, destinationPath, streamConfig).then(function (map) {
|
|
91
91
|
var indexHtmlIndex = map.findIndex(function (assetPath) { return assetPath.source === 'index.html'; });
|
|
92
92
|
map.splice(indexHtmlIndex, 1);
|
|
@@ -105,8 +105,8 @@ function createWebAppServices(target) {
|
|
|
105
105
|
})];
|
|
106
106
|
case 9:
|
|
107
107
|
_e.sent();
|
|
108
|
-
|
|
109
|
-
switch (
|
|
108
|
+
_b = target.serverType;
|
|
109
|
+
switch (_b) {
|
|
110
110
|
case utils_1.ServerType.SasViya: return [3 /*break*/, 10];
|
|
111
111
|
case utils_1.ServerType.Sas9: return [3 /*break*/, 12];
|
|
112
112
|
}
|
|
@@ -125,7 +125,6 @@ function createWebAppServices(target) {
|
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
exports.createWebAppServices = createWebAppServices;
|
|
129
128
|
var validateStreamConfig = function (streamConfig) { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
129
|
var webSourcePath, streamWebFolder, webSourcePathFull, indexHtmlPath;
|
|
131
130
|
return __generator(this, function (_a) {
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const aliasMap: Map<string, string[]>;
|
|
2
|
-
export declare const getAllSupportedAliases: () =>
|
|
2
|
+
export declare const getAllSupportedAliases: () => MapIterator<string>;
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|