rynkai 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -146,36 +146,23 @@ const bot = new Client({
146
146
 
147
147
  Kalau user kelebihan limit, bot otomatis reply pemberitahuan dan command tidak diteruskan ke middleware/plugin.
148
148
 
149
- ## Session store custom (misal MongoDB)
149
+ ## Session store custom
150
150
 
151
- Sudah disediakan `MongoSessionStore` built-in cocok kalau stack-mu (kayak rynk4) sudah pakai MongoDB/Mongoose:
152
-
153
- ```bash
154
- npm install mongoose
155
- ```
156
-
157
- ```ts
158
- import mongoose from 'mongoose';
159
- import { Client, MongoSessionStore } from 'rynkai';
160
-
161
- await mongoose.connect(process.env.MONGO_URI!); // buka koneksi dulu sebelum connect()
162
-
163
- const bot = new Client({
164
- sessionName: 'my-bot',
165
- sessionStore: new MongoSessionStore('my-bot'),
166
- });
167
- ```
168
-
169
- Kalau butuh store lain (Redis, dll), tinggal implement interface `SessionStore` yang sama:
151
+ Default-nya pakai `FileSessionStore` (simpan sesi sebagai file di disk). Kalau butuh store lain (MongoDB, Redis, dll), tinggal implement interface `SessionStore`:
170
152
 
171
153
  ```ts
172
154
  import type { SessionStore } from 'rynkai';
173
155
 
174
- class RedisSessionStore implements SessionStore {
156
+ class MySessionStore implements SessionStore {
175
157
  async load() { /* ... */ }
176
158
  async save(state) { /* ... */ }
177
159
  async clear() { /* ... */ }
178
160
  }
161
+
162
+ const bot = new Client({
163
+ sessionName: 'my-bot',
164
+ sessionStore: new MySessionStore(),
165
+ });
179
166
  ```
180
167
 
181
168
  ## Pairing code (tanpa QR)
@@ -199,7 +186,6 @@ Masih tahap awal (0.1.0). Yang sudah ada:
199
186
  - [x] MessageBuilder helper
200
187
  - [x] Middleware/hooks sebelum plugin dieksekusi
201
188
  - [x] Rate limiter global (terpisah dari cooldown per-plugin)
202
- - [x] Built-in MongoSessionStore
203
189
  - [x] Media downloader helper (`client.downloadMedia()`)
204
190
  - [x] Message send queue dengan throttle (anti rate-limit WA)
205
191
  - [x] Presence helper (`sendTyping`, `sendPresence`)
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { Client } from './core/Client';
2
2
  export { FileSessionStore } from './session/FileSessionStore';
3
- export { MongoSessionStore } from './session/MongoSessionStore';
4
3
  export { MessageBuilder } from './message/MessageBuilder';
5
4
  export { PluginLoader } from './plugin/PluginLoader';
6
5
  export { RateLimiter } from './core/RateLimiter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,MAAM,EACN,aAAa,EACb,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,MAAM,EACN,aAAa,EACb,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadMedia = exports.SendQueue = exports.compose = exports.RateLimiter = exports.PluginLoader = exports.MessageBuilder = exports.MongoSessionStore = exports.FileSessionStore = exports.Client = void 0;
3
+ exports.downloadMedia = exports.SendQueue = exports.compose = exports.RateLimiter = exports.PluginLoader = exports.MessageBuilder = exports.FileSessionStore = exports.Client = void 0;
4
4
  var Client_1 = require("./core/Client");
5
5
  Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
6
6
  var FileSessionStore_1 = require("./session/FileSessionStore");
7
7
  Object.defineProperty(exports, "FileSessionStore", { enumerable: true, get: function () { return FileSessionStore_1.FileSessionStore; } });
8
- var MongoSessionStore_1 = require("./session/MongoSessionStore");
9
- Object.defineProperty(exports, "MongoSessionStore", { enumerable: true, get: function () { return MongoSessionStore_1.MongoSessionStore; } });
10
8
  var MessageBuilder_1 = require("./message/MessageBuilder");
11
9
  Object.defineProperty(exports, "MessageBuilder", { enumerable: true, get: function () { return MessageBuilder_1.MessageBuilder; } });
12
10
  var PluginLoader_1 = require("./plugin/PluginLoader");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wCAAuC;AAA9B,gGAAA,MAAM,OAAA;AACf,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AACzB,iEAAgE;AAAvD,sHAAA,iBAAiB,OAAA;AAC1B,2DAA0D;AAAjD,gHAAA,cAAc,OAAA;AACvB,sDAAqD;AAA5C,4GAAA,YAAY,OAAA;AACrB,kDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,gDAA4C;AAAnC,qGAAA,OAAO,OAAA;AAChB,8CAA6C;AAApC,sGAAA,SAAS,OAAA;AAClB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wCAAuC;AAA9B,gGAAA,MAAM,OAAA;AACf,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AACzB,2DAA0D;AAAjD,gHAAA,cAAc,OAAA;AACvB,sDAAqD;AAA5C,4GAAA,YAAY,OAAA;AACrB,kDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,gDAA4C;AAAnC,qGAAA,OAAO,OAAA;AAChB,8CAA6C;AAApC,sGAAA,SAAS,OAAA;AAClB,uDAAsD;AAA7C,8GAAA,aAAa,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rynkai",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Clean, typed wrapper around Baileys with built-in plugin system and pluggable session store — for building WhatsApp bots fast.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,22 +33,17 @@
33
33
  "pino": "^9.4.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "qrcode-terminal": "^0.12.0",
37
- "mongoose": "^8.0.0"
36
+ "qrcode-terminal": "^0.12.0"
38
37
  },
39
38
  "peerDependenciesMeta": {
40
39
  "qrcode-terminal": {
41
40
  "optional": true
42
- },
43
- "mongoose": {
44
- "optional": true
45
41
  }
46
42
  },
47
43
  "devDependencies": {
48
44
  "typescript": "^5.5.4",
49
45
  "ts-node-dev": "^2.0.0",
50
- "@types/node": "^20.14.0",
51
- "mongoose": "^8.0.0"
46
+ "@types/node": "^20.14.0"
52
47
  },
53
48
  "files": [
54
49
  "dist"