@arkyn/server 2.0.1-beta.14 → 2.0.1-beta.16

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 +68 -54
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,102 +1,116 @@
1
- # @arkyn/shared
1
+ The `@arkyn/server` package provides utilities and services to streamline backend application development. It includes API configurations, HTTP error handlers, and various services for file manipulation.
2
2
 
3
- The `@arkyn/server` package provides utilities and services to facilitate backend application development. It includes API configurations, HTTP error handlers, and useful services for file manipulation.
3
+ ---
4
4
 
5
5
  ## Installation
6
6
 
7
+ Install the package using npm:
8
+
7
9
  ```bash
8
10
  npm install @arkyn/server
9
11
  ```
10
12
 
13
+ ---
14
+
11
15
  ## Features
12
16
 
13
17
  ### Settings
14
18
 
15
- `ApiInstance`
16
- Instance configured for API calls.
19
+ - **`ApiInstance`**
20
+ Pre-configured instance for API calls.
17
21
 
18
- `InboxFlowInstanceØ`
19
- Instance configured for integration with Inbox Flow.
22
+ - **`InboxFlowInstance`**
23
+ Pre-configured instance for integration with Inbox Flow.
24
+
25
+ ---
20
26
 
21
27
  ### HTTP Responses - Errors
22
28
 
23
- `BadGateway(message: string): Error`
24
- Represents an HTTP 502 error.
29
+ - **`BadGateway(message: string): Error`**
30
+ Represents an HTTP 502 error.
31
+
32
+ - **`BadRequest(message: string): Error`**
33
+ Represents an HTTP 400 error.
25
34
 
26
- `BadRequest(message: string): Error`
27
- Represents an HTTP 400 error.
35
+ - **`Conflict(message: string): Error`**
36
+ Represents an HTTP 409 error.
28
37
 
29
- `Conflict(message: string): Error`
30
- Represents an HTTP 409 error.
38
+ - **`Forbidden(message: string): Error`**
39
+ Represents an HTTP 403 error.
31
40
 
32
- `Forbidden(message: string): Error`
33
- Represents an HTTP 403 error.
41
+ - **`NotFound(message: string): Error`**
42
+ Represents an HTTP 404 error.
34
43
 
35
- `NotFound(message: string): Error`
36
- Represents an HTTP 404 error.
44
+ - **`NotImplemented(message: string): Error`**
45
+ Represents an HTTP 501 error.
37
46
 
38
- `NotImplemented(message: string): Error`
39
- Represents an HTTP 501 error.
47
+ - **`ServerError(message: string): Error`**
48
+ Represents an HTTP 500 error.
40
49
 
41
- `ServerError(message: string): Error`
42
- Represents an HTTP 500 error.
50
+ - **`Unauthorized(message: string): Error`**
51
+ Represents an HTTP 401 error.
43
52
 
44
- `Unauthorized(message: string): Error`
45
- Represents an HTTP 401 error.
53
+ - **`UnprocessableEntity(message: string): Error`**
54
+ Represents an HTTP 422 error.
46
55
 
47
- `UnprocessableEntity(message: string): Error`
48
- Represents an HTTP 422 error.
56
+ ---
49
57
 
50
58
  ### HTTP Responses - Success
51
59
 
52
- `Created(data: any): Response`
53
- Represents an HTTP 201 response.
60
+ - **`Created(data: any): Response`**
61
+ Represents an HTTP 201 response.
54
62
 
55
- `Found(data: any): Response`
56
- Represents an HTTP 302 response.
63
+ - **`Found(data: any): Response`**
64
+ Represents an HTTP 302 response.
57
65
 
58
- `NoContent(): Response`
59
- Represents an HTTP 204 response.
66
+ - **`NoContent(): Response`**
67
+ Represents an HTTP 204 response.
60
68
 
61
- `Success(data: any): Response`
62
- Represents an HTTP 200 response.
69
+ - **`Success(data: any): Response`**
70
+ Represents an HTTP 200 response.
63
71
 
64
- `Updated(data: any): Response`
65
- Represents an HTTP 200 response for updates.
72
+ - **`Updated(data: any): Response`**
73
+ Represents an HTTP 200 response for updates.
74
+
75
+ ---
66
76
 
67
77
  ### Services
68
78
 
69
- `decodeErrorMessageFromRequest(request: Request): string`
70
- Decodes error messages from a request.
79
+ - **`decodeErrorMessageFromRequest(request: Request): string`**
80
+ Decodes error messages from a request.
81
+
82
+ - **`decodeRequestBody(request: Request): any`**
83
+ Decodes the body of a request.
71
84
 
72
- `decodeRequestBody(request: Request): any`
73
- Decodes the body of a request.
85
+ - **`errorHandler(error: Error): Response`**
86
+ Handles errors and returns an appropriate response.
74
87
 
75
- `errorHandler(error: Error): Response`
76
- Handles errors and returns an appropriate response.
88
+ - **`formParse(request: Request): FormData`**
89
+ Parses form data.
77
90
 
78
- `formParse(request: Request): FormData`
79
- Parses form data.
91
+ - **`getCaller(): string`**
92
+ Returns the name of the function that invoked the method.
80
93
 
81
- `getCaller(): string`
82
- Returns the name of the function that called the method.
94
+ - **`getScopedParams(request: Request): URLSearchParams`**
95
+ Retrieves scoped parameters from a request.
83
96
 
84
- `getScopedParams(request: Request): URLSearchParams`
85
- Returns the scope parameters of a request.
97
+ - **`httpDebug(request: Request): void`**
98
+ Displays debug information for an HTTP request.
86
99
 
87
- `httpDebug(request: Request): void`
88
- Displays debug information for an HTTP request.
100
+ - **`SchemaValidator(schema: any, data: any): boolean`**
101
+ Validates data against a schema.
89
102
 
90
- `SchemaValidator(schema: any, data: any): boolean`
91
- Validates data against a schema.
103
+ - **`sendFileToS3(file: File, config: AwsConfig): Promise<{ url: string }>`**
104
+ Uploads a file to AWS S3.
92
105
 
93
- `sendFileToS3(file: File, config: AwsConfig): Promise<{ url: string }>`
94
- Uploads a file to AWS S3.
106
+ ---
95
107
 
96
108
  ## Contribution
97
109
 
98
- Contributions are welcome! Feel free to open issues or submit pull requests.
110
+ Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.
111
+
112
+ ---
99
113
 
100
114
  ## License
101
115
 
102
- MIT
116
+ This project is licensed under the MIT License. See the `LICENSE` file for more details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/server",
3
- "version": "2.0.1-beta.14",
3
+ "version": "2.0.1-beta.16",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./src/index.ts",
6
6
  "type": "module",