@opra/client 0.17.1 → 0.17.2

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 (188) hide show
  1. package/cjs/client-error.js +17 -0
  2. package/cjs/constants.js +7 -0
  3. package/cjs/http/batch-request.js +90 -0
  4. package/cjs/http/http-client.js +232 -0
  5. package/cjs/http/http-collection-node.js +110 -0
  6. package/cjs/http/http-request-observable.js +36 -0
  7. package/cjs/http/http-request.js +88 -0
  8. package/cjs/http/http-response.js +24 -0
  9. package/cjs/http/http-service-base.js +9 -0
  10. package/cjs/http/http-singleton-node.js +63 -0
  11. package/cjs/http/http-types.js +2 -0
  12. package/cjs/index.js +12 -0
  13. package/cjs/package.json +3 -0
  14. package/esm/client-error.js +13 -0
  15. package/esm/constants.js +4 -0
  16. package/esm/http/batch-request.js +90 -0
  17. package/esm/http/http-client.js +228 -0
  18. package/esm/http/http-collection-node.js +106 -0
  19. package/esm/http/http-request-observable.js +32 -0
  20. package/esm/http/http-request.js +84 -0
  21. package/esm/http/http-response.js +20 -0
  22. package/esm/http/http-service-base.js +5 -0
  23. package/esm/http/http-singleton-node.js +59 -0
  24. package/esm/http/http-types.js +1 -0
  25. package/esm/index.js +9 -0
  26. package/package.json +32 -12
  27. package/types/client-error.d.ts +1 -1
  28. package/types/http/http-client.d.ts +1 -1
  29. package/types/http/http-collection-node.d.ts +5 -5
  30. package/types/http/http-request-observable.d.ts +1 -1
  31. package/types/http/http-request.d.ts +1 -1
  32. package/types/http/http-response.d.ts +3 -1
  33. package/types/http/http-singleton-node.d.ts +1 -1
  34. package/types/http/http-types.d.ts +1 -1
  35. package/types/index.d.ts +0 -6
  36. package/cjs/content-disposition-d575fee5.js +0 -473
  37. package/cjs/cookie-signature-3e974173.js +0 -64
  38. package/cjs/index.min.mjs +0 -9295
  39. package/cjs/mime-db-49f150d0.js +0 -10719
  40. package/cjs/mime-types-6e2bdb57.js +0 -201
  41. package/cjs/safe-buffer-8acd60c7.js +0 -78
  42. package/esm/content-disposition-65f281a9.js +0 -470
  43. package/esm/cookie-signature-bf274b6b.js +0 -62
  44. package/esm/index.min.mjs +0 -9174
  45. package/esm/mime-db-d0f15d8f.js +0 -10717
  46. package/esm/mime-types-79c091fd.js +0 -199
  47. package/esm/safe-buffer-63383356.js +0 -76
  48. package/types/common/document/api-document.d.ts +0 -102
  49. package/types/common/document/constants.d.ts +0 -3
  50. package/types/common/document/data-type/api-field.d.ts +0 -41
  51. package/types/common/document/data-type/builtin/any.type.d.ts +0 -2
  52. package/types/common/document/data-type/builtin/base64.type.d.ts +0 -6
  53. package/types/common/document/data-type/builtin/bigint.type.d.ts +0 -6
  54. package/types/common/document/data-type/builtin/boolean.type.d.ts +0 -5
  55. package/types/common/document/data-type/builtin/date.type.d.ts +0 -4
  56. package/types/common/document/data-type/builtin/guid.type.d.ts +0 -7
  57. package/types/common/document/data-type/builtin/index.d.ts +0 -10
  58. package/types/common/document/data-type/builtin/integer.type.d.ts +0 -6
  59. package/types/common/document/data-type/builtin/number.type.d.ts +0 -6
  60. package/types/common/document/data-type/builtin/object.type.d.ts +0 -3
  61. package/types/common/document/data-type/builtin/string.type.d.ts +0 -5
  62. package/types/common/document/data-type/builtin/time.type.d.ts +0 -7
  63. package/types/common/document/data-type/builtin/timestamp.type.d.ts +0 -5
  64. package/types/common/document/data-type/complex-type.d.ts +0 -56
  65. package/types/common/document/data-type/data-type.d.ts +0 -33
  66. package/types/common/document/data-type/enum-type.d.ts +0 -32
  67. package/types/common/document/data-type/mapped-type.d.ts +0 -53
  68. package/types/common/document/data-type/simple-type.d.ts +0 -33
  69. package/types/common/document/data-type/union-type.d.ts +0 -42
  70. package/types/common/document/factory/add-references.d.ts +0 -4
  71. package/types/common/document/factory/create-document.d.ts +0 -12
  72. package/types/common/document/factory/factory.d.ts +0 -61
  73. package/types/common/document/factory/import-resource-class.d.ts +0 -10
  74. package/types/common/document/factory/import-type-class.d.ts +0 -17
  75. package/types/common/document/factory/index.d.ts +0 -1
  76. package/types/common/document/factory/process-resources.d.ts +0 -7
  77. package/types/common/document/factory/process-types.d.ts +0 -6
  78. package/types/common/document/index.d.ts +0 -14
  79. package/types/common/document/resource/collection.d.ts +0 -69
  80. package/types/common/document/resource/resource.d.ts +0 -29
  81. package/types/common/document/resource/singleton.d.ts +0 -51
  82. package/types/common/document/utils/inspect.util.d.ts +0 -4
  83. package/types/common/document/utils/string-compare.util.d.ts +0 -1
  84. package/types/common/exception/enums/issue-severity.enum.d.ts +0 -13
  85. package/types/common/exception/error-issue.d.ts +0 -9
  86. package/types/common/exception/http-errors/bad-request.error.d.ts +0 -10
  87. package/types/common/exception/http-errors/failed-dependency.error.d.ts +0 -9
  88. package/types/common/exception/http-errors/forbidden.error.d.ts +0 -11
  89. package/types/common/exception/http-errors/internal-server.error.d.ts +0 -9
  90. package/types/common/exception/http-errors/method-not-allowed.error.d.ts +0 -10
  91. package/types/common/exception/http-errors/not-acceptable.error.d.ts +0 -10
  92. package/types/common/exception/http-errors/not-found.error.d.ts +0 -13
  93. package/types/common/exception/http-errors/unauthorized.error.d.ts +0 -10
  94. package/types/common/exception/http-errors/unprocessable-entity.error.d.ts +0 -9
  95. package/types/common/exception/index.d.ts +0 -15
  96. package/types/common/exception/opra-exception.d.ts +0 -15
  97. package/types/common/exception/resource-errors/resource-conflict.error.d.ts +0 -5
  98. package/types/common/exception/resource-errors/resource-not-found.error.d.ts +0 -8
  99. package/types/common/exception/wrap-exception.d.ts +0 -2
  100. package/types/common/filter/antlr/OpraFilterLexer.d.ts +0 -77
  101. package/types/common/filter/antlr/OpraFilterListener.d.ts +0 -430
  102. package/types/common/filter/antlr/OpraFilterParser.d.ts +0 -437
  103. package/types/common/filter/antlr/OpraFilterVisitor.d.ts +0 -260
  104. package/types/common/filter/ast/abstract/ast.d.ts +0 -5
  105. package/types/common/filter/ast/abstract/expression.d.ts +0 -3
  106. package/types/common/filter/ast/abstract/literal.d.ts +0 -6
  107. package/types/common/filter/ast/abstract/term.d.ts +0 -3
  108. package/types/common/filter/ast/expressions/arithmetic-expression.d.ts +0 -13
  109. package/types/common/filter/ast/expressions/array-expression.d.ts +0 -7
  110. package/types/common/filter/ast/expressions/comparison-expression.d.ts +0 -10
  111. package/types/common/filter/ast/expressions/logical-expression.d.ts +0 -8
  112. package/types/common/filter/ast/expressions/parentheses-expression.d.ts +0 -6
  113. package/types/common/filter/ast/index.d.ts +0 -16
  114. package/types/common/filter/ast/terms/boolean-literal.d.ts +0 -5
  115. package/types/common/filter/ast/terms/date-literal.d.ts +0 -6
  116. package/types/common/filter/ast/terms/external-constant.d.ts +0 -5
  117. package/types/common/filter/ast/terms/null-literal.d.ts +0 -5
  118. package/types/common/filter/ast/terms/number-literal.d.ts +0 -6
  119. package/types/common/filter/ast/terms/qualified-identifier.d.ts +0 -8
  120. package/types/common/filter/ast/terms/string-literal.d.ts +0 -5
  121. package/types/common/filter/ast/terms/time-literal.d.ts +0 -6
  122. package/types/common/filter/build.d.ts +0 -31
  123. package/types/common/filter/errors.d.ts +0 -20
  124. package/types/common/filter/filter-tree-visitor.d.ts +0 -33
  125. package/types/common/filter/index.d.ts +0 -5
  126. package/types/common/filter/opra-error-listener.d.ts +0 -8
  127. package/types/common/filter/parse.d.ts +0 -2
  128. package/types/common/filter/utils.d.ts +0 -2
  129. package/types/common/helpers/function-utils.d.ts +0 -4
  130. package/types/common/helpers/get-stack-filename.d.ts +0 -1
  131. package/types/common/helpers/index.d.ts +0 -8
  132. package/types/common/helpers/is-url.d.ts +0 -1
  133. package/types/common/helpers/mixin-utils.d.ts +0 -3
  134. package/types/common/helpers/object-utils.d.ts +0 -2
  135. package/types/common/helpers/path-to-object-tree.d.ts +0 -4
  136. package/types/common/helpers/responsive-map.d.ts +0 -34
  137. package/types/common/helpers/type-guards.d.ts +0 -11
  138. package/types/common/http/codecs/boolean-codec.d.ts +0 -5
  139. package/types/common/http/codecs/date-codec.d.ts +0 -16
  140. package/types/common/http/codecs/filter-codec.d.ts +0 -6
  141. package/types/common/http/codecs/integer-codec.d.ts +0 -11
  142. package/types/common/http/codecs/number-codec.d.ts +0 -14
  143. package/types/common/http/codecs/string-codec.d.ts +0 -16
  144. package/types/common/http/enums/http-headers-codes.enum.d.ts +0 -388
  145. package/types/common/http/enums/http-status-codes.enum.d.ts +0 -290
  146. package/types/common/http/enums/http-status-messages.d.ts +0 -65
  147. package/types/common/http/http-headers.d.ts +0 -86
  148. package/types/common/http/http-message.host.d.ts +0 -122
  149. package/types/common/http/http-params.d.ts +0 -114
  150. package/types/common/http/http-request-message.d.ts +0 -213
  151. package/types/common/http/http-response-message.d.ts +0 -318
  152. package/types/common/http/index.d.ts +0 -14
  153. package/types/common/http/interfaces/client-http-headers.interface.d.ts +0 -65
  154. package/types/common/http/interfaces/cookie-options.interface.d.ts +0 -4
  155. package/types/common/http/interfaces/server-http-headers.interface.d.ts +0 -1
  156. package/types/common/http/multipart/batch-multipart.d.ts +0 -0
  157. package/types/common/http/multipart/http-request-content.d.ts +0 -0
  158. package/types/common/http/multipart/http-response-content.d.ts +0 -0
  159. package/types/common/http/multipart/index.d.ts +0 -0
  160. package/types/common/i18n/i18n.d.ts +0 -28
  161. package/types/common/i18n/index.d.ts +0 -5
  162. package/types/common/i18n/string-utils.d.ts +0 -2
  163. package/types/common/i18n/translate.d.ts +0 -4
  164. package/types/common/index.d.ts +0 -11
  165. package/types/common/schema/constants.d.ts +0 -2
  166. package/types/common/schema/data-type/complex-type.interface.d.ts +0 -16
  167. package/types/common/schema/data-type/data-type.interface.d.ts +0 -14
  168. package/types/common/schema/data-type/enum-type.interface.d.ts +0 -15
  169. package/types/common/schema/data-type/field.interface.d.ts +0 -21
  170. package/types/common/schema/data-type/mapped-type.interface.d.ts +0 -11
  171. package/types/common/schema/data-type/simple-type.interface.d.ts +0 -18
  172. package/types/common/schema/data-type/union-type.interface.d.ts +0 -10
  173. package/types/common/schema/document.interface.d.ts +0 -34
  174. package/types/common/schema/index.d.ts +0 -51
  175. package/types/common/schema/resource/collection.interface.d.ts +0 -33
  176. package/types/common/schema/resource/container.interface.d.ts +0 -9
  177. package/types/common/schema/resource/endpoint.interface.d.ts +0 -29
  178. package/types/common/schema/resource/resource.interface.d.ts +0 -12
  179. package/types/common/schema/resource/singleton.interface.d.ts +0 -22
  180. package/types/common/schema/type-guards.d.ts +0 -20
  181. package/types/common/types.d.ts +0 -11
  182. package/types/common/url/index.d.ts +0 -5
  183. package/types/common/url/opra-url-path-component.d.ts +0 -15
  184. package/types/common/url/opra-url-path.d.ts +0 -36
  185. package/types/common/url/opra-url.d.ts +0 -70
  186. package/types/common/url/utils/decode-path-component.d.ts +0 -5
  187. package/types/common/url/utils/encode-path-component.d.ts +0 -1
  188. package/types/common/utils/path-utils.d.ts +0 -2
