@aloma.io/integration-sdk 3.0.1-8 → 3.0.1-9

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.mjs CHANGED
@@ -4,7 +4,9 @@ import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import path from "node:path";
6
6
  import JWE from './internal/util/jwe/index.cjs';
7
- console.log(JWE);
7
+ import util from 'node:util';
8
+ import ChildProcess from 'node:child_process';
9
+ const exec = util.promisify(ChildProcess.exec);
8
10
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
11
  const files = [
10
12
  { name: "index.mts", dir: "src/controller" },
@@ -42,11 +44,10 @@ const generateKeys = async ({ target }) => {
42
44
  await jwe.newPair();
43
45
  const priv = await jwe.exportPrivateAsBase64();
44
46
  const pub = await jwe.exportPublicAsBase64();
45
- const content = `REGISTRATION_KEY=
47
+ const content = `REGISTRATION_TOKEN=
46
48
  PRIVATE_KEY=${priv}
47
49
  PUBLIC_KEY=${pub}
48
50
  `;
49
- console.log(content);
50
51
  fs.writeFileSync(`${target}/.env`, content);
51
52
  };
52
53
  const program = new Command();
@@ -69,4 +70,11 @@ program
69
70
  extract({ ...options, target, name });
70
71
  await generateKeys({ target });
71
72
  });
73
+ program
74
+ .command("build")
75
+ .description("Build the current connector project")
76
+ .action(async (str, options) => {
77
+ console.log('building');
78
+ //rm -rf build; mkdir -p build/controller; cp ./src/controller/index.mts ./build/controller/.controller-for-types.mts; ./node_modules/typescript/bin/tsc
79
+ });
72
80
  program.parse();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.0.1-8",
3
+ "version": "3.0.1-9",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",
8
8
  "bin": {
9
- "main": "./build/cli.mjs"
9
+ "aloma": "./build/cli.mjs"
10
10
  },
11
11
  "scripts": {
12
12
  "dev": "./node_modules/typescript/bin/tsc --watch",
package/src/cli.mts CHANGED
@@ -5,8 +5,10 @@ import fs from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "node:path";
7
7
  import JWE from './internal/util/jwe/index.cjs'
8
+ import util from 'node:util';
9
+ import ChildProcess from 'node:child_process';
8
10
 
9
- console.log(JWE)
11
+ const exec = util.promisify(ChildProcess.exec);
10
12
 
11
13
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
14
 
@@ -59,13 +61,11 @@ const generateKeys = async ({target}) =>
59
61
  const priv = await jwe.exportPrivateAsBase64();
60
62
  const pub = await jwe.exportPublicAsBase64();
61
63
 
62
- const content = `REGISTRATION_KEY=
64
+ const content = `REGISTRATION_TOKEN=
63
65
  PRIVATE_KEY=${priv}
64
66
  PUBLIC_KEY=${pub}
65
67
  `;
66
68
 
67
- console.log(content);
68
-
69
69
  fs.writeFileSync(`${target}/.env`, content);
70
70
  };
71
71
 
@@ -94,4 +94,12 @@ program
94
94
  await generateKeys({target});
95
95
  });
96
96
 
97
+ program
98
+ .command("build")
99
+ .description("Build the current connector project")
100
+ .action(async (str, options) => {
101
+ console.log('building');
102
+ //rm -rf build; mkdir -p build/controller; cp ./src/controller/index.mts ./build/controller/.controller-for-types.mts; ./node_modules/typescript/bin/tsc
103
+ });
104
+
97
105
  program.parse();