@objectstack/rest 3.0.3 → 3.0.5

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/rest@3.0.3 build /home/runner/work/spec/spec/packages/rest
2
+ > @objectstack/rest@3.0.5 build /home/runner/work/spec/spec/packages/rest
3
3
  > tsup --config ../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -12,11 +12,11 @@
12
12
  CJS Build start
13
13
  ESM dist/index.js 20.84 KB
14
14
  ESM dist/index.js.map 50.45 KB
15
- ESM ⚡️ Build success in 61ms
15
+ ESM ⚡️ Build success in 63ms
16
16
  CJS dist/index.cjs 21.98 KB
17
17
  CJS dist/index.cjs.map 50.95 KB
18
- CJS ⚡️ Build success in 64ms
18
+ CJS ⚡️ Build success in 68ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 9148ms
20
+ DTS ⚡️ Build success in 9458ms
21
21
  DTS dist/index.d.ts 6.42 KB
22
22
  DTS dist/index.d.cts 6.42 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @objectstack/rest
2
2
 
3
+ ## 3.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [23a4a68]
8
+ - @objectstack/spec@3.0.5
9
+ - @objectstack/core@3.0.5
10
+
11
+ ## 3.0.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [d738987]
16
+ - @objectstack/spec@3.0.4
17
+ - @objectstack/core@3.0.4
18
+
3
19
  ## 3.0.3
4
20
 
5
21
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @objectstack/rest
2
+
3
+ ObjectStack REST API Server — automatic REST endpoint generation from protocol metadata. Turns your ObjectStack schema definitions into fully functional CRUD endpoints with zero boilerplate.
4
+
5
+ ## Features
6
+
7
+ - **Auto-Generated Endpoints**: CRUD routes (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) from object schemas.
8
+ - **Batch Operations**: `/createMany`, `/updateMany`, `/deleteMany`, `/batch` endpoints.
9
+ - **Metadata API**: `/meta`, `/meta/{type}`, `/meta/{type}/{name}` for runtime introspection.
10
+ - **Discovery Endpoint**: `/api/v1` for API self-documentation.
11
+ - **Route Manager**: Centralized route registration, grouping, and middleware chain.
12
+ - **HTTP Caching**: ETag and Last-Modified header support.
13
+ - **Configurable Paths**: Plural, kebab-case, and camelCase path transformations.
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import { createRestApiPlugin } from '@objectstack/rest';
19
+
20
+ const restPlugin = createRestApiPlugin({
21
+ api: {
22
+ version: 'v1',
23
+ basePath: '/api',
24
+ },
25
+ });
26
+
27
+ // Register with ObjectKernel
28
+ kernel.use(restPlugin);
29
+ ```
30
+
31
+ ### Standalone RestServer
32
+
33
+ ```typescript
34
+ import { RestServer } from '@objectstack/rest';
35
+
36
+ const server = new RestServer(protocol, config);
37
+ server.registerRoutes(httpServer);
38
+ ```
39
+
40
+ ### Route Manager
41
+
42
+ ```typescript
43
+ import { RouteManager } from '@objectstack/rest';
44
+
45
+ const routes = new RouteManager();
46
+ routes.register({ method: 'GET', path: '/custom', handler });
47
+ ```
48
+
49
+ ## License
50
+
51
+ Apache-2.0 © ObjectStack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/rest",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "ObjectStack REST API Server - automatic REST endpoint generation from protocol",
6
6
  "type": "module",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "zod": "^4.3.6",
18
- "@objectstack/core": "3.0.3",
19
- "@objectstack/spec": "3.0.3"
18
+ "@objectstack/spec": "3.0.5",
19
+ "@objectstack/core": "3.0.5"
20
20
  },
21
21
  "devDependencies": {
22
22
  "typescript": "^5.0.0",