@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.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/highlight.css +0 -56
  3. package/docs/assets/main.js +4 -3
  4. package/docs/assets/navigation.js +1 -0
  5. package/docs/assets/search.js +1 -1
  6. package/docs/assets/style.css +95 -39
  7. package/docs/classes/ErrorWithStatus.html +13 -0
  8. package/docs/classes/ExecuteFunPayload.html +5 -108
  9. package/docs/classes/ExecutionContext.html +4 -101
  10. package/docs/classes/Fun.html +14 -171
  11. package/docs/classes/FunObject.html +6 -115
  12. package/docs/classes/SmeupDataStructureWriter.html +22 -0
  13. package/docs/classes/User.html +7 -122
  14. package/docs/enums/Format.html +3 -0
  15. package/docs/enums/Level.html +4 -0
  16. package/docs/enums/SmeupDataStructureType.html +8 -95
  17. package/docs/functions/clearLoggerContext.html +1 -0
  18. package/docs/functions/configureLogger.html +1 -0
  19. package/docs/functions/createLoggerContext.html +1 -0
  20. package/docs/functions/getSmeupDataStructureType.html +1 -0
  21. package/docs/functions/parseKeyValueBetweenBrackets.html +2 -0
  22. package/docs/functions/startServer.html +1 -0
  23. package/docs/functions/startServerWithCustomConfig.html +1 -0
  24. package/docs/index.html +3 -92
  25. package/docs/interfaces/DebugInfo.html +4 -0
  26. package/docs/interfaces/KokosService.html +3 -88
  27. package/docs/interfaces/KokosServiceMethods.html +2 -83
  28. package/docs/interfaces/KokosServiceModule.html +3 -88
  29. package/docs/interfaces/LoggerContext.html +5 -0
  30. package/docs/interfaces/MicroExecutorConfiguration.html +4 -0
  31. package/docs/interfaces/SmeupCell.html +7 -106
  32. package/docs/interfaces/SmeupColumn.html +26 -204
  33. package/docs/interfaces/SmeupDataStructure.html +5 -91
  34. package/docs/interfaces/SmeupFeedback.html +5 -0
  35. package/docs/interfaces/SmeupMessage.html +5 -102
  36. package/docs/interfaces/SmeupObject.html +18 -153
  37. package/docs/interfaces/SmeupRow.html +3 -93
  38. package/docs/interfaces/SmeupTable.html +7 -105
  39. package/docs/interfaces/SmeupTree.html +8 -112
  40. package/docs/interfaces/SmeupTreeNode.html +6 -109
  41. package/docs/modules.html +37 -93
  42. package/docs/variables/LOGGER.html +1 -0
  43. package/docs/variables/SMEUP_MESSAGE_GRAVITY.html +2 -72
  44. package/docs/variables/SMEUP_MESSAGE_MODE.html +2 -0
  45. package/lib/caller/serviceCaller.d.ts +3 -2
  46. package/lib/caller/serviceCaller.js +50 -21
  47. package/lib/configuration/configuration.d.ts +8 -0
  48. package/lib/configuration/configuration.js +29 -0
  49. package/lib/entrypoint/restapi/index.js +2 -110
  50. package/lib/entrypoint/restapi/restapi.d.ts +3 -0
  51. package/lib/entrypoint/restapi/restapi.js +149 -0
  52. package/lib/index.d.ts +8 -3
  53. package/lib/index.js +8 -3
  54. package/lib/logger/logger.d.ts +26 -0
  55. package/lib/logger/logger.js +87 -0
  56. package/lib/services/JS_00_01.js +42 -75
  57. package/lib/types/data-structures/smeupDataStructure.d.ts +27 -2
  58. package/lib/types/data-structures/smeupDataStructure.js +22 -1
  59. package/lib/types/data-structures/smeupObject.d.ts +2 -2
  60. package/lib/types/data-structures/smeupTree.d.ts +1 -1
  61. package/lib/types/general.d.ts +19 -2
  62. package/lib/types/general.js +7 -0
  63. package/lib/utils/fun.d.ts +3 -0
  64. package/lib/utils/fun.js +6 -0
  65. package/lib/utils/path.js +1 -1
  66. package/lib/utils/regex.d.ts +9 -0
  67. package/lib/utils/regex.js +53 -0
  68. package/lib/utils/smeupDataStructureWriter.d.ts +29 -0
  69. package/lib/utils/smeupDataStructureWriter.js +158 -0
  70. package/package.json +13 -14
  71. package/tsconfig.json +1 -0
  72. package/bin/kokos.js +0 -26
  73. package/docker/restapi/Dockerfile +0 -14
  74. package/docs/types/SmeupMessageGravity.html +0 -61
  75. package/init/JS_00_01.txt +0 -88
  76. package/lib/types/exceptions/execution.d.ts +0 -7
  77. package/lib/types/exceptions/execution.js +0 -10
  78. package/scripts/build.js +0 -26
  79. package/scripts/init.js +0 -95
  80. package/scripts/restapi/build-image-restapi.js +0 -60
  81. package/scripts/restapi/dev.js +0 -30
  82. 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
- }
@@ -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
- });
@@ -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");