@kedaruma/revlm-client 1.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.
Files changed (2) hide show
  1. package/README.md +31 -0
  2. package/package.json +42 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @kedaruma/revlm-client
2
+
3
+ English documentation | [日本語ドキュメントはこちら](README-ja.md)
4
+
5
+ TypeScript/JavaScript SDK for apps migrating from MongoDB Realm to the self-hosted Revlm server. It exposes helpers to authenticate users, call `/revlm-gate`, and manage collections.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm add @kedaruma/revlm-client
11
+ ```
12
+
13
+ The package ships both CJS and ESM bundles plus typings (`types` and `exports` are configured).
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { Revlm } from '@kedaruma/revlm-client';
19
+
20
+ const revlm = new Revlm({ baseUrl: 'https://your-server.example.com' });
21
+ const login = await revlm.login({ authId: 'user', password: 'secret' });
22
+ const db = revlm.db('db_name');
23
+ const coll = db.collection<any>('collection_name');
24
+ const all = await coll.find({});
25
+ ```
26
+
27
+ ## Scripts
28
+
29
+ - `pnpm run build` – bundle with `tsup`
30
+ - `pnpm test` – run Jest suites (server package must be running in test mode)
31
+ - `pnpm run clean` – remove build artifacts and `node_modules`
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@kedaruma/revlm-client",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "description": "TypeScript client SDK for talking to the Revlm server replacement for MongoDB Realm.",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.mts",
13
+ "default": "./dist/index.mjs"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
19
+ }
20
+ },
21
+ "sideEffects": false,
22
+ "files": [
23
+ "dist/"
24
+ ],
25
+ "license": "ISC",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "bson": "^6.10.4",
31
+ "dotenv": "^17.2.3",
32
+ "@kedaruma/revlm-shared": "1.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "tsup": "^8.5.1"
36
+ },
37
+ "scripts": {
38
+ "build": "tsup src/index.ts --format cjs,esm --dts",
39
+ "clean": "rm -rf dist node_modules kedaruma-revlm-client-*.tgz",
40
+ "test": "pnpm exec jest --config ../../jest.config.cjs packages/revlm-client/src/__tests__/ --runInBand --watchman=false --verbose"
41
+ }
42
+ }