@objectstack/rest 3.0.2 → 3.0.4
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +17 -0
- package/README.md +51 -0
- package/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/rest@3.0.
|
|
2
|
+
> @objectstack/rest@3.0.4 build /home/runner/work/spec/spec/packages/rest
|
|
3
3
|
> tsup --config ../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m21.98 KB[39m
|
|
14
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m50.95 KB[39m
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in 54ms
|
|
16
13
|
[32mESM[39m [1mdist/index.js [22m[32m20.84 KB[39m
|
|
17
14
|
[32mESM[39m [1mdist/index.js.map [22m[32m50.45 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 91ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m21.98 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m50.95 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 91ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 9375ms
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m6.42 KB[39m
|
|
22
22
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m6.42 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @objectstack/rest
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [d738987]
|
|
8
|
+
- @objectstack/spec@3.0.4
|
|
9
|
+
- @objectstack/core@3.0.4
|
|
10
|
+
|
|
11
|
+
## 3.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- c7267f6: Patch release for maintenance updates and improvements.
|
|
16
|
+
- Updated dependencies [c7267f6]
|
|
17
|
+
- @objectstack/spec@3.0.3
|
|
18
|
+
- @objectstack/core@3.0.3
|
|
19
|
+
|
|
3
20
|
## 3.0.2
|
|
4
21
|
|
|
5
22
|
### 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
|
+
"version": "3.0.4",
|
|
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.
|
|
19
|
-
"@objectstack/spec": "3.0.
|
|
18
|
+
"@objectstack/core": "3.0.4",
|
|
19
|
+
"@objectstack/spec": "3.0.4"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "^5.0.0",
|