@sme.up/kokos-sdk-node 0.0.1 → 0.0.3

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 CHANGED
@@ -1,6 +1,6 @@
1
- # Kokos Template Node
1
+ # Kokos SDK Node
2
2
 
3
- **Kokos Template Node** is the template for creating a micro executor based on Node.js with typescript support. It encapsulate all standard features such as:
3
+ **Kokos SDK Node** is the sdk for creating a micro executor based on Node.js with typescript support. It encapsulate all standard features such as:
4
4
 
5
5
  - types
6
6
  - interfaces
@@ -1,14 +1,14 @@
1
- FROM node:18-alpine AS builder
1
+ FROM node:18-slim AS builder
2
2
  WORKDIR /app
3
3
  COPY package*.json ./
4
4
  RUN npm install
5
5
  COPY . .
6
6
  RUN npm run build
7
7
 
8
- FROM node:18-alpine AS server
8
+ FROM node:18-slim AS server
9
9
  WORKDIR /app
10
10
  COPY package* ./
11
11
  RUN npm install
12
12
  COPY --from=builder ./app/lib ./lib
13
13
  EXPOSE 3000
14
- CMD ["npm", "run", "start:restapi"]
14
+ CMD ["npm", "run", "start:restapi"]
package/init/JS_00_01.txt CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  SmeupTree,
6
6
  SmeupTable,
7
7
  SmeupDataStructureType,
8
- } from "@sme.up/kokos-template-node";
8
+ } from "@sme.up/kokos-sdk-node";
9
9
 
