kozz-module-maker 0.2.10 → 0.3.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.
- package/dist/InlineCommands/index.js +13 -29
- package/dist/InlineCommands/index.js.map +1 -1
- package/dist/Instance/GeneralModule/index.d.ts +2 -1
- package/dist/Instance/GeneralModule/index.js +1 -1
- package/dist/Instance/GeneralModule/index.js.map +1 -1
- package/dist/Message/ProxiedMessage/index.d.ts +1 -0
- package/dist/Message/RoutineCreation/SendMessage/index.d.ts +1 -0
- package/dist/Message/RoutineCreation/SendMessage/index.js +4 -0
- package/dist/Message/RoutineCreation/SendMessage/index.js.map +1 -1
- package/dist/Message/index.d.ts +1 -0
- package/dist/Socket/Events/Emit/Introduction.d.ts +2 -1
- package/dist/Socket/Events/Emit/Introduction.js +2 -1
- package/dist/Socket/Events/Emit/Introduction.js.map +1 -1
- package/dist/jsx-runtime/MessageTemplating.js +3 -1
- package/dist/jsx-runtime/MessageTemplating.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +37 -0
- package/dist/debugIndex.d.ts +0 -1
- package/dist/debugIndex.js +0 -38
- package/dist/debugIndex.js.map +0 -1
|
@@ -41,63 +41,47 @@ exports.invisibleTagMember = invisibleTagMember;
|
|
|
41
41
|
const tagEveryone = (except = []) => inlineCommand('tageveryone', {
|
|
42
42
|
except
|
|
43
43
|
});
|
|
44
|
+
exports.tagEveryone = tagEveryone;
|
|
45
|
+
const textStylingCommand = variant => text => `${inlineCommand('begin_style', {
|
|
46
|
+
variant
|
|
47
|
+
})}${text}${inlineCommand('end_style', {
|
|
48
|
+
variant
|
|
49
|
+
})}`;
|
|
44
50
|
|
|
45
51
|
/**
|
|
46
52
|
* Formats text as bold.
|
|
47
53
|
* @param text The text to be formatted as bold
|
|
48
54
|
*/
|
|
49
|
-
exports.
|
|
50
|
-
const bold = text => inlineCommand('bold', {
|
|
51
|
-
text
|
|
52
|
-
});
|
|
55
|
+
const bold = exports.bold = textStylingCommand('bold');
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
58
|
* Formats text as inline code.
|
|
56
59
|
* @param text The text to be formatted as code
|
|
57
60
|
*/
|
|
58
|
-
exports.
|
|
59
|
-
const code = text => inlineCommand('code', {
|
|
60
|
-
text
|
|
61
|
-
});
|
|
61
|
+
const code = exports.code = textStylingCommand('code');
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Formats text as monospace.
|
|
65
65
|
* @param text The text to be formatted as monospace
|
|
66
66
|
*/
|
|
67
|
-
exports.
|
|
68
|
-
const monospace = text => inlineCommand('monospace', {
|
|
69
|
-
text
|
|
70
|
-
});
|
|
67
|
+
const monospace = exports.monospace = textStylingCommand('monospace');
|
|
71
68
|
|
|
72
69
|
/**
|
|
73
70
|
* Formats text with stroke effect.
|
|
74
71
|
* @param text The text to be formatted with stroke
|
|
75
72
|
*/
|
|
76
|
-
exports.
|
|
77
|
-
const stroke = text => inlineCommand('stroke', {
|
|
78
|
-
text
|
|
79
|
-
});
|
|
73
|
+
const stroke = exports.stroke = textStylingCommand('stroke');
|
|
80
74
|
|
|
81
75
|
/**
|
|
82
76
|
* Formats text as italic.
|
|
83
77
|
* @param text The text to be formatted as italic
|
|
84
78
|
*/
|
|
85
|
-
exports.
|
|
86
|
-
const italic = text => inlineCommand('italic', {
|
|
87
|
-
text
|
|
88
|
-
});
|
|
79
|
+
const italic = exports.italic = textStylingCommand('italic');
|
|
89
80
|
|
|
90
81
|
/**
|
|
91
82
|
* Creates a list item.
|
|
92
83
|
* @param text The content of the list item
|
|
93
84
|
*/
|
|
94
|
-
exports.
|
|
95
|
-
const
|
|
96
|
-
text
|
|
97
|
-
});
|
|
98
|
-
exports.listItem = listItem;
|
|
99
|
-
const paragraph = text => inlineCommand('paragraph', {
|
|
100
|
-
text
|
|
101
|
-
});
|
|
102
|
-
exports.paragraph = paragraph;
|
|
85
|
+
const listItem = exports.listItem = textStylingCommand('listItem');
|
|
86
|
+
const paragraph = exports.paragraph = textStylingCommand('paragraph');
|
|
103
87
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["inlineCommand","commandName","data","JSON","stringify","exports","tagMember","id","invisibleTagMember","tagEveryone","except","
|
|
1
|
+
{"version":3,"file":"index.js","names":["inlineCommand","commandName","data","JSON","stringify","exports","tagMember","id","invisibleTagMember","tagEveryone","except","textStylingCommand","variant","text","bold","code","monospace","stroke","italic","listItem","paragraph"],"sources":["../../src/InlineCommands/index.ts"],"sourcesContent":["/**\n * Creates an inline command with unespecified name and payload data.\n * @param commandName\n * @param data\n */\nexport const inlineCommand = (\n\tcommandName: string,\n\tdata: Record<string, any> = {}\n) => {\n\treturn `%${commandName}:${JSON.stringify(data)}`;\n};\n\n/**\n * Tags someone in the message. The tag will be visible for everyone\n * @param id\n */\nexport const tagMember = (id: string) => inlineCommand('mention', { id });\n\n/**\n * Tags someone in the message. The tag WILL NOT be visible for anyone\n * @param id\n * @returns\n */\nexport const invisibleTagMember = (id: string) =>\n\tinlineCommand('invisiblemention', { id });\n\n/**\n * Invisibly tag everyone\n * @param except\n * @returns\n */\nexport const tagEveryone = (except: string[] = []) =>\n\tinlineCommand('tageveryone', {\n\t\texcept,\n\t});\n\nconst textStylingCommand = (variant: string) => (text: string) =>\n\t`${inlineCommand('begin_style', { variant })}${text}${inlineCommand(\n\t\t'end_style',\n\t\t{ variant }\n\t)}`;\n\n/**\n * Formats text as bold.\n * @param text The text to be formatted as bold\n */\nexport const bold = textStylingCommand('bold');\n\n/**\n * Formats text as inline code.\n * @param text The text to be formatted as code\n */\nexport const code = textStylingCommand('code');\n\n/**\n * Formats text as monospace.\n * @param text The text to be formatted as monospace\n */\nexport const monospace = textStylingCommand('monospace');\n\n/**\n * Formats text with stroke effect.\n * @param text The text to be formatted with stroke\n */\nexport const stroke = textStylingCommand('stroke');\n\n/**\n * Formats text as italic.\n * @param text The text to be formatted as italic\n */\nexport const italic = textStylingCommand('italic');\n\n/**\n * Creates a list item.\n * @param text The content of the list item\n */\nexport const listItem = textStylingCommand('listItem');\n\nexport const paragraph = textStylingCommand('paragraph');\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAGA,CAC5BC,WAAmB,EACnBC,IAAyB,GAAG,CAAC,CAAC,KAC1B;EACJ,OAAO,IAAID,WAAW,IAAIE,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC,EAAE;AACjD,CAAC;;AAED;AACA;AACA;AACA;AAHAG,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAIO,MAAMM,SAAS,GAAIC,EAAU,IAAKP,aAAa,CAAC,SAAS,EAAE;EAAEO;AAAG,CAAC,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AAJAF,OAAA,CAAAC,SAAA,GAAAA,SAAA;AAKO,MAAME,kBAAkB,GAAID,EAAU,IAC5CP,aAAa,CAAC,kBAAkB,EAAE;EAAEO;AAAG,CAAC,CAAC;;AAE1C;AACA;AACA;AACA;AACA;AAJAF,OAAA,CAAAG,kBAAA,GAAAA,kBAAA;AAKO,MAAMC,WAAW,GAAGA,CAACC,MAAgB,GAAG,EAAE,KAChDV,aAAa,CAAC,aAAa,EAAE;EAC5BU;AACD,CAAC,CAAC;AAACL,OAAA,CAAAI,WAAA,GAAAA,WAAA;AAEJ,MAAME,kBAAkB,GAAIC,OAAe,IAAMC,IAAY,IAC5D,GAAGb,aAAa,CAAC,aAAa,EAAE;EAAEY;AAAQ,CAAC,CAAC,GAAGC,IAAI,GAAGb,aAAa,CAClE,WAAW,EACX;EAAEY;AAAQ,CACX,CAAC,EAAE;;AAEJ;AACA;AACA;AACA;AACO,MAAME,IAAI,GAAAT,OAAA,CAAAS,IAAA,GAAGH,kBAAkB,CAAC,MAAM,CAAC;;AAE9C;AACA;AACA;AACA;AACO,MAAMI,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAGJ,kBAAkB,CAAC,MAAM,CAAC;;AAE9C;AACA;AACA;AACA;AACO,MAAMK,SAAS,GAAAX,OAAA,CAAAW,SAAA,GAAGL,kBAAkB,CAAC,WAAW,CAAC;;AAExD;AACA;AACA;AACA;AACO,MAAMM,MAAM,GAAAZ,OAAA,CAAAY,MAAA,GAAGN,kBAAkB,CAAC,QAAQ,CAAC;;AAElD;AACA;AACA;AACA;AACO,MAAMO,MAAM,GAAAb,OAAA,CAAAa,MAAA,GAAGP,kBAAkB,CAAC,QAAQ,CAAC;;AAElD;AACA;AACA;AACA;AACO,MAAMQ,QAAQ,GAAAd,OAAA,CAAAc,QAAA,GAAGR,kBAAkB,CAAC,UAAU,CAAC;AAE/C,MAAMS,SAAS,GAAAf,OAAA,CAAAe,SAAA,GAAGT,kBAAkB,CAAC,WAAW,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Method, TypeString } from '../../Schema';
|
|
2
2
|
import { type ProxiedMessageObject } from '../../Message/ProxiedMessage';
|
|
3
|
-
import { type Source } from 'kozz-types';
|
|
3
|
+
import { type CommandAlias, type Source } from 'kozz-types';
|
|
4
4
|
export type ControllerInitParams<Methods extends Record<string, TypeString>> = {
|
|
5
5
|
name: string;
|
|
6
6
|
address: string;
|
|
@@ -10,6 +10,7 @@ export type ControllerInitParams<Methods extends Record<string, TypeString>> = {
|
|
|
10
10
|
commands?: {
|
|
11
11
|
boundariesToHandle: string[];
|
|
12
12
|
methods?: Record<string, Method<Methods>>;
|
|
13
|
+
aliases?: CommandAlias[];
|
|
13
14
|
};
|
|
14
15
|
proxy?: {
|
|
15
16
|
source: Source;
|
|
@@ -36,7 +36,7 @@ const createModule = ({
|
|
|
36
36
|
registerMethods
|
|
37
37
|
} = (0, _Socket.connect)(() => {
|
|
38
38
|
console.log(`Introducing ${name} to gateway on address ${address} with socketPath ${customSocketPath}`);
|
|
39
|
-
(0, _Introduction.introduce)(socket, name, commands?.methods || {}, signature);
|
|
39
|
+
(0, _Introduction.introduce)(socket, name, commands?.methods || {}, commands?.aliases, signature);
|
|
40
40
|
if (proxy) {
|
|
41
41
|
(0, _ProxiedMessage.onProxiedMessage)(socket, proxy.source, proxy.onMessage);
|
|
42
42
|
(0, _RequestProxy.requestProxy)(socket, _objectSpread({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Common","require","_Socket","_RevokeProxy","_RequestProxy","_AskResource","_SendMessage","_AskResource2","_Introduction","_ProxiedMessage","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","createModule","name","address","commands","proxy","signature","templatePath","customSocketPath","moduleUseFns","use","createUseFns","instance","socket","registerMethods","connect","console","log","introduce","methods","onProxiedMessage","source","onMessage","requestProxy","boundariesToHandle","removeResource","resourceMap","upsertResource","createResourceMap","onAskResource","sendMessage","sendMessageToContact","revoke","revokeProxy","on","onEvent","ask","createAskResource","requester","id","type","resources","exports"],"sources":["../../../src/Instance/GeneralModule/index.ts"],"sourcesContent":["import type { Method, TypeString } from '../../Schema';\nimport { createResourceMap, createUseFns, onEvent } from '../Common';\nimport { connect } from '../../Socket';\nimport { revokeProxy } from '../../Socket/Events/Emit/RevokeProxy';\nimport { requestProxy } from '../../Socket/Events/Emit/RequestProxy';\nimport { type ProxiedMessageObject } from '../../Message/ProxiedMessage';\nimport { type Source } from 'kozz-types';\nimport { onAskResource } from '../../Socket/Events/Handle/AskResource';\nimport { sendMessageToContact } from '../../Message/RoutineCreation/SendMessage';\nimport { createAskResource } from '../../Message/RoutineCreation/AskResource';\nimport { introduce } from '../../Socket/Events/Emit/Introduction';\nimport { onProxiedMessage } from '../../Socket/Events/Handle/ProxiedMessage';\n\nexport type ControllerInitParams<Methods extends Record<string, TypeString>> = {\n\tname: string;\n\n\taddress: string;\n\tcustomSocketPath?: string;\n\n\ttemplatePath?: string;\n\tsignature?: string;\n\n\tcommands?: {\n\t\tboundariesToHandle: string[];\n\t\tmethods?: Record<string, Method<Methods>>;\n\t};\n\n\tproxy?: {\n\t\tsource: Source;\n\t\tdestinationOverride?: string;\n\t\tonMessage: (message: ProxiedMessageObject) => any;\n\t\tkeepAliveProxy?: boolean;\n\t};\n};\n\nexport const createModule = <Methods extends Record<string, TypeString>>({\n\tname,\n\taddress,\n\tcommands,\n\tproxy,\n\tsignature,\n\ttemplatePath,\n\tcustomSocketPath,\n}: ControllerInitParams<Methods>) => {\n\tconst { moduleUseFns, use } = createUseFns(() => instance);\n\n\tconst { socket, registerMethods } = connect(\n\t\t() => {\n\t\t\tconsole.log(\n\t\t\t\t`Introducing ${name} to gateway on address ${address} with socketPath ${customSocketPath}`\n\t\t\t);\n\t\t\tintroduce(socket, name, commands?.methods || {}, signature);\n\t\t\tif (proxy) {\n\t\t\t\tonProxiedMessage(socket, proxy.source, proxy.onMessage);\n\t\t\t\trequestProxy(socket, {\n\t\t\t\t\taddress,\n\t\t\t\t\tname,\n\t\t\t\t\t...proxy,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\taddress,\n\t\tmoduleUseFns,\n\t\ttemplatePath || '',\n\t\tname,\n\t\tcommands?.boundariesToHandle || [],\n\t\tcustomSocketPath\n\t);\n\n\tif (commands?.methods) {\n\t\tregisterMethods(commands?.methods);\n\t}\n\n\tconst { removeResource, resourceMap, upsertResource } = createResourceMap();\n\tonAskResource(socket, resourceMap);\n\n\tconst sendMessage = sendMessageToContact(socket, name);\n\n\tlet revoke = () => {\n\t\tif (proxy) {\n\t\t\trevokeProxy(socket, proxy.source);\n\t\t}\n\t};\n\n\tconst { on } = onEvent(socket, name);\n\n\tconst ask = createAskResource(socket, {\n\t\trequester: {\n\t\t\tid: name,\n\t\t\ttype: 'Handler',\n\t\t},\n\t});\n\n\tconst instance = {\n\t\tuse,\n\t\ton,\n\t\tsendMessage,\n\t\tresources: {\n\t\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KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IAAAE,MAAA,CAAAgB,cAAA,CAAAnB,CAAA,EAAAC,CAAA,EAAAE,MAAA,CAAAK,wBAAA,CAAAN,CAAA,EAAAD,CAAA,iBAAAD,CAAA;AAAA,SAAAgB,gBAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAmB,cAAA,CAAAnB,CAAA,MAAAD,CAAA,GAAAG,MAAA,CAAAgB,cAAA,CAAAnB,CAAA,EAAAC,CAAA,IAAAoB,KAAA,EAAAnB,CAAA,EAAAO,UAAA,MAAAa,YAAA,MAAAC,QAAA,UAAAvB,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAoB,eAAAlB,CAAA,QAAAsB,CAAA,GAAAC,YAAA,CAAAvB,CAAA,uCAAAsB,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAvB,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAwB,MAAA,CAAAC,WAAA,kBAAA3B,CAAA,QAAAwB,CAAA,GAAAxB,CAAA,CAAA4B,IAAA,CAAA1B,CAAA,EAAAD,CAAA,uCAAAuB,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAA5B,CAAA,GAAA6B,MAAA,GAAAC,MAAA,EAAA7B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Common","require","_Socket","_RevokeProxy","_RequestProxy","_AskResource","_SendMessage","_AskResource2","_Introduction","_ProxiedMessage","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","createModule","name","address","commands","proxy","signature","templatePath","customSocketPath","moduleUseFns","use","createUseFns","instance","socket","registerMethods","connect","console","log","introduce","methods","aliases","onProxiedMessage","source","onMessage","requestProxy","boundariesToHandle","removeResource","resourceMap","upsertResource","createResourceMap","onAskResource","sendMessage","sendMessageToContact","revoke","revokeProxy","on","onEvent","ask","createAskResource","requester","id","type","resources","exports"],"sources":["../../../src/Instance/GeneralModule/index.ts"],"sourcesContent":["import type { Method, TypeString } from '../../Schema';\nimport { createResourceMap, createUseFns, onEvent } from '../Common';\nimport { connect } from '../../Socket';\nimport { revokeProxy } from '../../Socket/Events/Emit/RevokeProxy';\nimport { requestProxy } from '../../Socket/Events/Emit/RequestProxy';\nimport { type ProxiedMessageObject } from '../../Message/ProxiedMessage';\nimport { type CommandAlias, type Source } from 'kozz-types';\nimport { onAskResource } from '../../Socket/Events/Handle/AskResource';\nimport { sendMessageToContact } from '../../Message/RoutineCreation/SendMessage';\nimport { createAskResource } from '../../Message/RoutineCreation/AskResource';\nimport { introduce } from '../../Socket/Events/Emit/Introduction';\nimport { onProxiedMessage } from '../../Socket/Events/Handle/ProxiedMessage';\n\nexport type ControllerInitParams<Methods extends Record<string, TypeString>> = {\n\tname: string;\n\n\taddress: string;\n\tcustomSocketPath?: string;\n\n\ttemplatePath?: string;\n\tsignature?: string;\n\n\tcommands?: {\n\t\tboundariesToHandle: string[];\n\t\tmethods?: Record<string, Method<Methods>>;\n\t\taliases?: CommandAlias[];\n\t};\n\n\tproxy?: {\n\t\tsource: Source;\n\t\tdestinationOverride?: string;\n\t\tonMessage: (message: ProxiedMessageObject) => any;\n\t\tkeepAliveProxy?: boolean;\n\t};\n};\n\nexport const createModule = <Methods extends Record<string, TypeString>>({\n\tname,\n\taddress,\n\tcommands,\n\tproxy,\n\tsignature,\n\ttemplatePath,\n\tcustomSocketPath,\n}: ControllerInitParams<Methods>) => {\n\tconst { moduleUseFns, use } = createUseFns(() => instance);\n\n\tconst { socket, registerMethods } = connect(\n\t\t() => {\n\t\t\tconsole.log(\n\t\t\t\t`Introducing ${name} to gateway on address ${address} with socketPath ${customSocketPath}`\n\t\t\t);\n\t\t\tintroduce(socket, name, commands?.methods || {}, commands?.aliases, signature);\n\t\t\tif (proxy) {\n\t\t\t\tonProxiedMessage(socket, proxy.source, proxy.onMessage);\n\t\t\t\trequestProxy(socket, {\n\t\t\t\t\taddress,\n\t\t\t\t\tname,\n\t\t\t\t\t...proxy,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\taddress,\n\t\tmoduleUseFns,\n\t\ttemplatePath || '',\n\t\tname,\n\t\tcommands?.boundariesToHandle || [],\n\t\tcustomSocketPath\n\t);\n\n\tif (commands?.methods) {\n\t\tregisterMethods(commands?.methods);\n\t}\n\n\tconst { removeResource, resourceMap, upsertResource } = createResourceMap();\n\tonAskResource(socket, resourceMap);\n\n\tconst sendMessage = sendMessageToContact(socket, name);\n\n\tlet revoke = () => {\n\t\tif (proxy) {\n\t\t\trevokeProxy(socket, proxy.source);\n\t\t}\n\t};\n\n\tconst { on } = onEvent(socket, name);\n\n\tconst ask = createAskResource(socket, {\n\t\trequester: {\n\t\t\tid: name,\n\t\t\ttype: 'Handler',\n\t\t},\n\t});\n\n\tconst instance = {\n\t\tuse,\n\t\ton,\n\t\tsendMessage,\n\t\tresources: {\n\t\t\tremoveResource,\n\t\t\tupsertResource,\n\t\t},\n\t\tproxy: {\n\t\t\trevoke,\n\t\t},\n\t\task,\n\t\tsocket,\n\t};\n\n\treturn instance;\n};\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AAA6E,SAA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;IACH;EACD,CAAC,EACDF,OAAO,EACPM,YAAY,EACZF,YAAY,IAAI,EAAE,EAClBL,IAAI,EACJE,QAAQ,EAAEqB,kBAAkB,IAAI,EAAE,EAClCjB,gBACD,CAAC;EAED,IAAIJ,QAAQ,EAAEe,OAAO,EAAE;IACtBL,eAAe,CAACV,QAAQ,EAAEe,OAAO,CAAC;EACnC;EAEA,MAAM;IAAEO,cAAc;IAAEC,WAAW;IAAEC;EAAe,CAAC,GAAG,IAAAC,yBAAiB,EAAC,CAAC;EAC3E,IAAAC,0BAAa,EAACjB,MAAM,EAAEc,WAAW,CAAC;EAElC,MAAMI,WAAW,GAAG,IAAAC,iCAAoB,EAACnB,MAAM,EAAEX,IAAI,CAAC;EAEtD,IAAI+B,MAAM,GAAGA,CAAA,KAAM;IAClB,IAAI5B,KAAK,EAAE;MACV,IAAA6B,wBAAW,EAACrB,MAAM,EAAER,KAAK,CAACiB,MAAM,CAAC;IAClC;EACD,CAAC;EAED,MAAM;IAAEa;EAAG,CAAC,GAAG,IAAAC,eAAO,EAACvB,MAAM,EAAEX,IAAI,CAAC;EAEpC,MAAMmC,GAAG,GAAG,IAAAC,+BAAiB,EAACzB,MAAM,EAAE;IACrC0B,SAAS,EAAE;MACVC,EAAE,EAAEtC,IAAI;MACRuC,IAAI,EAAE;IACP;EACD,CAAC,CAAC;EAEF,MAAM7B,QAAQ,GAAG;IAChBF,GAAG;IACHyB,EAAE;IACFJ,WAAW;IACXW,SAAS,EAAE;MACVhB,cAAc;MACdE;IACD,CAAC;IACDvB,KAAK,EAAE;MACN4B;IACD,CAAC;IACDI,GAAG;IACHxB;EACD,CAAC;EAED,OAAOD,QAAQ;AAChB,CAAC;AAAC+B,OAAA,CAAA1C,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ export declare const createProxiedMessageOject: (socket: Socket, source: Source,
|
|
|
14
14
|
};
|
|
15
15
|
sendMessage: {
|
|
16
16
|
(contactId: string, body: string): void;
|
|
17
|
+
toOtherBoundary(otherBoundary: string, contactId: string, body: string): void;
|
|
17
18
|
withMedia(contactId: string, caption: string, media: import("kozz-types").Media): void;
|
|
18
19
|
};
|
|
19
20
|
react: (emote: string) => Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
|
@@ -2,6 +2,7 @@ import { Media } from 'kozz-types';
|
|
|
2
2
|
import { Socket } from 'socket.io-client';
|
|
3
3
|
export declare const sendMessageToContactOnRequesterObject: (socket: Socket, handlerName: string, boundaryId: string) => {
|
|
4
4
|
(contactId: string, body: string): void;
|
|
5
|
+
toOtherBoundary(otherBoundary: string, contactId: string, body: string): void;
|
|
5
6
|
withMedia(contactId: string, caption: string, media: Media): void;
|
|
6
7
|
};
|
|
7
8
|
export declare const sendMessageToContact: (socket: Socket, handlerName: string) => {
|
|
@@ -10,6 +10,10 @@ const sendMessageToContactOnRequesterObject = (socket, handlerName, boundaryId)
|
|
|
10
10
|
const payload = (0, _sendMessage.createSendMessagePayload)(handlerName, contactId, boundaryId, body);
|
|
11
11
|
socket.emit('send_message', payload);
|
|
12
12
|
};
|
|
13
|
+
sendMessage.toOtherBoundary = (otherBoundary, contactId, body) => {
|
|
14
|
+
const payload = (0, _sendMessage.createSendMessagePayload)(handlerName, contactId, otherBoundary, body);
|
|
15
|
+
socket.emit('send_message', payload);
|
|
16
|
+
};
|
|
13
17
|
sendMessage.withMedia = (contactId, caption, media) => {
|
|
14
18
|
const payload = (0, _sendMessage.createSendMessagePayload)(handlerName, contactId, boundaryId, caption, media);
|
|
15
19
|
socket.emit('send_message', payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_sendMessage","require","sendMessageToContactOnRequesterObject","socket","handlerName","boundaryId","sendMessage","contactId","body","payload","createSendMessagePayload","emit","withMedia","caption","media","exports","sendMessageToContact"],"sources":["../../../../src/Message/RoutineCreation/SendMessage/index.ts"],"sourcesContent":["import { Command, Media, MessageReceivedByGateway } from 'kozz-types';\nimport { Socket } from 'socket.io-client';\nimport { createSendMessagePayload } from '../../PayloadCreation/sendMessage';\n\nexport const sendMessageToContactOnRequesterObject = (\n\tsocket: Socket,\n\thandlerName: string,\n\tboundaryId: string\n) => {\n\tconst sendMessage = (contactId: string, body: string) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tbody\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\tsendMessage.withMedia = (\n\t\tcontactId: string,\n\t\tcaption: string,\n\t\tmedia: Media\n\t) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tcaption,\n\t\t\tmedia\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\treturn sendMessage;\n};\n\nexport const sendMessageToContact = (socket: Socket, handlerName: string) => {\n\tconst sendMessage = (contactId: string, boundaryId: string, body: string) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tbody\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\tsendMessage.withMedia = (\n\t\tcontactId: string,\n\t\tboundaryId: string,\n\t\tcaption: string,\n\t\tmedia: Media\n\t) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tcaption,\n\t\t\tmedia\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\treturn sendMessage;\n};\n"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,qCAAqC,GAAGA,CACpDC,MAAc,EACdC,WAAmB,EACnBC,UAAkB,KACd;EACJ,MAAMC,WAAW,GAAGA,CAACC,SAAiB,EAAEC,IAAY,KAAK;IACxD,MAAMC,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTF,UAAU,EACVG,IACD,CAAC;IAEDL,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAEDH,WAAW,CAACM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_sendMessage","require","sendMessageToContactOnRequesterObject","socket","handlerName","boundaryId","sendMessage","contactId","body","payload","createSendMessagePayload","emit","toOtherBoundary","otherBoundary","withMedia","caption","media","exports","sendMessageToContact"],"sources":["../../../../src/Message/RoutineCreation/SendMessage/index.ts"],"sourcesContent":["import { Command, Media, MessageReceivedByGateway } from 'kozz-types';\nimport { Socket } from 'socket.io-client';\nimport { createSendMessagePayload } from '../../PayloadCreation/sendMessage';\n\nexport const sendMessageToContactOnRequesterObject = (\n\tsocket: Socket,\n\thandlerName: string,\n\tboundaryId: string\n) => {\n\tconst sendMessage = (contactId: string, body: string) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tbody\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\tsendMessage.toOtherBoundary = (\n\t\totherBoundary: string,\n\t\tcontactId: string,\n\t\tbody: string\n\t) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\totherBoundary,\n\t\t\tbody\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\tsendMessage.withMedia = (\n\t\tcontactId: string,\n\t\tcaption: string,\n\t\tmedia: Media\n\t) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tcaption,\n\t\t\tmedia\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\treturn sendMessage;\n};\n\nexport const sendMessageToContact = (socket: Socket, handlerName: string) => {\n\tconst sendMessage = (contactId: string, boundaryId: string, body: string) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tbody\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\tsendMessage.withMedia = (\n\t\tcontactId: string,\n\t\tboundaryId: string,\n\t\tcaption: string,\n\t\tmedia: Media\n\t) => {\n\t\tconst payload = createSendMessagePayload(\n\t\t\thandlerName,\n\t\t\tcontactId,\n\t\t\tboundaryId,\n\t\t\tcaption,\n\t\t\tmedia\n\t\t);\n\n\t\tsocket.emit('send_message', payload);\n\t};\n\n\treturn sendMessage;\n};\n"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,qCAAqC,GAAGA,CACpDC,MAAc,EACdC,WAAmB,EACnBC,UAAkB,KACd;EACJ,MAAMC,WAAW,GAAGA,CAACC,SAAiB,EAAEC,IAAY,KAAK;IACxD,MAAMC,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTF,UAAU,EACVG,IACD,CAAC;IAEDL,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAEDH,WAAW,CAACM,eAAe,GAAG,CAC7BC,aAAqB,EACrBN,SAAiB,EACjBC,IAAY,KACR;IACJ,MAAMC,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTM,aAAa,EACbL,IACD,CAAC;IAEDL,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAEDH,WAAW,CAACQ,SAAS,GAAG,CACvBP,SAAiB,EACjBQ,OAAe,EACfC,KAAY,KACR;IACJ,MAAMP,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTF,UAAU,EACVU,OAAO,EACPC,KACD,CAAC;IAEDb,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAED,OAAOH,WAAW;AACnB,CAAC;AAACW,OAAA,CAAAf,qCAAA,GAAAA,qCAAA;AAEK,MAAMgB,oBAAoB,GAAGA,CAACf,MAAc,EAAEC,WAAmB,KAAK;EAC5E,MAAME,WAAW,GAAGA,CAACC,SAAiB,EAAEF,UAAkB,EAAEG,IAAY,KAAK;IAC5E,MAAMC,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTF,UAAU,EACVG,IACD,CAAC;IAEDL,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAEDH,WAAW,CAACQ,SAAS,GAAG,CACvBP,SAAiB,EACjBF,UAAkB,EAClBU,OAAe,EACfC,KAAY,KACR;IACJ,MAAMP,OAAO,GAAG,IAAAC,qCAAwB,EACvCN,WAAW,EACXG,SAAS,EACTF,UAAU,EACVU,OAAO,EACPC,KACD,CAAC;IAEDb,MAAM,CAACQ,IAAI,CAAC,cAAc,EAAEF,OAAO,CAAC;EACrC,CAAC;EAED,OAAOH,WAAW;AACnB,CAAC;AAACW,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/dist/Message/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const createMessageObject: (socket: Socket, messagePayload: Messa
|
|
|
14
14
|
};
|
|
15
15
|
sendMessage: {
|
|
16
16
|
(contactId: string, body: string): void;
|
|
17
|
+
toOtherBoundary(otherBoundary: string, contactId: string, body: string): void;
|
|
17
18
|
withMedia(contactId: string, caption: string, media: import("kozz-types").Media): void;
|
|
18
19
|
};
|
|
19
20
|
react: (emote: string) => Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommandAlias } from 'kozz-types/dist';
|
|
1
2
|
import { Socket } from 'socket.io-client';
|
|
2
3
|
import { Method, TypeString } from '../../../Schema';
|
|
3
4
|
/**
|
|
@@ -7,4 +8,4 @@ import { Method, TypeString } from '../../../Schema';
|
|
|
7
8
|
* @param methods
|
|
8
9
|
* @param signature
|
|
9
10
|
*/
|
|
10
|
-
export declare const introduce: <T extends Record<string, Method<Record<string, TypeString>>>>(socket: Socket, handlerName: string, methods: T, signature?: string) => Promise<void>;
|
|
11
|
+
export declare const introduce: <T extends Record<string, Method<Record<string, TypeString>>>>(socket: Socket, handlerName: string, methods: T, aliases?: CommandAlias[], signature?: string) => Promise<void>;
|
|
@@ -12,8 +12,9 @@ var _util = require("../../../util");
|
|
|
12
12
|
* @param methods
|
|
13
13
|
* @param signature
|
|
14
14
|
*/
|
|
15
|
-
const introduce = async (socket, handlerName, methods, signature) => {
|
|
15
|
+
const introduce = async (socket, handlerName, methods, aliases = [], signature) => {
|
|
16
16
|
const payload = {
|
|
17
|
+
aliases,
|
|
17
18
|
methods: Object.keys(methods),
|
|
18
19
|
name: handlerName,
|
|
19
20
|
role: 'handler'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Introduction.js","names":["_util","require","introduce","socket","handlerName","methods","signature","payload","Object","keys","name","role","emit","signPayload","exports"],"sources":["../../../../src/Socket/Events/Emit/Introduction.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Introduction.js","names":["_util","require","introduce","socket","handlerName","methods","aliases","signature","payload","Object","keys","name","role","emit","signPayload","exports"],"sources":["../../../../src/Socket/Events/Emit/Introduction.ts"],"sourcesContent":["import {\n\tCommandAlias,\n\tHandlerIntroduction,\n\tSignaturelessPayload,\n} from 'kozz-types/dist';\nimport { Socket } from 'socket.io-client';\nimport { Method, TypeString } from '../../../Schema';\nimport { signPayload } from '../../../util';\n\n/**\n * Emits the introduction payload to the gateway\n * @param socket\n * @param handlerName\n * @param methods\n * @param signature\n */\nexport const introduce = async <\n\tT extends Record<string, Method<Record<string, TypeString>>>\n>(\n\tsocket: Socket,\n\thandlerName: string,\n\tmethods: T,\n\taliases: CommandAlias[] = [],\n\tsignature?: string\n) => {\n\tconst payload: SignaturelessPayload<HandlerIntroduction> = {\n\t\taliases,\n\t\tmethods: Object.keys(methods),\n\t\tname: handlerName,\n\t\trole: 'handler',\n\t};\n\n\tsocket.emit('introduction', await signPayload(payload, signature));\n};\n"],"mappings":";;;;;;AAOA,IAAAA,KAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,SAAS,GAAG,MAAAA,CAGxBC,MAAc,EACdC,WAAmB,EACnBC,OAAU,EACVC,OAAuB,GAAG,EAAE,EAC5BC,SAAkB,KACd;EACJ,MAAMC,OAAkD,GAAG;IAC1DF,OAAO;IACPD,OAAO,EAAEI,MAAM,CAACC,IAAI,CAACL,OAAO,CAAC;IAC7BM,IAAI,EAAEP,WAAW;IACjBQ,IAAI,EAAE;EACP,CAAC;EAEDT,MAAM,CAACU,IAAI,CAAC,cAAc,EAAE,MAAM,IAAAC,iBAAW,EAACN,OAAO,EAAED,SAAS,CAAC,CAAC;AACnE,CAAC;AAACQ,OAAA,CAAAb,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageTemplating.js","names":["_InlineCommands","require","createTemplatingComponent","command","children","Array","isArray","join","toString","exports","Bold","bold","Code","code","Monospace","monospace","Stroke","stroke","Italic","italic","ListItem","listItem","Paragraph","paragraph","Line","List","items","map","item","Render","when","shouldRender","ForEach","props","data","index","render"],"sources":["../../src/jsx-runtime/MessageTemplating.tsx"],"sourcesContent":["import {\n\tbold,\n\tcode,\n\titalic,\n\tlistItem,\n\tmonospace,\n\tparagraph,\n\tstroke,\n} from 'src/InlineCommands';\nimport { type Component } from '.';\n\nexport const createTemplatingComponent =\n\t(command: (text: string) => string): Component<{}> =>\n\t({ children }) => {\n\t\treturn typeof children === 'string'\n\t\t\t? `${command(children)}`\n\t\t\t: Array.isArray(children)\n\t\t\t? `${command(children.join(''))}`\n\t\t\t: children?.toString();\n\t};\n\nexport const Bold = createTemplatingComponent(bold);\nexport const Code = createTemplatingComponent(code);\nexport const Monospace = createTemplatingComponent(monospace);\nexport const Stroke = createTemplatingComponent(stroke);\nexport const Italic = createTemplatingComponent(italic);\nexport const ListItem = createTemplatingComponent(listItem);\nexport const Paragraph = createTemplatingComponent(paragraph);\n\nexport const Line: Component<{}> = ({ children }) => {\n\treturn typeof children === 'string'\n\t\t? children\n\t\t: Array.isArray(children)\n\t\t? `${children.join('')}`\n\t\t: children?.toString();\n};\n\nexport const List = ({ items }: { items: string | string[] }) => {\n\tif (typeof items === 'string') return `- ${items}`;\n\treturn items.map(item =>
|
|
1
|
+
{"version":3,"file":"MessageTemplating.js","names":["_InlineCommands","require","createTemplatingComponent","command","children","Array","isArray","join","toString","exports","Bold","bold","Code","code","Monospace","monospace","Stroke","stroke","Italic","italic","ListItem","listItem","Paragraph","paragraph","Line","List","items","map","item","Render","when","shouldRender","ForEach","props","data","index","render"],"sources":["../../src/jsx-runtime/MessageTemplating.tsx"],"sourcesContent":["import {\n\tbold,\n\tcode,\n\titalic,\n\tlistItem,\n\tmonospace,\n\tparagraph,\n\tstroke,\n} from 'src/InlineCommands';\nimport { type Component } from '.';\n\nexport const createTemplatingComponent =\n\t(command: (text: string) => string): Component<{}> =>\n\t({ children }) => {\n\t\treturn typeof children === 'string'\n\t\t\t? `${command(children)}`\n\t\t\t: Array.isArray(children)\n\t\t\t? `${command(children.join(''))}`\n\t\t\t: children?.toString();\n\t};\n\nexport const Bold = createTemplatingComponent(bold);\nexport const Code = createTemplatingComponent(code);\nexport const Monospace = createTemplatingComponent(monospace);\nexport const Stroke = createTemplatingComponent(stroke);\nexport const Italic = createTemplatingComponent(italic);\nexport const ListItem = createTemplatingComponent(listItem);\nexport const Paragraph = createTemplatingComponent(paragraph);\n\nexport const Line: Component<{}> = ({ children }) => {\n\treturn typeof children === 'string'\n\t\t? children\n\t\t: Array.isArray(children)\n\t\t? `${children.join('')}`\n\t\t: children?.toString();\n};\n\nexport const List = ({ items }: { items: string | string[] }) => {\n\tif (typeof items === 'string') return `- ${items}`;\n\treturn items.map(item => ListItem({ children: item })).join('\\n');\n};\n\n/**\n * Conditionally renders it's children if the prop 'when' evaluates to true\n * @param param0\n * @returns\n */\nexport const Render: Component<{ when: boolean | (() => boolean) }> = ({\n\twhen,\n\tchildren,\n}) => {\n\tconst shouldRender = typeof when === 'boolean' ? when : when();\n\n\tif (shouldRender) {\n\t\treturn children;\n\t} else {\n\t\treturn null;\n\t}\n};\n\ntype ForEachProps<TData> = {\n\tdata: Readonly<TData[]>;\n\trender: (data: TData, index: number) => Component<any>;\n};\n\n/**\n * Iterates over an array and renders a component for each item.\n * @param props\n * @returns\n */\nexport const ForEach = <TData extends any>(props: ForEachProps<TData>) => {\n\treturn (props.data ?? []).map(\n\t\t(data, index) => props.render(data, index) + '\\n'\n\t);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAWO,MAAMC,yBAAyB,GACpCC,OAAiC,IAClC,CAAC;EAAEC;AAAS,CAAC,KAAK;EACjB,OAAO,OAAOA,QAAQ,KAAK,QAAQ,GAChC,GAAGD,OAAO,CAACC,QAAQ,CAAC,EAAE,GACtBC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GACvB,GAAGD,OAAO,CAACC,QAAQ,CAACG,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,GAC/BH,QAAQ,EAAEI,QAAQ,CAAC,CAAC;AACxB,CAAC;AAACC,OAAA,CAAAP,yBAAA,GAAAA,yBAAA;AAEI,MAAMQ,IAAI,GAAAD,OAAA,CAAAC,IAAA,GAAGR,yBAAyB,CAACS,oBAAI,CAAC;AAC5C,MAAMC,IAAI,GAAAH,OAAA,CAAAG,IAAA,GAAGV,yBAAyB,CAACW,oBAAI,CAAC;AAC5C,MAAMC,SAAS,GAAAL,OAAA,CAAAK,SAAA,GAAGZ,yBAAyB,CAACa,yBAAS,CAAC;AACtD,MAAMC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAA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A,MAAA;AAOF;AACA;AACA;AACA;AACA;AACO,MAAMG,OAAO,GAAuBC,KAA0B,IAAK;EACzE,OAAO,CAACA,KAAK,CAACC,IAAI,IAAI,EAAE,EAAEP,GAAG,CAC5B,CAACO,IAAI,EAAEC,KAAK,KAAKF,KAAK,CAACG,MAAM,CAACF,IAAI,EAAEC,KAAK,CAAC,GAAG,IAC9C,CAAC;AACF,CAAC;AAAC1B,OAAA,CAAAuB,OAAA,GAAAA,OAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kozz-module-maker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Library to create new module for the Kozz-Bot protocol",
|
|
5
5
|
"main": "./dist",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"babel": "^6.23.0",
|
|
25
25
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
26
26
|
"concurrently": "^7.6.0",
|
|
27
|
-
"kozz-types": "^0.1.
|
|
27
|
+
"kozz-types": "^0.1.23",
|
|
28
28
|
"nodemon": "^2.0.22"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
package/readme.md
CHANGED
|
@@ -146,6 +146,43 @@ createHandlerInstance({
|
|
|
146
146
|
});
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
+
### Command aliases
|
|
150
|
+
|
|
151
|
+
Handlers can announce aliases in the introduction payload. The gateway resolves
|
|
152
|
+
the alias before routing the command, so no extra handler module is required.
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
createModule({
|
|
156
|
+
name: 'ping',
|
|
157
|
+
address: 'gateway_address',
|
|
158
|
+
commands: {
|
|
159
|
+
boundariesToHandle: ['my_boundary', 'my-other-boundary'],
|
|
160
|
+
aliases: [
|
|
161
|
+
{
|
|
162
|
+
name: 'pong',
|
|
163
|
+
target: {
|
|
164
|
+
method: 'default',
|
|
165
|
+
immediateArg: null,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
methods: {
|
|
170
|
+
...createMethod(
|
|
171
|
+
'default',
|
|
172
|
+
requester => {
|
|
173
|
+
requester.reply('Pong!');
|
|
174
|
+
},
|
|
175
|
+
{}
|
|
176
|
+
),
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
If `target.module` is omitted, the alias targets the handler that declared it.
|
|
183
|
+
Arguments typed after the alias are appended to the target `immediateArg`, and
|
|
184
|
+
named args from the message override named args declared in the alias target.
|
|
185
|
+
|
|
149
186
|
## From template
|
|
150
187
|
|
|
151
188
|
You cand send or reply to messages using templates. Instead of relying on strings hard-coded in the methods or callbacks, you can create a simpler version of .MD files and read message templates direct from them. It is still in its early stages so you can bet the .md parser will fail. Use at your own risk.
|
package/dist/debugIndex.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/debugIndex.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _GeneralModule = require("./Instance/GeneralModule");
|
|
4
|
-
var _ = require(".");
|
|
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 Pong = ({
|
|
14
|
-
time
|
|
15
|
-
}) => {
|
|
16
|
-
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
17
|
-
children: (0, _jsxRuntime.jsxs)(_.Line, {
|
|
18
|
-
children: ["Pong! Tempo de resposta: ", time.toString()]
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const defaultMethod = (0, _Schema.createMethod)('default', requester => {
|
|
23
|
-
const now = new Date().getTime();
|
|
24
|
-
const requestTime = requester.message.timestamp;
|
|
25
|
-
const difference = (now - requestTime) / 1000;
|
|
26
|
-
requester.reply((0, _jsxRuntime.jsx)(Pong, {
|
|
27
|
-
time: difference
|
|
28
|
-
}));
|
|
29
|
-
});
|
|
30
|
-
(0, _GeneralModule.createModule)({
|
|
31
|
-
name: 'test',
|
|
32
|
-
address: defaultGatewayUrl,
|
|
33
|
-
commands: {
|
|
34
|
-
boundariesToHandle: ['*'],
|
|
35
|
-
methods: _objectSpread({}, defaultMethod)
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=debugIndex.js.map
|
package/dist/debugIndex.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debugIndex.js","names":["_GeneralModule","require","_","_Schema","_jsxRuntime","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","defaultGatewayUrl","Pong","time","jsx","Fragment","children","jsxs","Line","toString","defaultMethod","createMethod","requester","now","Date","getTime","requestTime","message","timestamp","difference","reply","createModule","name","address","commands","boundariesToHandle","methods"],"sources":["../src/debugIndex.tsx"],"sourcesContent":["import { createModule } from './Instance/GeneralModule';\nimport { Bold, ForEach, Italic, Line, List } from '.';\n\nimport { createMethod } from './Schema';\n\nconst defaultGatewayUrl = 'ws://127.0.0.1:4521';\n\nconst Pong = ({ time }: { time: number }) => {\n\treturn (\n\t\t<>\n\t\t\t<Line>Pong! Tempo de resposta: {time.toString()}</Line>\n\t\t</>\n\t);\n};\n\nconst defaultMethod = createMethod('default', requester => {\n\tconst now = new Date().getTime();\n\tconst requestTime = requester.message.timestamp;\n\tconst difference = (now - requestTime!) / 1000;\n\n\trequester.reply(<Pong time={difference} />);\n});\n\ncreateModule({\n\tname: 'test',\n\taddress: defaultGatewayUrl,\n\tcommands: {\n\t\tboundariesToHandle: ['*'],\n\t\tmethods: {\n\t\t\t...defaultMethod,\n\t\t},\n\t},\n});\n"],"mappings":";;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAAwC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,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