@@ -1,318 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Readable } from 'stream';
4
- import { HttpMessage, HttpMessageHost } from './http-message.host.js';
5
- import type { HttpRequestMessage } from './http-request-message.js';
6
- import { CookieOptions } from './interfaces/cookie-options.interface.js';
7
- export interface HttpResponseMessage extends HttpMessage {
8
- method?: string | undefined;
9
- url?: string | undefined;
10
- body?: any;
11
- statusCode?: number;
12
- statusMessage?: string;
13
- readonly upgrade?: any;
14
- /**
15
- * Return request header.
16
- *
17
- * The `Referrer` header field is special-cased,
18
- * both `Referrer` and `Referer` are interchangeable.
19
- *
20
- * Examples:
21
- *
22
- * req.get('Content-Type');
23
- * // => "text/plain"
24
- *
25
- * req.get('content-type');
26
- * // => "text/plain"
27
- *
28
- * req.get('Something');
29
- * // => undefined
30
- *
31
- * Aliased as `req.header()`.
32
- */
33
- get(field: string): string | undefined;
34
- getHeader(name: string): number | string | string[] | undefined;
35
- /**
36
- * Set header `field` to `val`,
37
- * or pass an object of header fields.
38
- *
39
- * Examples:
40
- *
41
- * msg.setHeader('Foo', ['bar', 'baz']);
42
- * msg.setHeader('Accept', 'application/json');
43
- * msg.setHeader({ Accept: 'text/plain', 'X-API-Key': 'tobi' });
44
- *
45
- */
46
- setHeader(name: string, value: number | string | readonly string[]): this;
47
- /**
48
- * Set status `code`.
49
- */
50
- status(code: number): this;
51
- /**
52
- * Set the response HTTP status code to `statusCode` and send its string representation as the response body.
53
- * @link http://expressjs.com/4x/api.html#res.sendStatus
54
- *
55
- * Examples:
56
- *
57
- * res.sendStatus(200); // equivalent to res.status(200).send('OK')
58
- * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
59
- * res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
60
- * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')
61
- */
62
- sendStatus(code: number): this;
63
- /**
64
- * Set Link header field with the given `links`.
65
- *
66
- * Examples:
67
- *
68
- * res.links({
69
- * next: 'http://api.example.com/users?page=2',
70
- * last: 'http://api.example.com/users?page=5'
71
- * });
72
- */
73
- links(links: any): this;
74
- /**
75
- * Send JSON response.
76
- *
77
- * Examples:
78
- *
79
- * res.json(null);
80
- * res.json({ user: 'tj' });
81
- * res.status(500).json('oh noes!');
82
- * res.status(404).json('I dont have that');
83
- */
84
- json(body: any): this;
85
- /**
86
- * Set _Content-Type_ response header with `type` through `mime.lookup()`
87
- * when it does not contain "/", or set the Content-Type to `type` otherwise.
88
- *
89
- * Examples:
90
- *
91
- * res.type('.html');
92
- * res.type('html');
93
- * res.type('json');
94
- * res.type('application/json');
95
- * res.type('png');
96
- */
97
- contentType(type: string): this;
98
- /**
99
- * Set _Content-Type_ response header with `type` through `mime.lookup()`
100
- * when it does not contain "/", or set the Content-Type to `type` otherwise.
101
- *
102
- * Examples:
103
- *
104
- * res.type('.html');
105
- * res.type('html');
106
- * res.type('json');
107
- * res.type('application/json');
108
- * res.type('png');
109
- */
110
- type(type: string): this;
111
- /**
112
- * Set _Content-Disposition_ header to _attachment_ with optional `filename`.
113
- */
114
- attachment(filename?: string): this;
115
- /**
116
- * Set header `field` to `val`, or pass
117
- * an object of header fields.
118
- *
119
- * Examples:
120
- *
121
- * res.set('Foo', ['bar', 'baz']);
122
- * res.set('Accept', 'application/json');
123
- * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });
124
- *
125
- * Aliased as `res.header()`.
126
- */
127
- set(field: any): this;
128
- set(field: string, value?: string | string[]): this;
129
- header(field: any): this;
130
- header(field: string, value?: string | string[]): this;
131
- append(field: string, value?: string | string[]): this;
132
- /** Clear cookie `name`. */
133
- clearCookie(name: string, options?: CookieOptions): this;
134
- /**
135
- * Set cookie `name` to `val`, with the given `options`.
136
- *
137
- * Options:
138
- *
139
- * - `maxAge` max-age in milliseconds, converted to `expires`
140
- * - `signed` sign the cookie
141
- * - `path` defaults to "/"
142
- *
143
- * Examples:
144
- *
145
- * // "Remember Me" for 15 minutes
146
- * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
147
- *
148
- * // save as above
149
- * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
150
- */
151
- cookie(name: string, val: string, options: CookieOptions): this;
152
- cookie(name: string, val: any, options: CookieOptions): this;
153
- cookie(name: string, val: any): this;
154
- /**
155
- * Set the location header to `url`.
156
- *
157
- * The given `url` can also be the name of a mapped url, for
158
- * example by default express supports "back" which redirects
159
- * to the _Referrer_ or _Referer_ headers or "/".
160
- *
161
- * Examples:
162
- *
163
- * res.location('/foo/bar').;
164
- * res.location('http://example.com');
165
- * res.location('../login'); // /blog/post/1 -> /blog/login
166
- *
167
- * Mounting:
168
- *
169
- * When an application is mounted and `res.location()`
170
- * is given a path that does _not_ lead with "/" it becomes
171
- * relative to the mount-point. For example if the application
172
- * is mounted at "/blog", the following would become "/blog/login".
173
- *
174
- * res.location('login');
175
- *
176
- * While the leading slash would result in a location of "/login":
177
- *
178
- * res.location('/login');
179
- */
180
- location(url: string): this;
181
- /**
182
- * Redirect to the given `url` with optional response `status`
183
- * defaulting to 302.
184
- *
185
- * The resulting `url` is determined by `res.location()`, so
186
- * it will play nicely with mounted apps, relative paths,
187
- * `"back"` etc.
188
- *
189
- * Examples:
190
- *
191
- * res.redirect('back');
192
- * res.redirect('/foo/bar');
193
- * res.redirect('http://example.com');
194
- * res.redirect(301, 'http://example.com');
195
- * res.redirect('http://example.com', 301);
196
- * res.redirect('../login'); // /blog/post/1 -> /blog/login
197
- */
198
- redirect(url: string): void;
199
- redirect(status: number, url: string): void;
200
- /** @deprecated use res.redirect(status, url) instead */
201
- redirect(url: string, status: number): void;
202
- }
203
- /**
204
- * @namespace HttpResponseMessage
205
- */
206
- export declare namespace HttpResponseMessage {
207
- interface Initiator extends HttpMessage.Initiator {
208
- statusCode?: number;
209
- statusMessage?: string;
210
- req?: HttpRequestMessage;
211
- chunkedEncoding?: boolean;
212
- }
213
- function create(init: Initiator): HttpResponseMessage;
214
- function fromBuffer(buffer: Buffer | ArrayBuffer): HttpResponseMessage;
215
- function fromStream(readable: Readable): Promise<HttpResponseMessage>;
216
- }
217
- /**
218
- * @class HttpResponseMessageHost
219
- */
220
- export declare class HttpResponseMessageHost extends HttpMessageHost implements HttpResponseMessage {
221
- chunkedEncoding?: boolean;
222
- req?: HttpRequestMessage;
223
- statusCode?: number;
224
- statusMessage?: string;
225
- constructor();
226
- header(name: 'set-cookie' | 'Set-Cookie', value: string | string[]): this;
227
- header(name: string, value: number | string): this;
228
- header(headers: Record<string, number | string | string[]>): this;
229
- append(name: string, value: string | string[]): this;
230
- /**
231
- * Set "Content-Disposition" header to "attachment" with optional `filename`.
232
- */
233
- attachment(filename?: string): this;
234
- /**
235
- * Alias for msg.type()
236
- */
237
- contentType(type: string): this;
238
- /**
239
- * Set _Content-Type_ response header with `type` through `mime.lookup()`
240
- * when it does not contain "/", or set the Content-Type to `type` otherwise.
241
- *
242
- * Examples:
243
- *
244
- * res.type('.html');
245
- * res.type('html');
246
- * res.type('json');
247
- * res.type('application/json');
248
- * res.type('png');
249
- */
250
- type(type: string): this;
251
- /**
252
- * Set cookie `name` to `value`, with the given `options`.
253
- *
254
- * Options:
255
- *
256
- * - `maxAge` max-age in milliseconds, converted to `expires`
257
- * - `signed` sign the cookie
258
- * - `path` defaults to "/"
259
- *
260
- * Examples:
261
- *
262
- * // "Remember Me" for 15 minutes
263
- * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
264
- *
265
- * // same as above
266
- * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
267
- *
268
- */
269
- cookie(name: string, value: string, options?: CookieOptions): this;
270
- /**
271
- * Clear cookie `name`.
272
- */
273
- clearCookie(name: string, options?: CookieOptions): this;
274
- /**
275
- * Set Link header field with the given `links`.
276
- *
277
- * Examples:
278
- *
279
- * res.links({
280
- * next: 'http://api.example.com/users?page=2',
281
- * last: 'http://api.example.com/users?page=5'
282
- * });
283
- *
284
- */
285
- links(links: Record<string, string>): this;
286
- redirect(url: string): any;
287
- redirect(status: number, url: string): any;
288
- /**
289
- * Send JSON response.
290
- *
291
- * Examples:
292
- *
293
- * res.json(null);
294
- * res.json({ user: 'tj' });
295
- */
296
- json(obj: any): this;
297
- location(url: string): this;
298
- /**
299
- * Set status `code`.
300
- */
301
- status(code: number): this;
302
- /**
303
- * Set the response HTTP status code to `statusCode` and send its string representation as the response body.
304
- * @link http://expressjs.com/4x/api.html#res.sendStatus
305
- *
306
- * Examples:
307
- *
308
- * res.sendStatus(200); // equivalent to res.status(200).send('OK')
309
- * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
310
- * res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
311
- * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')
312
- */
313
- sendStatus(statusCode: number): this;
314
- protected _init(init: HttpResponseMessage.Initiator): void;
315
- static create(init: HttpResponseMessage.Initiator): HttpResponseMessage;
316
- static fromBuffer(buffer: Buffer | ArrayBuffer): HttpResponseMessage;
317
- static fromStream(readable: Readable): Promise<HttpResponseMessage>;
318
- }
@@ -1,14 +0,0 @@
1
- export * from './http-headers.js';
2
- export * from './http-params.js';
3
- export * from './http-response-message.js';
4
- export * from './http-request-message.js';
5
- export * from './enums/http-headers-codes.enum.js';
6
- export * from './enums/http-status-codes.enum.js';
7
- export * from './interfaces/client-http-headers.interface.js';
8
- export * from './interfaces/server-http-headers.interface.js';
9
- export * from './codecs/date-codec.js';
10
- export * from './codecs/boolean-codec.js';
11
- export * from './codecs/filter-codec.js';
12
- export * from './codecs/integer-codec.js';
13
- export * from './codecs/number-codec.js';
14
- export * from './codecs/string-codec.js';
@@ -1,65 +0,0 @@
1
- export type ClientHttpHeaders = Record<string, string | string[]> & {
2
- accept?: string;
3
- 'accept-language'?: string;
4
- 'accept-patch'?: string;
5
- 'accept-ranges'?: string;
6
- 'access-control-allow-credentials'?: string;
7
- 'access-control-allow-headers'?: string;
8
- 'access-control-allow-methods'?: string;
9
- 'access-control-allow-origin'?: string;
10
- 'access-control-expose-headers'?: string;
11
- 'access-control-max-age'?: string;
12
- 'access-control-request-headers'?: string;
13
- 'access-control-request-method'?: string;
14
- age?: string;
15
- allow?: string;
16
- 'alt-svc'?: string;
17
- authorization?: string;
18
- 'cache-control'?: string;
19
- connection?: string;
20
- 'content-disposition'?: string;
21
- 'content-encoding'?: string;
22
- 'content-language'?: string;
23
- 'content-length'?: string;
24
- 'content-location'?: string;
25
- 'content-range'?: string;
26
- 'content-type'?: string;
27
- cookie?: string;
28
- date?: string;
29
- etag?: string;
30
- expect?: string;
31
- expires?: string;
32
- forwarded?: string;
33
- from?: string;
34
- host?: string;
35
- 'if-match'?: string;
36
- 'if-modified-since'?: string;
37
- 'if-none-match'?: string;
38
- 'if-unmodified-since'?: string;
39
- 'last-modified'?: string;
40
- location?: string;
41
- origin?: string;
42
- pragma?: string;
43
- 'proxy-authenticate'?: string;
44
- 'proxy-authorization'?: string;
45
- 'public-key-pins'?: string;
46
- range?: string;
47
- referer?: string;
48
- 'retry-after'?: string;
49
- 'sec-websocket-accept'?: string;
50
- 'sec-websocket-extensions'?: string;
51
- 'sec-websocket-key'?: string;
52
- 'sec-websocket-protocol'?: string;
53
- 'sec-websocket-version'?: string;
54
- 'set-cookie'?: string[];
55
- 'strict-transport-security'?: string;
56
- tk?: string;
57
- trailer?: string;
58
- 'transfer-encoding'?: string;
59
- upgrade?: string;
60
- 'user-agent'?: string;
61
- vary?: string;
62
- via?: string;
63
- warning?: string;
64
- 'www-authenticate'?: string;
65
- };
@@ -1,4 +0,0 @@
1
- import cookie from 'cookie';
2
- export interface CookieOptions extends cookie.CookieSerializeOptions {
3
- signed?: boolean;
4
- }
@@ -1 +0,0 @@
1
- export type ServerHttpHeaders = Record<string, string | string[]> & {};
File without changes
File without changes
@@ -1,28 +0,0 @@
1
- import { FallbackLng, Formatter as I18nextFormatter, i18n, InitOptions as I18nextInitOptions, Resource as I18nextResource, TFunction as I18nextTFunction, TOptions } from '@browsery/i18next';
2
- import * as I18next from '@browsery/i18next';
3
- import { Type } from 'ts-gems';
4
- export type BaseI18n = Type<I18next.i18n>;
5
- export declare const BaseI18n: BaseI18n;
6
- export type DeepTranslateOptions = TOptions & {
7
- ignore?: (input: any, inst: i18n) => boolean;
8
- };
9
- export type InitCallback = I18next.Callback;
10
- export type TranslateFunction = I18nextTFunction;
11
- export type Formatter = I18nextFormatter;
12
- export type LanguageResource = I18nextResource;
13
- export type { FallbackLng };
14
- export interface InitOptions extends I18nextInitOptions {
15
- resourceDirs?: string[];
16
- }
17
- export declare class I18n extends BaseI18n {
18
- init(callback?: InitCallback): Promise<TranslateFunction>;
19
- init(options: InitOptions, callback?: InitCallback): Promise<TranslateFunction>;
20
- deep(input: any, options?: DeepTranslateOptions): any;
21
- registerLocaleDir(...dirname: string[]): void;
22
- loadResourceBundle(lang: string, ns: string, filePath: string, deep?: boolean, overwrite?: boolean): Promise<void>;
23
- loadResourceDir(dirnames: string | string[], deep?: boolean, overwrite?: boolean): Promise<void>;
24
- createInstance(options: {} | undefined, callback: any): I18n;
25
- static createInstance(options?: InitOptions, callback?: InitCallback): I18n;
26
- protected _deepTranslate(input: any, objectStack: WeakMap<object, any>, options?: DeepTranslateOptions): any;
27
- static get defaultInstance(): I18n;
28
- }
@@ -1,5 +0,0 @@
1
- import { I18n } from './i18n.js';
2
- export * from './i18n.js';
3
- export * from './translate.js';
4
- declare const i18n: I18n;
5
- export { i18n };
@@ -1,2 +0,0 @@
1
- export declare function escapeString(s: string): string;
2
- export declare function unescapeString(s: string): string;
@@ -1,4 +0,0 @@
1
- import { TOptions } from '@browsery/i18next';
2
- export declare function translate(key: string, options?: TOptions<Record<string, any>>): string;
3
- export declare function translate(key: string, options: TOptions<Record<string, any>>, fallback: string): string;
4
- export declare function translate(key: string, fallback: string): string;
@@ -1,11 +0,0 @@
1
- export * from './types.js';
2
- export * from './document/index.js';
3
- export * from './exception/index.js';
4
- export * from './filter/index.js';
5
- export * from './helpers/index.js';
6
- export * from './http/index.js';
7
- export * from './i18n/index.js';
8
- export * from './schema/index.js';
9
- export * from './url/index.js';
10
- export * from './utils/path-utils.js';
11
- export { uid } from 'uid';
@@ -1,2 +0,0 @@
1
- export declare const SpecVersion = "1.0";
2
- export type SpecVersion = '1.0';
@@ -1,16 +0,0 @@
1
- import { Type } from 'ts-gems';
2
- import type { DataType, DataTypeBase } from './data-type.interface.js';
3
- import { Field } from './field.interface.js';
4
- import type { MappedType } from './mapped-type.interface.js';
5
- import type { UnionType } from './union-type.interface.js';
6
- export interface ComplexType extends DataTypeBase {
7
- ctor?: Type;
8
- base?: DataType.Name | ComplexType | UnionType | MappedType;
9
- abstract?: boolean;
10
- fields?: Record<Field.Name, Field | DataType.Name>;
11
- additionalFields?: boolean;
12
- }
13
- export declare namespace ComplexType {
14
- const Kind = "ComplexType";
15
- type Kind = 'ComplexType';
16
- }
@@ -1,14 +0,0 @@
1
- import type { ComplexType } from './complex-type.interface.js';
2
- import type { EnumType } from './enum-type.interface.js';
3
- import type { MappedType } from './mapped-type.interface.js';
4
- import type { SimpleType } from './simple-type.interface.js';
5
- import type { UnionType } from './union-type.interface.js';
6
- export type DataType = SimpleType | EnumType | ComplexType | MappedType | UnionType;
7
- export declare namespace DataType {
8
- type Name = string;
9
- type Kind = ComplexType.Kind | EnumType.Kind | MappedType.Kind | SimpleType.Kind | UnionType.Kind;
10
- }
11
- export type DataTypeBase = {
12
- kind: DataType.Kind;
13
- description?: string;
14
- };
@@ -1,15 +0,0 @@
1
- import type { DataType, DataTypeBase } from './data-type.interface.js';
2
- export interface EnumType extends DataTypeBase {
3
- base?: DataType.Name | EnumType;
4
- values: Record<EnumType.key, EnumType.value>;
5
- meanings?: Record<EnumType.key, string>;
6
- }
7
- export type EnumObject = Record<EnumType.key, EnumType.value>;
8
- export type EnumArray = readonly (string | number)[];
9
- export type EnumThunk = EnumObject | EnumArray;
10
- export declare namespace EnumType {
11
- const Kind = "EnumType";
12
- type Kind = typeof Kind;
13
- type value = string | number;
14
- type key = string;
15
- }
@@ -1,21 +0,0 @@
1
- import type { DataType } from './data-type.interface.js';
2
- export declare namespace Field {
3
- type Name = string;
4
- type QualifiedName = string;
5
- }
6
- export type Field = {
7
- type: DataType.Name | DataType;
8
- description?: string;
9
- isArray?: boolean;
10
- default?: any;
11
- required?: boolean;
12
- format?: string;
13
- fixed?: string | number;
14
- examples?: any[] | Record<string, any>;
15
- deprecated?: boolean | string;
16
- /**
17
- * If true, this Field will not be included in results by default.
18
- * The client side should include the Field name in the "include" query parameter.
19
- */
20
- exclusive?: boolean;
21
- };
@@ -1,11 +0,0 @@
1
- import type { DataType, DataTypeBase } from './data-type.interface.js';
2
- import { Field } from './field.interface.js';
3
- export interface MappedType extends DataTypeBase {
4
- type: DataType.Name | DataType;
5
- omit?: Field.Name[];
6
- pick?: Field.Name[];
7
- }
8
- export declare namespace MappedType {
9
- const Kind = "MappedType";
10
- type Kind = 'MappedType';
11
- }
@@ -1,18 +0,0 @@
1
- import { Type } from 'ts-gems';
2
- import type { DataType, DataTypeBase } from './data-type.interface.js';
3
- export interface SimpleType extends DataTypeBase {
4
- ctor?: Type;
5
- base?: DataType.Name | SimpleType;
6
- pattern?: string | RegExp;
7
- codec?: SimpleType.Codec;
8
- }
9
- export declare namespace SimpleType {
10
- const Kind = "SimpleType";
11
- type Kind = 'SimpleType';
12
- interface Codec {
13
- decode?: (v: any) => any;
14
- encode?: (v: any) => any;
15
- coerce?: (v: any) => any;
16
- validate?: (v: any) => void;
17
- }
18
- }
@@ -1,10 +0,0 @@
1
- import type { ComplexType } from './complex-type.interface.js';
2
- import type { DataType, DataTypeBase } from './data-type.interface.js';
3
- import type { MappedType } from './mapped-type.interface.js';
4
- export declare namespace UnionType {
5
- const Kind = "UnionType";
6
- type Kind = 'UnionType';
7
- }
8
- export interface UnionType extends DataTypeBase {
9
- types: (DataType.Name | ComplexType | UnionType | MappedType)[];
10
- }
@@ -1,34 +0,0 @@
1
- import type { SpecVersion } from './constants.js';
2
- import type { DataType } from './data-type/data-type.interface.js';
3
- import type { Resource } from './resource/resource.interface.js';
4
- export interface ApiDocument {
5
- version: SpecVersion;
6
- url?: string;
7
- info: DocumentInfo;
8
- references?: Record<string, string | ApiDocument>;
9
- types?: Record<DataType.Name, DataType>;
10
- resources?: Record<Resource.Name, Resource>;
11
- servers?: ServerInfo[];
12
- }
13
- export type DocumentInfo = {
14
- title: string;
15
- version: string;
16
- description?: string;
17
- termsOfService?: string;
18
- contact?: ContactPerson[];
19
- license?: LicenseInfo;
20
- };
21
- export type ServerInfo = {
22
- url: string;
23
- description?: string;
24
- };
25
- export type ContactPerson = {
26
- name?: string;
27
- email?: string;
28
- url?: string;
29
- };
30
- export type LicenseInfo = {
31
- name: string;
32
- url?: string;
33
- content?: string;
34
- };