adminforth 1.1.79 → 1.1.80

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 (210) hide show
  1. package/dist/modules/codeInjector.js +51 -23
  2. package/dist/plugins/AuditLog/index.js +13 -0
  3. package/dist/plugins/AuditLog/types.js +1 -0
  4. package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  5. package/dist/spa/index.html +1 -1
  6. package/dist/spa/package-lock.json +0 -111
  7. package/dist/spa/package.json +0 -1
  8. package/dist/spa/spa/src/App.vue +1 -1
  9. package/dist/spa/spa/src/components/MenuLink.vue +1 -1
  10. package/dist/spa/src/App.vue +133 -178
  11. package/dist/spa/src/components/MenuLink.vue +3 -3
  12. package/dist/spa/src/components/ResourceForm.vue +96 -96
  13. package/dist/spa/src/components/ResourceListTable.vue +84 -69
  14. package/dist/spa/src/components/ValueRenderer.vue +3 -2
  15. package/dist/spa/src/composables/useStores.ts +11 -24
  16. package/dist/spa/src/main.ts +1 -1
  17. package/dist/spa/src/router/index.ts +1 -0
  18. package/dist/spa/src/utils.ts +1 -1
  19. package/dist/spa/src/views/CreateView.vue +9 -1
  20. package/dist/spa/src/views/EditView.vue +9 -1
  21. package/dist/spa/src/views/ListView.vue +3 -12
  22. package/dist/spa/src/views/LoginView.vue +1 -6
  23. package/dist/spa/src/views/ResourceParent.vue +2 -1
  24. package/dist/spa/src/views/ShowView.vue +14 -6
  25. package/dist/spa/tailwind.config.js +1 -3
  26. package/modules/codeInjector.ts +56 -26
  27. package/package.json +1 -1
  28. package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
  29. package/spa/src/App.vue +1 -1
  30. package/spa/src/components/MenuLink.vue +1 -1
  31. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  32. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  33. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  34. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  35. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  36. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  37. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  38. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  39. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  40. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  41. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  42. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  43. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  44. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  45. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  46. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  47. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  48. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  49. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  50. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  51. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  52. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  53. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  54. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  55. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  56. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  57. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  58. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  59. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  60. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  61. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  62. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  63. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  64. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  65. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  66. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  67. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  68. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  69. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  70. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  71. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  72. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  73. package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  74. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  75. package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
  76. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
  77. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
  78. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
  79. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
  80. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
  81. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
  82. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
  83. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
  84. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
  85. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
  86. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
  87. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
  88. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  89. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
  90. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
  91. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
  92. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
  93. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
  94. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
  95. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
  96. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
  97. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
  98. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
  99. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
  100. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
  101. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
  102. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
  103. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
  104. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
  105. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
  106. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
  107. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
  108. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
  109. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
  110. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
  111. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
  112. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
  113. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
  114. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
  115. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
  116. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
  117. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
  118. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
  119. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
  120. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
  121. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
  122. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
  123. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
  124. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
  125. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
  126. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
  127. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
  128. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
  129. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
  130. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
  131. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
  132. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
  133. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
  134. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
  135. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
  136. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
  137. package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
  138. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
  139. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
  140. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
  141. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
  142. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
  143. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
  144. package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
  145. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
  146. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
  147. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
  148. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
  149. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
  150. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
  151. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
  152. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
  153. package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
  154. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
  155. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
  156. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
  157. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
  158. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
  159. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
  160. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
  161. package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
  162. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
  163. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
  164. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
  165. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
  166. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
  167. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
  168. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
  169. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
  170. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
  171. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
  172. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
  173. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
  174. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
  175. package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
  176. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
  177. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
  178. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
  179. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
  180. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
  181. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
  182. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
  183. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
  184. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
  185. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  186. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
  187. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
  188. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
  189. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
  190. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
  191. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
  192. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  193. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
  194. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
  195. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
  196. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
  197. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
  198. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
  199. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
  200. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
  201. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  202. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
  203. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
  204. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
  205. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
  206. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
  207. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
  208. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
  209. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
  210. package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +0 -131
