chat-adapter-line 0.0.0
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/LICENSE +21 -0
- package/README.md +52 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Noppakorn Kaewsalabnil
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Chat SDK LINE Adapter
|
|
2
|
+
|
|
3
|
+
[LINE Messaging API](https://developers.line.biz/en/docs/messaging-api/) adapter for [Chat SDK](https://chat-sdk.dev/) — send and receive messages from your bot.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install chat-adapter-line
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Chat } from "chat";
|
|
15
|
+
import { createLineAdapter } from "chat-adapter-line";
|
|
16
|
+
|
|
17
|
+
const bot = new Chat({
|
|
18
|
+
userName: "mybot",
|
|
19
|
+
adapters: {
|
|
20
|
+
line: createLineAdapter(),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
bot.onNewMention(async (thread) => {
|
|
25
|
+
await thread.subscribe();
|
|
26
|
+
await thread.post("Hello! I'm listening to this thread.");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
bot.onSubscribedMessage(async (thread, message) => {
|
|
30
|
+
await thread.post(`You said: ${message.text}`);
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
the factory reads credentials from the environment variables by default.
|
|
35
|
+
|
|
36
|
+
| Environment Variable | Required | Description |
|
|
37
|
+
| --------------------------- | -------- | -------------------------------------- |
|
|
38
|
+
| `LINE_CHANNEL_ACCESS_TOKEN` | Yes | The access token for the LINE channel. |
|
|
39
|
+
| `LINE_CHANNEL_SECRET` | Yes | The secret for the LINE channel. |
|
|
40
|
+
|
|
41
|
+
or pass them as options to the factory:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const adapter = createLineAdapter({
|
|
45
|
+
channelAccessToken: "eyJhbG...",
|
|
46
|
+
channelSecret: "abc123...",
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
[MIT](./LICENSE)
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chat-adapter-line",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "LINE Messaging API adapter for Chat SDK",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"adapter",
|
|
7
|
+
"bot",
|
|
8
|
+
"chat",
|
|
9
|
+
"chat-adapter",
|
|
10
|
+
"chat-sdk",
|
|
11
|
+
"line",
|
|
12
|
+
"messaging"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/PunGrumpy/chat-adapter-line",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/PunGrumpy/chat-adapter-line/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/PunGrumpy/chat-adapter-line.git"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "vp pack --watch",
|
|
42
|
+
"build": "vp pack",
|
|
43
|
+
"test": "vp test",
|
|
44
|
+
"lint": "ultracite check",
|
|
45
|
+
"format": "ultracite fix",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"changeset": "changeset",
|
|
48
|
+
"changeset:version": "changeset version",
|
|
49
|
+
"changeset:publish": "vp pack && changeset publish"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@changesets/cli": "^2.30.0",
|
|
53
|
+
"@chat-adapter/shared": "^4.23.0",
|
|
54
|
+
"@line/bot-sdk": "^11.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^25.5.2",
|
|
58
|
+
"chat": "^4.23.0",
|
|
59
|
+
"oxfmt": "^0.43.0",
|
|
60
|
+
"oxlint": "^1.58.0",
|
|
61
|
+
"typescript": "~5.9.3",
|
|
62
|
+
"ultracite": "7.4.3",
|
|
63
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
64
|
+
"vite-plus": "latest"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"chat": ">=4.0.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"chat": {
|
|
71
|
+
"optional": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
76
|
+
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "bun@1.3.11"
|
|
79
|
+
}
|