@cedx/base 0.6.0 → 0.7.0

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 (125) hide show
  1. package/ReadMe.md +1 -1
  2. package/lib/Data/Pagination.d.ts +30 -13
  3. package/lib/Data/Pagination.d.ts.map +1 -1
  4. package/lib/Data/Pagination.js +39 -12
  5. package/lib/Data/Sort.d.ts +25 -23
  6. package/lib/Data/Sort.d.ts.map +1 -1
  7. package/lib/Data/Sort.js +37 -33
  8. package/lib/{Date.d.ts → DateExtensions.d.ts} +1 -1
  9. package/lib/DateExtensions.d.ts.map +1 -0
  10. package/lib/{Html/File.d.ts → FileExtensions.d.ts} +4 -11
  11. package/lib/FileExtensions.d.ts.map +1 -0
  12. package/lib/{Html/File.js → FileExtensions.js} +3 -12
  13. package/lib/{Http → Net/Http}/HttpClient.d.ts +17 -2
  14. package/lib/Net/Http/HttpClient.d.ts.map +1 -0
  15. package/lib/{Http → Net/Http}/HttpClient.js +17 -15
  16. package/lib/Net/Http/HttpMethod.d.ts +46 -0
  17. package/lib/Net/Http/HttpMethod.d.ts.map +1 -0
  18. package/lib/Net/Http/HttpMethod.js +41 -0
  19. package/lib/Net/Http/HttpRequestError.d.ts +33 -0
  20. package/lib/Net/Http/HttpRequestError.d.ts.map +1 -0
  21. package/lib/{Http/HttpError.js → Net/Http/HttpRequestError.js} +16 -16
  22. package/lib/Net/Http/StatusCode.d.ts +122 -0
  23. package/lib/Net/Http/StatusCode.d.ts.map +1 -0
  24. package/lib/Net/Http/StatusCode.js +117 -0
  25. package/lib/Net/Mime/DispositionType.d.ts +18 -0
  26. package/lib/Net/Mime/DispositionType.d.ts.map +1 -0
  27. package/lib/Net/Mime/DispositionType.js +13 -0
  28. package/lib/Net/Mime/MediaType.d.ts +151 -0
  29. package/lib/Net/Mime/MediaType.d.ts.map +1 -0
  30. package/lib/Net/Mime/MediaType.js +150 -0
  31. package/lib/{Number.d.ts → NumberExtensions.d.ts} +1 -1
  32. package/lib/NumberExtensions.d.ts.map +1 -0
  33. package/lib/{String.d.ts → StringExtensions.d.ts} +1 -1
  34. package/lib/StringExtensions.d.ts.map +1 -0
  35. package/lib/{Html → UI}/AppTheme.d.ts +3 -3
  36. package/lib/UI/AppTheme.d.ts.map +1 -0
  37. package/lib/{Html → UI}/AppTheme.js +3 -3
  38. package/lib/UI/{Component.d.ts → Components/ComponentBase.d.ts} +5 -5
  39. package/lib/UI/Components/ComponentBase.d.ts.map +1 -0
  40. package/lib/UI/Components/ComponentBase.js +29 -0
  41. package/lib/UI/{LoadingIndicator.d.ts → Components/LoadingIndicator.d.ts} +1 -2
  42. package/lib/UI/Components/LoadingIndicator.d.ts.map +1 -0
  43. package/lib/UI/Components/MenuActivator.d.ts.map +1 -0
  44. package/lib/UI/Components/OfflineIndicator.d.ts.map +1 -0
  45. package/lib/UI/Components/ThemeDropdown.d.ts +67 -0
  46. package/lib/UI/Components/ThemeDropdown.d.ts.map +1 -0
  47. package/lib/UI/Components/ThemeDropdown.js +140 -0
  48. package/lib/UI/Context.d.ts.map +1 -0
  49. package/lib/UI/MenuAlignment.d.ts +18 -0
  50. package/lib/UI/MenuAlignment.d.ts.map +1 -0
  51. package/lib/UI/MenuAlignment.js +13 -0
  52. package/lib/{Html → UI}/ViewportScroller.d.ts +1 -1
  53. package/lib/UI/ViewportScroller.d.ts.map +1 -0
  54. package/lib/{Html → UI}/ViewportScroller.js +6 -6
  55. package/package.json +5 -7
  56. package/src/Client/Data/Pagination.ts +59 -13
  57. package/src/Client/Data/Sort.ts +40 -35
  58. package/src/Client/Data/tsconfig.json +1 -1
  59. package/src/Client/{Html/File.ts → FileExtensions.ts} +3 -13
  60. package/src/Client/{Http → Net/Http}/HttpClient.ts +32 -14
  61. package/src/Client/Net/Http/HttpMethod.ts +55 -0
  62. package/src/Client/{Http/HttpError.ts → Net/Http/HttpRequestError.ts} +17 -17
  63. package/src/Client/Net/Http/StatusCode.ts +150 -0
  64. package/src/Client/Net/Mime/DispositionType.ts +20 -0
  65. package/src/Client/Net/Mime/MediaType.ts +185 -0
  66. package/src/Client/{Abstractions → Net}/tsconfig.json +3 -3
  67. package/src/Client/{Html → UI}/AppTheme.ts +3 -3
  68. package/src/Client/UI/Components/ComponentBase.ts +34 -0
  69. package/src/Client/UI/{LoadingIndicator.ts → Components/LoadingIndicator.ts} +1 -3
  70. package/src/Client/UI/Components/ThemeDropdown.ts +163 -0
  71. package/src/Client/UI/MenuAlignment.ts +20 -0
  72. package/src/Client/{Html → UI}/ViewportScroller.ts +6 -6
  73. package/src/Client/UI/tsconfig.json +2 -3
  74. package/src/Client/tsconfig.json +1 -4
  75. package/lib/Abstractions/ILoadingIndicator.d.ts +0 -17
  76. package/lib/Abstractions/ILoadingIndicator.d.ts.map +0 -1
  77. package/lib/Abstractions/ILoadingIndicator.js +0 -1
  78. package/lib/Date.d.ts.map +0 -1
  79. package/lib/DependencyInjection/Container.d.ts +0 -43
  80. package/lib/DependencyInjection/Container.d.ts.map +0 -1
  81. package/lib/DependencyInjection/Container.js +0 -65
  82. package/lib/Html/AppTheme.d.ts.map +0 -1
  83. package/lib/Html/Context.d.ts.map +0 -1
  84. package/lib/Html/File.d.ts.map +0 -1
  85. package/lib/Html/ViewportScroller.d.ts.map +0 -1
  86. package/lib/Http/HttpClient.d.ts.map +0 -1
  87. package/lib/Http/HttpError.d.ts +0 -33
  88. package/lib/Http/HttpError.d.ts.map +0 -1
  89. package/lib/Http/StatusCodes.d.ts +0 -114
  90. package/lib/Http/StatusCodes.d.ts.map +0 -1
  91. package/lib/Http/StatusCodes.js +0 -109
  92. package/lib/Number.d.ts.map +0 -1
  93. package/lib/String.d.ts.map +0 -1
  94. package/lib/UI/Component.d.ts.map +0 -1
  95. package/lib/UI/Component.js +0 -29
  96. package/lib/UI/LoadingIndicator.d.ts.map +0 -1
  97. package/lib/UI/MenuActivator.d.ts.map +0 -1
  98. package/lib/UI/OfflineIndicator.d.ts.map +0 -1
  99. package/lib/UI/ThemeDropdown.d.ts +0 -40
  100. package/lib/UI/ThemeDropdown.d.ts.map +0 -1
  101. package/lib/UI/ThemeDropdown.js +0 -80
  102. package/src/Client/Abstractions/ILoadingIndicator.ts +0 -16
  103. package/src/Client/DependencyInjection/Container.ts +0 -75
  104. package/src/Client/DependencyInjection/tsconfig.json +0 -13
  105. package/src/Client/Html/tsconfig.json +0 -16
  106. package/src/Client/Http/StatusCodes.ts +0 -140
  107. package/src/Client/Http/tsconfig.json +0 -16
  108. package/src/Client/UI/Component.ts +0 -34
  109. package/src/Client/UI/ThemeDropdown.ts +0 -104
  110. /package/lib/{Date.js → DateExtensions.js} +0 -0
  111. /package/lib/{Number.js → NumberExtensions.js} +0 -0
  112. /package/lib/{String.js → StringExtensions.js} +0 -0
  113. /package/lib/UI/{LoadingIndicator.js → Components/LoadingIndicator.js} +0 -0
  114. /package/lib/UI/{MenuActivator.d.ts → Components/MenuActivator.d.ts} +0 -0
  115. /package/lib/UI/{MenuActivator.js → Components/MenuActivator.js} +0 -0
  116. /package/lib/UI/{OfflineIndicator.d.ts → Components/OfflineIndicator.d.ts} +0 -0
  117. /package/lib/UI/{OfflineIndicator.js → Components/OfflineIndicator.js} +0 -0
  118. /package/lib/{Html → UI}/Context.d.ts +0 -0
  119. /package/lib/{Html → UI}/Context.js +0 -0
  120. /package/src/Client/{Date.ts → DateExtensions.ts} +0 -0
  121. /package/src/Client/{Number.ts → NumberExtensions.ts} +0 -0
  122. /package/src/Client/{String.ts → StringExtensions.ts} +0 -0
  123. /package/src/Client/UI/{MenuActivator.ts → Components/MenuActivator.ts} +0 -0
  124. /package/src/Client/UI/{OfflineIndicator.ts → Components/OfflineIndicator.ts} +0 -0
  125. /package/src/Client/{Html → UI}/Context.ts +0 -0
