feat: add tailchat-client-sdk package

pull/70/head
moonrailgun 2 years ago
parent eecac23d9a
commit 94b56f0af5

@ -0,0 +1,20 @@
{
"name": "tailchat-client-sdk",
"version": "1.0.0",
"description": "",
"main": "lib/index.js",
"scripts": {
"prepare": "tsc",
"release": "npm publish --registry https://registry.npmjs.com/",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "moonrailgun <moonrailgun@gmail.com>",
"license": "MIT",
"devDependencies": {
"typescript": "^4.9.5"
},
"dependencies": {
"axios": "^1.3.2"
}
}

@ -0,0 +1 @@
export * from './plugins/simplenotify';

@ -0,0 +1,24 @@
import axios from 'axios';
/**
*
*
* @param hostUrl url
* @param subscribeId id
* @param text bbcode
*/
export async function sendSimpleNotify(
hostUrl: string,
subscribeId: string,
text: string
) {
await axios({
method: 'post',
baseURL: hostUrl,
url: '/api/plugin:com.msgbyte.simplenotify/webhook/callback',
data: {
subscribeId,
text,
},
});
}

@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["ESNext"],
"outDir": "lib",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"isolatedModules": true,
"module": "CommonJS",
"moduleResolution": "node",
"strict": true,
"importsNotUsedAsValues": "error",
},
"include": ["./src/*"]
}

@ -288,6 +288,15 @@ importers:
'@types/node': 18.11.16
ts-node: 10.9.1_rmyookn2hbqnnqjamditnjqvjq
client/packages/tailchat-client-sdk:
specifiers:
axios: ^1.3.2
typescript: ^4.9.5
dependencies:
axios: 1.3.2
devDependencies:
typescript: 4.9.5
client/shared:
specifiers:
'@reduxjs/toolkit': ^1.7.1
@ -15395,6 +15404,16 @@ packages:
- debug
dev: false
/axios/1.3.2:
resolution: {integrity: sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw==}
dependencies:
follow-redirects: 1.15.2
form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
dev: false
/b-tween/0.3.3:
resolution: {integrity: sha512-oEHegcRpA7fAuc9KC4nktucuZn2aS8htymCPcP3qkEGPqiBH+GfqtqoG2l7LxHngg6O0HFM7hOeOYExl1Oz4ZA==}
dev: false
@ -37616,6 +37635,12 @@ packages:
engines: {node: '>=4.2.0'}
hasBin: true
/typescript/4.9.5:
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
/ua-parser-js/0.7.31:
resolution: {integrity: sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==}
dev: false

Loading…
Cancel
Save