@@ -1,181 +0,0 @@
1
- /**
2
- * **The `node:wasi` module does not currently provide the**
3
- * **comprehensive file system security properties provided by some WASI runtimes.**
4
- * **Full support for secure file system sandboxing may or may not be implemented in**
5
- * **future. In the mean time, do not rely on it to run untrusted code.**
6
- *
7
- * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying
8
- * operating system via a collection of POSIX-like functions.
9
- *
10
- * ```js
11
- * import { readFile } from 'node:fs/promises';
12
- * import { WASI } from 'wasi';
13
- * import { argv, env } from 'node:process';
14
- *
15
- * const wasi = new WASI({
16
- * version: 'preview1',
17
- * args: argv,
18
- * env,
19
- * preopens: {
20
- * '/local': '/some/real/path/that/wasm/can/access',
21
- * },
22
- * });
23
- *
24
- * const wasm = await WebAssembly.compile(
25
- * await readFile(new URL('./demo.wasm', import.meta.url)),
26
- * );
27
- * const instance = await WebAssembly.instantiate(wasm, wasi.getImportObject());
28
- *
29
- * wasi.start(instance);
30
- * ```
31
- *
32
- * To run the above example, create a new WebAssembly text format file named `demo.wat`:
33
- *
34
- * ```text
35
- * (module
36
- * ;; Import the required fd_write WASI function which will write the given io vectors to stdout
37
- * ;; The function signature for fd_write is:
38
- * ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written
39
- * (import "wasi_snapshot_preview1" "fd_write" (func $fd_write (param i32 i32 i32 i32) (result i32)))
40
- *
41
- * (memory 1)
42
- * (export "memory" (memory 0))
43
- *
44
- * ;; Write 'hello world\n' to memory at an offset of 8 bytes
45
- * ;; Note the trailing newline which is required for the text to appear
46
- * (data (i32.const 8) "hello world\n")
47
- *
48
- * (func $main (export "_start")
49
- * ;; Creating a new io vector within linear memory
50
- * (i32.store (i32.const 0) (i32.const 8)) ;; iov.iov_base - This is a pointer to the start of the 'hello world\n' string
51
- * (i32.store (i32.const 4) (i32.const 12)) ;; iov.iov_len - The length of the 'hello world\n' string
52
- *
53
- * (call $fd_write
54
- * (i32.const 1) ;; file_descriptor - 1 for stdout
55
- * (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0
56
- * (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one.
57
- * (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written
58
- * )
59
- * drop ;; Discard the number of bytes written from the top of the stack
60
- * )
61
- * )
62
- * ```
63
- *
64
- * Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
65
- *
66
- * ```bash
67
- * wat2wasm demo.wat
68
- * ```
69
- * @experimental
70
- * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/wasi.js)
71
- */
72
- declare module "wasi" {
73
- interface WASIOptions {
74
- /**
75
- * An array of strings that the WebAssembly application will
76
- * see as command line arguments. The first argument is the virtual path to the
77
- * WASI command itself.
78
- * @default []
79
- */
80
- args?: string[] | undefined;
81
- /**
82
- * An object similar to `process.env` that the WebAssembly
83
- * application will see as its environment.
84
- * @default {}
85
- */
86
- env?: object | undefined;
87
- /**
88
- * This object represents the WebAssembly application's
89
- * sandbox directory structure. The string keys of `preopens` are treated as
90
- * directories within the sandbox. The corresponding values in `preopens` are
91
- * the real paths to those directories on the host machine.
92
- */
93
- preopens?: NodeJS.Dict<string> | undefined;
94
- /**
95
- * By default, when WASI applications call `__wasi_proc_exit()`
96
- * `wasi.start()` will return with the exit code specified rather than terminatng the process.
97
- * Setting this option to `false` will cause the Node.js process to exit with
98
- * the specified exit code instead.
99
- * @default true
100
- */
101
- returnOnExit?: boolean | undefined;
102
- /**
103
- * The file descriptor used as standard input in the WebAssembly application.
104
- * @default 0
105
- */
106
- stdin?: number | undefined;
107
- /**
108
- * The file descriptor used as standard output in the WebAssembly application.
109
- * @default 1
110
- */
111
- stdout?: number | undefined;
112
- /**
113
- * The file descriptor used as standard error in the WebAssembly application.
114
- * @default 2
115
- */
116
- stderr?: number | undefined;
117
- /**
118
- * The version of WASI requested.
119
- * Currently the only supported versions are `'unstable'` and `'preview1'`. This option is mandatory.
120
- * @since v19.8.0
121
- */
122
- version: "unstable" | "preview1";
123
- }
124
- /**
125
- * The `WASI` class provides the WASI system call API and additional convenience
126
- * methods for working with WASI-based applications. Each `WASI` instance
127
- * represents a distinct environment.
128
- * @since v13.3.0, v12.16.0
129
- */
130
- class WASI {
131
- constructor(options?: WASIOptions);
132
- /**
133
- * Return an import object that can be passed to `WebAssembly.instantiate()` if no other WASM imports are needed beyond those provided by WASI.
134
- *
135
- * If version `unstable` was passed into the constructor it will return:
136
- *
137
- * ```js
138
- * { wasi_unstable: wasi.wasiImport }
139
- * ```
140
- *
141
- * If version `preview1` was passed into the constructor or no version was specified it will return:
142
- *
143
- * ```js
144
- * { wasi_snapshot_preview1: wasi.wasiImport }
145
- * ```
146
- * @since v19.8.0
147
- */
148
- getImportObject(): object;
149
- /**
150
- * Attempt to begin execution of `instance` as a WASI command by invoking its `_start()` export. If `instance` does not contain a `_start()` export, or if `instance` contains an `_initialize()`
151
- * export, then an exception is thrown.
152
- *
153
- * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory`. If
154
- * `instance` does not have a `memory` export an exception is thrown.
155
- *
156
- * If `start()` is called more than once, an exception is thrown.
157
- * @since v13.3.0, v12.16.0
158
- */
159
- start(instance: object): number; // TODO: avoid DOM dependency until WASM moved to own lib.
160
- /**
161
- * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present. If `instance` contains a `_start()` export, then an exception is thrown.
162
- *
163
- * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory`.
164
- * If `instance` does not have a `memory` export an exception is thrown.
165
- *
166
- * If `initialize()` is called more than once, an exception is thrown.
167
- * @since v14.6.0, v12.19.0
168
- */
169
- initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
170
- /**
171
- * `wasiImport` is an object that implements the WASI system call API. This object
172
- * should be passed as the `wasi_snapshot_preview1` import during the instantiation
173
- * of a [`WebAssembly.Instance`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance).
174
- * @since v13.3.0, v12.16.0
175
- */
176
- readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
177
- }
178
- }
179
- declare module "node:wasi" {
180
- export * from "wasi";
181
- }