@sleekify/sleekify-fastify 1.2.2 → 1.2.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.
Files changed (2) hide show
  1. package/README.md +19 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -24,6 +24,22 @@ Your API documentation will both match the OpenAPI specification's schema and be
24
24
  2. Create REST resources using the provided decorators
25
25
  <br/><sub>_src/v1/users.ts_</sub>
26
26
  ```TypeScript
27
+ import { type FastifyReply, type FastifyRequest } from 'fastify';
28
+ import { DELETE, GET, Path, POST, PUT, Schema } from '@sleekify/sleekify';
29
+
30
+ @Path('/v1/users')
31
+ export class UsersResource {
32
+ @POST()
33
+ async createOne (request: FastifyRequest, reply: FastifyReply) {
34
+ // TODO: your create user code here
35
+ }
36
+
37
+ @GET()
38
+ async getMany (request: FastifyRequest, reply: FastifyReply) {
39
+ // TODO: your query users code here
40
+ }
41
+ }
42
+
27
43
  @Path({
28
44
  path: '/v1/users/{id}',
29
45
  parameters: [
@@ -37,17 +53,17 @@ Your API documentation will both match the OpenAPI specification's schema and be
37
53
  })
38
54
  export class UsersIdResource {
39
55
  @GET()
40
- async getOne () {
56
+ async getOne (request: FastifyRequest, reply: FastifyReply) {
41
57
  // TODO: your read user code here
42
58
  }
43
59
 
44
60
  @PUT()
45
- async updateOne () {
61
+ async updateOne (request: FastifyRequest, reply: FastifyReply) {
46
62
  // TODO: your update user code here
47
63
  }
48
64
 
49
65
  @DELETE()
50
- async deleteOne () {
66
+ async deleteOne (request: FastifyRequest, reply: FastifyReply) {
51
67
  // TODO: your delete user code here
52
68
  }
53
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleekify/sleekify-fastify",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "A TypeScript decorator driven approach for developing Fastify web applications.",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -51,7 +51,7 @@
51
51
  "typescript": "^5.1.6"
52
52
  },
53
53
  "dependencies": {
54
- "@sleekify/sleekify": "^1.2.2",
54
+ "@sleekify/sleekify": "^1.2.4",
55
55
  "@types/node": "^20.4.5",
56
56
  "fastify": "^5.0.0",
57
57
  "fastify-openapi-glue": "^4.7.1",