10
10
  const JS_00_01: KokosService = {
11
11
  methods: {
@@ -17,6 +17,13 @@ const JS_00_01: KokosService = {
17
17
  async function getTree(fun: Fun, context: ExecutionContext): Promise<SmeupTree> {
18
18
  const tree: SmeupTree = {
19
19
  type: SmeupDataStructureType.SmeupTree,
20
+ messages: [
21
+ {
22
+ gravity: "INFO",
23
+ message: "Info message. CN;COL;PIPPO",
24
+ mode: "TN",
25
+ }
26
+ ],
20
27
  children: [
21
28
  {
22
29
  children: [],
@@ -35,6 +42,23 @@ async function getTree(fun: Fun, context: ExecutionContext): Promise<SmeupTree>
35
42
  async function getTable(fun: Fun, context: ExecutionContext): Promise<SmeupTable> {
36
43
  const table: SmeupTable = {
37
44
  type: SmeupDataStructureType.SmeupTable,
45
+ messages: [
46
+ {
47
+ gravity: "INFO",
48
+ message: "Info message. CN;COL;PIPPO",
49
+ mode: "TN",
50
+ },
51
+ {
52
+ gravity: "WARNING",
53
+ message: "Warning message. CN;COL;PLUTO",
54
+ mode: "PM",
55
+ },
56
+ {
57
+ gravity: "ERROR",
58
+ message: "Error message.",
59
+ mode: "PN",
60
+ }
61
+ ],
38
62
  columns: [
39
63
  {
40
64
  code: "COL",
@@ -8,6 +8,13 @@ const JS_00_01 = {
8
8
  async function getTree(fun, context) {
9
9
  const tree = {
10
10
  type: SmeupDataStructureType.SmeupTree,
11
+ messages: [
12
+ {
13
+ gravity: "INFO",
14
+ message: "Info message. CN;COL;PIPPO",
15
+ mode: "TN",
16
+ }
17
+ ],
11
18
  children: [
12
19
  {
13
20
  children: [],
@@ -25,6 +32,23 @@ async function getTree(fun, context) {
25
32
  async function getTable(fun, context) {
26
33
  const table = {
27
34
  type: SmeupDataStructureType.SmeupTable,
35
+ messages: [
36
+ {
37
+ gravity: "INFO",
38
+ message: "Info message. CN;COL;PIPPO",
39
+ mode: "TN",
40
+ },
41
+ {
42
+ gravity: "WARNING",
43
+ message: "Warning message. CN;COL;PLUTO",
44
+ mode: "PM",
45
+ },
46
+ {
47
+ gravity: "ERROR",
48
+ message: "Error message.",
49
+ mode: "PN",
50
+ }
51
+ ],
28
52
  columns: [
29
53
  {
30
54
  code: "COL1",
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export interface SmeupDataStructure {
5
5
  type: SmeupDataStructureType;
6
+ messages: SmeupMessage[];
6
7
  }
7
8
  /**
8
9
  * SmeupDataStructure types
package/package.json CHANGED
@@ -1,63 +1,66 @@
1
1
  {
2
- "name": "@sme.up/kokos-sdk-node",
3
- "version": "0.0.1",
4
- "description": "Node.js Kokos SDK",
5
- "author": "Smeup LAB <info@smeup.com> (https://www.smeup.com/)",
6
- "type": "module",
7
- "exports": "./lib/index.js",
8
- "module": "./lib/index.js",
9
- "typings": "./lib/index.d.ts",
10
- "files": [
11
- "lib/",
12
- "scripts/",
13
- "bin/",
14
- "docker/",
15
- "init/",
16
- "swagger/",
17
- "docs/",
18
- "package.json",
19
- "tsconfig.json"
20
- ],
21
- "bin": {
22
- "kokos": "./bin/kokos.js"
23
- },
24
- "scripts": {
25
- "clean": "rimraf lib",
26
- "test": "NODE_ENV=test jest",
27
- "build": "npm run clean && tsc",
28
- "start:restapi": "NODE_ENV=production node ./lib/entrypoint/restapi/index.js",
29
- "dev:restapi": "NODE_ENV=development nodemon --watch './**/*.ts' --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/entrypoint/restapi/index.ts"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/smeup/kokos.git"
34
- },
35
- "license": "ISC",
36
- "bugs": {
37
- "url": "https://github.com/smeup/kokos/issues"
38
- },
39
- "homepage": "https://github.com/smeup/kokos#readme",
40
- "dependencies": {
41
- "@types/node": "^18.15.11",
42
- "class-transformer": "^0.5.1",
43
- "class-validator": "^0.14.0",
44
- "express": "^4.18.2",
45
- "nodemon": "^2.0.22",
46
- "rimraf": "^4.4.1",
47
- "ts-node": "^10.9.1",
48
- "typescript": "^4.9.4"
49
- },
50
- "devDependencies": {
51
- "@types/express": "^4.17.17",
52
- "@types/jest": "^29.5.0",
53
- "axios": "^1.3.4",
54
- "jest": "^29.5.0",
55
- "ts-jest": "^29.0.5"
56
- },
57
- "jest": {
58
- "preset": "ts-jest/presets/default-esm",
59
- "moduleNameMapper": {
60
- "^(\\.{1,2}/.*)\\.js$": "$1"
61
- }
62
- }
2
+ "name": "@sme.up/kokos-sdk-node",
3
+ "version": "0.0.3",
4
+ "description": "Kokos SDK Node.js",
5
+ "author": "Smeup LAB <info@smeup.com> (https://www.smeup.com/)",
6
+ "type": "module",
7
+ "exports": "./lib/index.js",
8
+ "module": "./lib/index.js",
9
+ "typings": "./lib/index.d.ts",
10
+ "files": [
11
+ "lib/",
12
+ "scripts/",
13
+ "bin/",
14
+ "docker/",
15
+ "init/",
16
+ "swagger/",
17
+ "docs/",
18
+ "package.json",
19
+ "tsconfig.json"
20
+ ],
21
+ "bin": {
22
+ "kokos": "./bin/kokos.js"
23
+ },
24
+ "scripts": {
25
+ "clean": "rimraf lib",
26
+ "test": "NODE_ENV=test jest",
27
+ "build": "npm run clean && tsc",
28
+ "start:restapi": "NODE_ENV=production node ./lib/entrypoint/restapi/index.js",
29
+ "dev:restapi": "NODE_ENV=development nodemon --watch './**/*.ts' --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/entrypoint/restapi/index.ts"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/smeup/kokos-sdk-node.git"
34
+ },
35
+ "license": "ISC",
36
+ "bugs": {
37
+ "url": "https://github.com/smeup/kokos-sdk-node/issues"
38
+ },
39
+ "homepage": "https://github.com/smeup/kokos-sdk-node#readme",
40
+ "dependencies": {
41
+ "@types/node": "^18.15.11",
42
+ "class-transformer": "^0.5.1",
43
+ "class-validator": "^0.14.0",
44
+ "express": "^4.18.2",
45
+ "nodemon": "^2.0.22",
46
+ "rimraf": "^4.4.1",
47
+ "ts-node": "^10.9.1",
48
+ "typescript": "^4.9.4"
49
+ },
50
+ "devDependencies": {
51
+ "@types/express": "^4.17.17",
52
+ "@types/jest": "^29.5.0",
53
+ "axios": "^1.3.4",
54
+ "jest": "^29.5.0",
55
+ "ts-jest": "^29.0.5"
56
+ },
57
+ "engines": {
58
+ "node": ">=18.0.0"
59
+ },
60
+ "jest": {
61
+ "preset": "ts-jest/presets/default-esm",
62
+ "moduleNameMapper": {
63
+ "^(\\.{1,2}/.*)\\.js$": "$1"
64
+ }
65
+ }
63
66
  }
package/scripts/init.js CHANGED
@@ -25,7 +25,7 @@ try {
25
25
  const projectName = process.argv[3];
26
26
  if (!projectName) {
27
27
  console.error(
28
- "Error: project name not defined \nSyntax: npx @sme.up/kokos-template-node init [PROJECT_NAME]"
28
+ "Error: project name not defined \nSyntax: npx @sme.up/kokos-sdk-node init [PROJECT_NAME]"
29
29
  );
30
30
  process.exit();
31
31
  }
@@ -13,7 +13,7 @@ import fs from "fs";
13
13
  try {
14
14
  // dockerfile path
15
15
  const dockerfilePath = path.resolve(
16
- `${getProjectRoot()}/node_modules/@sme.up/kokos-template-node/docker/restapi/Dockerfile`
16
+ `${getProjectRoot()}/node_modules/@sme.up/kokos-sdk-node/docker/restapi/Dockerfile`
17
17
  );
18
18
  const destinationDockerfilePath = `${getProjectRoot()}/Dockerfile`;
19
19
 
@@ -11,7 +11,7 @@ process.env.NODE_ENV = "development";
11
11
 
12
12
  // start nodemon
13
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-template-node/lib/entrypoint/restapi/index.js"
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
15
  );
16
16
 
17
17
  // redirect docker build stdout to standard output