adminforth 1.1.79 → 1.1.81

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 (212) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/modules/codeInjector.js +51 -23
  3. package/dist/plugins/AuditLog/index.js +13 -0
  4. package/dist/plugins/AuditLog/types.js +1 -0
  5. package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  6. package/dist/spa/index.html +1 -1
  7. package/dist/spa/package-lock.json +0 -111
  8. package/dist/spa/package.json +0 -1
  9. package/dist/spa/spa/src/App.vue +1 -1
  10. package/dist/spa/spa/src/components/MenuLink.vue +1 -1
  11. package/dist/spa/src/App.vue +133 -178
  12. package/dist/spa/src/components/MenuLink.vue +3 -3
  13. package/dist/spa/src/components/ResourceForm.vue +96 -96
  14. package/dist/spa/src/components/ResourceListTable.vue +84 -69
  15. package/dist/spa/src/components/ValueRenderer.vue +3 -2
  16. package/dist/spa/src/composables/useStores.ts +11 -24
  17. package/dist/spa/src/main.ts +1 -1
  18. package/dist/spa/src/router/index.ts +1 -0
  19. package/dist/spa/src/utils.ts +1 -1
  20. package/dist/spa/src/views/CreateView.vue +9 -1
  21. package/dist/spa/src/views/EditView.vue +9 -1
  22. package/dist/spa/src/views/ListView.vue +3 -12
  23. package/dist/spa/src/views/LoginView.vue +1 -6
  24. package/dist/spa/src/views/ResourceParent.vue +2 -1
  25. package/dist/spa/src/views/ShowView.vue +14 -6
  26. package/dist/spa/tailwind.config.js +1 -3
  27. package/index.ts +1 -1
  28. package/modules/codeInjector.ts +56 -26
  29. package/package.json +1 -1
  30. package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  31. package/spa/src/App.vue +1 -1
  32. package/spa/src/components/MenuLink.vue +1 -1
  33. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  34. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  35. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  36. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  37. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  38. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  39. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  40. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  41. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  42. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  43. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  44. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  45. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  46. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  47. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  48. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  49. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  50. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  51. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  52. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  53. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  54. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  55. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  56. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  57. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  58. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  59. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  60. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  61. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  62. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  63. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  64. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  65. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  66. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  67. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  68. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  69. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  70. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  71. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  72. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  73. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  74. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  75. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  76. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  77. package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  78. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  79. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  80. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
  81. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
  82. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
  83. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
  84. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
  85. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
  86. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
  87. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
  88. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
  89. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
  90. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  91. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
  92. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
  93. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
  94. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
  95. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
  96. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
  97. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
  98. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
  99. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
  100. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
  101. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
  102. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
  103. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
  104. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
  105. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
  106. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
  107. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
  108. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  109. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
  110. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
  111. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
  112. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
  113. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
  114. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
  115. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
  116. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
  117. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
  118. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
  119. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
  120. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
  121. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
  122. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
  123. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
  124. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
  125. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
  126. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
  127. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
  128. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
  129. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
  130. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
  131. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
  132. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
  133. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
  134. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
  135. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
  136. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  137. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  138. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
  139. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  140. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  141. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  142. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
  143. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  144. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
  145. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  146. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  147. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  148. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  149. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  150. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  151. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  152. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  153. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  154. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  155. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  156. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  157. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  158. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  159. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  160. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  161. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  162. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  163. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  164. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  165. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  166. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  167. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  168. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
  169. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  170. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  171. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  172. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
  173. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  174. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  175. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  176. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  177. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  178. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  179. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
  180. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
  181. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
  182. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
  183. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
  184. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
  185. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
  186. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
  187. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  188. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
  189. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
  190. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
  191. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
  192. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
  193. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
  194. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  195. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
  196. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
  197. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
  198. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
  199. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
  200. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
  201. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
  202. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
  203. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  204. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
  205. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  206. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
  207. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
  208. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
  209. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
  210. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
  211. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
  212. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +0 -131
