@uvrn/api 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +54 -0
  2. package/package.json +8 -2
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @uvrn/api
2
+
3
+ UVRN REST API — HTTP server for Delta Engine bundle processing. Exposes run, validate, and verify over HTTP so any client (browser, script, or service) can call the engine without installing the core or SDK.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @uvrn/api
9
+ ```
10
+
11
+ Or with pnpm:
12
+
13
+ ```bash
14
+ pnpm add @uvrn/api
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ 1. **Start the server** (default port 3000):
20
+
21
+ ```bash
22
+ npx @uvrn/api
23
+ ```
24
+
25
+ Or from your app:
26
+
27
+ ```typescript
28
+ import { startServer, createServer } from '@uvrn/api';
29
+
30
+ const server = await createServer();
31
+ await startServer(server);
32
+ ```
33
+
34
+ 2. **Send a bundle** (e.g. POST to `/delta/run`) and get a receipt in the response. Use `/delta/validate` and `/delta/verify` for validation and verification.
35
+
36
+ Example with curl:
37
+
38
+ ```bash
39
+ curl -X POST http://localhost:3000/delta/run \
40
+ -H "Content-Type: application/json" \
41
+ -d '{"bundleId":"example-001","claim":"Compare sources","thresholdPct":0.1,"dataSpecs":[...]}'
42
+ ```
43
+
44
+ ## Use cases
45
+
46
+ - **Expose the engine over HTTP** — Let frontends, scripts, or other services run the Delta Engine without a local Node dependency.
47
+ - **Centralized verification service** — Run one API instance and have many clients submit bundles and get receipts.
48
+ - **CI or automation** — Call the API from pipelines to run comparisons and verify receipts.
49
+
50
+ ## Links
51
+
52
+ - [Repository](https://github.com/UVRN-org/uvrn-packages) — monorepo (this package: `uvrn-api`)
53
+ - [@uvrn/core](https://www.npmjs.com/package/@uvrn/core) — Delta Engine core used by this server
54
+ - [@uvrn/cli](https://www.npmjs.com/package/@uvrn/cli) — run the engine from the command line instead of HTTP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uvrn/api",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "UVRN REST API — HTTP access to bundle processing",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,12 +11,18 @@
11
11
  "protocol"
12
12
  ],
13
13
  "license": "MIT",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/UVRN-org/uvrn-packages.git",
17
+ "directory": "uvrn-api"
18
+ },
19
+ "homepage": "https://github.com/UVRN-org/uvrn-packages#readme",
14
20
  "dependencies": {
15
21
  "fastify": "^4.25.0",
16
22
  "@fastify/cors": "^8.5.0",
17
23
  "@fastify/rate-limit": "^9.1.0",
18
24
  "@fastify/helmet": "^11.1.0",
19
- "@uvrn/core": "1.0.0"
25
+ "@uvrn/core": "1.0.1"
20
26
  },
21
27
  "devDependencies": {
22
28
  "@types/node": "^20.0.0",