kozz-module-maker 0.1.21 → 0.2.1

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 (125) hide show
  1. package/.babelrc +24 -0
  2. package/bun.lock +617 -0
  3. package/dist/InlineCommands/index.js +19 -11
  4. package/dist/Instance/Basic/index.d.ts +40 -0
  5. package/dist/Instance/Basic/index.js +43 -0
  6. package/dist/Instance/Basic/index.js.map +1 -0
  7. package/dist/Instance/BasicController/index.d.ts +40 -0
  8. package/dist/Instance/BasicController/index.js +43 -0
  9. package/dist/Instance/BasicController/index.js.map +1 -0
  10. package/dist/Instance/CommandHandler/index.d.ts +20 -0
  11. package/dist/Instance/CommandHandler/index.js +26 -0
  12. package/dist/Instance/CommandHandler/index.js.map +1 -0
  13. package/dist/Instance/Common/ResourceMap/index.js +17 -15
  14. package/dist/Instance/Common/UseFns/index.js +24 -19
  15. package/dist/Instance/Common/index.js +31 -9
  16. package/dist/Instance/Common/onEvent/index.js +82 -76
  17. package/dist/Instance/Common/onEvent/index.js.map +1 -1
  18. package/dist/Instance/GeneralHandler/index.d.ts +19 -0
  19. package/dist/Instance/GeneralHandler/index.js +49 -0
  20. package/dist/Instance/GeneralHandler/index.js.map +1 -0
  21. package/dist/Instance/GeneralModule/index.d.ts +1 -2
  22. package/dist/Instance/GeneralModule/index.js +83 -58
  23. package/dist/Instance/GeneralModule/index.js.map +1 -1
  24. package/dist/Instance/Handler/index.d.ts +23 -0
  25. package/dist/Instance/Handler/index.js +26 -0
  26. package/dist/Instance/Handler/index.js.map +1 -0
  27. package/dist/Instance/Proxy/index.d.ts +22 -0
  28. package/dist/Instance/Proxy/index.js +36 -0
  29. package/dist/Instance/Proxy/index.js.map +1 -0
  30. package/dist/Instance/index.d.ts +14 -0
  31. package/dist/Instance/index.js +20 -0
  32. package/dist/Instance/index.js.map +1 -0
  33. package/dist/Message/FromTemplate/index.js +53 -46
  34. package/dist/Message/PayloadCreation/Media.js +40 -36
  35. package/dist/Message/PayloadCreation/Media.js.map +1 -1
  36. package/dist/Message/PayloadCreation/React.js +11 -9
  37. package/dist/Message/PayloadCreation/Reply.js +37 -35
  38. package/dist/Message/PayloadCreation/Reply.js.map +1 -1
  39. package/dist/Message/PayloadCreation/ReplyWithSticker.d.ts +0 -0
  40. package/dist/Message/PayloadCreation/ReplyWithSticker.js +1 -0
  41. package/dist/Message/PayloadCreation/ReplyWithText.d.ts +2 -0
  42. package/dist/Message/PayloadCreation/ReplyWithText.js +15 -0
  43. package/dist/Message/PayloadCreation/deleteMessage.js +10 -8
  44. package/dist/Message/PayloadCreation/index.js +25 -17
  45. package/dist/Message/PayloadCreation/sendMessage.js +23 -21
  46. package/dist/Message/PayloadCreation/sendMessage.js.map +1 -1
  47. package/dist/Message/ProxiedMessage/index.d.ts +1 -1
  48. package/dist/Message/ProxiedMessage/index.js +17 -11
  49. package/dist/Message/RoutineCreation/AskResource/AskResourceApi/index.js +21 -16
  50. package/dist/Message/RoutineCreation/AskResource/index.js +58 -56
  51. package/dist/Message/RoutineCreation/DeleteMessage/index.js +18 -14
  52. package/dist/Message/RoutineCreation/Reply/WithMedia.js +32 -30
  53. package/dist/Message/RoutineCreation/Reply/WithSticke.d.ts +3 -0
  54. package/dist/Message/RoutineCreation/Reply/WithSticke.js +9 -0
  55. package/dist/Message/RoutineCreation/Reply/WithSticke.js.map +1 -0
  56. package/dist/Message/RoutineCreation/Reply/WithSticker.js +14 -8
  57. package/dist/Message/RoutineCreation/Reply/WithTemplate.js +15 -15
  58. package/dist/Message/RoutineCreation/Reply/index.js +25 -9
  59. package/dist/Message/RoutineCreation/SendMessage/index.js +25 -23
  60. package/dist/Message/RoutineCreation/SendMessage/index.js.map +1 -1
  61. package/dist/Message/RoutineCreation/reply.js +16 -14
  62. package/dist/Message/index.d.ts +1 -1
  63. package/dist/Message/index.js +49 -46
  64. package/dist/Message/kozz-md.parser/index.js +42 -92
  65. package/dist/Message/zap-md.parser/index.d.ts +1 -0
  66. package/dist/Message/zap-md.parser/index.js +2 -0
  67. package/dist/MessageTemplate/h.d.ts +3 -0
  68. package/dist/MessageTemplate/h.js +24 -0
  69. package/dist/MessageTemplate/h.js.map +1 -0
  70. package/dist/MessageTemplate/htm.d.ts +1 -0
  71. package/dist/MessageTemplate/htm.js +10 -0
  72. package/dist/MessageTemplate/htm.js.map +1 -0
  73. package/dist/MessageTemplate/renderer.d.ts +13 -0
  74. package/dist/MessageTemplate/renderer.js +62 -0
  75. package/dist/MessageTemplate/renderer.js.map +1 -0
  76. package/dist/MessageTemplate/types.d.ts +12 -0
  77. package/dist/MessageTemplate/types.js +5 -0
  78. package/dist/MessageTemplate/types.js.map +1 -0
  79. package/dist/Schema/index.js +11 -9
  80. package/dist/Socket/Events/Command.d.ts +3 -0
  81. package/dist/Socket/Events/Command.js +19 -0
  82. package/dist/Socket/Events/Command.js.map +1 -0
  83. package/dist/Socket/Events/Emit/ForwardEvent.js +19 -17
  84. package/dist/Socket/Events/Emit/Introduction.js +12 -10
  85. package/dist/Socket/Events/Emit/ProxyRequest.d.ts +0 -0
  86. package/dist/Socket/Events/Emit/ProxyRequest.js +2 -0
  87. package/dist/Socket/Events/Emit/ProxyRequest.js.map +1 -0
  88. package/dist/Socket/Events/Emit/RequestProxy.js +13 -10
  89. package/dist/Socket/Events/Emit/RevokeProxy.js +9 -7
  90. package/dist/Socket/Events/Handle/AskResource.js +27 -25
  91. package/dist/Socket/Events/Handle/Command.js +35 -38
  92. package/dist/Socket/Events/Handle/ProxiedMessage.js +11 -9
  93. package/dist/Socket/Events/Introduction.d.ts +3 -0
  94. package/dist/Socket/Events/Introduction.js +15 -0
  95. package/dist/Socket/Events/Introduction.js.map +1 -0
  96. package/dist/Socket/Events/ProxiedMessage.d.ts +2 -0
  97. package/dist/Socket/Events/ProxiedMessage.js +10 -0
  98. package/dist/Socket/Events/ProxiedMessage.js.map +1 -0
  99. package/dist/Socket/Messages/Command.d.ts +2 -0
  100. package/dist/Socket/Messages/Command.js +6 -0
  101. package/dist/Socket/Messages/Command.js.map +1 -0
  102. package/dist/Socket/Messages/Introduction.d.ts +3 -0
  103. package/dist/Socket/Messages/Introduction.js +15 -0
  104. package/dist/Socket/Messages/Introduction.js.map +1 -0
  105. package/dist/Socket/index.js +17 -15
  106. package/dist/StateMachine/index.js +44 -38
  107. package/dist/Validator/index.js +41 -38
  108. package/dist/debugIndex.d.ts +1 -0
  109. package/dist/debugIndex.js +73 -0
  110. package/dist/debugIndex.js.map +1 -0
  111. package/dist/index.d.ts +1 -0
  112. package/dist/index.js +47 -18
  113. package/dist/index.js.map +1 -1
  114. package/dist/jsx-runtime/MessageTemplating.js +51 -0
  115. package/dist/jsx-runtime/index.js +83 -0
  116. package/dist/messages.kozz.md +52 -0
  117. package/dist/util/index.js +63 -59
  118. package/dist/util/index.js.map +1 -1
  119. package/dist/util.d.ts +8 -0
  120. package/dist/util.js +36 -0
  121. package/dist/util.js.map +1 -0
  122. package/package.json +21 -17
  123. package/tsconfig.json +26 -97
  124. package/jest.config.ts +0 -196
  125. package/test.kozz.md +0 -81
