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

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