@@ -1,34 +0,0 @@
1
- import { TLSSocket, ConnectionOptions } from 'tls'
2
- import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'net'
3
-
4
- export default buildConnector
5
- declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector
6
-
7
- declare namespace buildConnector {
8
- export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
9
- allowH2?: boolean;
10
- maxCachedSessions?: number | null;
11
- socketPath?: string | null;
12
- timeout?: number | null;
13
- port?: number;
14
- keepAlive?: boolean | null;
15
- keepAliveInitialDelay?: number | null;
16
- }
17
-
18
- export interface Options {
19
- hostname: string
20
- host?: string
21
- protocol: string
22
- port: string
23
- servername?: string
24
- localAddress?: string | null
25
- httpSocket?: Socket
26
- }
27
-
28
- export type Callback = (...args: CallbackArgs) => void
29
- type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
30
-
31
- export interface connector {
32
- (options: buildConnector.Options, callback: buildConnector.Callback): void
33
- }
34
- }
@@ -1,21 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- interface MIMEType {
4
- type: string
5
- subtype: string
6
- parameters: Map<string, string>
7
- essence: string
8
- }
9
-
10
- /**
11
- * Parse a string to a {@link MIMEType} object. Returns `failure` if the string
12
- * couldn't be parsed.
13
- * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type
14
- */
15
- export function parseMIMEType (input: string): 'failure' | MIMEType
16
-
17
- /**
18
- * Convert a MIMEType object to a string.
19
- * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
20
- */
21
- export function serializeAMimeType (mimeType: MIMEType): string
@@ -1,28 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import type { Headers } from './fetch'
4
-
5
- export interface Cookie {
6
- name: string
7
- value: string
8
- expires?: Date | number
9
- maxAge?: number
10
- domain?: string
11
- path?: string
12
- secure?: boolean
13
- httpOnly?: boolean
14
- sameSite?: 'Strict' | 'Lax' | 'None'
15
- unparsed?: string[]
16
- }
17
-
18
- export function deleteCookie (
19
- headers: Headers,
20
- name: string,
21
- attributes?: { name?: string, domain?: string }
22
- ): void
23
-
24
- export function getCookies (headers: Headers): Record<string, string>
25
-
26
- export function getSetCookies (headers: Headers): Cookie[]
27
-
28
- export function setCookie (headers: Headers, cookie: Cookie): void
@@ -1,67 +0,0 @@
1
- import { Socket } from "net";
2
- import { URL } from "url";
3
- import Connector from "./connector";
4
- import Dispatcher from "./dispatcher";
5
-
6
- declare namespace DiagnosticsChannel {
7
- interface Request {
8
- origin?: string | URL;
9
- completed: boolean;
10
- method?: Dispatcher.HttpMethod;
11
- path: string;
12
- headers: string;
13
- addHeader(key: string, value: string): Request;
14
- }
15
- interface Response {
16
- statusCode: number;
17
- statusText: string;
18
- headers: Array<Buffer>;
19
- }
20
- type Error = unknown;
21
- interface ConnectParams {
22
- host: URL["host"];
23
- hostname: URL["hostname"];
24
- protocol: URL["protocol"];
25
- port: URL["port"];
26
- servername: string | null;
27
- }
28
- type Connector = Connector.connector;
29
- export interface RequestCreateMessage {
30
- request: Request;
31
- }
32
- export interface RequestBodySentMessage {
33
- request: Request;
34
- }
35
- export interface RequestHeadersMessage {
36
- request: Request;
37
- response: Response;
38
- }
39
- export interface RequestTrailersMessage {
40
- request: Request;
41
- trailers: Array<Buffer>;
42
- }
43
- export interface RequestErrorMessage {
44
- request: Request;
45
- error: Error;
46
- }
47
- export interface ClientSendHeadersMessage {
48
- request: Request;
49
- headers: string;
50
- socket: Socket;
51
- }
52
- export interface ClientBeforeConnectMessage {
53
- connectParams: ConnectParams;
54
- connector: Connector;
55
- }
56
- export interface ClientConnectedMessage {
57
- socket: Socket;
58
- connectParams: ConnectParams;
59
- connector: Connector;
60
- }
61
- export interface ClientConnectErrorMessage {
62
- error: Error;
63
- socket: Socket;
64
- connectParams: ConnectParams;
65
- connector: Connector;
66
- }
67
- }
@@ -1,241 +0,0 @@
1
- import { URL } from 'url'
2
- import { Duplex, Readable, Writable } from 'stream'
3
- import { EventEmitter } from 'events'
4
- import { Blob } from 'buffer'
5
- import { IncomingHttpHeaders } from './header'
6
- import BodyReadable from './readable'
7
- import { FormData } from './formdata'
8
- import Errors from './errors'
9
-
10
- type AbortSignal = unknown;
11
-
12
- export default Dispatcher
13
-
14
- /** Dispatcher is the core API used to dispatch requests. */
15
- declare class Dispatcher extends EventEmitter {
16
- /** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */
17
- dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
18
- /** Starts two-way communications with the requested resource. */
19
- connect(options: Dispatcher.ConnectOptions): Promise<Dispatcher.ConnectData>;
20
- connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
21
- /** Performs an HTTP request. */
22
- request(options: Dispatcher.RequestOptions): Promise<Dispatcher.ResponseData>;
23
- request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void;
24
- /** For easy use with `stream.pipeline`. */
25
- pipeline(options: Dispatcher.PipelineOptions, handler: Dispatcher.PipelineHandler): Duplex;
26
- /** A faster version of `Dispatcher.request`. */
27
- stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory): Promise<Dispatcher.StreamData>;
28
- stream(options: Dispatcher.RequestOptions, factory: Dispatcher.StreamFactory, callback: (err: Error | null, data: Dispatcher.StreamData) => void): void;
29
- /** Upgrade to a different protocol. */
30
- upgrade(options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>;
31
- upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void;
32
- /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
33
- close(): Promise<void>;
34
- close(callback: () => void): void;
35
- /** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */
36
- destroy(): Promise<void>;
37
- destroy(err: Error | null): Promise<void>;
38
- destroy(callback: () => void): void;
39
- destroy(err: Error | null, callback: () => void): void;
40
-
41
- on(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
42
- on(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
43
- on(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
44
- on(eventName: 'drain', callback: (origin: URL) => void): this;
45
-
46
-
47
- once(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
48
- once(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
49
- once(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
50
- once(eventName: 'drain', callback: (origin: URL) => void): this;
51
-
52
-
53
- off(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
54
- off(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
55
- off(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
56
- off(eventName: 'drain', callback: (origin: URL) => void): this;
57
-
58
-
59
- addListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
60
- addListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
61
- addListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
62
- addListener(eventName: 'drain', callback: (origin: URL) => void): this;
63
-
64
- removeListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
65
- removeListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
66
- removeListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
67
- removeListener(eventName: 'drain', callback: (origin: URL) => void): this;
68
-
69
- prependListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
70
- prependListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
71
- prependListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
72
- prependListener(eventName: 'drain', callback: (origin: URL) => void): this;
73
-
74
- prependOnceListener(eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this;
75
- prependOnceListener(eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
76
- prependOnceListener(eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
77
- prependOnceListener(eventName: 'drain', callback: (origin: URL) => void): this;
78
-
79
- listeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
80
- listeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
81
- listeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
82
- listeners(eventName: 'drain'): ((origin: URL) => void)[];
83
-
84
- rawListeners(eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
85
- rawListeners(eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
86
- rawListeners(eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
87
- rawListeners(eventName: 'drain'): ((origin: URL) => void)[];
88
-
89
- emit(eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean;
90
- emit(eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
91
- emit(eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
92
- emit(eventName: 'drain', origin: URL): boolean;
93
- }
94
-
95
- declare namespace Dispatcher {
96
- export interface DispatchOptions {
97
- origin?: string | URL;
98
- path: string;
99
- method: HttpMethod;
100
- /** Default: `null` */
101
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
102
- /** Default: `null` */
103
- headers?: IncomingHttpHeaders | string[] | null;
104
- /** Query string params to be embedded in the request URL. Default: `null` */
105
- query?: Record<string, any>;
106
- /** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */
107
- idempotent?: boolean;
108
- /** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. */
109
- blocking?: boolean;
110
- /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
111
- upgrade?: boolean | string | null;
112
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
113
- headersTimeout?: number | null;
114
- /** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */
115
- bodyTimeout?: number | null;
116
- /** Whether the request should stablish a keep-alive or not. Default `false` */
117
- reset?: boolean;
118
- /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
119
- throwOnError?: boolean;
120
- /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server*/
121
- expectContinue?: boolean;
122
- }
123
- export interface ConnectOptions {
124
- path: string;
125
- /** Default: `null` */
126
- headers?: IncomingHttpHeaders | string[] | null;
127
- /** Default: `null` */
128
- signal?: AbortSignal | EventEmitter | null;
129
- /** This argument parameter is passed through to `ConnectData` */
130
- opaque?: unknown;
131
- /** Default: 0 */
132
- maxRedirections?: number;
133
- /** Default: `null` */
134
- responseHeader?: 'raw' | null;
135
- }
136
- export interface RequestOptions extends DispatchOptions {
137
- /** Default: `null` */
138
- opaque?: unknown;
139
- /** Default: `null` */
140
- signal?: AbortSignal | EventEmitter | null;
141
- /** Default: 0 */
142
- maxRedirections?: number;
143
- /** Default: `null` */
144
- onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
145
- /** Default: `null` */
146
- responseHeader?: 'raw' | null;
147
- /** Default: `64 KiB` */
148
- highWaterMark?: number;
149
- }
150
- export interface PipelineOptions extends RequestOptions {
151
- /** `true` if the `handler` will return an object stream. Default: `false` */
152
- objectMode?: boolean;
153
- }
154
- export interface UpgradeOptions {
155
- path: string;
156
- /** Default: `'GET'` */
157
- method?: string;
158
- /** Default: `null` */
159
- headers?: IncomingHttpHeaders | string[] | null;
160
- /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
161
- protocol?: string;
162
- /** Default: `null` */
163
- signal?: AbortSignal | EventEmitter | null;
164
- /** Default: 0 */
165
- maxRedirections?: number;
166
- /** Default: `null` */
167
- responseHeader?: 'raw' | null;
168
- }
169
- export interface ConnectData {
170
- statusCode: number;
171
- headers: IncomingHttpHeaders;
172
- socket: Duplex;
173
- opaque: unknown;
174
- }
175
- export interface ResponseData {
176
- statusCode: number;
177
- headers: IncomingHttpHeaders;
178
- body: BodyReadable & BodyMixin;
179
- trailers: Record<string, string>;
180
- opaque: unknown;
181
- context: object;
182
- }
183
- export interface PipelineHandlerData {
184
- statusCode: number;
185
- headers: IncomingHttpHeaders;
186
- opaque: unknown;
187
- body: BodyReadable;
188
- context: object;
189
- }
190
- export interface StreamData {
191
- opaque: unknown;
192
- trailers: Record<string, string>;
193
- }
194
- export interface UpgradeData {
195
- headers: IncomingHttpHeaders;
196
- socket: Duplex;
197
- opaque: unknown;
198
- }
199
- export interface StreamFactoryData {
200
- statusCode: number;
201
- headers: IncomingHttpHeaders;
202
- opaque: unknown;
203
- context: object;
204
- }
205
- export type StreamFactory = (data: StreamFactoryData) => Writable;
206
- export interface DispatchHandlers {
207
- /** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
208
- onConnect?(abort: () => void): void;
209
- /** Invoked when an error has occurred. */
210
- onError?(err: Error): void;
211
- /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
212
- onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
213
- /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
214
- onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void): boolean;
215
- /** Invoked when response payload data is received. */
216
- onData?(chunk: Buffer): boolean;
217
- /** Invoked when response payload and trailers have been received and the request has completed. */
218
- onComplete?(trailers: string[] | null): void;
219
- /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
220
- onBodySent?(chunkSize: number, totalBytesSent: number): void;
221
- }
222
- export type PipelineHandler = (data: PipelineHandlerData) => Readable;
223
- export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
224
-
225
- /**
226
- * @link https://fetch.spec.whatwg.org/#body-mixin
227
- */
228
- interface BodyMixin {
229
- readonly body?: never; // throws on node v16.6.0
230
- readonly bodyUsed: boolean;
231
- arrayBuffer(): Promise<ArrayBuffer>;
232
- blob(): Promise<Blob>;
233
- formData(): Promise<never>;
234
- json(): Promise<unknown>;
235
- text(): Promise<string>;
236
- }
237
-
238
- export interface DispatchInterceptor {
239
- (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch']
240
- }
241
- }
@@ -1,128 +0,0 @@
1
- import { IncomingHttpHeaders } from "./header";
2
- import Client from './client'
3
-
4
- export default Errors
5
-
6
- declare namespace Errors {
7
- export class UndiciError extends Error {
8
- name: string;
9
- code: string;
10
- }
11
-
12
- /** Connect timeout error. */
13
- export class ConnectTimeoutError extends UndiciError {
14
- name: 'ConnectTimeoutError';
15
- code: 'UND_ERR_CONNECT_TIMEOUT';
16
- }
17
-
18
- /** A header exceeds the `headersTimeout` option. */
19
- export class HeadersTimeoutError extends UndiciError {
20
- name: 'HeadersTimeoutError';
21
- code: 'UND_ERR_HEADERS_TIMEOUT';
22
- }
23
-
24
- /** Headers overflow error. */
25
- export class HeadersOverflowError extends UndiciError {
26
- name: 'HeadersOverflowError'
27
- code: 'UND_ERR_HEADERS_OVERFLOW'
28
- }
29
-
30
- /** A body exceeds the `bodyTimeout` option. */
31
- export class BodyTimeoutError extends UndiciError {
32
- name: 'BodyTimeoutError';
33
- code: 'UND_ERR_BODY_TIMEOUT';
34
- }
35
-
36
- export class ResponseStatusCodeError extends UndiciError {
37
- constructor (
38
- message?: string,
39
- statusCode?: number,
40
- headers?: IncomingHttpHeaders | string[] | null,
41
- body?: null | Record<string, any> | string
42
- );
43
- name: 'ResponseStatusCodeError';
44
- code: 'UND_ERR_RESPONSE_STATUS_CODE';
45
- body: null | Record<string, any> | string
46
- status: number
47
- statusCode: number
48
- headers: IncomingHttpHeaders | string[] | null;
49
- }
50
-
51
- /** Passed an invalid argument. */
52
- export class InvalidArgumentError extends UndiciError {
53
- name: 'InvalidArgumentError';
54
- code: 'UND_ERR_INVALID_ARG';
55
- }
56
-
57
- /** Returned an invalid value. */
58
- export class InvalidReturnValueError extends UndiciError {
59
- name: 'InvalidReturnValueError';
60
- code: 'UND_ERR_INVALID_RETURN_VALUE';
61
- }
62
-
63
- /** The request has been aborted by the user. */
64
- export class RequestAbortedError extends UndiciError {
65
- name: 'AbortError';
66
- code: 'UND_ERR_ABORTED';
67
- }
68
-
69
- /** Expected error with reason. */
70
- export class InformationalError extends UndiciError {
71
- name: 'InformationalError';
72
- code: 'UND_ERR_INFO';
73
- }
74
-
75
- /** Request body length does not match content-length header. */
76
- export class RequestContentLengthMismatchError extends UndiciError {
77
- name: 'RequestContentLengthMismatchError';
78
- code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
79
- }
80
-
81
- /** Response body length does not match content-length header. */
82
- export class ResponseContentLengthMismatchError extends UndiciError {
83
- name: 'ResponseContentLengthMismatchError';
84
- code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
85
- }
86
-
87
- /** Trying to use a destroyed client. */
88
- export class ClientDestroyedError extends UndiciError {
89
- name: 'ClientDestroyedError';
90
- code: 'UND_ERR_DESTROYED';
91
- }
92
-
93
- /** Trying to use a closed client. */
94
- export class ClientClosedError extends UndiciError {
95
- name: 'ClientClosedError';
96
- code: 'UND_ERR_CLOSED';
97
- }
98
-
99
- /** There is an error with the socket. */
100
- export class SocketError extends UndiciError {
101
- name: 'SocketError';
102
- code: 'UND_ERR_SOCKET';
103
- socket: Client.SocketInfo | null
104
- }
105
-
106
- /** Encountered unsupported functionality. */
107
- export class NotSupportedError extends UndiciError {
108
- name: 'NotSupportedError';
109
- code: 'UND_ERR_NOT_SUPPORTED';
110
- }
111
-
112
- /** No upstream has been added to the BalancedPool. */
113
- export class BalancedPoolMissingUpstreamError extends UndiciError {
114
- name: 'MissingUpstreamError';
115
- code: 'UND_ERR_BPL_MISSING_UPSTREAM';
116
- }
117
-
118
- export class HTTPParserError extends UndiciError {
119
- name: 'HTTPParserError';
120
- code: string;
121
- }
122
-
123
- /** The response exceed the length allowed. */
124
- export class ResponseExceededMaxSizeError extends UndiciError {
125
- name: 'ResponseExceededMaxSizeError';
126
- code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
127
- }
128
- }