@sme.up/kokos-sdk-node 0.0.3 → 0.0.6
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/README.md +1 -1
- package/docs/assets/highlight.css +0 -56
- package/docs/assets/main.js +4 -3
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +95 -39
- package/docs/classes/ErrorWithStatus.html +13 -0
- package/docs/classes/ExecuteFunPayload.html +5 -108
- package/docs/classes/ExecutionContext.html +4 -101
- package/docs/classes/Fun.html +14 -171
- package/docs/classes/FunObject.html +6 -115
- package/docs/classes/SmeupDataStructureWriter.html +22 -0
- package/docs/classes/User.html +7 -122
- package/docs/enums/Format.html +3 -0
- package/docs/enums/Level.html +4 -0
- package/docs/enums/SmeupDataStructureType.html +8 -95
- package/docs/functions/clearLoggerContext.html +1 -0
- package/docs/functions/configureLogger.html +1 -0
- package/docs/functions/createLoggerContext.html +1 -0
- package/docs/functions/getSmeupDataStructureType.html +1 -0
- package/docs/functions/parseKeyValueBetweenBrackets.html +2 -0
- package/docs/functions/startServer.html +1 -0
- package/docs/functions/startServerWithCustomConfig.html +1 -0
- package/docs/index.html +3 -92
- package/docs/interfaces/DebugInfo.html +4 -0
- package/docs/interfaces/KokosService.html +3 -88
- package/docs/interfaces/KokosServiceMethods.html +2 -83
- package/docs/interfaces/KokosServiceModule.html +3 -88
- package/docs/interfaces/LoggerContext.html +5 -0
- package/docs/interfaces/MicroExecutorConfiguration.html +4 -0
- package/docs/interfaces/SmeupCell.html +7 -106
- package/docs/interfaces/SmeupColumn.html +26 -204
- package/docs/interfaces/SmeupDataStructure.html +5 -91
- package/docs/interfaces/SmeupFeedback.html +5 -0
- package/docs/interfaces/SmeupMessage.html +5 -102
- package/docs/interfaces/SmeupObject.html +18 -153
- package/docs/interfaces/SmeupRow.html +3 -93
- package/docs/interfaces/SmeupTable.html +7 -105
- package/docs/interfaces/SmeupTree.html +8 -112
- package/docs/interfaces/SmeupTreeNode.html +6 -109
- package/docs/modules.html +37 -93
- package/docs/variables/LOGGER.html +1 -0
- package/docs/variables/SMEUP_MESSAGE_GRAVITY.html +2 -72
- package/docs/variables/SMEUP_MESSAGE_MODE.html +2 -0
- package/lib/caller/serviceCaller.d.ts +3 -2
- package/lib/caller/serviceCaller.js +50 -21
- package/lib/configuration/configuration.d.ts +8 -0
- package/lib/configuration/configuration.js +29 -0
- package/lib/entrypoint/restapi/index.js +2 -110
- package/lib/entrypoint/restapi/restapi.d.ts +3 -0
- package/lib/entrypoint/restapi/restapi.js +149 -0
- package/lib/index.d.ts +8 -3
- package/lib/index.js +8 -3
- package/lib/logger/logger.d.ts +26 -0
- package/lib/logger/logger.js +87 -0
- package/lib/services/JS_00_01.js +42 -75
- package/lib/types/data-structures/smeupDataStructure.d.ts +27 -2
- package/lib/types/data-structures/smeupDataStructure.js +22 -1
- package/lib/types/data-structures/smeupObject.d.ts +2 -2
- package/lib/types/data-structures/smeupTree.d.ts +1 -1
- package/lib/types/general.d.ts +19 -2
- package/lib/types/general.js +7 -0
- package/lib/utils/fun.d.ts +3 -0
- package/lib/utils/fun.js +6 -0
- package/lib/utils/path.js +1 -1
- package/lib/utils/regex.d.ts +9 -0
- package/lib/utils/regex.js +53 -0
- package/lib/utils/smeupDataStructureWriter.d.ts +29 -0
- package/lib/utils/smeupDataStructureWriter.js +158 -0
- package/package.json +13 -14
- package/tsconfig.json +1 -0
- package/bin/kokos.js +0 -26
- package/docker/restapi/Dockerfile +0 -14
- package/docs/types/SmeupMessageGravity.html +0 -61
- package/init/JS_00_01.txt +0 -88
- package/lib/types/exceptions/execution.d.ts +0 -7
- package/lib/types/exceptions/execution.js +0 -10
- package/scripts/build.js +0 -26
- package/scripts/init.js +0 -95
- package/scripts/restapi/build-image-restapi.js +0 -60
- package/scripts/restapi/dev.js +0 -30
- package/scripts/restapi/start.js +0 -14
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { exec } from "child_process";
|
|
4
|
-
import { getProjectRoot } from "../../lib/utils/path.js";
|
|
5
|
-
import { readFile } from "fs/promises";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import fs from "fs";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* BUILD IMAGE FOR REST API
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
// dockerfile path
|
|
15
|
-
const dockerfilePath = path.resolve(
|
|
16
|
-
`${getProjectRoot()}/node_modules/@sme.up/kokos-sdk-node/docker/restapi/Dockerfile`
|
|
17
|
-
);
|
|
18
|
-
const destinationDockerfilePath = `${getProjectRoot()}/Dockerfile`;
|
|
19
|
-
|
|
20
|
-
// copy dockerfile to project root
|
|
21
|
-
fs.copyFileSync(dockerfilePath, destinationDockerfilePath);
|
|
22
|
-
|
|
23
|
-
// load package json
|
|
24
|
-
const packageJson = JSON.parse(
|
|
25
|
-
await readFile(new URL(getProjectRoot() + "/package.json", import.meta.url))
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
// get image name based on project name
|
|
29
|
-
let imageName;
|
|
30
|
-
if (packageJson.name.includes("@")) {
|
|
31
|
-
imageName = packageJson.name.substring(packageJson.name.indexOf("/") + 1);
|
|
32
|
-
} else {
|
|
33
|
-
imageName = packageJson.name;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// start production mode
|
|
37
|
-
console.log(`Start build image for REST API: ${imageName}`);
|
|
38
|
-
|
|
39
|
-
// build project with typescript compiler
|
|
40
|
-
const dockerBuild = exec(`docker build -t ${imageName} .`);
|
|
41
|
-
|
|
42
|
-
// redirect docker build stdout to standard output
|
|
43
|
-
dockerBuild.stdout.pipe(process.stdout);
|
|
44
|
-
// redirect docker build stderr to standard output
|
|
45
|
-
dockerBuild.stderr.pipe(process.stderr);
|
|
46
|
-
|
|
47
|
-
if (dockerBuild.pid) {
|
|
48
|
-
console.log(
|
|
49
|
-
`Building image...\nPress CTRL+C to exit\nPID: ${dockerBuild.pid}`
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
dockerBuild.on("exit", function () {
|
|
54
|
-
// delete dockerfile from project root
|
|
55
|
-
fs.unlinkSync(destinationDockerfilePath);
|
|
56
|
-
console.log("Image build successfull");
|
|
57
|
-
});
|
|
58
|
-
} catch (err) {
|
|
59
|
-
console.error(err);
|
|
60
|
-
}
|
package/scripts/restapi/dev.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { exec } from "child_process";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* DEVELOPMENT MODE
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// set environment variables
|
|
10
|
-
process.env.NODE_ENV = "development";
|
|
11
|
-
|
|
12
|
-
// start nodemon
|
|
13
|
-
const devServer = exec(
|
|
14
|
-
"NODE_ENV=development nodemon --watch src/**/* -e ts,js --exec node --experimental-specifier-resolution=node --loader ts-node/esm node_modules/@sme.up/kokos-sdk-node/lib/entrypoint/restapi/index.js"
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
// redirect docker build stdout to standard output
|
|
18
|
-
devServer.stdout.pipe(process.stdout);
|
|
19
|
-
// redirect docker build stderr to standard output
|
|
20
|
-
devServer.stderr.pipe(process.stderr);
|
|
21
|
-
|
|
22
|
-
if (!devServer.pid) {
|
|
23
|
-
console.log(
|
|
24
|
-
`Development mode active \nPress CTRL+C to exit\nPID: ${devServer.pid}`
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
devServer.on("exit", function () {
|
|
29
|
-
console.log("Development server terminated");
|
|
30
|
-
});
|
package/scripts/restapi/start.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* PRODUCTION MODE
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// start production mode
|
|
8
|
-
console.log("Start production mode");
|
|
9
|
-
|
|
10
|
-
// set environment variables
|
|
11
|
-
process.env.NODE_ENV = "production";
|
|
12
|
-
|
|
13
|
-
// start rest api entrypoint
|
|
14
|
-
import("../../lib/entrypoint/restapi/index.js");
|