kozz-module-maker 0.1.9 → 0.1.10

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.
@@ -7,4 +7,4 @@ import { Method, TypeString } from '../../../Schema';
7
7
  * @param methods
8
8
  * @param signature
9
9
  */
10
- export declare const introduce: <T extends Record<string, Method<Record<string, TypeString>>>>(socket: Socket, handlerName: string, methods: T, signature?: string) => void;
10
+ export declare const introduce: <T extends Record<string, Method<Record<string, TypeString>>>>(socket: Socket, handlerName: string, methods: T, signature?: string) => Promise<void>;
@@ -9,13 +9,13 @@ const util_1 = require("../../../util");
9
9
  * @param methods
10
10
  * @param signature
11
11
  */
12
- const introduce = (socket, handlerName, methods, signature) => {
12
+ const introduce = async (socket, handlerName, methods, signature) => {
13
13
  const payload = {
14
14
  methods: Object.keys(methods),
15
15
  name: handlerName,
16
16
  role: 'handler',
17
17
  };
18
- socket.emit('introduction', (0, util_1.signPayload)(payload, signature));
18
+ socket.emit('introduction', await (0, util_1.signPayload)(payload, signature));
19
19
  };
20
20
  exports.introduce = introduce;
21
21
  //# sourceMappingURL=Introduction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Introduction.js","sourceRoot":"","sources":["../../../../src/Socket/Events/Emit/Introduction.ts"],"names":[],"mappings":";;;AAGA,wCAA4C;AAE5C;;;;;;GAMG;AACI,MAAM,SAAS,GAAG,CAGxB,MAAc,EACd,WAAmB,EACnB,OAAU,EACV,SAAkB,EACjB,EAAE;IACH,MAAM,OAAO,GAA8C;QAC1D,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;KACf,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,IAAA,kBAAW,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC;AAfW,QAAA,SAAS,aAepB"}
1
+ {"version":3,"file":"Introduction.js","sourceRoot":"","sources":["../../../../src/Socket/Events/Emit/Introduction.ts"],"names":[],"mappings":";;;AAGA,wCAA4C;AAE5C;;;;;;GAMG;AACI,MAAM,SAAS,GAAG,KAAK,EAG7B,MAAc,EACd,WAAmB,EACnB,OAAU,EACV,SAAkB,EACjB,EAAE;IACH,MAAM,OAAO,GAA8C;QAC1D,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;KACf,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,IAAA,kBAAW,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAfW,QAAA,SAAS,aAepB"}
@@ -5,10 +5,12 @@ const defaultGatewayUrl = 'http://127.0.0.1:4521';
5
5
  const myModule = (0, _1.createModule)({
6
6
  name: 'test',
7
7
  address: defaultGatewayUrl,
8
- proxy: {
9
- source: "Gramonta-Wa/5511967700452@c.us",
10
- onMessage: async (requester) => {
11
- }
12
- }
8
+ commands: {
9
+ boundariesToHandle: ['*'],
10
+ methods: {
11
+ ...(0, _1.createMethod)('fallback', requester => requester.reply('oops, this method doesnt exist')),
12
+ ...(0, _1.createMethod)('default', requester => requester.reply('pong')),
13
+ },
14
+ },
13
15
  });
14
16
  //# sourceMappingURL=debugIndex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debugIndex.js","sourceRoot":"","sources":["../src/debugIndex.ts"],"names":[],"mappings":";;AAAA,wBAAmE;AAEnE,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAElD,MAAM,QAAQ,GAAG,IAAA,eAAY,EAAC;IAC7B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iBAAiB;IAC1B,KAAK,EAAE;QACN,MAAM,EAAE,gCAAgC;QACxC,SAAS,EAAE,KAAK,EAAC,SAAS,EAAC,EAAE;QAE7B,CAAC;KACD;CACD,CAAC,CAAC"}
1
+ {"version":3,"file":"debugIndex.js","sourceRoot":"","sources":["../src/debugIndex.ts"],"names":[],"mappings":";;AAAA,wBAA+C;AAE/C,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAElD,MAAM,QAAQ,GAAG,IAAA,eAAY,EAAC;IAC7B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE;QACT,kBAAkB,EAAE,CAAC,GAAG,CAAC;QACzB,OAAO,EAAE;YACR,GAAG,IAAA,eAAY,EAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CACvC,SAAS,CAAC,KAAK,CAAC,gCAAgC,CAAC,CACjD;YACD,GAAG,IAAA,eAAY,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAChE;KACD;CACD,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kozz-module-maker",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Library to create new module for the Kozz-Bot protocol",
5
5
  "main": "./dist",
6
6
  "license": "MIT",