@@ -1,55 +1,58 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.isArgsObjectValid = exports.isArgValid = exports.describeType = void 0;
4
- const typeIsArray = (type) => {
5
- return type.includes('[]');
7
+ const typeIsArray = type => {
8
+ return type.includes('[]');
6
9
  };
7
- const typeIsOptional = (type) => {
8
- return type.includes('?');
10
+ const typeIsOptional = type => {
11
+ return type.includes('?');
9
12
  };
10
- const toPrimitiveType = (type) => {
11
- if (type.includes('boolean')) {
12
- return 'boolean';
13
- }
14
- if (type.includes('number')) {
15
- return 'number';
16
- }
17
- return 'string';
13
+ const toPrimitiveType = type => {
14
+ if (type.includes('boolean')) {
15
+ return 'boolean';
16
+ }
17
+ if (type.includes('number')) {
18
+ return 'number';
19
+ }
20
+ return 'string';
18
21
  };
19
- const describeType = (type) => ({
20
- array: typeIsArray(type),
21
- optional: typeIsOptional(type),
22
- type: toPrimitiveType(type),
22
+ const describeType = type => ({
23
+ array: typeIsArray(type),
24
+ optional: typeIsOptional(type),
25
+ type: toPrimitiveType(type)
23
26
  });
24
27
  exports.describeType = describeType;
25
28
  const isArgValid = (arg, typeDescriptor) => {
26
- if (arg === undefined && typeDescriptor.optional) {
27
- return true;
28
- }
29
- if (Array.isArray(arg) !== typeDescriptor.array) {
30
- return false;
31
- }
32
- if (Array.isArray(arg) && typeDescriptor.array && arg.length === 0) {
33
- return true;
34
- }
35
- if (Array.isArray(arg) && typeDescriptor.array && arg.length > 0) {
36
- return arg.reduce((valid, arg) => {
37
- return valid && typeof arg === typeDescriptor.type;
38
- }, true);
39
- }
40
- return typeof arg === typeDescriptor.type;
29
+ if (arg === undefined && typeDescriptor.optional) {
30
+ return true;
31
+ }
32
+ if (Array.isArray(arg) !== typeDescriptor.array) {
33
+ return false;
34
+ }
35
+ if (Array.isArray(arg) && typeDescriptor.array && arg.length === 0) {
36
+ return true;
37
+ }
38
+ if (Array.isArray(arg) && typeDescriptor.array && arg.length > 0) {
39
+ return arg.reduce((valid, arg) => {
40
+ return valid && typeof arg === typeDescriptor.type;
41
+ }, true);
42
+ }
43
+ return typeof arg === typeDescriptor.type;
41
44
  };
42
- exports.isArgValid = isArgValid;
45
+
43
46
  /**
44
47
  * Check ifm the arguments of a provided command are valid
45
48
  * @param args
46
49
  * @param descriptionMap
47
50
  * @returns
48
51
  */
52
+ exports.isArgValid = isArgValid;
49
53
  const isArgsObjectValid = (args, descriptionMap = {}) => {
50
- return Object.entries(descriptionMap).reduce((valid, [argName, argType]) => {
51
- return valid && (0, exports.isArgValid)(args[argName], (0, exports.describeType)(argType));
52
- }, true);
54
+ return Object.entries(descriptionMap).reduce((valid, [argName, argType]) => {
55
+ return valid && isArgValid(args[argName], describeType(argType));
56
+ }, true);
53
57
  };
54
- exports.isArgsObjectValid = isArgsObjectValid;
55
- //# sourceMappingURL=index.js.map
58
+ exports.isArgsObjectValid = isArgsObjectValid;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ var _GeneralModule = require("./Instance/GeneralModule");
4
+ var _MessageTemplating = require("./jsx-runtime/MessageTemplating");
5
+ var _Schema = require("./Schema");
6
+ var _jsxRuntime = require("./jsx-runtime");
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ const defaultGatewayUrl = 'ws://127.0.0.1:4521';
13
+ const products = [{
14
+ id: '1',
15
+ name: 'Product 1',
16
+ price: 19.99,
17
+ description: 'This is the first sample product'
18
+ }, {
19
+ id: '2',
20
+ name: 'Product 2',
21
+ price: 29.99,
22
+ description: 'This is the second sample product'
23
+ }, {
24
+ id: '3',
25
+ name: 'Product 3',
26
+ price: 39.99,
27
+ description: 'This is the third sample product'
28
+ }];
29
+ const ProductView = ({
30
+ product
31
+ }) => {
32
+ return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
33
+ children: [(0, _jsxRuntime.jsxs)(_MessageTemplating.Line, {
34
+ children: [(0, _jsxRuntime.jsx)(_MessageTemplating.Bold, {
35
+ children: product.name
36
+ }), " - R$", product.price.toLocaleString('pt-BR')]
37
+ }), (0, _jsxRuntime.jsx)(_MessageTemplating.Line, {
38
+ children: (0, _jsxRuntime.jsx)(_MessageTemplating.Italic, {
39
+ children: product.description
40
+ })
41
+ })]
42
+ });
43
+ };
44
+ const TestMessage = ({
45
+ name
46
+ }) => (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
47
+ children: [(0, _jsxRuntime.jsx)(_MessageTemplating.Line, {
48
+ children: "Test"
49
+ }), (0, _jsxRuntime.jsxs)(_MessageTemplating.Line, {
50
+ children: [(0, _jsxRuntime.jsx)(_MessageTemplating.Bold, {
51
+ children: name
52
+ }), " is a great guy!"]
53
+ }), (0, _jsxRuntime.jsx)(_MessageTemplating.ForEach, {
54
+ data: products,
55
+ render: product => (0, _jsxRuntime.jsx)(_MessageTemplating.List, {
56
+ items: (0, _jsxRuntime.jsx)(ProductView, {
57
+ product: product
58
+ })
59
+ })
60
+ })]
61
+ });
62
+ (0, _GeneralModule.createModule)({
63
+ name: 'test',
64
+ address: defaultGatewayUrl,
65
+ commands: {
66
+ boundariesToHandle: ['*'],
67
+ methods: _objectSpread({}, (0, _Schema.createMethod)('default', requester => {
68
+ requester.reply((0, _jsxRuntime.jsx)(TestMessage, {
69
+ name: 'Tramonta'
70
+ }));
71
+ }))
72
+ }
73
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debugIndex.js","sourceRoot":"","sources":["../src/debugIndex.ts"],"names":[],"mappings":";;AAAA,wBAA+D;AAC/D,+CAAwD;AACxD,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEnD,MAAM,eAAe,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,IAAA,qBAAe,EAAA;;;EAG1D,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,qBAAe,EAAA,aAAa,IAAI,aAAa,CAAC;;;;;;;;;;;;CAYjE,CAAC;AAEF,MAAM,UAAU,GAAG,IAAA,eAAY,EAAC;IAC/B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iBAAiB;IAC1B,gBAAgB,EAAE,aAAa;IAC/B,QAAQ,EAAE;QACT,kBAAkB,EAAE,CAAC,GAAG,CAAC;QACzB,OAAO,EAAE;YACR,GAAG,IAAA,eAAY,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE;gBACtC,SAAS,CAAC,KAAK,CACd,IAAA,iBAAc,EAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAC/D,CAAC;YACH,CAAC,CAAC;SACF;KACD;CACD,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './Instance/GeneralModule';
2
2
  export * from './Schema';
3
3
  export * from './StateMachine';
4
+ export * from './MessageTemplate/renderer';
package/dist/index.js CHANGED
@@ -1,20 +1,49 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _GeneralModule = require("./Instance/GeneralModule");
7
+ Object.keys(_GeneralModule).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _GeneralModule[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _GeneralModule[key];
7
14
  }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Instance/GeneralModule"), exports);
18
- __exportStar(require("./Schema"), exports);
19
- __exportStar(require("./StateMachine"), exports);
20
- //# sourceMappingURL=index.js.map
15
+ });
16
+ });
17
+ var _Schema = require("./Schema");
18
+ Object.keys(_Schema).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _Schema[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _Schema[key];
25
+ }
26
+ });
27
+ });
28
+ var _StateMachine = require("./StateMachine");
29
+ Object.keys(_StateMachine).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _StateMachine[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _StateMachine[key];
36
+ }
37
+ });
38
+ });
39
+ var _jsxRuntime = require("./jsx-runtime");
40
+ Object.keys(_jsxRuntime).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _jsxRuntime[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _jsxRuntime[key];
47
+ }
48
+ });
49
+ });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,2CAAyB;AACzB,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,2CAAyB;AACzB,iDAA+B;AAC/B,6DAA2C"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Stroke = exports.Render = exports.Monospace = exports.List = exports.Line = exports.Italic = exports.ForEach = exports.Code = exports.Bold = void 0;
7
+ const createTemplatingComponent = markup => ({
8
+ children
9
+ }) => {
10
+ return typeof children === 'string' ? `${markup}${children}${markup}` : Array.isArray(children) ? `${markup}${children.join('')}${markup}` : children?.toString();
11
+ };
12
+ const Bold = exports.Bold = createTemplatingComponent('*');
13
+ const Code = exports.Code = createTemplatingComponent('```');
14
+ const Line = exports.Line = createTemplatingComponent('');
15
+ const Monospace = exports.Monospace = createTemplatingComponent('`');
16
+ const Stroke = exports.Stroke = createTemplatingComponent('~');
17
+ const Italic = exports.Italic = createTemplatingComponent('_');
18
+ const List = ({
19
+ items
20
+ }) => {
21
+ if (typeof items === 'string') return `- ${items}`;
22
+ return items.map(item => `- ${item}`).join('\n');
23
+ };
24
+
25
+ /**
26
+ * Conditionally renders it's children if the prop 'when' evaluates to true
27
+ * @param param0
28
+ * @returns
29
+ */
30
+ exports.List = List;
31
+ const Render = ({
32
+ when,
33
+ children
34
+ }) => {
35
+ const shouldRender = typeof when === 'boolean' ? when : when();
36
+ if (shouldRender) {
37
+ return children;
38
+ } else {
39
+ return null;
40
+ }
41
+ };
42
+ exports.Render = Render;
43
+ /**
44
+ * Iterates over an array and renders a component for each item.
45
+ * @param props
46
+ * @returns
47
+ */
48
+ const ForEach = props => {
49
+ return (props.data ?? []).map((data, index) => props.render(data, index) + '\n');
50
+ };
51
+ exports.ForEach = ForEach;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Fragment = void 0;
7
+ exports.createElement = createElement;
8
+ exports.jsx = jsx;
9
+ exports.jsxDEV = jsxDEV;
10
+ exports.jsxs = void 0;
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
+ // mini-jsx-string/index.ts
17
+
18
+ // ----------------- Types -----------------
19
+
20
+ // ----------------- Element creation -----------------
21
+ const Fragment = exports.Fragment = Symbol.for('mini-jsx.fragment');
22
+ function createElement(type, props, ...children) {
23
+ const nextProps = props ? _objectSpread({}, props) : {};
24
+ if (children.length) {
25
+ nextProps.children = children.length === 1 ? children[0] : children;
26
+ }
27
+ return {
28
+ type,
29
+ props: nextProps
30
+ };
31
+ }
32
+
33
+ // Automatic runtime entry points (@babel/preset-react runtime: 'automatic')
34
+ function jsx(type, props, key) {
35
+ const p = props || {};
36
+ if (key != null) p.key = key;
37
+ return renderNode({
38
+ type,
39
+ props: p
40
+ });
41
+ }
42
+ const jsxs = exports.jsxs = jsx;
43
+ function jsxDEV(type, props, key, _isStaticChildren, _source, _self) {
44
+ const p = props || {};
45
+ if (key != null) p.key = key;
46
+ return {
47
+ type,
48
+ props: p
49
+ };
50
+ }
51
+ function renderNode(node) {
52
+ if (node == null || node === false || node === true) return '';
53
+ if (typeof node === 'string' || typeof node === 'number') return String(node);
54
+ if (Array.isArray(node)) {
55
+ return node.map(n => renderNode(n)).join('');
56
+ }
57
+
58
+ // VNode
59
+ const {
60
+ type,
61
+ props = {}
62
+ } = node;
63
+
64
+ // Function component
65
+ if (typeof type === 'function') {
66
+ const rendered = type(_objectSpread(_objectSpread({}, props), {}, {
67
+ children: props.children
68
+ }));
69
+ return renderNode(rendered);
70
+ }
71
+
72
+ // Fragment
73
+ if (type === Fragment) {
74
+ return props.children.map(childNode => renderNode(childNode)).join('\n').trim();
75
+ }
76
+
77
+ // Intrinsic "tag" (string) -> reduce to text using mapping (or pass-through)
78
+ if (typeof type === 'string') {
79
+ const childrenText = renderNode(props.children);
80
+ return childrenText;
81
+ }
82
+ return '';
83
+ }
@@ -0,0 +1,52 @@
1
+ > @foo
2
+
3
+ # This is the foo message
4
+
5
+ The foo message says "Hi" to {{name}}
6
+
7
+ _Nice to meet you!_
8
+
9
+ > ---
10
+
11
+ > @bar
12
+
13
+ # This is the bar message
14
+
15
+ The foo message says "GoodBye" to {{name}}
16
+
17
+ _See you soon!_
18
+
19
+ > ---
20
+
21
+ > @list
22
+
23
+ # This is the header. It can't interpolate variables.
24
+
25
+ # This is a list. The items can't interpolate variables or styles yet.
26
+
27
+ - item 1
28
+ - item 2
29
+ - item 3
30
+ <br>
31
+
32
+ # This is a table:
33
+
34
+ `| Command | Bot's Response |`
35
+ `| ------------- | -------------------------------- |`
36
+ `| !ping | pong! |`
37
+ `| !ping default | pong! |`
38
+ `| !ping blah | Ooops, this method doesn't exist |`
39
+ <br>
40
+
41
+ _Note:_ Be careful not to make wide tables, most chat's will automatically break lines that become too long.
42
+ <br>
43
+
44
+ Text _*bold*_ _italic_ and `monospace` can appear in the same line, but you can't mix and match them
45
+ In order to skip a line, use a line with nothing but `"<br>"`
46
+ <br>
47
+ <br>
48
+ <br>
49
+
50
+ Messages start with `"> @messageName"` and end with `"> ---"`
51
+
52
+ > ---
@@ -1,81 +1,85 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.signInNodeEnvironment = exports.signInBrowser = exports.signPayload = exports.randomId = exports.normalizeString = exports.runUse = void 0;
7
- const promises_1 = __importDefault(require("fs/promises"));
8
- const crypto_1 = __importDefault(require("crypto"));
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.normalizeString = normalizeString;
7
+ exports.signPayload = exports.signInNodeEnvironment = exports.signInBrowser = exports.runUse = exports.randomId = void 0;
8
+ var _promises = _interopRequireDefault(require("fs/promises"));
9
+ var _crypto = _interopRequireDefault(require("crypto"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
16
  let privateKey;
10
17
  const runUse = (useArr, args) => {
11
- return useArr.reduce((res, fn) => {
12
- return fn(res);
13
- }, args);
18
+ return useArr.reduce((res, fn) => {
19
+ return fn(res);
20
+ }, args);
14
21
  };
15
22
  exports.runUse = runUse;
16
23
  function normalizeString(string) {
17
- return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
24
+ return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
18
25
  }
19
- exports.normalizeString = normalizeString;
20
- const randomId = () => crypto_1.default.randomUUID();
26
+ const randomId = () => _crypto.default.randomUUID();
21
27
  exports.randomId = randomId;
22
28
  const signPayload = (payload, signature) => {
23
- if (signature) {
24
- return {
25
- ...payload,
26
- signature,
27
- };
28
- }
29
- try {
30
- return (0, exports.signInNodeEnvironment)(payload);
31
- }
32
- catch (e) {
33
- throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${projetc_root}/keys/privatekey.pem". Leve the key names as it is';
34
- }
29
+ if (signature) {
30
+ return _objectSpread(_objectSpread({}, payload), {}, {
31
+ signature
32
+ });
33
+ }
34
+ try {
35
+ return signInNodeEnvironment(payload);
36
+ } catch (e) {
37
+ throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${projetc_root}/keys/privatekey.pem". Leve the key names as it is';
38
+ }
35
39
  };
36
- exports.signPayload = signPayload;
40
+
37
41
  /**
38
42
  * Useful for when you need to authenticate in the web. Still didn't managed to make it work
39
43
  * @param payload
40
44
  * @returns
41
45
  */
42
- const signInBrowser = (payload) => {
43
- try {
44
- // @ts-ignore
45
- return fetch('./keys/privatekey.pem')
46
- .then((privateKey) => privateKey.text())
47
- .then((privateKey) => {
48
- const signature = crypto_1.default.sign('sha256', new Uint8Array(Buffer.from(JSON.stringify(payload, undefined, ' '))), { key: privateKey, padding: crypto_1.default.constants.RSA_PKCS1_PSS_PADDING });
49
- return {
50
- ...payload,
51
- signature,
52
- };
53
- });
54
- }
55
- catch (e) {
56
- throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${projetc_root}/keys/privatekey.pem". Leve the key names as it is';
57
- }
46
+ exports.signPayload = signPayload;
47
+ const signInBrowser = payload => {
48
+ try {
49
+ // @ts-ignore
50
+ return fetch('./keys/privatekey.pem').then(privateKey => privateKey.text()).then(privateKey => {
51
+ const signature = _crypto.default.sign('sha256', Buffer.from(JSON.stringify(payload, undefined, ' ')), {
52
+ key: privateKey,
53
+ padding: _crypto.default.constants.RSA_PKCS1_PSS_PADDING
54
+ });
55
+ return _objectSpread(_objectSpread({}, payload), {}, {
56
+ signature
57
+ });
58
+ });
59
+ } catch (e) {
60
+ throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${projetc_root}/keys/privatekey.pem". Leve the key names as it is';
61
+ }
58
62
  };
59
- exports.signInBrowser = signInBrowser;
60
63
  /**
61
64
  * Sign any payload using fs to retrieve the key
62
65
  * @param payload
63
66
  * @returns
64
67
  */
65
- const signInNodeEnvironment = async (payload) => {
66
- try {
67
- privateKey = await promises_1.default.readFile('./keys/privatekey.pem', {
68
- encoding: 'utf-8',
69
- });
70
- }
71
- catch (e) {
72
- throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${project_root}/keys/privatekey.pem". Leve the key names as it is';
73
- }
74
- const signature = crypto_1.default.sign('sha256', new Uint8Array(Buffer.from(JSON.stringify(payload, undefined, ' '))), { key: privateKey, padding: crypto_1.default.constants.RSA_PKCS1_PSS_PADDING });
75
- return {
76
- ...payload,
77
- signature,
78
- };
68
+ exports.signInBrowser = signInBrowser;
69
+ const signInNodeEnvironment = async payload => {
70
+ try {
71
+ privateKey = await _promises.default.readFile('./keys/privatekey.pem', {
72
+ encoding: 'utf-8'
73
+ });
74
+ } catch (e) {
75
+ throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${project_root}/keys/privatekey.pem". Leve the key names as it is';
76
+ }
77
+ const signature = _crypto.default.sign('sha256', Buffer.from(JSON.stringify(payload, undefined, ' ')), {
78
+ key: privateKey,
79
+ padding: _crypto.default.constants.RSA_PKCS1_PSS_PADDING
80
+ });
81
+ return _objectSpread(_objectSpread({}, payload), {}, {
82
+ signature
83
+ });
79
84
  };
80
- exports.signInNodeEnvironment = signInNodeEnvironment;
81
- //# sourceMappingURL=index.js.map
85
+ exports.signInNodeEnvironment = signInNodeEnvironment;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;AAEA,2DAA6B;AAC7B,oDAA4B;AAE5B,IAAI,UAA8B,CAAC;AAE5B,MAAM,MAAM,GAAG,CAAC,MAAe,EAAE,IAAa,EAAE,EAAE;IACxD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,EAAE,IAAI,CAAC,CAAC;AACV,CAAC,CAAC;AAJW,QAAA,MAAM,UAIjB;AAEF,SAAgB,eAAe,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAFD,0CAEC;AAEM,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,gBAAM,CAAC,UAAU,EAAE,CAAC;AAArC,QAAA,QAAQ,YAA6B;AAE3C,MAAM,WAAW,GAAG,CAC1B,OAAU,EACV,SAAkB,EACjB,EAAE;IACH,IAAI,SAAS,EAAE;QACd,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,SAAS;KACT,CAAC;AACH,CAAC,CAAC;AArBW,QAAA,qBAAqB,yBAqBhC"}
package/dist/util.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" />
2
+ import { Command } from 'kozz-types';
3
+ import { UseFn } from './Instance/Handler';
4
+ export declare const runUse: (useArr: UseFn[], args: Command) => Command;
5
+ export declare function normalizeString(string: string): string;
6
+ export declare const signPayload: <T extends Record<string, any>>(payload: T) => T & {
7
+ signature: Buffer;
8
+ };
package/dist/util.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.signPayload = exports.normalizeString = exports.runUse = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const crypto_1 = __importDefault(require("crypto"));
9
+ let privateKey;
10
+ const runUse = (useArr, args) => {
11
+ return useArr.reduce((res, fn) => {
12
+ return fn(res);
13
+ }, args);
14
+ };
15
+ exports.runUse = runUse;
16
+ function normalizeString(string) {
17
+ return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
18
+ }
19
+ exports.normalizeString = normalizeString;
20
+ const signPayload = (payload) => {
21
+ try {
22
+ privateKey = fs_1.default.readFileSync('./keys/privatekey.pem', {
23
+ encoding: 'utf-8',
24
+ });
25
+ }
26
+ catch (e) {
27
+ throw 'Please generate a keypair using the script "scripts/generate_key_pair.sh" and copy the publickey to the "${gateway_root}/keys/publickey.pem". Leve the key names as it is';
28
+ }
29
+ const signature = crypto_1.default.sign('sha256', Buffer.from(JSON.stringify(payload, undefined, ' ')), { key: privateKey, padding: crypto_1.default.constants.RSA_PKCS1_PSS_PADDING });
30
+ return {
31
+ ...payload,
32
+ signature,
33
+ };
34
+ };
35
+ exports.signPayload = signPayload;
36
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;AAEA,4CAAoB;AACpB,oDAA4B;AAE5B,IAAI,UAA8B,CAAC;AAE5B,MAAM,MAAM,GAAG,CAAC,MAAe,EAAE,IAAa,EAAE,EAAE;IACxD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAChC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,EAAE,IAAI,CAAC,CAAC;AACV,CAAC,CAAC;AAJW,QAAA,MAAM,UAIjB;AAEF,SAAgB,eAAe,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAFD,0CAEC;AAEM,MAAM,WAAW,GAAG,CAAgC,OAAU,EAAE,EAAE;IACxE,IAAI;QACH,UAAU,GAAG,YAAE,CAAC,YAAY,CAAC,uBAAuB,EAAE;YACrD,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACX,MAAM,4KAA4K,CAAC;KACnL;IAED,MAAM,SAAS,GAAG,gBAAM,CAAC,IAAI,CAC5B,QAAQ,EACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,EACrD,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAM,CAAC,SAAS,CAAC,qBAAqB,EAAE,CACpE,CAAC;IAEF,OAAO;QACN,GAAG,OAAO;QACV,SAAS;KACT,CAAC;AACH,CAAC,CAAC;AAnBW,QAAA,WAAW,eAmBtB"}