@@ -1,4 +1,6 @@
1
- import { HttpError } from "./HttpError.js";
1
+ import { MediaType } from "../Mime/MediaType.js";
2
+ import { HttpMethod } from "./HttpMethod.js";
3
+ import { HttpRequestError } from "./HttpRequestError.js";
2
4
  /**
3
5
  * Performs HTTP requests.
4
6
  */
@@ -6,7 +8,7 @@ export class HttpClient {
6
8
  /**
7
9
  * The base URL of the remote service.
8
10
  */
9
- baseUrl;
11
+ baseAddress;
10
12
  /**
11
13
  * The function returning the component used as loading indicator.
12
14
  */
@@ -17,8 +19,8 @@ export class HttpClient {
17
19
  */
18
20
  constructor(options = {}) {
19
21
  const url = options.baseUrl ? (options.baseUrl instanceof URL ? options.baseUrl.href : options.baseUrl) : document.baseURI;
20
- this.baseUrl = new URL(url.endsWith("/") ? url : `${url}/`);
21
- this.#loadingIndicator = options.loadingIndicator ?? (() => document.body.querySelector("loading-indicator"));
22
+ this.baseAddress = new URL(url.endsWith("/") ? url : `${url}/`);
23
+ this.#loadingIndicator = options.loadingIndicator ?? (() => document.body.querySelector("loading-indicator, .loading-indicator"));
22
24
  }
23
25
  /**
24
26
  * Performs a DELETE request.
@@ -27,7 +29,7 @@ export class HttpClient {
27
29
  * @returns The server response.
28
30
  */
29
31
  delete(url, options) {
30
- return this.#fetch("DELETE", url, null, options);
32
+ return this.#fetch(HttpMethod.Delete, url, null, options);
31
33
  }
32
34
  /**
33
35
  * Performs a GET request.
@@ -36,7 +38,7 @@ export class HttpClient {
36
38
  * @returns The server response.
37
39
  */
38
40
  get(url, options) {
39
- return this.#fetch("GET", url, null, options);
41
+ return this.#fetch(HttpMethod.Get, url, null, options);
40
42
  }
41
43
  /**
42
44
  * Performs a PATCH request.
@@ -46,7 +48,7 @@ export class HttpClient {
46
48
  * @returns The server response.
47
49
  */
48
50
  patch(url, body, options) {
49
- return this.#fetch("PATCH", url, body, options);
51
+ return this.#fetch(HttpMethod.Patch, url, body, options);
50
52
  }
51
53
  /**
52
54
  * Performs a POST request.
@@ -56,7 +58,7 @@ export class HttpClient {
56
58
  * @returns The server response.
57
59
  */
58
60
  post(url, body, options) {
59
- return this.#fetch("POST", url, body, options);
61
+ return this.#fetch(HttpMethod.Post, url, body, options);
60
62
  }
61
63
  /**
62
64
  * Performs a PUT request.
@@ -66,7 +68,7 @@ export class HttpClient {
66
68
  * @returns The server response.
67
69
  */
68
70
  put(url, body, options) {
69
- return this.#fetch("PUT", url, body, options);
71
+ return this.#fetch(HttpMethod.Put, url, body, options);
70
72
  }
71
73
  /**
72
74
  * Performs a custom HTTP request.
@@ -78,21 +80,21 @@ export class HttpClient {
78
80
  */
79
81
  async #fetch(method, url = "", body = null, options = {}) {
80
82
  const headers = new Headers(options.headers);
81
- if (!headers.has("accept"))
82
- headers.set("accept", "application/json");
83
+ if (!headers.has("Accept"))
84
+ headers.set("Accept", MediaType.Application.Json);
83
85
  if (body && !(body instanceof Blob || body instanceof FormData || body instanceof URLSearchParams)) {
84
86
  if (typeof body != "string")
85
87
  body = JSON.stringify(body);
86
- if (!headers.has("content-type"))
87
- headers.set("content-type", "application/json");
88
+ if (!headers.has("Content-Type"))
89
+ headers.set("Content-Type", MediaType.Application.Json);
88
90
  }
89
91
  const loadingIndicator = this.#loadingIndicator();
90
92
  try {
91
93
  loadingIndicator?.start();
92
- const request = new Request(new URL(url, this.baseUrl), { ...options, method, headers, body });
94
+ const request = new Request(new URL(url, this.baseAddress), { ...options, method, headers, body });
93
95
  const response = await fetch(request);
94
96
  if (!response.ok)
95
- throw new HttpError(response);
97
+ throw new HttpRequestError(response);
96
98
  return response;
97
99
  }
98
100
  finally {
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Provides HTTP methods.
3
+ */
4
+ export declare const HttpMethod: Readonly<{
5
+ /**
6
+ * The `CONNECT` HTTP method.
7
+ */
8
+ Connect: "CONNECT";
9
+ /**
10
+ * The `DELETE` HTTP method.
11
+ */
12
+ Delete: "DELETE";
13
+ /**
14
+ * The `GET` HTTP method.
15
+ */
16
+ Get: "GET";
17
+ /**
18
+ * The `HEAD` HTTP method.
19
+ */
20
+ Head: "HEAD";
21
+ /**
22
+ * The `OPTIONS` HTTP method.
23
+ */
24
+ Options: "OPTIONS";
25
+ /**
26
+ * The `PATCH` HTTP method.
27
+ */
28
+ Patch: "PATCH";
29
+ /**
30
+ * The `POST` HTTP method.
31
+ */
32
+ Post: "POST";
33
+ /**
34
+ * The `PUT` HTTP method.
35
+ */
36
+ Put: "PUT";
37
+ /**
38
+ * The `TRACE` HTTP method.
39
+ */
40
+ Trace: "TRACE";
41
+ }>;
42
+ /**
43
+ * Provides HTTP methods.
44
+ */
45
+ export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
46
+ //# sourceMappingURL=HttpMethod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpMethod.d.ts","sourceRoot":"","sources":["../../../src/Client/Net/Http/HttpMethod.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;IAEtB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEF,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Provides HTTP methods.
3
+ */
4
+ export const HttpMethod = Object.freeze({
5
+ /**
6
+ * The `CONNECT` HTTP method.
7
+ */
8
+ Connect: "CONNECT",
9
+ /**
10
+ * The `DELETE` HTTP method.
11
+ */
12
+ Delete: "DELETE",
13
+ /**
14
+ * The `GET` HTTP method.
15
+ */
16
+ Get: "GET",
17
+ /**
18
+ * The `HEAD` HTTP method.
19
+ */
20
+ Head: "HEAD",
21
+ /**
22
+ * The `OPTIONS` HTTP method.
23
+ */
24
+ Options: "OPTIONS",
25
+ /**
26
+ * The `PATCH` HTTP method.
27
+ */
28
+ Patch: "PATCH",
29
+ /**
30
+ * The `POST` HTTP method.
31
+ */
32
+ Post: "POST",
33
+ /**
34
+ * The `PUT` HTTP method.
35
+ */
36
+ Put: "PUT",
37
+ /**
38
+ * The `TRACE` HTTP method.
39
+ */
40
+ Trace: "TRACE"
41
+ });
@@ -0,0 +1,33 @@
1
+ import { StatusCode } from "./StatusCode.js";
2
+ /**
3
+ * An error thrown by the HTTP client.
4
+ */
5
+ export declare class HttpRequestError extends globalThis.Error {
6
+ #private;
7
+ /**
8
+ * Creates a new HTTP error.
9
+ * @param response The HTTP response.
10
+ */
11
+ constructor(response: Response);
12
+ /**
13
+ * The HTTP response.
14
+ */
15
+ get cause(): Response;
16
+ /**
17
+ * Value indicating whether the HTTP status code is between 400 and 499.
18
+ */
19
+ get isClientError(): boolean;
20
+ /**
21
+ * Value indicating whether the HTTP status code is between 500 and 599.
22
+ */
23
+ get isServerError(): boolean;
24
+ /**
25
+ * The HTTP status code.
26
+ */
27
+ get statusCode(): StatusCode;
28
+ /**
29
+ * The validation errors.
30
+ */
31
+ get validationErrors(): Promise<Map<string, string>>;
32
+ }
33
+ //# sourceMappingURL=HttpRequestError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpRequestError.d.ts","sourceRoot":"","sources":["../../../src/Client/Net/Http/HttpRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,KAAK;;IAOrD;;;OAGG;gBACS,QAAQ,EAAE,QAAQ;IAK9B;;OAEG;IACH,IAAa,KAAK,IAAI,QAAQ,CAE7B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,OAAO,CAG3B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,OAAO,CAG3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAInD;CAgBD"}
@@ -1,44 +1,44 @@
1
- import { StatusCodes } from "./StatusCodes.js";
1
+ import { StatusCode } from "./StatusCode.js";
2
2
  /**
3
- * An object thrown when an HTTP error occurs.
3
+ * An error thrown by the HTTP client.
4
4
  */
5
- export class HttpError extends globalThis.Error {
5
+ export class HttpRequestError extends globalThis.Error {
6
6
  /**
7
7
  * The validation errors.
8
8
  */
9
9
  #validationErrors = null;
10
10
  /**
11
11
  * Creates a new HTTP error.
12
- * @param response The server response.
12
+ * @param response The HTTP response.
13
13
  */
14
14
  constructor(response) {
15
15
  super(`${response.status} ${response.statusText}`, { cause: response });
16
- this.name = "HttpError";
16
+ this.name = "HttpRequestError";
17
17
  }
18
18
  /**
19
- * The server response.
19
+ * The HTTP response.
20
20
  */
21
21
  get cause() {
22
22
  return super.cause;
23
23
  }
24
24
  /**
25
- * Value indicating whether the response's status code is between 400 and 499.
25
+ * Value indicating whether the HTTP status code is between 400 and 499.
26
26
  */
27
27
  get isClientError() {
28
- const { status } = this;
29
- return status >= 400 && status < 500;
28
+ const { statusCode } = this;
29
+ return statusCode >= 400 && statusCode < 500;
30
30
  }
31
31
  /**
32
- * Value indicating whether the response's status code is between 500 and 599.
32
+ * Value indicating whether the HTTP status code is between 500 and 599.
33
33
  */
34
34
  get isServerError() {
35
- const { status } = this;
36
- return status >= 500 && status < 600;
35
+ const { statusCode } = this;
36
+ return statusCode >= 500 && statusCode < 600;
37
37
  }
38
38
  /**
39
- * The response's status code.
39
+ * The HTTP status code.
40
40
  */
41
- get status() {
41
+ get statusCode() {
42
42
  return this.cause.status;
43
43
  }
44
44
  /**
@@ -55,8 +55,8 @@ export class HttpError extends globalThis.Error {
55
55
  */
56
56
  async #parseValidationErrors() {
57
57
  try {
58
- const statuses = new Set([StatusCodes.BadRequest, StatusCodes.UnprocessableContent]);
59
- const ignoreBody = this.cause.bodyUsed || !statuses.has(this.status);
58
+ const statuses = [StatusCode.BadRequest, StatusCode.UnprocessableContent];
59
+ const ignoreBody = this.cause.bodyUsed || !statuses.includes(this.statusCode);
60
60
  return new Map(ignoreBody ? [] : Object.entries(await this.cause.json()));
61
61
  }
62
62
  catch {
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Provides common HTTP status codes.
3
+ */
4
+ export declare const StatusCode: Readonly<{
5
+ /**
6
+ * The `OK` status code.
7
+ */
8
+ OK: 200;
9
+ /**
10
+ * The `Created` status code.
11
+ */
12
+ Created: 201;
13
+ /**
14
+ * The `No Content` status code.
15
+ */
16
+ NoContent: 204;
17
+ /**
18
+ * The `Moved Permanently` status code.
19
+ */
20
+ MovedPermanently: 301;
21
+ /**
22
+ * The `Found` status code.
23
+ */
24
+ Found: 302;
25
+ /**
26
+ * The `Not Modified` status code.
27
+ */
28
+ NotModified: 304;
29
+ /**
30
+ * The `Temporary Redirect` status code.
31
+ */
32
+ TemporaryRedirect: 307;
33
+ /**
34
+ * The `Permanent Redirect` status code.
35
+ */
36
+ PermanentRedirect: 308;
37
+ /**
38
+ * The `Bad Request` status code.
39
+ */
40
+ BadRequest: 400;
41
+ /**
42
+ * The `Unauthorized` status code.
43
+ */
44
+ Unauthorized: 401;
45
+ /**
46
+ * The `Payment Required` status code.
47
+ */
48
+ PaymentRequired: 402;
49
+ /**
50
+ * The `Forbidden` status code.
51
+ */
52
+ Forbidden: 403;
53
+ /**
54
+ * The `Not Found` status code.
55
+ */
56
+ NotFound: 404;
57
+ /**
58
+ * The `Method Not Allowed` status code.
59
+ */
60
+ MethodNotAllowed: 405;
61
+ /**
62
+ * The `Not Acceptable` status code.
63
+ */
64
+ NotAcceptable: 406;
65
+ /**
66
+ * The `Request Timeout` status code.
67
+ */
68
+ RequestTimeout: 408;
69
+ /**
70
+ * The `Conflict` status code.
71
+ */
72
+ Conflict: 409;
73
+ /**
74
+ * The `Payload Too Large` status code.
75
+ */
76
+ PayloadTooLarge: 413;
77
+ /**
78
+ * The `Unsupported Media Type` status code.
79
+ */
80
+ UnsupportedMediaType: 415;
81
+ /**
82
+ * The `Authentication Timeout` status code.
83
+ */
84
+ AuthenticationTimeout: 419;
85
+ /**
86
+ * The `Unprocessable Content` status code.
87
+ */
88
+ UnprocessableContent: 422;
89
+ /**
90
+ * The `Too Many Requests` status code.
91
+ */
92
+ TooManyRequests: 429;
93
+ /**
94
+ * The `Internal Server Error` status code.
95
+ */
96
+ InternalServerError: 500;
97
+ /**
98
+ * The `Not Implemented` status code.
99
+ */
100
+ NotImplemented: 501;
101
+ /**
102
+ * The `Bad Gateway` status code.
103
+ */
104
+ BadGateway: 502;
105
+ /**
106
+ * The `Service Unavailable` status code.
107
+ */
108
+ ServiceUnavailable: 503;
109
+ /**
110
+ * The `Gateway Timeout` status code.
111
+ */
112
+ GatewayTimeout: 504;
113
+ /**
114
+ * The `Bandwidth Limit Exceeded` status
115
+ */
116
+ BandwidthLimitExceeded: 509;
117
+ }>;
118
+ /**
119
+ * Provides common HTTP status codes.
120
+ */
121
+ export type StatusCode = typeof StatusCode[keyof typeof StatusCode];
122
+ //# sourceMappingURL=StatusCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusCode.d.ts","sourceRoot":"","sources":["../../../src/Client/Net/Http/StatusCode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;IAEtB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEF,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Provides common HTTP status codes.
3
+ */
4
+ export const StatusCode = Object.freeze({
5
+ /**
6
+ * The `OK` status code.
7
+ */
8
+ OK: 200,
9
+ /**
10
+ * The `Created` status code.
11
+ */
12
+ Created: 201,
13
+ /**
14
+ * The `No Content` status code.
15
+ */
16
+ NoContent: 204,
17
+ /**
18
+ * The `Moved Permanently` status code.
19
+ */
20
+ MovedPermanently: 301,
21
+ /**
22
+ * The `Found` status code.
23
+ */
24
+ Found: 302,
25
+ /**
26
+ * The `Not Modified` status code.
27
+ */
28
+ NotModified: 304,
29
+ /**
30
+ * The `Temporary Redirect` status code.
31
+ */
32
+ TemporaryRedirect: 307,
33
+ /**
34
+ * The `Permanent Redirect` status code.
35
+ */
36
+ PermanentRedirect: 308,
37
+ /**
38
+ * The `Bad Request` status code.
39
+ */
40
+ BadRequest: 400,
41
+ /**
42
+ * The `Unauthorized` status code.
43
+ */
44
+ Unauthorized: 401,
45
+ /**
46
+ * The `Payment Required` status code.
47
+ */
48
+ PaymentRequired: 402,
49
+ /**
50
+ * The `Forbidden` status code.
51
+ */
52
+ Forbidden: 403,
53
+ /**
54
+ * The `Not Found` status code.
55
+ */
56
+ NotFound: 404,
57
+ /**
58
+ * The `Method Not Allowed` status code.
59
+ */
60
+ MethodNotAllowed: 405,
61
+ /**
62
+ * The `Not Acceptable` status code.
63
+ */
64
+ NotAcceptable: 406,
65
+ /**
66
+ * The `Request Timeout` status code.
67
+ */
68
+ RequestTimeout: 408,
69
+ /**
70
+ * The `Conflict` status code.
71
+ */
72
+ Conflict: 409,
73
+ /**
74
+ * The `Payload Too Large` status code.
75
+ */
76
+ PayloadTooLarge: 413,
77
+ /**
78
+ * The `Unsupported Media Type` status code.
79
+ */
80
+ UnsupportedMediaType: 415,
81
+ /**
82
+ * The `Authentication Timeout` status code.
83
+ */
84
+ AuthenticationTimeout: 419,
85
+ /**
86
+ * The `Unprocessable Content` status code.
87
+ */
88
+ UnprocessableContent: 422,
89
+ /**
90
+ * The `Too Many Requests` status code.
91
+ */
92
+ TooManyRequests: 429,
93
+ /**
94
+ * The `Internal Server Error` status code.
95
+ */
96
+ InternalServerError: 500,
97
+ /**
98
+ * The `Not Implemented` status code.
99
+ */
100
+ NotImplemented: 501,
101
+ /**
102
+ * The `Bad Gateway` status code.
103
+ */
104
+ BadGateway: 502,
105
+ /**
106
+ * The `Service Unavailable` status code.
107
+ */
108
+ ServiceUnavailable: 503,
109
+ /**
110
+ * The `Gateway Timeout` status code.
111
+ */
112
+ GatewayTimeout: 504,
113
+ /**
114
+ * The `Bandwidth Limit Exceeded` status
115
+ */
116
+ BandwidthLimitExceeded: 509
117
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Provides the strings used to specify the disposition type.
3
+ */
4
+ export declare const DispositionType: Readonly<{
5
+ /**
6
+ * The `attachment` disposition type.
7
+ */
8
+ Attachment: "attachment";
9
+ /**
10
+ * The `inline` disposition type.
11
+ */
12
+ Inline: "inline";
13
+ }>;
14
+ /**
15
+ * Provides the strings used to specify the disposition type.
16
+ */
17
+ export type DispositionType = typeof DispositionType[keyof typeof DispositionType];
18
+ //# sourceMappingURL=DispositionType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DispositionType.d.ts","sourceRoot":"","sources":["../../../src/Client/Net/Mime/DispositionType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe;IAE3B;;OAEG;;IAGH;;OAEG;;EAEF,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Provides the strings used to specify the disposition type.
3
+ */
4
+ export const DispositionType = Object.freeze({
5
+ /**
6
+ * The `attachment` disposition type.
7
+ */
8
+ Attachment: "attachment",
9
+ /**
10
+ * The `inline` disposition type.
11
+ */
12
+ Inline: "inline"
13
+ });