smart001 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1448) hide show
  1. package/backend/db.js +19 -0
  2. package/backend/node_modules/.bin/bcrypt +16 -0
  3. package/backend/node_modules/.bin/bcrypt.cmd +17 -0
  4. package/backend/node_modules/.bin/bcrypt.ps1 +28 -0
  5. package/backend/node_modules/.bin/json +16 -0
  6. package/backend/node_modules/.bin/json.cmd +17 -0
  7. package/backend/node_modules/.bin/json.ps1 +28 -0
  8. package/backend/node_modules/.bin/node-gyp-build +16 -0
  9. package/backend/node_modules/.bin/node-gyp-build-optional +16 -0
  10. package/backend/node_modules/.bin/node-gyp-build-optional.cmd +17 -0
  11. package/backend/node_modules/.bin/node-gyp-build-optional.ps1 +28 -0
  12. package/backend/node_modules/.bin/node-gyp-build-test +16 -0
  13. package/backend/node_modules/.bin/node-gyp-build-test.cmd +17 -0
  14. package/backend/node_modules/.bin/node-gyp-build-test.ps1 +28 -0
  15. package/backend/node_modules/.bin/node-gyp-build.cmd +17 -0
  16. package/backend/node_modules/.bin/node-gyp-build.ps1 +28 -0
  17. package/backend/node_modules/.bin/nodemon +16 -0
  18. package/backend/node_modules/.bin/nodemon.cmd +17 -0
  19. package/backend/node_modules/.bin/nodemon.ps1 +28 -0
  20. package/backend/node_modules/.bin/nodetouch +16 -0
  21. package/backend/node_modules/.bin/nodetouch.cmd +17 -0
  22. package/backend/node_modules/.bin/nodetouch.ps1 +28 -0
  23. package/backend/node_modules/.bin/semver +16 -0
  24. package/backend/node_modules/.bin/semver.cmd +17 -0
  25. package/backend/node_modules/.bin/semver.ps1 +28 -0
  26. package/backend/node_modules/.package-lock.json +1475 -0
  27. package/backend/node_modules/@types/node/LICENSE +21 -0
  28. package/backend/node_modules/@types/node/README.md +15 -0
  29. package/backend/node_modules/@types/node/assert/strict.d.ts +59 -0
  30. package/backend/node_modules/@types/node/assert.d.ts +950 -0
  31. package/backend/node_modules/@types/node/async_hooks.d.ts +711 -0
  32. package/backend/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  33. package/backend/node_modules/@types/node/buffer.d.ts +1765 -0
  34. package/backend/node_modules/@types/node/child_process.d.ts +1366 -0
  35. package/backend/node_modules/@types/node/cluster.d.ts +432 -0
  36. package/backend/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  37. package/backend/node_modules/@types/node/console.d.ts +93 -0
  38. package/backend/node_modules/@types/node/constants.d.ts +14 -0
  39. package/backend/node_modules/@types/node/crypto.d.ts +4058 -0
  40. package/backend/node_modules/@types/node/dgram.d.ts +537 -0
  41. package/backend/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  42. package/backend/node_modules/@types/node/dns/promises.d.ts +497 -0
  43. package/backend/node_modules/@types/node/dns.d.ts +876 -0
  44. package/backend/node_modules/@types/node/domain.d.ts +150 -0
  45. package/backend/node_modules/@types/node/events.d.ts +1008 -0
  46. package/backend/node_modules/@types/node/fs/promises.d.ts +1468 -0
  47. package/backend/node_modules/@types/node/fs.d.ts +4780 -0
  48. package/backend/node_modules/@types/node/globals.d.ts +150 -0
  49. package/backend/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  50. package/backend/node_modules/@types/node/http.d.ts +2147 -0
  51. package/backend/node_modules/@types/node/http2.d.ts +2485 -0
  52. package/backend/node_modules/@types/node/https.d.ts +400 -0
  53. package/backend/node_modules/@types/node/index.d.ts +117 -0
  54. package/backend/node_modules/@types/node/inspector/promises.d.ts +35 -0
  55. package/backend/node_modules/@types/node/inspector.d.ts +264 -0
  56. package/backend/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  57. package/backend/node_modules/@types/node/module.d.ts +755 -0
  58. package/backend/node_modules/@types/node/net.d.ts +970 -0
  59. package/backend/node_modules/@types/node/os.d.ts +498 -0
  60. package/backend/node_modules/@types/node/package.json +155 -0
  61. package/backend/node_modules/@types/node/path/posix.d.ts +8 -0
  62. package/backend/node_modules/@types/node/path/win32.d.ts +8 -0
  63. package/backend/node_modules/@types/node/path.d.ts +178 -0
  64. package/backend/node_modules/@types/node/perf_hooks.d.ts +612 -0
  65. package/backend/node_modules/@types/node/process.d.ts +2204 -0
  66. package/backend/node_modules/@types/node/punycode.d.ts +89 -0
  67. package/backend/node_modules/@types/node/querystring.d.ts +139 -0
  68. package/backend/node_modules/@types/node/quic.d.ts +897 -0
  69. package/backend/node_modules/@types/node/readline/promises.d.ts +158 -0
  70. package/backend/node_modules/@types/node/readline.d.ts +507 -0
  71. package/backend/node_modules/@types/node/repl.d.ts +420 -0
  72. package/backend/node_modules/@types/node/sea.d.ts +47 -0
  73. package/backend/node_modules/@types/node/sqlite.d.ts +1068 -0
  74. package/backend/node_modules/@types/node/stream/consumers.d.ts +114 -0
  75. package/backend/node_modules/@types/node/stream/iter.d.ts +301 -0
  76. package/backend/node_modules/@types/node/stream/promises.d.ts +211 -0
  77. package/backend/node_modules/@types/node/stream/web.d.ts +300 -0
  78. package/backend/node_modules/@types/node/stream.d.ts +1774 -0
  79. package/backend/node_modules/@types/node/string_decoder.d.ts +27 -0
  80. package/backend/node_modules/@types/node/test/reporters.d.ts +59 -0
  81. package/backend/node_modules/@types/node/test.d.ts +2279 -0
  82. package/backend/node_modules/@types/node/timers/promises.d.ts +93 -0
  83. package/backend/node_modules/@types/node/timers.d.ts +149 -0
  84. package/backend/node_modules/@types/node/tls.d.ts +1193 -0
  85. package/backend/node_modules/@types/node/trace_events.d.ts +103 -0
  86. package/backend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  87. package/backend/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  88. package/backend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  89. package/backend/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  90. package/backend/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  91. package/backend/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  92. package/backend/node_modules/@types/node/tty.d.ts +225 -0
  93. package/backend/node_modules/@types/node/url.d.ts +556 -0
  94. package/backend/node_modules/@types/node/util/types.d.ts +558 -0
  95. package/backend/node_modules/@types/node/util.d.ts +1677 -0
  96. package/backend/node_modules/@types/node/v8.d.ts +980 -0
  97. package/backend/node_modules/@types/node/vm.d.ts +1136 -0
  98. package/backend/node_modules/@types/node/wasi.d.ts +131 -0
  99. package/backend/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  100. package/backend/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  101. package/backend/node_modules/@types/node/web-globals/console.d.ts +9 -0
  102. package/backend/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  103. package/backend/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  104. package/backend/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  105. package/backend/node_modules/@types/node/web-globals/events.d.ts +106 -0
  106. package/backend/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  107. package/backend/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  108. package/backend/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  109. package/backend/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  110. package/backend/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  111. package/backend/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  112. package/backend/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  113. package/backend/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  114. package/backend/node_modules/@types/node/web-globals/url.d.ts +24 -0
  115. package/backend/node_modules/@types/node/worker_threads.d.ts +671 -0
  116. package/backend/node_modules/@types/node/zlib/iter.d.ts +131 -0
  117. package/backend/node_modules/@types/node/zlib.d.ts +589 -0
  118. package/backend/node_modules/accepts/HISTORY.md +250 -0
  119. package/backend/node_modules/accepts/LICENSE +23 -0
  120. package/backend/node_modules/accepts/README.md +140 -0
  121. package/backend/node_modules/accepts/index.js +238 -0
  122. package/backend/node_modules/accepts/package.json +47 -0
  123. package/backend/node_modules/anymatch/LICENSE +15 -0
  124. package/backend/node_modules/anymatch/README.md +87 -0
  125. package/backend/node_modules/anymatch/index.d.ts +20 -0
  126. package/backend/node_modules/anymatch/index.js +104 -0
  127. package/backend/node_modules/anymatch/package.json +48 -0
  128. package/backend/node_modules/aws-ssl-profiles/LICENSE +19 -0
  129. package/backend/node_modules/aws-ssl-profiles/README.md +146 -0
  130. package/backend/node_modules/aws-ssl-profiles/lib/@types/profiles.d.ts +4 -0
  131. package/backend/node_modules/aws-ssl-profiles/lib/@types/profiles.js +2 -0
  132. package/backend/node_modules/aws-ssl-profiles/lib/index.d.ts +8 -0
  133. package/backend/node_modules/aws-ssl-profiles/lib/index.js +13 -0
  134. package/backend/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.d.ts +9 -0
  135. package/backend/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js +2888 -0
  136. package/backend/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.d.ts +8 -0
  137. package/backend/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js +111 -0
  138. package/backend/node_modules/aws-ssl-profiles/package.json +52 -0
  139. package/backend/node_modules/balanced-match/LICENSE.md +23 -0
  140. package/backend/node_modules/balanced-match/README.md +57 -0
  141. package/backend/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
  142. package/backend/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  143. package/backend/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  144. package/backend/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
  145. package/backend/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  146. package/backend/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
  147. package/backend/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
  148. package/backend/node_modules/balanced-match/dist/esm/index.js +54 -0
  149. package/backend/node_modules/balanced-match/dist/esm/index.js.map +1 -0
  150. package/backend/node_modules/balanced-match/dist/esm/package.json +3 -0
  151. package/backend/node_modules/balanced-match/package.json +68 -0
  152. package/backend/node_modules/bcrypt/.dockerignore +6 -0
  153. package/backend/node_modules/bcrypt/.editorconfig +19 -0
  154. package/backend/node_modules/bcrypt/.github/workflows/build-pack-publish.yml +110 -0
  155. package/backend/node_modules/bcrypt/.github/workflows/ci.yaml +42 -0
  156. package/backend/node_modules/bcrypt/CHANGELOG.md +184 -0
  157. package/backend/node_modules/bcrypt/Dockerfile +57 -0
  158. package/backend/node_modules/bcrypt/Dockerfile-alpine +41 -0
  159. package/backend/node_modules/bcrypt/ISSUE_TEMPLATE.md +18 -0
  160. package/backend/node_modules/bcrypt/LICENSE +19 -0
  161. package/backend/node_modules/bcrypt/Makefile +19 -0
  162. package/backend/node_modules/bcrypt/README.md +388 -0
  163. package/backend/node_modules/bcrypt/SECURITY.md +15 -0
  164. package/backend/node_modules/bcrypt/bcrypt.js +242 -0
  165. package/backend/node_modules/bcrypt/binding.gyp +49 -0
  166. package/backend/node_modules/bcrypt/build-all.sh +37 -0
  167. package/backend/node_modules/bcrypt/examples/async_compare.js +28 -0
  168. package/backend/node_modules/bcrypt/examples/forever_gen_salt.js +8 -0
  169. package/backend/node_modules/bcrypt/package.json +62 -0
  170. package/backend/node_modules/bcrypt/prebuilds/darwin-arm64/bcrypt.node +0 -0
  171. package/backend/node_modules/bcrypt/prebuilds/darwin-x64/bcrypt.node +0 -0
  172. package/backend/node_modules/bcrypt/prebuilds/linux-arm/bcrypt.glibc.node +0 -0
  173. package/backend/node_modules/bcrypt/prebuilds/linux-arm/bcrypt.musl.node +0 -0
  174. package/backend/node_modules/bcrypt/prebuilds/linux-arm64/bcrypt.glibc.node +0 -0
  175. package/backend/node_modules/bcrypt/prebuilds/linux-arm64/bcrypt.musl.node +0 -0
  176. package/backend/node_modules/bcrypt/prebuilds/linux-x64/bcrypt.glibc.node +0 -0
  177. package/backend/node_modules/bcrypt/prebuilds/linux-x64/bcrypt.musl.node +0 -0
  178. package/backend/node_modules/bcrypt/prebuilds/win32-arm64/bcrypt.node +0 -0
  179. package/backend/node_modules/bcrypt/prebuilds/win32-x64/bcrypt.node +0 -0
  180. package/backend/node_modules/bcrypt/promises.js +45 -0
  181. package/backend/node_modules/bcrypt/src/bcrypt.cc +315 -0
  182. package/backend/node_modules/bcrypt/src/bcrypt_node.cc +288 -0
  183. package/backend/node_modules/bcrypt/src/blowfish.cc +679 -0
  184. package/backend/node_modules/bcrypt/src/node_blf.h +132 -0
  185. package/backend/node_modules/bcrypt/test/async.test.js +209 -0
  186. package/backend/node_modules/bcrypt/test/implementation.test.js +48 -0
  187. package/backend/node_modules/bcrypt/test/promise.test.js +168 -0
  188. package/backend/node_modules/bcrypt/test/repetitions.test.js +55 -0
  189. package/backend/node_modules/bcrypt/test/sync.test.js +125 -0
  190. package/backend/node_modules/bcryptjs/LICENSE +27 -0
  191. package/backend/node_modules/bcryptjs/README.md +201 -0
  192. package/backend/node_modules/bcryptjs/bin/bcrypt +23 -0
  193. package/backend/node_modules/bcryptjs/index.d.ts +3 -0
  194. package/backend/node_modules/bcryptjs/index.js +1159 -0
  195. package/backend/node_modules/bcryptjs/package.json +76 -0
  196. package/backend/node_modules/bcryptjs/types.d.ts +157 -0
  197. package/backend/node_modules/bcryptjs/umd/index.d.ts +3 -0
  198. package/backend/node_modules/bcryptjs/umd/index.js +1220 -0
  199. package/backend/node_modules/bcryptjs/umd/package.json +3 -0
  200. package/backend/node_modules/bcryptjs/umd/types.d.ts +157 -0
  201. package/backend/node_modules/binary-extensions/binary-extensions.json +263 -0
  202. package/backend/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
  203. package/backend/node_modules/binary-extensions/index.d.ts +14 -0
  204. package/backend/node_modules/binary-extensions/index.js +1 -0
  205. package/backend/node_modules/binary-extensions/license +10 -0
  206. package/backend/node_modules/binary-extensions/package.json +40 -0
  207. package/backend/node_modules/binary-extensions/readme.md +25 -0
  208. package/backend/node_modules/body-parser/LICENSE +23 -0
  209. package/backend/node_modules/body-parser/README.md +494 -0
  210. package/backend/node_modules/body-parser/index.js +71 -0
  211. package/backend/node_modules/body-parser/lib/read.js +247 -0
  212. package/backend/node_modules/body-parser/lib/types/json.js +158 -0
  213. package/backend/node_modules/body-parser/lib/types/raw.js +42 -0
  214. package/backend/node_modules/body-parser/lib/types/text.js +36 -0
  215. package/backend/node_modules/body-parser/lib/types/urlencoded.js +142 -0
  216. package/backend/node_modules/body-parser/lib/utils.js +98 -0
  217. package/backend/node_modules/body-parser/package.json +52 -0
  218. package/backend/node_modules/brace-expansion/LICENSE +23 -0
  219. package/backend/node_modules/brace-expansion/README.md +94 -0
  220. package/backend/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
  221. package/backend/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  222. package/backend/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
  223. package/backend/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
  224. package/backend/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  225. package/backend/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
  226. package/backend/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
  227. package/backend/node_modules/brace-expansion/dist/esm/index.js +197 -0
  228. package/backend/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
  229. package/backend/node_modules/brace-expansion/dist/esm/package.json +3 -0
  230. package/backend/node_modules/brace-expansion/package.json +64 -0
  231. package/backend/node_modules/braces/LICENSE +21 -0
  232. package/backend/node_modules/braces/README.md +586 -0
  233. package/backend/node_modules/braces/index.js +170 -0
  234. package/backend/node_modules/braces/lib/compile.js +60 -0
  235. package/backend/node_modules/braces/lib/constants.js +57 -0
  236. package/backend/node_modules/braces/lib/expand.js +113 -0
  237. package/backend/node_modules/braces/lib/parse.js +331 -0
  238. package/backend/node_modules/braces/lib/stringify.js +32 -0
  239. package/backend/node_modules/braces/lib/utils.js +122 -0
  240. package/backend/node_modules/braces/package.json +77 -0
  241. package/backend/node_modules/buffer-equal-constant-time/.travis.yml +4 -0
  242. package/backend/node_modules/buffer-equal-constant-time/LICENSE.txt +12 -0
  243. package/backend/node_modules/buffer-equal-constant-time/README.md +50 -0
  244. package/backend/node_modules/buffer-equal-constant-time/index.js +41 -0
  245. package/backend/node_modules/buffer-equal-constant-time/package.json +21 -0
  246. package/backend/node_modules/buffer-equal-constant-time/test.js +42 -0
  247. package/backend/node_modules/bytes/History.md +97 -0
  248. package/backend/node_modules/bytes/LICENSE +23 -0
  249. package/backend/node_modules/bytes/Readme.md +152 -0
  250. package/backend/node_modules/bytes/index.js +170 -0
  251. package/backend/node_modules/bytes/package.json +42 -0
  252. package/backend/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  253. package/backend/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  254. package/backend/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  255. package/backend/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  256. package/backend/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  257. package/backend/node_modules/call-bind-apply-helpers/README.md +62 -0
  258. package/backend/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  259. package/backend/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  260. package/backend/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  261. package/backend/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  262. package/backend/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  263. package/backend/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  264. package/backend/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  265. package/backend/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  266. package/backend/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  267. package/backend/node_modules/call-bind-apply-helpers/index.js +15 -0
  268. package/backend/node_modules/call-bind-apply-helpers/package.json +85 -0
  269. package/backend/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  270. package/backend/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  271. package/backend/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  272. package/backend/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  273. package/backend/node_modules/call-bound/.eslintrc +13 -0
  274. package/backend/node_modules/call-bound/.github/FUNDING.yml +12 -0
  275. package/backend/node_modules/call-bound/.nycrc +9 -0
  276. package/backend/node_modules/call-bound/CHANGELOG.md +42 -0
  277. package/backend/node_modules/call-bound/LICENSE +21 -0
  278. package/backend/node_modules/call-bound/README.md +53 -0
  279. package/backend/node_modules/call-bound/index.d.ts +94 -0
  280. package/backend/node_modules/call-bound/index.js +19 -0
  281. package/backend/node_modules/call-bound/package.json +99 -0
  282. package/backend/node_modules/call-bound/test/index.js +61 -0
  283. package/backend/node_modules/call-bound/tsconfig.json +10 -0
  284. package/backend/node_modules/chokidar/LICENSE +21 -0
  285. package/backend/node_modules/chokidar/README.md +308 -0
  286. package/backend/node_modules/chokidar/index.js +973 -0
  287. package/backend/node_modules/chokidar/lib/constants.js +66 -0
  288. package/backend/node_modules/chokidar/lib/fsevents-handler.js +526 -0
  289. package/backend/node_modules/chokidar/lib/nodefs-handler.js +654 -0
  290. package/backend/node_modules/chokidar/package.json +70 -0
  291. package/backend/node_modules/chokidar/types/index.d.ts +192 -0
  292. package/backend/node_modules/content-disposition/LICENSE +22 -0
  293. package/backend/node_modules/content-disposition/README.md +141 -0
  294. package/backend/node_modules/content-disposition/index.js +536 -0
  295. package/backend/node_modules/content-disposition/package.json +40 -0
  296. package/backend/node_modules/content-type/HISTORY.md +29 -0
  297. package/backend/node_modules/content-type/LICENSE +22 -0
  298. package/backend/node_modules/content-type/README.md +94 -0
  299. package/backend/node_modules/content-type/index.js +225 -0
  300. package/backend/node_modules/content-type/package.json +42 -0
  301. package/backend/node_modules/cookie/LICENSE +24 -0
  302. package/backend/node_modules/cookie/README.md +317 -0
  303. package/backend/node_modules/cookie/SECURITY.md +25 -0
  304. package/backend/node_modules/cookie/index.js +335 -0
  305. package/backend/node_modules/cookie/package.json +44 -0
  306. package/backend/node_modules/cookie-signature/History.md +70 -0
  307. package/backend/node_modules/cookie-signature/LICENSE +22 -0
  308. package/backend/node_modules/cookie-signature/Readme.md +23 -0
  309. package/backend/node_modules/cookie-signature/index.js +47 -0
  310. package/backend/node_modules/cookie-signature/package.json +24 -0
  311. package/backend/node_modules/cors/LICENSE +22 -0
  312. package/backend/node_modules/cors/README.md +277 -0
  313. package/backend/node_modules/cors/lib/index.js +238 -0
  314. package/backend/node_modules/cors/package.json +42 -0
  315. package/backend/node_modules/debug/LICENSE +20 -0
  316. package/backend/node_modules/debug/README.md +481 -0
  317. package/backend/node_modules/debug/package.json +64 -0
  318. package/backend/node_modules/debug/src/browser.js +272 -0
  319. package/backend/node_modules/debug/src/common.js +292 -0
  320. package/backend/node_modules/debug/src/index.js +10 -0
  321. package/backend/node_modules/debug/src/node.js +263 -0
  322. package/backend/node_modules/denque/CHANGELOG.md +29 -0
  323. package/backend/node_modules/denque/LICENSE +201 -0
  324. package/backend/node_modules/denque/README.md +77 -0
  325. package/backend/node_modules/denque/index.d.ts +47 -0
  326. package/backend/node_modules/denque/index.js +481 -0
  327. package/backend/node_modules/denque/package.json +58 -0
  328. package/backend/node_modules/depd/History.md +103 -0
  329. package/backend/node_modules/depd/LICENSE +22 -0
  330. package/backend/node_modules/depd/Readme.md +280 -0
  331. package/backend/node_modules/depd/index.js +538 -0
  332. package/backend/node_modules/depd/lib/browser/index.js +77 -0
  333. package/backend/node_modules/depd/package.json +45 -0
  334. package/backend/node_modules/dunder-proto/.eslintrc +5 -0
  335. package/backend/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  336. package/backend/node_modules/dunder-proto/.nycrc +13 -0
  337. package/backend/node_modules/dunder-proto/CHANGELOG.md +24 -0
  338. package/backend/node_modules/dunder-proto/LICENSE +21 -0
  339. package/backend/node_modules/dunder-proto/README.md +54 -0
  340. package/backend/node_modules/dunder-proto/get.d.ts +5 -0
  341. package/backend/node_modules/dunder-proto/get.js +30 -0
  342. package/backend/node_modules/dunder-proto/package.json +76 -0
  343. package/backend/node_modules/dunder-proto/set.d.ts +5 -0
  344. package/backend/node_modules/dunder-proto/set.js +35 -0
  345. package/backend/node_modules/dunder-proto/test/get.js +34 -0
  346. package/backend/node_modules/dunder-proto/test/index.js +4 -0
  347. package/backend/node_modules/dunder-proto/test/set.js +50 -0
  348. package/backend/node_modules/dunder-proto/tsconfig.json +9 -0
  349. package/backend/node_modules/ecdsa-sig-formatter/CODEOWNERS +1 -0
  350. package/backend/node_modules/ecdsa-sig-formatter/LICENSE +201 -0
  351. package/backend/node_modules/ecdsa-sig-formatter/README.md +65 -0
  352. package/backend/node_modules/ecdsa-sig-formatter/package.json +46 -0
  353. package/backend/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts +17 -0
  354. package/backend/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +187 -0
  355. package/backend/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +23 -0
  356. package/backend/node_modules/ee-first/LICENSE +22 -0
  357. package/backend/node_modules/ee-first/README.md +80 -0
  358. package/backend/node_modules/ee-first/index.js +95 -0
  359. package/backend/node_modules/ee-first/package.json +29 -0
  360. package/backend/node_modules/encodeurl/LICENSE +22 -0
  361. package/backend/node_modules/encodeurl/README.md +109 -0
  362. package/backend/node_modules/encodeurl/index.js +60 -0
  363. package/backend/node_modules/encodeurl/package.json +40 -0
  364. package/backend/node_modules/es-define-property/.eslintrc +13 -0
  365. package/backend/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  366. package/backend/node_modules/es-define-property/.nycrc +9 -0
  367. package/backend/node_modules/es-define-property/CHANGELOG.md +29 -0
  368. package/backend/node_modules/es-define-property/LICENSE +21 -0
  369. package/backend/node_modules/es-define-property/README.md +49 -0
  370. package/backend/node_modules/es-define-property/index.d.ts +3 -0
  371. package/backend/node_modules/es-define-property/index.js +14 -0
  372. package/backend/node_modules/es-define-property/package.json +81 -0
  373. package/backend/node_modules/es-define-property/test/index.js +56 -0
  374. package/backend/node_modules/es-define-property/tsconfig.json +10 -0
  375. package/backend/node_modules/es-errors/.eslintrc +5 -0
  376. package/backend/node_modules/es-errors/.github/FUNDING.yml +12 -0
  377. package/backend/node_modules/es-errors/CHANGELOG.md +40 -0
  378. package/backend/node_modules/es-errors/LICENSE +21 -0
  379. package/backend/node_modules/es-errors/README.md +55 -0
  380. package/backend/node_modules/es-errors/eval.d.ts +3 -0
  381. package/backend/node_modules/es-errors/eval.js +4 -0
  382. package/backend/node_modules/es-errors/index.d.ts +3 -0
  383. package/backend/node_modules/es-errors/index.js +4 -0
  384. package/backend/node_modules/es-errors/package.json +80 -0
  385. package/backend/node_modules/es-errors/range.d.ts +3 -0
  386. package/backend/node_modules/es-errors/range.js +4 -0
  387. package/backend/node_modules/es-errors/ref.d.ts +3 -0
  388. package/backend/node_modules/es-errors/ref.js +4 -0
  389. package/backend/node_modules/es-errors/syntax.d.ts +3 -0
  390. package/backend/node_modules/es-errors/syntax.js +4 -0
  391. package/backend/node_modules/es-errors/test/index.js +19 -0
  392. package/backend/node_modules/es-errors/tsconfig.json +49 -0
  393. package/backend/node_modules/es-errors/type.d.ts +3 -0
  394. package/backend/node_modules/es-errors/type.js +4 -0
  395. package/backend/node_modules/es-errors/uri.d.ts +3 -0
  396. package/backend/node_modules/es-errors/uri.js +4 -0
  397. package/backend/node_modules/es-object-atoms/.eslintrc +16 -0
  398. package/backend/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  399. package/backend/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  400. package/backend/node_modules/es-object-atoms/LICENSE +21 -0
  401. package/backend/node_modules/es-object-atoms/README.md +63 -0
  402. package/backend/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  403. package/backend/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  404. package/backend/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  405. package/backend/node_modules/es-object-atoms/ToObject.js +10 -0
  406. package/backend/node_modules/es-object-atoms/index.d.ts +3 -0
  407. package/backend/node_modules/es-object-atoms/index.js +4 -0
  408. package/backend/node_modules/es-object-atoms/isObject.d.ts +3 -0
  409. package/backend/node_modules/es-object-atoms/isObject.js +6 -0
  410. package/backend/node_modules/es-object-atoms/package.json +80 -0
  411. package/backend/node_modules/es-object-atoms/test/index.js +38 -0
  412. package/backend/node_modules/es-object-atoms/tsconfig.json +6 -0
  413. package/backend/node_modules/escape-html/LICENSE +24 -0
  414. package/backend/node_modules/escape-html/Readme.md +43 -0
  415. package/backend/node_modules/escape-html/index.js +78 -0
  416. package/backend/node_modules/escape-html/package.json +24 -0
  417. package/backend/node_modules/etag/HISTORY.md +83 -0
  418. package/backend/node_modules/etag/LICENSE +22 -0
  419. package/backend/node_modules/etag/README.md +159 -0
  420. package/backend/node_modules/etag/index.js +131 -0
  421. package/backend/node_modules/etag/package.json +47 -0
  422. package/backend/node_modules/express/LICENSE +24 -0
  423. package/backend/node_modules/express/Readme.md +276 -0
  424. package/backend/node_modules/express/index.js +11 -0
  425. package/backend/node_modules/express/lib/application.js +631 -0
  426. package/backend/node_modules/express/lib/express.js +81 -0
  427. package/backend/node_modules/express/lib/request.js +514 -0
  428. package/backend/node_modules/express/lib/response.js +1053 -0
  429. package/backend/node_modules/express/lib/utils.js +271 -0
  430. package/backend/node_modules/express/lib/view.js +205 -0
  431. package/backend/node_modules/express/package.json +99 -0
  432. package/backend/node_modules/fill-range/LICENSE +21 -0
  433. package/backend/node_modules/fill-range/README.md +237 -0
  434. package/backend/node_modules/fill-range/index.js +248 -0
  435. package/backend/node_modules/fill-range/package.json +74 -0
  436. package/backend/node_modules/finalhandler/HISTORY.md +239 -0
  437. package/backend/node_modules/finalhandler/LICENSE +22 -0
  438. package/backend/node_modules/finalhandler/README.md +150 -0
  439. package/backend/node_modules/finalhandler/index.js +293 -0
  440. package/backend/node_modules/finalhandler/package.json +47 -0
  441. package/backend/node_modules/forwarded/HISTORY.md +21 -0
  442. package/backend/node_modules/forwarded/LICENSE +22 -0
  443. package/backend/node_modules/forwarded/README.md +57 -0
  444. package/backend/node_modules/forwarded/index.js +90 -0
  445. package/backend/node_modules/forwarded/package.json +45 -0
  446. package/backend/node_modules/fresh/HISTORY.md +80 -0
  447. package/backend/node_modules/fresh/LICENSE +23 -0
  448. package/backend/node_modules/fresh/README.md +117 -0
  449. package/backend/node_modules/fresh/index.js +136 -0
  450. package/backend/node_modules/fresh/package.json +46 -0
  451. package/backend/node_modules/function-bind/.eslintrc +21 -0
  452. package/backend/node_modules/function-bind/.github/FUNDING.yml +12 -0
  453. package/backend/node_modules/function-bind/.github/SECURITY.md +3 -0
  454. package/backend/node_modules/function-bind/.nycrc +13 -0
  455. package/backend/node_modules/function-bind/CHANGELOG.md +136 -0
  456. package/backend/node_modules/function-bind/LICENSE +20 -0
  457. package/backend/node_modules/function-bind/README.md +46 -0
  458. package/backend/node_modules/function-bind/implementation.js +84 -0
  459. package/backend/node_modules/function-bind/index.js +5 -0
  460. package/backend/node_modules/function-bind/package.json +87 -0
  461. package/backend/node_modules/function-bind/test/.eslintrc +9 -0
  462. package/backend/node_modules/function-bind/test/index.js +252 -0
  463. package/backend/node_modules/generate-function/.travis.yml +3 -0
  464. package/backend/node_modules/generate-function/LICENSE +21 -0
  465. package/backend/node_modules/generate-function/README.md +89 -0
  466. package/backend/node_modules/generate-function/example.js +27 -0
  467. package/backend/node_modules/generate-function/index.js +181 -0
  468. package/backend/node_modules/generate-function/package.json +32 -0
  469. package/backend/node_modules/generate-function/test.js +49 -0
  470. package/backend/node_modules/get-intrinsic/.eslintrc +42 -0
  471. package/backend/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  472. package/backend/node_modules/get-intrinsic/.nycrc +9 -0
  473. package/backend/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  474. package/backend/node_modules/get-intrinsic/LICENSE +21 -0
  475. package/backend/node_modules/get-intrinsic/README.md +71 -0
  476. package/backend/node_modules/get-intrinsic/index.js +378 -0
  477. package/backend/node_modules/get-intrinsic/package.json +97 -0
  478. package/backend/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  479. package/backend/node_modules/get-proto/.eslintrc +10 -0
  480. package/backend/node_modules/get-proto/.github/FUNDING.yml +12 -0
  481. package/backend/node_modules/get-proto/.nycrc +9 -0
  482. package/backend/node_modules/get-proto/CHANGELOG.md +21 -0
  483. package/backend/node_modules/get-proto/LICENSE +21 -0
  484. package/backend/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  485. package/backend/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  486. package/backend/node_modules/get-proto/README.md +50 -0
  487. package/backend/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  488. package/backend/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  489. package/backend/node_modules/get-proto/index.d.ts +5 -0
  490. package/backend/node_modules/get-proto/index.js +27 -0
  491. package/backend/node_modules/get-proto/package.json +81 -0
  492. package/backend/node_modules/get-proto/test/index.js +68 -0
  493. package/backend/node_modules/get-proto/tsconfig.json +9 -0
  494. package/backend/node_modules/glob-parent/CHANGELOG.md +110 -0
  495. package/backend/node_modules/glob-parent/LICENSE +15 -0
  496. package/backend/node_modules/glob-parent/README.md +137 -0
  497. package/backend/node_modules/glob-parent/index.js +42 -0
  498. package/backend/node_modules/glob-parent/package.json +48 -0
  499. package/backend/node_modules/gopd/.eslintrc +16 -0
  500. package/backend/node_modules/gopd/.github/FUNDING.yml +12 -0
  501. package/backend/node_modules/gopd/CHANGELOG.md +45 -0
  502. package/backend/node_modules/gopd/LICENSE +21 -0
  503. package/backend/node_modules/gopd/README.md +40 -0
  504. package/backend/node_modules/gopd/gOPD.d.ts +1 -0
  505. package/backend/node_modules/gopd/gOPD.js +4 -0
  506. package/backend/node_modules/gopd/index.d.ts +5 -0
  507. package/backend/node_modules/gopd/index.js +15 -0
  508. package/backend/node_modules/gopd/package.json +77 -0
  509. package/backend/node_modules/gopd/test/index.js +36 -0
  510. package/backend/node_modules/gopd/tsconfig.json +9 -0
  511. package/backend/node_modules/has-flag/index.js +8 -0
  512. package/backend/node_modules/has-flag/license +9 -0
  513. package/backend/node_modules/has-flag/package.json +44 -0
  514. package/backend/node_modules/has-flag/readme.md +70 -0
  515. package/backend/node_modules/has-symbols/.eslintrc +11 -0
  516. package/backend/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  517. package/backend/node_modules/has-symbols/.nycrc +9 -0
  518. package/backend/node_modules/has-symbols/CHANGELOG.md +91 -0
  519. package/backend/node_modules/has-symbols/LICENSE +21 -0
  520. package/backend/node_modules/has-symbols/README.md +46 -0
  521. package/backend/node_modules/has-symbols/index.d.ts +3 -0
  522. package/backend/node_modules/has-symbols/index.js +14 -0
  523. package/backend/node_modules/has-symbols/package.json +111 -0
  524. package/backend/node_modules/has-symbols/shams.d.ts +3 -0
  525. package/backend/node_modules/has-symbols/shams.js +45 -0
  526. package/backend/node_modules/has-symbols/test/index.js +22 -0
  527. package/backend/node_modules/has-symbols/test/shams/core-js.js +29 -0
  528. package/backend/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  529. package/backend/node_modules/has-symbols/test/tests.js +58 -0
  530. package/backend/node_modules/has-symbols/tsconfig.json +10 -0
  531. package/backend/node_modules/hasown/.github/FUNDING.yml +12 -0
  532. package/backend/node_modules/hasown/.nycrc +13 -0
  533. package/backend/node_modules/hasown/CHANGELOG.md +51 -0
  534. package/backend/node_modules/hasown/LICENSE +21 -0
  535. package/backend/node_modules/hasown/README.md +40 -0
  536. package/backend/node_modules/hasown/eslint.config.mjs +6 -0
  537. package/backend/node_modules/hasown/index.d.ts +4 -0
  538. package/backend/node_modules/hasown/index.js +8 -0
  539. package/backend/node_modules/hasown/package.json +92 -0
  540. package/backend/node_modules/hasown/tsconfig.json +6 -0
  541. package/backend/node_modules/http-errors/HISTORY.md +186 -0
  542. package/backend/node_modules/http-errors/LICENSE +23 -0
  543. package/backend/node_modules/http-errors/README.md +169 -0
  544. package/backend/node_modules/http-errors/index.js +290 -0
  545. package/backend/node_modules/http-errors/package.json +54 -0
  546. package/backend/node_modules/iconv-lite/LICENSE +21 -0
  547. package/backend/node_modules/iconv-lite/README.md +138 -0
  548. package/backend/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  549. package/backend/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  550. package/backend/node_modules/iconv-lite/encodings/index.js +23 -0
  551. package/backend/node_modules/iconv-lite/encodings/internal.js +218 -0
  552. package/backend/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  553. package/backend/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  554. package/backend/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
  555. package/backend/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  556. package/backend/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  557. package/backend/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  558. package/backend/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  559. package/backend/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  560. package/backend/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  561. package/backend/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  562. package/backend/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  563. package/backend/node_modules/iconv-lite/encodings/utf16.js +187 -0
  564. package/backend/node_modules/iconv-lite/encodings/utf32.js +307 -0
  565. package/backend/node_modules/iconv-lite/encodings/utf7.js +283 -0
  566. package/backend/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  567. package/backend/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  568. package/backend/node_modules/iconv-lite/lib/index.d.ts +129 -0
  569. package/backend/node_modules/iconv-lite/lib/index.js +182 -0
  570. package/backend/node_modules/iconv-lite/lib/streams.js +105 -0
  571. package/backend/node_modules/iconv-lite/package.json +70 -0
  572. package/backend/node_modules/iconv-lite/types/encodings.d.ts +423 -0
  573. package/backend/node_modules/ignore-by-default/LICENSE +14 -0
  574. package/backend/node_modules/ignore-by-default/README.md +26 -0
  575. package/backend/node_modules/ignore-by-default/index.js +12 -0
  576. package/backend/node_modules/ignore-by-default/package.json +34 -0
  577. package/backend/node_modules/inherits/LICENSE +16 -0
  578. package/backend/node_modules/inherits/README.md +42 -0
  579. package/backend/node_modules/inherits/inherits.js +9 -0
  580. package/backend/node_modules/inherits/inherits_browser.js +27 -0
  581. package/backend/node_modules/inherits/package.json +29 -0
  582. package/backend/node_modules/ipaddr.js/LICENSE +19 -0
  583. package/backend/node_modules/ipaddr.js/README.md +233 -0
  584. package/backend/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  585. package/backend/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
  586. package/backend/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  587. package/backend/node_modules/ipaddr.js/package.json +35 -0
  588. package/backend/node_modules/is-binary-path/index.d.ts +17 -0
  589. package/backend/node_modules/is-binary-path/index.js +7 -0
  590. package/backend/node_modules/is-binary-path/license +9 -0
  591. package/backend/node_modules/is-binary-path/package.json +40 -0
  592. package/backend/node_modules/is-binary-path/readme.md +34 -0
  593. package/backend/node_modules/is-extglob/LICENSE +21 -0
  594. package/backend/node_modules/is-extglob/README.md +107 -0
  595. package/backend/node_modules/is-extglob/index.js +20 -0
  596. package/backend/node_modules/is-extglob/package.json +69 -0
  597. package/backend/node_modules/is-glob/LICENSE +21 -0
  598. package/backend/node_modules/is-glob/README.md +206 -0
  599. package/backend/node_modules/is-glob/index.js +150 -0
  600. package/backend/node_modules/is-glob/package.json +81 -0
  601. package/backend/node_modules/is-number/LICENSE +21 -0
  602. package/backend/node_modules/is-number/README.md +187 -0
  603. package/backend/node_modules/is-number/index.js +18 -0
  604. package/backend/node_modules/is-number/package.json +82 -0
  605. package/backend/node_modules/is-promise/LICENSE +19 -0
  606. package/backend/node_modules/is-promise/index.d.ts +2 -0
  607. package/backend/node_modules/is-promise/index.js +6 -0
  608. package/backend/node_modules/is-promise/index.mjs +3 -0
  609. package/backend/node_modules/is-promise/package.json +30 -0
  610. package/backend/node_modules/is-promise/readme.md +33 -0
  611. package/backend/node_modules/is-property/LICENSE +22 -0
  612. package/backend/node_modules/is-property/README.md +28 -0
  613. package/backend/node_modules/is-property/is-property.js +5 -0
  614. package/backend/node_modules/is-property/package.json +36 -0
  615. package/backend/node_modules/json/.gitmodules +3 -0
  616. package/backend/node_modules/json/.jshintrc +3 -0
  617. package/backend/node_modules/json/CHANGES.md +1050 -0
  618. package/backend/node_modules/json/LICENSE.txt +24 -0
  619. package/backend/node_modules/json/README.md +122 -0
  620. package/backend/node_modules/json/lib/json.js +1765 -0
  621. package/backend/node_modules/json/man/man1/json.1 +1151 -0
  622. package/backend/node_modules/json/package.json +38 -0
  623. package/backend/node_modules/jsonwebtoken/LICENSE +21 -0
  624. package/backend/node_modules/jsonwebtoken/README.md +396 -0
  625. package/backend/node_modules/jsonwebtoken/decode.js +30 -0
  626. package/backend/node_modules/jsonwebtoken/index.js +8 -0
  627. package/backend/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +14 -0
  628. package/backend/node_modules/jsonwebtoken/lib/NotBeforeError.js +13 -0
  629. package/backend/node_modules/jsonwebtoken/lib/TokenExpiredError.js +13 -0
  630. package/backend/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +3 -0
  631. package/backend/node_modules/jsonwebtoken/lib/psSupported.js +3 -0
  632. package/backend/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +3 -0
  633. package/backend/node_modules/jsonwebtoken/lib/timespan.js +18 -0
  634. package/backend/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +66 -0
  635. package/backend/node_modules/jsonwebtoken/package.json +70 -0
  636. package/backend/node_modules/jsonwebtoken/sign.js +253 -0
  637. package/backend/node_modules/jsonwebtoken/verify.js +263 -0
  638. package/backend/node_modules/jwa/LICENSE +17 -0
  639. package/backend/node_modules/jwa/README.md +150 -0
  640. package/backend/node_modules/jwa/index.js +266 -0
  641. package/backend/node_modules/jwa/opslevel.yml +6 -0
  642. package/backend/node_modules/jwa/package.json +37 -0
  643. package/backend/node_modules/jws/CHANGELOG.md +56 -0
  644. package/backend/node_modules/jws/LICENSE +17 -0
  645. package/backend/node_modules/jws/index.js +22 -0
  646. package/backend/node_modules/jws/lib/data-stream.js +55 -0
  647. package/backend/node_modules/jws/lib/sign-stream.js +83 -0
  648. package/backend/node_modules/jws/lib/tostring.js +10 -0
  649. package/backend/node_modules/jws/lib/verify-stream.js +125 -0
  650. package/backend/node_modules/jws/opslevel.yml +6 -0
  651. package/backend/node_modules/jws/package.json +34 -0
  652. package/backend/node_modules/jws/readme.md +255 -0
  653. package/backend/node_modules/lodash.includes/LICENSE +47 -0
  654. package/backend/node_modules/lodash.includes/README.md +18 -0
  655. package/backend/node_modules/lodash.includes/index.js +745 -0
  656. package/backend/node_modules/lodash.includes/package.json +17 -0
  657. package/backend/node_modules/lodash.isboolean/LICENSE +22 -0
  658. package/backend/node_modules/lodash.isboolean/README.md +18 -0
  659. package/backend/node_modules/lodash.isboolean/index.js +70 -0
  660. package/backend/node_modules/lodash.isboolean/package.json +17 -0
  661. package/backend/node_modules/lodash.isinteger/LICENSE +47 -0
  662. package/backend/node_modules/lodash.isinteger/README.md +18 -0
  663. package/backend/node_modules/lodash.isinteger/index.js +265 -0
  664. package/backend/node_modules/lodash.isinteger/package.json +17 -0
  665. package/backend/node_modules/lodash.isnumber/LICENSE +22 -0
  666. package/backend/node_modules/lodash.isnumber/README.md +18 -0
  667. package/backend/node_modules/lodash.isnumber/index.js +79 -0
  668. package/backend/node_modules/lodash.isnumber/package.json +17 -0
  669. package/backend/node_modules/lodash.isplainobject/LICENSE +47 -0
  670. package/backend/node_modules/lodash.isplainobject/README.md +18 -0
  671. package/backend/node_modules/lodash.isplainobject/index.js +139 -0
  672. package/backend/node_modules/lodash.isplainobject/package.json +17 -0
  673. package/backend/node_modules/lodash.isstring/LICENSE +22 -0
  674. package/backend/node_modules/lodash.isstring/README.md +18 -0
  675. package/backend/node_modules/lodash.isstring/index.js +95 -0
  676. package/backend/node_modules/lodash.isstring/package.json +17 -0
  677. package/backend/node_modules/lodash.once/LICENSE +47 -0
  678. package/backend/node_modules/lodash.once/README.md +18 -0
  679. package/backend/node_modules/lodash.once/index.js +294 -0
  680. package/backend/node_modules/lodash.once/package.json +17 -0
  681. package/backend/node_modules/long/LICENSE +202 -0
  682. package/backend/node_modules/long/README.md +286 -0
  683. package/backend/node_modules/long/index.d.ts +2 -0
  684. package/backend/node_modules/long/index.js +1581 -0
  685. package/backend/node_modules/long/package.json +58 -0
  686. package/backend/node_modules/long/types.d.ts +474 -0
  687. package/backend/node_modules/long/umd/index.d.ts +3 -0
  688. package/backend/node_modules/long/umd/index.js +1622 -0
  689. package/backend/node_modules/long/umd/package.json +3 -0
  690. package/backend/node_modules/long/umd/types.d.ts +474 -0
  691. package/backend/node_modules/lru.min/LICENSE +21 -0
  692. package/backend/node_modules/lru.min/README.md +392 -0
  693. package/backend/node_modules/lru.min/browser/lru.min.js +1 -0
  694. package/backend/node_modules/lru.min/lib/index.d.ts +38 -0
  695. package/backend/node_modules/lru.min/lib/index.js +248 -0
  696. package/backend/node_modules/lru.min/lib/index.mjs +227 -0
  697. package/backend/node_modules/lru.min/package.json +87 -0
  698. package/backend/node_modules/math-intrinsics/.eslintrc +16 -0
  699. package/backend/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  700. package/backend/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  701. package/backend/node_modules/math-intrinsics/LICENSE +21 -0
  702. package/backend/node_modules/math-intrinsics/README.md +50 -0
  703. package/backend/node_modules/math-intrinsics/abs.d.ts +1 -0
  704. package/backend/node_modules/math-intrinsics/abs.js +4 -0
  705. package/backend/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  706. package/backend/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  707. package/backend/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  708. package/backend/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  709. package/backend/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  710. package/backend/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  711. package/backend/node_modules/math-intrinsics/floor.d.ts +1 -0
  712. package/backend/node_modules/math-intrinsics/floor.js +4 -0
  713. package/backend/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  714. package/backend/node_modules/math-intrinsics/isFinite.js +12 -0
  715. package/backend/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  716. package/backend/node_modules/math-intrinsics/isInteger.js +16 -0
  717. package/backend/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  718. package/backend/node_modules/math-intrinsics/isNaN.js +6 -0
  719. package/backend/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  720. package/backend/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  721. package/backend/node_modules/math-intrinsics/max.d.ts +1 -0
  722. package/backend/node_modules/math-intrinsics/max.js +4 -0
  723. package/backend/node_modules/math-intrinsics/min.d.ts +1 -0
  724. package/backend/node_modules/math-intrinsics/min.js +4 -0
  725. package/backend/node_modules/math-intrinsics/mod.d.ts +3 -0
  726. package/backend/node_modules/math-intrinsics/mod.js +9 -0
  727. package/backend/node_modules/math-intrinsics/package.json +86 -0
  728. package/backend/node_modules/math-intrinsics/pow.d.ts +1 -0
  729. package/backend/node_modules/math-intrinsics/pow.js +4 -0
  730. package/backend/node_modules/math-intrinsics/round.d.ts +1 -0
  731. package/backend/node_modules/math-intrinsics/round.js +4 -0
  732. package/backend/node_modules/math-intrinsics/sign.d.ts +3 -0
  733. package/backend/node_modules/math-intrinsics/sign.js +11 -0
  734. package/backend/node_modules/math-intrinsics/test/index.js +192 -0
  735. package/backend/node_modules/math-intrinsics/tsconfig.json +3 -0
  736. package/backend/node_modules/media-typer/HISTORY.md +50 -0
  737. package/backend/node_modules/media-typer/LICENSE +22 -0
  738. package/backend/node_modules/media-typer/README.md +93 -0
  739. package/backend/node_modules/media-typer/index.js +143 -0
  740. package/backend/node_modules/media-typer/package.json +33 -0
  741. package/backend/node_modules/merge-descriptors/index.d.ts +11 -0
  742. package/backend/node_modules/merge-descriptors/index.js +26 -0
  743. package/backend/node_modules/merge-descriptors/license +11 -0
  744. package/backend/node_modules/merge-descriptors/package.json +50 -0
  745. package/backend/node_modules/merge-descriptors/readme.md +55 -0
  746. package/backend/node_modules/mime-db/HISTORY.md +541 -0
  747. package/backend/node_modules/mime-db/LICENSE +23 -0
  748. package/backend/node_modules/mime-db/README.md +109 -0
  749. package/backend/node_modules/mime-db/db.json +9342 -0
  750. package/backend/node_modules/mime-db/index.js +12 -0
  751. package/backend/node_modules/mime-db/package.json +56 -0
  752. package/backend/node_modules/mime-types/HISTORY.md +428 -0
  753. package/backend/node_modules/mime-types/LICENSE +23 -0
  754. package/backend/node_modules/mime-types/README.md +126 -0
  755. package/backend/node_modules/mime-types/index.js +211 -0
  756. package/backend/node_modules/mime-types/mimeScore.js +57 -0
  757. package/backend/node_modules/mime-types/package.json +49 -0
  758. package/backend/node_modules/minimatch/LICENSE.md +55 -0
  759. package/backend/node_modules/minimatch/README.md +528 -0
  760. package/backend/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  761. package/backend/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  762. package/backend/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  763. package/backend/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  764. package/backend/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
  765. package/backend/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  766. package/backend/node_modules/minimatch/dist/commonjs/ast.js +845 -0
  767. package/backend/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  768. package/backend/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  769. package/backend/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  770. package/backend/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  771. package/backend/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  772. package/backend/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
  773. package/backend/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  774. package/backend/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  775. package/backend/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  776. package/backend/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
  777. package/backend/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  778. package/backend/node_modules/minimatch/dist/commonjs/index.js +1127 -0
  779. package/backend/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  780. package/backend/node_modules/minimatch/dist/commonjs/package.json +3 -0
  781. package/backend/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
  782. package/backend/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  783. package/backend/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  784. package/backend/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  785. package/backend/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  786. package/backend/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  787. package/backend/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  788. package/backend/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  789. package/backend/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
  790. package/backend/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  791. package/backend/node_modules/minimatch/dist/esm/ast.js +841 -0
  792. package/backend/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  793. package/backend/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  794. package/backend/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  795. package/backend/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  796. package/backend/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  797. package/backend/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
  798. package/backend/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  799. package/backend/node_modules/minimatch/dist/esm/escape.js +26 -0
  800. package/backend/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  801. package/backend/node_modules/minimatch/dist/esm/index.d.ts +174 -0
  802. package/backend/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  803. package/backend/node_modules/minimatch/dist/esm/index.js +1114 -0
  804. package/backend/node_modules/minimatch/dist/esm/index.js.map +1 -0
  805. package/backend/node_modules/minimatch/dist/esm/package.json +3 -0
  806. package/backend/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
  807. package/backend/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  808. package/backend/node_modules/minimatch/dist/esm/unescape.js +34 -0
  809. package/backend/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  810. package/backend/node_modules/minimatch/package.json +73 -0
  811. package/backend/node_modules/ms/index.js +162 -0
  812. package/backend/node_modules/ms/license.md +21 -0
  813. package/backend/node_modules/ms/package.json +38 -0
  814. package/backend/node_modules/ms/readme.md +59 -0
  815. package/backend/node_modules/mysql2/License +19 -0
  816. package/backend/node_modules/mysql2/README.md +114 -0
  817. package/backend/node_modules/mysql2/index.d.ts +1 -0
  818. package/backend/node_modules/mysql2/index.js +77 -0
  819. package/backend/node_modules/mysql2/lib/auth_41.js +95 -0
  820. package/backend/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js +115 -0
  821. package/backend/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md +18 -0
  822. package/backend/node_modules/mysql2/lib/auth_plugins/index.js +8 -0
  823. package/backend/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js +17 -0
  824. package/backend/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js +34 -0
  825. package/backend/node_modules/mysql2/lib/auth_plugins/sha256_password.js +74 -0
  826. package/backend/node_modules/mysql2/lib/base/connection.js +1139 -0
  827. package/backend/node_modules/mysql2/lib/base/pool.js +343 -0
  828. package/backend/node_modules/mysql2/lib/commands/auth_switch.js +151 -0
  829. package/backend/node_modules/mysql2/lib/commands/binlog_dump.js +109 -0
  830. package/backend/node_modules/mysql2/lib/commands/change_user.js +68 -0
  831. package/backend/node_modules/mysql2/lib/commands/client_handshake.js +386 -0
  832. package/backend/node_modules/mysql2/lib/commands/close_statement.js +18 -0
  833. package/backend/node_modules/mysql2/lib/commands/command.js +54 -0
  834. package/backend/node_modules/mysql2/lib/commands/execute.js +116 -0
  835. package/backend/node_modules/mysql2/lib/commands/index.js +29 -0
  836. package/backend/node_modules/mysql2/lib/commands/ping.js +36 -0
  837. package/backend/node_modules/mysql2/lib/commands/prepare.js +143 -0
  838. package/backend/node_modules/mysql2/lib/commands/query.js +365 -0
  839. package/backend/node_modules/mysql2/lib/commands/quit.js +29 -0
  840. package/backend/node_modules/mysql2/lib/commands/register_slave.js +27 -0
  841. package/backend/node_modules/mysql2/lib/commands/reset_connection.js +29 -0
  842. package/backend/node_modules/mysql2/lib/commands/server_handshake.js +205 -0
  843. package/backend/node_modules/mysql2/lib/compressed_protocol.js +153 -0
  844. package/backend/node_modules/mysql2/lib/connection.js +12 -0
  845. package/backend/node_modules/mysql2/lib/connection_config.js +300 -0
  846. package/backend/node_modules/mysql2/lib/constants/charset_encodings.js +317 -0
  847. package/backend/node_modules/mysql2/lib/constants/charsets.js +317 -0
  848. package/backend/node_modules/mysql2/lib/constants/client.js +39 -0
  849. package/backend/node_modules/mysql2/lib/constants/commands.js +37 -0
  850. package/backend/node_modules/mysql2/lib/constants/cursor.js +9 -0
  851. package/backend/node_modules/mysql2/lib/constants/encoding_charset.js +50 -0
  852. package/backend/node_modules/mysql2/lib/constants/errors.js +3973 -0
  853. package/backend/node_modules/mysql2/lib/constants/field_flags.js +20 -0
  854. package/backend/node_modules/mysql2/lib/constants/server_status.js +44 -0
  855. package/backend/node_modules/mysql2/lib/constants/session_track.js +11 -0
  856. package/backend/node_modules/mysql2/lib/constants/ssl_profiles.js +11 -0
  857. package/backend/node_modules/mysql2/lib/constants/types.js +64 -0
  858. package/backend/node_modules/mysql2/lib/create_connection.js +10 -0
  859. package/backend/node_modules/mysql2/lib/create_pool.js +10 -0
  860. package/backend/node_modules/mysql2/lib/create_pool_cluster.js +9 -0
  861. package/backend/node_modules/mysql2/lib/helpers.js +83 -0
  862. package/backend/node_modules/mysql2/lib/packet_parser.js +195 -0
  863. package/backend/node_modules/mysql2/lib/packets/auth_next_factor.js +35 -0
  864. package/backend/node_modules/mysql2/lib/packets/auth_switch_request.js +38 -0
  865. package/backend/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js +33 -0
  866. package/backend/node_modules/mysql2/lib/packets/auth_switch_response.js +30 -0
  867. package/backend/node_modules/mysql2/lib/packets/binary_row.js +95 -0
  868. package/backend/node_modules/mysql2/lib/packets/binlog_dump.js +33 -0
  869. package/backend/node_modules/mysql2/lib/packets/binlog_query_statusvars.js +115 -0
  870. package/backend/node_modules/mysql2/lib/packets/change_user.js +97 -0
  871. package/backend/node_modules/mysql2/lib/packets/close_statement.js +21 -0
  872. package/backend/node_modules/mysql2/lib/packets/column_definition.js +291 -0
  873. package/backend/node_modules/mysql2/lib/packets/encode_parameter.js +69 -0
  874. package/backend/node_modules/mysql2/lib/packets/execute.js +177 -0
  875. package/backend/node_modules/mysql2/lib/packets/handshake.js +112 -0
  876. package/backend/node_modules/mysql2/lib/packets/handshake_response.js +173 -0
  877. package/backend/node_modules/mysql2/lib/packets/index.js +154 -0
  878. package/backend/node_modules/mysql2/lib/packets/packet.js +978 -0
  879. package/backend/node_modules/mysql2/lib/packets/prepare_statement.js +27 -0
  880. package/backend/node_modules/mysql2/lib/packets/prepared_statement_header.js +16 -0
  881. package/backend/node_modules/mysql2/lib/packets/query.js +102 -0
  882. package/backend/node_modules/mysql2/lib/packets/register_slave.js +46 -0
  883. package/backend/node_modules/mysql2/lib/packets/reset_connection.js +17 -0
  884. package/backend/node_modules/mysql2/lib/packets/resultset_header.js +124 -0
  885. package/backend/node_modules/mysql2/lib/packets/ssl_request.js +25 -0
  886. package/backend/node_modules/mysql2/lib/packets/text_row.js +47 -0
  887. package/backend/node_modules/mysql2/lib/parsers/binary_parser.js +235 -0
  888. package/backend/node_modules/mysql2/lib/parsers/parser_cache.js +68 -0
  889. package/backend/node_modules/mysql2/lib/parsers/static_binary_parser.js +213 -0
  890. package/backend/node_modules/mysql2/lib/parsers/static_text_parser.js +152 -0
  891. package/backend/node_modules/mysql2/lib/parsers/string.js +50 -0
  892. package/backend/node_modules/mysql2/lib/parsers/text_parser.js +214 -0
  893. package/backend/node_modules/mysql2/lib/pool.js +12 -0
  894. package/backend/node_modules/mysql2/lib/pool_cluster.js +375 -0
  895. package/backend/node_modules/mysql2/lib/pool_config.js +34 -0
  896. package/backend/node_modules/mysql2/lib/pool_connection.js +81 -0
  897. package/backend/node_modules/mysql2/lib/promise/capture_local_err.js +25 -0
  898. package/backend/node_modules/mysql2/lib/promise/connection.js +237 -0
  899. package/backend/node_modules/mysql2/lib/promise/inherit_events.js +27 -0
  900. package/backend/node_modules/mysql2/lib/promise/make_done_cb.js +16 -0
  901. package/backend/node_modules/mysql2/lib/promise/pool.js +118 -0
  902. package/backend/node_modules/mysql2/lib/promise/pool_cluster.js +59 -0
  903. package/backend/node_modules/mysql2/lib/promise/pool_connection.js +19 -0
  904. package/backend/node_modules/mysql2/lib/promise/prepared_statement_info.js +35 -0
  905. package/backend/node_modules/mysql2/lib/results_stream.js +38 -0
  906. package/backend/node_modules/mysql2/lib/server.js +37 -0
  907. package/backend/node_modules/mysql2/lib/tracing.js +81 -0
  908. package/backend/node_modules/mysql2/package.json +95 -0
  909. package/backend/node_modules/mysql2/promise.d.ts +141 -0
  910. package/backend/node_modules/mysql2/promise.js +209 -0
  911. package/backend/node_modules/mysql2/typings/mysql/LICENSE.txt +15 -0
  912. package/backend/node_modules/mysql2/typings/mysql/index.d.ts +93 -0
  913. package/backend/node_modules/mysql2/typings/mysql/info.txt +1 -0
  914. package/backend/node_modules/mysql2/typings/mysql/lib/Auth.d.ts +30 -0
  915. package/backend/node_modules/mysql2/typings/mysql/lib/Connection.d.ts +456 -0
  916. package/backend/node_modules/mysql2/typings/mysql/lib/Pool.d.ts +78 -0
  917. package/backend/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts +92 -0
  918. package/backend/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts +11 -0
  919. package/backend/node_modules/mysql2/typings/mysql/lib/Server.d.ts +11 -0
  920. package/backend/node_modules/mysql2/typings/mysql/lib/Tracing.d.ts +71 -0
  921. package/backend/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts +8 -0
  922. package/backend/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts +326 -0
  923. package/backend/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts +70 -0
  924. package/backend/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts +5 -0
  925. package/backend/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts +4 -0
  926. package/backend/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts +18 -0
  927. package/backend/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts +54 -0
  928. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts +10 -0
  929. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts +27 -0
  930. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts +23 -0
  931. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts +13 -0
  932. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts +18 -0
  933. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts +9 -0
  934. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts +28 -0
  935. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts +6 -0
  936. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts +9 -0
  937. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts +41 -0
  938. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts +65 -0
  939. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts +235 -0
  940. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts +41 -0
  941. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts +5 -0
  942. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts +17 -0
  943. package/backend/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts +18 -0
  944. package/backend/node_modules/named-placeholders/LICENSE +21 -0
  945. package/backend/node_modules/named-placeholders/README.md +27 -0
  946. package/backend/node_modules/named-placeholders/index.js +179 -0
  947. package/backend/node_modules/named-placeholders/package.json +36 -0
  948. package/backend/node_modules/negotiator/HISTORY.md +114 -0
  949. package/backend/node_modules/negotiator/LICENSE +24 -0
  950. package/backend/node_modules/negotiator/README.md +212 -0
  951. package/backend/node_modules/negotiator/index.js +83 -0
  952. package/backend/node_modules/negotiator/lib/charset.js +169 -0
  953. package/backend/node_modules/negotiator/lib/encoding.js +205 -0
  954. package/backend/node_modules/negotiator/lib/language.js +179 -0
  955. package/backend/node_modules/negotiator/lib/mediaType.js +294 -0
  956. package/backend/node_modules/negotiator/package.json +43 -0
  957. package/backend/node_modules/node-addon-api/LICENSE.md +9 -0
  958. package/backend/node_modules/node-addon-api/README.md +95 -0
  959. package/backend/node_modules/node-addon-api/common.gypi +21 -0
  960. package/backend/node_modules/node-addon-api/except.gypi +25 -0
  961. package/backend/node_modules/node-addon-api/index.js +14 -0
  962. package/backend/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  963. package/backend/node_modules/node-addon-api/napi-inl.h +7181 -0
  964. package/backend/node_modules/node-addon-api/napi.h +3380 -0
  965. package/backend/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  966. package/backend/node_modules/node-addon-api/node_api.gyp +9 -0
  967. package/backend/node_modules/node-addon-api/noexcept.gypi +26 -0
  968. package/backend/node_modules/node-addon-api/nothing.c +0 -0
  969. package/backend/node_modules/node-addon-api/package-support.json +21 -0
  970. package/backend/node_modules/node-addon-api/package.json +480 -0
  971. package/backend/node_modules/node-addon-api/tools/README.md +73 -0
  972. package/backend/node_modules/node-addon-api/tools/check-napi.js +99 -0
  973. package/backend/node_modules/node-addon-api/tools/clang-format.js +71 -0
  974. package/backend/node_modules/node-addon-api/tools/conversion.js +301 -0
  975. package/backend/node_modules/node-gyp-build/LICENSE +21 -0
  976. package/backend/node_modules/node-gyp-build/README.md +58 -0
  977. package/backend/node_modules/node-gyp-build/SECURITY.md +5 -0
  978. package/backend/node_modules/node-gyp-build/bin.js +84 -0
  979. package/backend/node_modules/node-gyp-build/build-test.js +19 -0
  980. package/backend/node_modules/node-gyp-build/index.js +6 -0
  981. package/backend/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  982. package/backend/node_modules/node-gyp-build/optional.js +7 -0
  983. package/backend/node_modules/node-gyp-build/package.json +43 -0
  984. package/backend/node_modules/nodemon/.prettierrc.json +3 -0
  985. package/backend/node_modules/nodemon/LICENSE +21 -0
  986. package/backend/node_modules/nodemon/README.md +439 -0
  987. package/backend/node_modules/nodemon/bin/nodemon.js +16 -0
  988. package/backend/node_modules/nodemon/bin/windows-kill.exe +0 -0
  989. package/backend/node_modules/nodemon/doc/cli/authors.txt +8 -0
  990. package/backend/node_modules/nodemon/doc/cli/config.txt +44 -0
  991. package/backend/node_modules/nodemon/doc/cli/help.txt +29 -0
  992. package/backend/node_modules/nodemon/doc/cli/logo.txt +20 -0
  993. package/backend/node_modules/nodemon/doc/cli/options.txt +36 -0
  994. package/backend/node_modules/nodemon/doc/cli/topics.txt +8 -0
  995. package/backend/node_modules/nodemon/doc/cli/usage.txt +3 -0
  996. package/backend/node_modules/nodemon/doc/cli/whoami.txt +9 -0
  997. package/backend/node_modules/nodemon/index.d.ts +124 -0
  998. package/backend/node_modules/nodemon/jsconfig.json +7 -0
  999. package/backend/node_modules/nodemon/lib/cli/index.js +49 -0
  1000. package/backend/node_modules/nodemon/lib/cli/parse.js +230 -0
  1001. package/backend/node_modules/nodemon/lib/config/command.js +43 -0
  1002. package/backend/node_modules/nodemon/lib/config/defaults.js +34 -0
  1003. package/backend/node_modules/nodemon/lib/config/exec.js +240 -0
  1004. package/backend/node_modules/nodemon/lib/config/index.js +93 -0
  1005. package/backend/node_modules/nodemon/lib/config/load.js +225 -0
  1006. package/backend/node_modules/nodemon/lib/help/index.js +27 -0
  1007. package/backend/node_modules/nodemon/lib/index.js +1 -0
  1008. package/backend/node_modules/nodemon/lib/monitor/index.js +4 -0
  1009. package/backend/node_modules/nodemon/lib/monitor/match.js +288 -0
  1010. package/backend/node_modules/nodemon/lib/monitor/run.js +562 -0
  1011. package/backend/node_modules/nodemon/lib/monitor/signals.js +34 -0
  1012. package/backend/node_modules/nodemon/lib/monitor/watch.js +244 -0
  1013. package/backend/node_modules/nodemon/lib/nodemon.js +317 -0
  1014. package/backend/node_modules/nodemon/lib/rules/add.js +89 -0
  1015. package/backend/node_modules/nodemon/lib/rules/index.js +53 -0
  1016. package/backend/node_modules/nodemon/lib/rules/parse.js +43 -0
  1017. package/backend/node_modules/nodemon/lib/spawn.js +74 -0
  1018. package/backend/node_modules/nodemon/lib/utils/bus.js +44 -0
  1019. package/backend/node_modules/nodemon/lib/utils/clone.js +40 -0
  1020. package/backend/node_modules/nodemon/lib/utils/colour.js +26 -0
  1021. package/backend/node_modules/nodemon/lib/utils/index.js +103 -0
  1022. package/backend/node_modules/nodemon/lib/utils/log.js +82 -0
  1023. package/backend/node_modules/nodemon/lib/utils/merge.js +47 -0
  1024. package/backend/node_modules/nodemon/lib/version.js +100 -0
  1025. package/backend/node_modules/nodemon/package.json +78 -0
  1026. package/backend/node_modules/normalize-path/LICENSE +21 -0
  1027. package/backend/node_modules/normalize-path/README.md +127 -0
  1028. package/backend/node_modules/normalize-path/index.js +35 -0
  1029. package/backend/node_modules/normalize-path/package.json +77 -0
  1030. package/backend/node_modules/object-assign/index.js +90 -0
  1031. package/backend/node_modules/object-assign/license +21 -0
  1032. package/backend/node_modules/object-assign/package.json +42 -0
  1033. package/backend/node_modules/object-assign/readme.md +61 -0
  1034. package/backend/node_modules/object-inspect/.eslintrc +53 -0
  1035. package/backend/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  1036. package/backend/node_modules/object-inspect/.nycrc +13 -0
  1037. package/backend/node_modules/object-inspect/CHANGELOG.md +424 -0
  1038. package/backend/node_modules/object-inspect/LICENSE +21 -0
  1039. package/backend/node_modules/object-inspect/example/all.js +23 -0
  1040. package/backend/node_modules/object-inspect/example/circular.js +6 -0
  1041. package/backend/node_modules/object-inspect/example/fn.js +5 -0
  1042. package/backend/node_modules/object-inspect/example/inspect.js +10 -0
  1043. package/backend/node_modules/object-inspect/index.js +544 -0
  1044. package/backend/node_modules/object-inspect/package-support.json +20 -0
  1045. package/backend/node_modules/object-inspect/package.json +105 -0
  1046. package/backend/node_modules/object-inspect/readme.markdown +84 -0
  1047. package/backend/node_modules/object-inspect/test/bigint.js +58 -0
  1048. package/backend/node_modules/object-inspect/test/browser/dom.js +15 -0
  1049. package/backend/node_modules/object-inspect/test/circular.js +16 -0
  1050. package/backend/node_modules/object-inspect/test/deep.js +12 -0
  1051. package/backend/node_modules/object-inspect/test/element.js +53 -0
  1052. package/backend/node_modules/object-inspect/test/err.js +48 -0
  1053. package/backend/node_modules/object-inspect/test/fakes.js +29 -0
  1054. package/backend/node_modules/object-inspect/test/fn.js +76 -0
  1055. package/backend/node_modules/object-inspect/test/global.js +17 -0
  1056. package/backend/node_modules/object-inspect/test/has.js +15 -0
  1057. package/backend/node_modules/object-inspect/test/holes.js +15 -0
  1058. package/backend/node_modules/object-inspect/test/indent-option.js +271 -0
  1059. package/backend/node_modules/object-inspect/test/inspect.js +139 -0
  1060. package/backend/node_modules/object-inspect/test/lowbyte.js +12 -0
  1061. package/backend/node_modules/object-inspect/test/number.js +58 -0
  1062. package/backend/node_modules/object-inspect/test/quoteStyle.js +26 -0
  1063. package/backend/node_modules/object-inspect/test/toStringTag.js +40 -0
  1064. package/backend/node_modules/object-inspect/test/undef.js +12 -0
  1065. package/backend/node_modules/object-inspect/test/values.js +261 -0
  1066. package/backend/node_modules/object-inspect/test-core-js.js +26 -0
  1067. package/backend/node_modules/object-inspect/util.inspect.js +1 -0
  1068. package/backend/node_modules/on-finished/HISTORY.md +98 -0
  1069. package/backend/node_modules/on-finished/LICENSE +23 -0
  1070. package/backend/node_modules/on-finished/README.md +162 -0
  1071. package/backend/node_modules/on-finished/index.js +234 -0
  1072. package/backend/node_modules/on-finished/package.json +39 -0
  1073. package/backend/node_modules/once/LICENSE +15 -0
  1074. package/backend/node_modules/once/README.md +79 -0
  1075. package/backend/node_modules/once/once.js +42 -0
  1076. package/backend/node_modules/once/package.json +33 -0
  1077. package/backend/node_modules/parseurl/HISTORY.md +58 -0
  1078. package/backend/node_modules/parseurl/LICENSE +24 -0
  1079. package/backend/node_modules/parseurl/README.md +133 -0
  1080. package/backend/node_modules/parseurl/index.js +158 -0
  1081. package/backend/node_modules/parseurl/package.json +40 -0
  1082. package/backend/node_modules/path-to-regexp/LICENSE +21 -0
  1083. package/backend/node_modules/path-to-regexp/Readme.md +224 -0
  1084. package/backend/node_modules/path-to-regexp/dist/index.d.ts +147 -0
  1085. package/backend/node_modules/path-to-regexp/dist/index.js +431 -0
  1086. package/backend/node_modules/path-to-regexp/dist/index.js.map +1 -0
  1087. package/backend/node_modules/path-to-regexp/package.json +64 -0
  1088. package/backend/node_modules/picomatch/LICENSE +21 -0
  1089. package/backend/node_modules/picomatch/README.md +716 -0
  1090. package/backend/node_modules/picomatch/index.js +3 -0
  1091. package/backend/node_modules/picomatch/lib/constants.js +184 -0
  1092. package/backend/node_modules/picomatch/lib/parse.js +1392 -0
  1093. package/backend/node_modules/picomatch/lib/picomatch.js +342 -0
  1094. package/backend/node_modules/picomatch/lib/scan.js +391 -0
  1095. package/backend/node_modules/picomatch/lib/utils.js +64 -0
  1096. package/backend/node_modules/picomatch/package.json +81 -0
  1097. package/backend/node_modules/proxy-addr/HISTORY.md +161 -0
  1098. package/backend/node_modules/proxy-addr/LICENSE +22 -0
  1099. package/backend/node_modules/proxy-addr/README.md +139 -0
  1100. package/backend/node_modules/proxy-addr/index.js +327 -0
  1101. package/backend/node_modules/proxy-addr/package.json +47 -0
  1102. package/backend/node_modules/pstree.remy/.travis.yml +8 -0
  1103. package/backend/node_modules/pstree.remy/LICENSE +7 -0
  1104. package/backend/node_modules/pstree.remy/README.md +26 -0
  1105. package/backend/node_modules/pstree.remy/lib/index.js +37 -0
  1106. package/backend/node_modules/pstree.remy/lib/tree.js +37 -0
  1107. package/backend/node_modules/pstree.remy/lib/utils.js +53 -0
  1108. package/backend/node_modules/pstree.remy/package.json +33 -0
  1109. package/backend/node_modules/pstree.remy/tests/fixtures/index.js +13 -0
  1110. package/backend/node_modules/pstree.remy/tests/fixtures/out1 +10 -0
  1111. package/backend/node_modules/pstree.remy/tests/fixtures/out2 +29 -0
  1112. package/backend/node_modules/pstree.remy/tests/index.test.js +51 -0
  1113. package/backend/node_modules/qs/.editorconfig +46 -0
  1114. package/backend/node_modules/qs/.github/FUNDING.yml +12 -0
  1115. package/backend/node_modules/qs/.github/SECURITY.md +11 -0
  1116. package/backend/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  1117. package/backend/node_modules/qs/.nycrc +13 -0
  1118. package/backend/node_modules/qs/CHANGELOG.md +822 -0
  1119. package/backend/node_modules/qs/LICENSE.md +29 -0
  1120. package/backend/node_modules/qs/README.md +758 -0
  1121. package/backend/node_modules/qs/dist/qs.js +141 -0
  1122. package/backend/node_modules/qs/eslint.config.mjs +57 -0
  1123. package/backend/node_modules/qs/lib/formats.js +23 -0
  1124. package/backend/node_modules/qs/lib/index.js +11 -0
  1125. package/backend/node_modules/qs/lib/parse.js +403 -0
  1126. package/backend/node_modules/qs/lib/stringify.js +363 -0
  1127. package/backend/node_modules/qs/lib/utils.js +342 -0
  1128. package/backend/node_modules/qs/package.json +94 -0
  1129. package/backend/node_modules/qs/test/empty-keys-cases.js +267 -0
  1130. package/backend/node_modules/qs/test/parse.js +1703 -0
  1131. package/backend/node_modules/qs/test/stringify.js +1448 -0
  1132. package/backend/node_modules/qs/test/utils.js +432 -0
  1133. package/backend/node_modules/range-parser/HISTORY.md +56 -0
  1134. package/backend/node_modules/range-parser/LICENSE +23 -0
  1135. package/backend/node_modules/range-parser/README.md +84 -0
  1136. package/backend/node_modules/range-parser/index.js +162 -0
  1137. package/backend/node_modules/range-parser/package.json +44 -0
  1138. package/backend/node_modules/raw-body/LICENSE +22 -0
  1139. package/backend/node_modules/raw-body/README.md +223 -0
  1140. package/backend/node_modules/raw-body/index.d.ts +85 -0
  1141. package/backend/node_modules/raw-body/index.js +336 -0
  1142. package/backend/node_modules/raw-body/package.json +46 -0
  1143. package/backend/node_modules/readdirp/LICENSE +21 -0
  1144. package/backend/node_modules/readdirp/README.md +122 -0
  1145. package/backend/node_modules/readdirp/index.d.ts +43 -0
  1146. package/backend/node_modules/readdirp/index.js +287 -0
  1147. package/backend/node_modules/readdirp/package.json +122 -0
  1148. package/backend/node_modules/router/HISTORY.md +228 -0
  1149. package/backend/node_modules/router/LICENSE +23 -0
  1150. package/backend/node_modules/router/README.md +416 -0
  1151. package/backend/node_modules/router/index.js +748 -0
  1152. package/backend/node_modules/router/lib/layer.js +247 -0
  1153. package/backend/node_modules/router/lib/route.js +242 -0
  1154. package/backend/node_modules/router/package.json +44 -0
  1155. package/backend/node_modules/safe-buffer/LICENSE +21 -0
  1156. package/backend/node_modules/safe-buffer/README.md +584 -0
  1157. package/backend/node_modules/safe-buffer/index.d.ts +187 -0
  1158. package/backend/node_modules/safe-buffer/index.js +65 -0
  1159. package/backend/node_modules/safe-buffer/package.json +51 -0
  1160. package/backend/node_modules/safer-buffer/LICENSE +21 -0
  1161. package/backend/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  1162. package/backend/node_modules/safer-buffer/Readme.md +156 -0
  1163. package/backend/node_modules/safer-buffer/dangerous.js +58 -0
  1164. package/backend/node_modules/safer-buffer/package.json +34 -0
  1165. package/backend/node_modules/safer-buffer/safer.js +77 -0
  1166. package/backend/node_modules/safer-buffer/tests.js +406 -0
  1167. package/backend/node_modules/semver/LICENSE +15 -0
  1168. package/backend/node_modules/semver/README.md +680 -0
  1169. package/backend/node_modules/semver/bin/semver.js +195 -0
  1170. package/backend/node_modules/semver/classes/comparator.js +143 -0
  1171. package/backend/node_modules/semver/classes/index.js +7 -0
  1172. package/backend/node_modules/semver/classes/range.js +557 -0
  1173. package/backend/node_modules/semver/classes/semver.js +333 -0
  1174. package/backend/node_modules/semver/functions/clean.js +8 -0
  1175. package/backend/node_modules/semver/functions/cmp.js +54 -0
  1176. package/backend/node_modules/semver/functions/coerce.js +62 -0
  1177. package/backend/node_modules/semver/functions/compare-build.js +9 -0
  1178. package/backend/node_modules/semver/functions/compare-loose.js +5 -0
  1179. package/backend/node_modules/semver/functions/compare.js +7 -0
  1180. package/backend/node_modules/semver/functions/diff.js +60 -0
  1181. package/backend/node_modules/semver/functions/eq.js +5 -0
  1182. package/backend/node_modules/semver/functions/gt.js +5 -0
  1183. package/backend/node_modules/semver/functions/gte.js +5 -0
  1184. package/backend/node_modules/semver/functions/inc.js +21 -0
  1185. package/backend/node_modules/semver/functions/lt.js +5 -0
  1186. package/backend/node_modules/semver/functions/lte.js +5 -0
  1187. package/backend/node_modules/semver/functions/major.js +5 -0
  1188. package/backend/node_modules/semver/functions/minor.js +5 -0
  1189. package/backend/node_modules/semver/functions/neq.js +5 -0
  1190. package/backend/node_modules/semver/functions/parse.js +18 -0
  1191. package/backend/node_modules/semver/functions/patch.js +5 -0
  1192. package/backend/node_modules/semver/functions/prerelease.js +8 -0
  1193. package/backend/node_modules/semver/functions/rcompare.js +5 -0
  1194. package/backend/node_modules/semver/functions/rsort.js +5 -0
  1195. package/backend/node_modules/semver/functions/satisfies.js +12 -0
  1196. package/backend/node_modules/semver/functions/sort.js +5 -0
  1197. package/backend/node_modules/semver/functions/truncate.js +48 -0
  1198. package/backend/node_modules/semver/functions/valid.js +8 -0
  1199. package/backend/node_modules/semver/index.js +93 -0
  1200. package/backend/node_modules/semver/internal/constants.js +37 -0
  1201. package/backend/node_modules/semver/internal/debug.js +11 -0
  1202. package/backend/node_modules/semver/internal/identifiers.js +29 -0
  1203. package/backend/node_modules/semver/internal/lrucache.js +42 -0
  1204. package/backend/node_modules/semver/internal/parse-options.js +17 -0
  1205. package/backend/node_modules/semver/internal/re.js +223 -0
  1206. package/backend/node_modules/semver/package.json +78 -0
  1207. package/backend/node_modules/semver/preload.js +4 -0
  1208. package/backend/node_modules/semver/range.bnf +17 -0
  1209. package/backend/node_modules/semver/ranges/gtr.js +6 -0
  1210. package/backend/node_modules/semver/ranges/intersects.js +9 -0
  1211. package/backend/node_modules/semver/ranges/ltr.js +6 -0
  1212. package/backend/node_modules/semver/ranges/max-satisfying.js +27 -0
  1213. package/backend/node_modules/semver/ranges/min-satisfying.js +26 -0
  1214. package/backend/node_modules/semver/ranges/min-version.js +63 -0
  1215. package/backend/node_modules/semver/ranges/outside.js +82 -0
  1216. package/backend/node_modules/semver/ranges/simplify.js +49 -0
  1217. package/backend/node_modules/semver/ranges/subset.js +249 -0
  1218. package/backend/node_modules/semver/ranges/to-comparators.js +10 -0
  1219. package/backend/node_modules/semver/ranges/valid.js +13 -0
  1220. package/backend/node_modules/send/LICENSE +23 -0
  1221. package/backend/node_modules/send/README.md +317 -0
  1222. package/backend/node_modules/send/index.js +997 -0
  1223. package/backend/node_modules/send/package.json +63 -0
  1224. package/backend/node_modules/serve-static/LICENSE +25 -0
  1225. package/backend/node_modules/serve-static/README.md +253 -0
  1226. package/backend/node_modules/serve-static/index.js +208 -0
  1227. package/backend/node_modules/serve-static/package.json +44 -0
  1228. package/backend/node_modules/setprototypeof/LICENSE +13 -0
  1229. package/backend/node_modules/setprototypeof/README.md +31 -0
  1230. package/backend/node_modules/setprototypeof/index.d.ts +2 -0
  1231. package/backend/node_modules/setprototypeof/index.js +17 -0
  1232. package/backend/node_modules/setprototypeof/package.json +38 -0
  1233. package/backend/node_modules/setprototypeof/test/index.js +24 -0
  1234. package/backend/node_modules/side-channel/.editorconfig +9 -0
  1235. package/backend/node_modules/side-channel/.eslintrc +12 -0
  1236. package/backend/node_modules/side-channel/.github/FUNDING.yml +12 -0
  1237. package/backend/node_modules/side-channel/.nycrc +13 -0
  1238. package/backend/node_modules/side-channel/CHANGELOG.md +110 -0
  1239. package/backend/node_modules/side-channel/LICENSE +21 -0
  1240. package/backend/node_modules/side-channel/README.md +61 -0
  1241. package/backend/node_modules/side-channel/index.d.ts +14 -0
  1242. package/backend/node_modules/side-channel/index.js +43 -0
  1243. package/backend/node_modules/side-channel/package.json +85 -0
  1244. package/backend/node_modules/side-channel/test/index.js +104 -0
  1245. package/backend/node_modules/side-channel/tsconfig.json +9 -0
  1246. package/backend/node_modules/side-channel-list/.editorconfig +9 -0
  1247. package/backend/node_modules/side-channel-list/.eslintrc +11 -0
  1248. package/backend/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
  1249. package/backend/node_modules/side-channel-list/.nycrc +13 -0
  1250. package/backend/node_modules/side-channel-list/CHANGELOG.md +36 -0
  1251. package/backend/node_modules/side-channel-list/LICENSE +21 -0
  1252. package/backend/node_modules/side-channel-list/README.md +62 -0
  1253. package/backend/node_modules/side-channel-list/index.d.ts +13 -0
  1254. package/backend/node_modules/side-channel-list/index.js +111 -0
  1255. package/backend/node_modules/side-channel-list/list.d.ts +14 -0
  1256. package/backend/node_modules/side-channel-list/package.json +77 -0
  1257. package/backend/node_modules/side-channel-list/test/index.js +154 -0
  1258. package/backend/node_modules/side-channel-list/tsconfig.json +9 -0
  1259. package/backend/node_modules/side-channel-map/.editorconfig +9 -0
  1260. package/backend/node_modules/side-channel-map/.eslintrc +11 -0
  1261. package/backend/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
  1262. package/backend/node_modules/side-channel-map/.nycrc +13 -0
  1263. package/backend/node_modules/side-channel-map/CHANGELOG.md +22 -0
  1264. package/backend/node_modules/side-channel-map/LICENSE +21 -0
  1265. package/backend/node_modules/side-channel-map/README.md +62 -0
  1266. package/backend/node_modules/side-channel-map/index.d.ts +15 -0
  1267. package/backend/node_modules/side-channel-map/index.js +68 -0
  1268. package/backend/node_modules/side-channel-map/package.json +80 -0
  1269. package/backend/node_modules/side-channel-map/test/index.js +114 -0
  1270. package/backend/node_modules/side-channel-map/tsconfig.json +9 -0
  1271. package/backend/node_modules/side-channel-weakmap/.editorconfig +9 -0
  1272. package/backend/node_modules/side-channel-weakmap/.eslintrc +12 -0
  1273. package/backend/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  1274. package/backend/node_modules/side-channel-weakmap/.nycrc +13 -0
  1275. package/backend/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  1276. package/backend/node_modules/side-channel-weakmap/LICENSE +21 -0
  1277. package/backend/node_modules/side-channel-weakmap/README.md +62 -0
  1278. package/backend/node_modules/side-channel-weakmap/index.d.ts +15 -0
  1279. package/backend/node_modules/side-channel-weakmap/index.js +84 -0
  1280. package/backend/node_modules/side-channel-weakmap/package.json +87 -0
  1281. package/backend/node_modules/side-channel-weakmap/test/index.js +114 -0
  1282. package/backend/node_modules/side-channel-weakmap/tsconfig.json +9 -0
  1283. package/backend/node_modules/simple-update-notifier/LICENSE +21 -0
  1284. package/backend/node_modules/simple-update-notifier/README.md +82 -0
  1285. package/backend/node_modules/simple-update-notifier/build/index.d.ts +13 -0
  1286. package/backend/node_modules/simple-update-notifier/build/index.js +210 -0
  1287. package/backend/node_modules/simple-update-notifier/package.json +100 -0
  1288. package/backend/node_modules/simple-update-notifier/src/borderedText.ts +12 -0
  1289. package/backend/node_modules/simple-update-notifier/src/cache.spec.ts +17 -0
  1290. package/backend/node_modules/simple-update-notifier/src/cache.ts +44 -0
  1291. package/backend/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +35 -0
  1292. package/backend/node_modules/simple-update-notifier/src/getDistVersion.ts +29 -0
  1293. package/backend/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +82 -0
  1294. package/backend/node_modules/simple-update-notifier/src/hasNewVersion.ts +40 -0
  1295. package/backend/node_modules/simple-update-notifier/src/index.spec.ts +27 -0
  1296. package/backend/node_modules/simple-update-notifier/src/index.ts +34 -0
  1297. package/backend/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +12 -0
  1298. package/backend/node_modules/simple-update-notifier/src/types.ts +8 -0
  1299. package/backend/node_modules/sql-escaper/LICENSE +21 -0
  1300. package/backend/node_modules/sql-escaper/README.md +424 -0
  1301. package/backend/node_modules/sql-escaper/lib/index.d.ts +15 -0
  1302. package/backend/node_modules/sql-escaper/lib/index.js +398 -0
  1303. package/backend/node_modules/sql-escaper/lib/index.mjs +305 -0
  1304. package/backend/node_modules/sql-escaper/lib/types.d.ts +5 -0
  1305. package/backend/node_modules/sql-escaper/lib/types.js +2 -0
  1306. package/backend/node_modules/sql-escaper/package.json +81 -0
  1307. package/backend/node_modules/statuses/HISTORY.md +87 -0
  1308. package/backend/node_modules/statuses/LICENSE +23 -0
  1309. package/backend/node_modules/statuses/README.md +139 -0
  1310. package/backend/node_modules/statuses/codes.json +65 -0
  1311. package/backend/node_modules/statuses/index.js +146 -0
  1312. package/backend/node_modules/statuses/package.json +49 -0
  1313. package/backend/node_modules/supports-color/browser.js +5 -0
  1314. package/backend/node_modules/supports-color/index.js +131 -0
  1315. package/backend/node_modules/supports-color/license +9 -0
  1316. package/backend/node_modules/supports-color/package.json +53 -0
  1317. package/backend/node_modules/supports-color/readme.md +66 -0
  1318. package/backend/node_modules/to-regex-range/LICENSE +21 -0
  1319. package/backend/node_modules/to-regex-range/README.md +305 -0
  1320. package/backend/node_modules/to-regex-range/index.js +288 -0
  1321. package/backend/node_modules/to-regex-range/package.json +88 -0
  1322. package/backend/node_modules/toidentifier/HISTORY.md +9 -0
  1323. package/backend/node_modules/toidentifier/LICENSE +21 -0
  1324. package/backend/node_modules/toidentifier/README.md +61 -0
  1325. package/backend/node_modules/toidentifier/index.js +32 -0
  1326. package/backend/node_modules/toidentifier/package.json +38 -0
  1327. package/backend/node_modules/token/index.js +60 -0
  1328. package/backend/node_modules/token/package.json +24 -0
  1329. package/backend/node_modules/token/readme.md +70 -0
  1330. package/backend/node_modules/token/test/token.test.js +77 -0
  1331. package/backend/node_modules/touch/LICENSE +15 -0
  1332. package/backend/node_modules/touch/README.md +52 -0
  1333. package/backend/node_modules/touch/bin/nodetouch.js +112 -0
  1334. package/backend/node_modules/touch/index.js +224 -0
  1335. package/backend/node_modules/touch/package.json +25 -0
  1336. package/backend/node_modules/type-is/HISTORY.md +292 -0
  1337. package/backend/node_modules/type-is/LICENSE +23 -0
  1338. package/backend/node_modules/type-is/README.md +198 -0
  1339. package/backend/node_modules/type-is/index.js +240 -0
  1340. package/backend/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
  1341. package/backend/node_modules/type-is/node_modules/content-type/README.md +69 -0
  1342. package/backend/node_modules/type-is/node_modules/content-type/dist/index.d.ts +26 -0
  1343. package/backend/node_modules/type-is/node_modules/content-type/dist/index.js +170 -0
  1344. package/backend/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
  1345. package/backend/node_modules/type-is/node_modules/content-type/package.json +52 -0
  1346. package/backend/node_modules/type-is/package.json +51 -0
  1347. package/backend/node_modules/undefsafe/.github/workflows/release.yml +25 -0
  1348. package/backend/node_modules/undefsafe/.jscsrc +13 -0
  1349. package/backend/node_modules/undefsafe/.jshintrc +16 -0
  1350. package/backend/node_modules/undefsafe/.travis.yml +18 -0
  1351. package/backend/node_modules/undefsafe/LICENSE +22 -0
  1352. package/backend/node_modules/undefsafe/README.md +63 -0
  1353. package/backend/node_modules/undefsafe/example.js +14 -0
  1354. package/backend/node_modules/undefsafe/lib/undefsafe.js +125 -0
  1355. package/backend/node_modules/undefsafe/package.json +34 -0
  1356. package/backend/node_modules/undici-types/LICENSE +21 -0
  1357. package/backend/node_modules/undici-types/README.md +6 -0
  1358. package/backend/node_modules/undici-types/agent.d.ts +32 -0
  1359. package/backend/node_modules/undici-types/api.d.ts +43 -0
  1360. package/backend/node_modules/undici-types/balanced-pool.d.ts +30 -0
  1361. package/backend/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  1362. package/backend/node_modules/undici-types/cache.d.ts +36 -0
  1363. package/backend/node_modules/undici-types/client-stats.d.ts +15 -0
  1364. package/backend/node_modules/undici-types/client.d.ts +123 -0
  1365. package/backend/node_modules/undici-types/connector.d.ts +36 -0
  1366. package/backend/node_modules/undici-types/content-type.d.ts +21 -0
  1367. package/backend/node_modules/undici-types/cookies.d.ts +30 -0
  1368. package/backend/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  1369. package/backend/node_modules/undici-types/dispatcher.d.ts +279 -0
  1370. package/backend/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  1371. package/backend/node_modules/undici-types/errors.d.ts +177 -0
  1372. package/backend/node_modules/undici-types/eventsource.d.ts +66 -0
  1373. package/backend/node_modules/undici-types/fetch.d.ts +211 -0
  1374. package/backend/node_modules/undici-types/formdata.d.ts +108 -0
  1375. package/backend/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  1376. package/backend/node_modules/undici-types/global-origin.d.ts +7 -0
  1377. package/backend/node_modules/undici-types/h2c-client.d.ts +73 -0
  1378. package/backend/node_modules/undici-types/handlers.d.ts +15 -0
  1379. package/backend/node_modules/undici-types/header.d.ts +160 -0
  1380. package/backend/node_modules/undici-types/index.d.ts +91 -0
  1381. package/backend/node_modules/undici-types/interceptors.d.ts +80 -0
  1382. package/backend/node_modules/undici-types/mock-agent.d.ts +68 -0
  1383. package/backend/node_modules/undici-types/mock-call-history.d.ts +111 -0
  1384. package/backend/node_modules/undici-types/mock-client.d.ts +27 -0
  1385. package/backend/node_modules/undici-types/mock-errors.d.ts +12 -0
  1386. package/backend/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  1387. package/backend/node_modules/undici-types/mock-pool.d.ts +27 -0
  1388. package/backend/node_modules/undici-types/package.json +55 -0
  1389. package/backend/node_modules/undici-types/patch.d.ts +29 -0
  1390. package/backend/node_modules/undici-types/pool-stats.d.ts +19 -0
  1391. package/backend/node_modules/undici-types/pool.d.ts +41 -0
  1392. package/backend/node_modules/undici-types/proxy-agent.d.ts +29 -0
  1393. package/backend/node_modules/undici-types/readable.d.ts +68 -0
  1394. package/backend/node_modules/undici-types/retry-agent.d.ts +8 -0
  1395. package/backend/node_modules/undici-types/retry-handler.d.ts +125 -0
  1396. package/backend/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  1397. package/backend/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  1398. package/backend/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  1399. package/backend/node_modules/undici-types/util.d.ts +18 -0
  1400. package/backend/node_modules/undici-types/utility.d.ts +7 -0
  1401. package/backend/node_modules/undici-types/webidl.d.ts +347 -0
  1402. package/backend/node_modules/undici-types/websocket.d.ts +188 -0
  1403. package/backend/node_modules/unpipe/HISTORY.md +4 -0
  1404. package/backend/node_modules/unpipe/LICENSE +22 -0
  1405. package/backend/node_modules/unpipe/README.md +43 -0
  1406. package/backend/node_modules/unpipe/index.js +69 -0
  1407. package/backend/node_modules/unpipe/package.json +27 -0
  1408. package/backend/node_modules/vary/HISTORY.md +39 -0
  1409. package/backend/node_modules/vary/LICENSE +22 -0
  1410. package/backend/node_modules/vary/README.md +101 -0
  1411. package/backend/node_modules/vary/index.js +149 -0
  1412. package/backend/node_modules/vary/package.json +43 -0
  1413. package/backend/node_modules/web/README.md +191 -0
  1414. package/backend/node_modules/web/package.json +17 -0
  1415. package/backend/node_modules/web/test-web.js +16 -0
  1416. package/backend/node_modules/web/web.js +200 -0
  1417. package/backend/node_modules/wrappy/LICENSE +15 -0
  1418. package/backend/node_modules/wrappy/README.md +36 -0
  1419. package/backend/node_modules/wrappy/package.json +29 -0
  1420. package/backend/node_modules/wrappy/wrappy.js +33 -0
  1421. package/backend/package-lock.json +1506 -0
  1422. package/backend/package.json +25 -0
  1423. package/backend/server.js +561 -0
  1424. package/epms.sql +162 -0
  1425. package/frontend/README.md +16 -0
  1426. package/frontend/eslint.config.js +21 -0
  1427. package/frontend/index.html +13 -0
  1428. package/frontend/package-lock.json +3042 -0
  1429. package/frontend/package.json +31 -0
  1430. package/frontend/public/favicon.svg +1 -0
  1431. package/frontend/public/icons.svg +24 -0
  1432. package/frontend/src/App.css +184 -0
  1433. package/frontend/src/App.jsx +58 -0
  1434. package/frontend/src/assets/hero.png +0 -0
  1435. package/frontend/src/assets/react.svg +1 -0
  1436. package/frontend/src/assets/vite.svg +1 -0
  1437. package/frontend/src/components/Sidebar.jsx +77 -0
  1438. package/frontend/src/index.css +1 -0
  1439. package/frontend/src/main.jsx +12 -0
  1440. package/frontend/src/pages/Dashboard.jsx +26 -0
  1441. package/frontend/src/pages/Department.jsx +282 -0
  1442. package/frontend/src/pages/Employee.jsx +317 -0
  1443. package/frontend/src/pages/Login.jsx +114 -0
  1444. package/frontend/src/pages/Payroll.jsx +113 -0
  1445. package/frontend/src/pages/Register.jsx +108 -0
  1446. package/frontend/src/pages/Salary.jsx +166 -0
  1447. package/frontend/vite.config.js +8 -0
  1448. package/package.json +13 -0
@@ -0,0 +1,1765 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copyright 2021 Trent Mick.
4
+ * Copyright 2020 Joyent Inc.
5
+ *
6
+ * json -- JSON love for your command line.
7
+ *
8
+ * See <https://github.com/trentm/json> and <https://trentm.com/json/>
9
+ */
10
+
11
+ var VERSION = '11.0.0';
12
+
13
+ var p = console.warn;
14
+ var util = require('util');
15
+ var assert = require('assert');
16
+ var path = require('path');
17
+ var vm = require('vm');
18
+ var fs = require('fs');
19
+ var warn = console.warn;
20
+ var EventEmitter = require('events').EventEmitter;
21
+
22
+
23
+
24
+ //--- exports for module usage
25
+
26
+ exports.main = main;
27
+ exports.getVersion = getVersion;
28
+ exports.parseLookup = parseLookup;
29
+
30
+ // As an exported API, these are still experimental:
31
+ exports.lookupDatum = lookupDatum;
32
+ exports.printDatum = printDatum; // DEPRECATED
33
+
34
+
35
+
36
+ //---- globals and constants
37
+
38
+ // Output modes.
39
+ var OM_JSONY = 1;
40
+ var OM_JSON = 2;
41
+ var OM_INSPECT = 3;
42
+ var OM_COMPACT = 4;
43
+ var OM_FROM_NAME = {
44
+ 'jsony': OM_JSONY,
45
+ 'json': OM_JSON,
46
+ 'inspect': OM_INSPECT,
47
+ 'compact': OM_COMPACT
48
+ };
49
+
50
+
51
+
52
+ //---- support functions
53
+
54
+ function getVersion() {
55
+ return VERSION;
56
+ }
57
+
58
+ /**
59
+ * Return a *shallow* copy of the given object.
60
+ *
61
+ * Only support objects that you get out of JSON, i.e. no functions.
62
+ */
63
+ function objCopy(obj) {
64
+ var copy;
65
+ if (Array.isArray(obj)) {
66
+ copy = obj.slice();
67
+ } else if (typeof (obj) === 'object') {
68
+ copy = {};
69
+ Object.keys(obj).forEach(function (k) {
70
+ copy[k] = obj[k];
71
+ });
72
+ } else {
73
+ copy = obj; // immutable type
74
+ }
75
+ return copy;
76
+ }
77
+
78
+ if (util.format) {
79
+ format = util.format;
80
+ } else {
81
+ // From <https://github.com/joyent/node/blob/master/lib/util.js#L22>:
82
+ var formatRegExp = /%[sdj%]/g;
83
+
84
+ function format(f) {
85
+ var i;
86
+ if (typeof (f) !== 'string') {
87
+ var objects = [];
88
+ for (i = 0; i < arguments.length; i++) {
89
+ objects.push(util.inspect(arguments[i]));
90
+ }
91
+ return objects.join(' ');
92
+ }
93
+ i = 1;
94
+ var args = arguments;
95
+ var len = args.length;
96
+ var str = String(f).replace(formatRegExp, function (x) {
97
+ if (i >= len)
98
+ return x;
99
+ switch (x) {
100
+ case '%s':
101
+ return String(args[i++]);
102
+ case '%d':
103
+ return Number(args[i++]);
104
+ case '%j':
105
+ return JSON.stringify(args[i++]);
106
+ case '%%':
107
+ return '%';
108
+ default:
109
+ return x;
110
+ }
111
+ });
112
+ for (var x = args[i]; i < len; x = args[++i]) {
113
+ if (x === null || typeof (x) !== 'object') {
114
+ str += ' ' + x;
115
+ } else {
116
+ str += ' ' + util.inspect(x);
117
+ }
118
+ }
119
+ return str;
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Parse the given string into a JS string. Basically: handle escapes.
125
+ * Note that this only handles JSON escapes, which are a subset of all
126
+ * JavaScript-supported string escapes.
127
+ */
128
+ function _parseString(s) {
129
+ /* JSSTYLED */
130
+ var quoted = '"' + s.replace(/\\"/g, '"').replace(/"/g, '\\"') + '"';
131
+ return JSON.parse(quoted);
132
+ }
133
+
134
+ // json_parse.js (<https://github.com/douglascrockford/JSON-js>)
135
+ /* BEGIN JSSTYLED */
136
+ // START json_parse
137
+ var json_parse=function(){"use strict";var at,ch,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},text,error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){if(c&&c!==ch){error("Expected '"+c+"' instead of '"+ch+"'")}ch=text.charAt(at);at+=1;return ch},number=function(){var number,string="";if(ch==="-"){string="-";next("-")}while(ch>="0"&&ch<="9"){string+=ch;next()}if(ch==="."){string+=".";while(next()&&ch>="0"&&ch<="9"){string+=ch}}if(ch==="e"||ch==="E"){string+=ch;next();if(ch==="-"||ch==="+"){string+=ch;next()}while(ch>="0"&&ch<="9"){string+=ch;next()}}number=+string;if(!isFinite(number)){error("Bad number")}else{return number}},string=function(){var hex,i,string="",uffff;if(ch==='"'){while(next()){if(ch==='"'){next();return string}else if(ch==="\\"){next();if(ch==="u"){uffff=0;for(i=0;i<4;i+=1){hex=parseInt(next(),16);if(!isFinite(hex)){break}uffff=uffff*16+hex}string+=String.fromCharCode(uffff)}else if(typeof escapee[ch]==="string"){string+=escapee[ch]}else{break}}else{string+=ch}}}error("Bad string")},white=function(){while(ch&&ch<=" "){next()}},word=function(){switch(ch){case"t":next("t");next("r");next("u");next("e");return true;case"f":next("f");next("a");next("l");next("s");next("e");return false;case"n":next("n");next("u");next("l");next("l");return null}error("Unexpected '"+ch+"'")},value,array=function(){var array=[];if(ch==="["){next("[");white();if(ch==="]"){next("]");return array}while(ch){array.push(value());white();if(ch==="]"){next("]");return array}next(",");white()}}error("Bad array")},object=function(){var key,object={};if(ch==="{"){next("{");white();if(ch==="}"){next("}");return object}while(ch){key=string();white();next(":");if(Object.hasOwnProperty.call(object,key)){error('Duplicate key "'+key+'"')}object[key]=value();white();if(ch==="}"){next("}");return object}next(",");white()}}error("Bad object")};value=function(){white();switch(ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}};return function(source,reviver){var result;text=source;at=0;ch=" ";result=value();white();if(ch){error("Syntax error")}return typeof reviver==="function"?function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}({"":result},""):result}}();
138
+
139
+ // END json_parse
140
+ /* END JSSTYLED */
141
+
142
+ function printHelp() {
143
+ /* BEGIN JSSTYLED */
144
+ var w = console.log;
145
+ w('Usage:');
146
+ w(' <something generating JSON on stdout> | json [OPTIONS] [LOOKUPS...]');
147
+ w(' json -f FILE [OPTIONS] [LOOKUPS...]');
148
+ w('');
149
+ w('Pipe in your JSON for pretty-printing, JSON validation, filtering, ');
150
+ w('and modification. Supply one or more `LOOKUPS` to extract a ');
151
+ w('subset of the JSON. HTTP header blocks are skipped by default.');
152
+ w('Roughly in order of processing, features are:');
153
+ w('');
154
+ w('Grouping:');
155
+ w(' Use "-g" or "--group" to group adjacent objects, separated by');
156
+ w(' by no space or a by a newline, or adjacent arrays, separate by');
157
+ w(' by a newline. This can be helpful for, e.g.: ');
158
+ w(' $ cat *.json | json -g ... ');
159
+ w(' and similar.');
160
+ w('');
161
+ w('Execution:');
162
+ w(' Use the "-e CODE" option to execute JavaScript code on the input JSON.');
163
+ w(' $ echo \'{"name":"trent","age":38}\' | json -e \'this.age++\'');
164
+ w(' {');
165
+ w(' "name": "trent",');
166
+ w(' "age": 39');
167
+ w(' }');
168
+ w(' If input is an array, this will automatically process each');
169
+ w(' item separately.');
170
+ w('');
171
+ w('Conditional filtering:');
172
+ w(' Use the "-c CODE" option to filter the input JSON.');
173
+ w(' $ echo \'[{"age":38},{"age":4}]\' | json -c \'this.age>21\'');
174
+ w(' [{\'age\':38}]');
175
+ w(' If input is an array, this will automatically process each');
176
+ w(' item separately. Note: "CODE" is JavaScript code.');
177
+ w('');
178
+ w('Lookups:');
179
+ w(' Use lookup arguments to extract particular values:');
180
+ w(' $ echo \'{"name":"trent","age":38}\' | json name');
181
+ w(' trent');
182
+ w('');
183
+ w(' Use "-a" for *array processing* of lookups and *tabular output*:');
184
+ w(' $ echo \'{"name":"trent","age":38}\' | json name age');
185
+ w(' trent');
186
+ w(' 38');
187
+ w(' $ echo \'[{"name":"trent","age":38},');
188
+ w(' {"name":"ewan","age":4}]\' | json -a name age');
189
+ w(' trent 38');
190
+ w(' ewan 4');
191
+ w('');
192
+ w('In-place editing:');
193
+ w(' Use "-I, --in-place" to edit a file in place:');
194
+ w(' $ json -I -f config.json # reformat');
195
+ w(' $ json -I -f config.json -c \'this.logLevel="debug"\' # add field');
196
+ w('');
197
+ w('Pretty-printing:');
198
+ w(' Output is "jsony" by default: 2-space indented JSON, except a');
199
+ w(' single string value is printed without quotes.');
200
+ w(' $ echo \'{"name": "trent", "age": 38}\' | json');
201
+ w(' {');
202
+ w(' "name": "trent",');
203
+ w(' "age": 38');
204
+ w(' }');
205
+ w(' $ echo \'{"name": "trent", "age": 38}\' | json name');
206
+ w(' trent');
207
+ w('');
208
+ w(" Use '-j' or '-o json' for explicit JSON, '-o json-N' for N-space indent:");
209
+ w(' $ echo \'{"name": "trent", "age": 38}\' | json -o json-0');
210
+ w(' {"name":"trent","age":38}');
211
+ w('');
212
+ w('Options:');
213
+ w(' -h, --help Print this help info and exit.');
214
+ w(' --version Print version of this command and exit.');
215
+ w(' -q, --quiet Don\'t warn if input isn\'t valid JSON.');
216
+ w('');
217
+ w(' -f FILE Path to a file to process. If not given, then');
218
+ w(' stdin is used.');
219
+ w(' -I, --in-place In-place edit of the file given with "-f".');
220
+ w(' Lookups are not allow with in-place editing');
221
+ w(' because it makes it too easy to lose content.');
222
+ w('');
223
+ w(' -H Drop any HTTP header block (as from `curl -i ...`).');
224
+ w(' -g, --group Group adjacent objects or arrays into an array.');
225
+ w(' --merge Merge adjacent objects into one. Keys in last ');
226
+ w(' object win.');
227
+ w(' --deep-merge Same as "--merge", but will recurse into objects ');
228
+ w(' under the same key in both.')
229
+ w(' -a, --array Process input as an array of separate inputs');
230
+ w(' and output in tabular form.');
231
+ w(' -A Process input as a single object, i.e. stop');
232
+ w(' "-e" and "-c" automatically processing each');
233
+ w(' item of an input array.');
234
+ w(' -d DELIM Delimiter char for tabular output (default is " ").');
235
+ w(' -D DELIM Delimiter char between lookups (default is "."). E.g.:');
236
+ w(' $ echo \'{"a.b": {"b": 1}}\' | json -D / a.b/b');
237
+ w('');
238
+ w(' -M, --items Itemize an object into an array of ');
239
+ w(' {"key": <key>, "value": <value>}');
240
+ w(' objects for easier processing.');
241
+ w('');
242
+ w(' -e CODE Execute the given JavaScript code on the input. If input');
243
+ w(' is an array, then each item of the array is processed');
244
+ w(' separately (use "-A" to override).');
245
+ w(' -c CODE Filter the input with JavaScript `CODE`. If `CODE`');
246
+ w(' returns false-y, then the item is filtered out. If');
247
+ w(' input is an array, then each item of the array is ');
248
+ w(' processed separately (use "-A" to override).');
249
+ w('');
250
+ w(' -k, --keys Output the input object\'s keys.');
251
+ w(' -n, --validate Just validate the input (no processing or output).');
252
+ w(' Use with "-q" for silent validation (exit status).');
253
+ w('');
254
+ w(' -o, --output MODE');
255
+ w(' Specify an output mode. One of:');
256
+ w(' jsony (default): JSON with string quotes elided');
257
+ w(' json: JSON output, 2-space indent');
258
+ w(' json-N: JSON output, N-space indent, e.g. "json-4"');
259
+ w(' inspect: node.js `util.inspect` output');
260
+ w(' -i Shortcut for `-o inspect`');
261
+ w(' -j Shortcut for `-o json`');
262
+ w(' -0, -2, -4 Set indentation to the given value w/o setting MODE.');
263
+ w(' -0 => -o jsony-0');
264
+ w(' -4 => -o jsony-4');
265
+ w(' -j0 => -o json-0');
266
+ w('');
267
+ w('See <http://trentm.com/json> for more docs and ');
268
+ w('<https://github.com/trentm/json> for project details.');
269
+ /* END JSSTYLED */
270
+ }
271
+
272
+
273
+ /**
274
+ * Parse the command-line options and arguments into an object.
275
+ *
276
+ * {
277
+ * 'args': [...] // arguments
278
+ * 'help': true, // true if '-h' option given
279
+ * // etc.
280
+ * }
281
+ *
282
+ * @return {Object} The parsed options. `.args` is the argument list.
283
+ * @throws {Error} If there is an error parsing argv.
284
+ */
285
+ function parseArgv(argv) {
286
+ var parsed = {
287
+ args: [],
288
+ help: false,
289
+ quiet: false,
290
+ dropHeaders: false,
291
+ exeSnippets: [],
292
+ condSnippets: [],
293
+ outputMode: OM_JSONY,
294
+ jsonIndent: 2,
295
+ array: null,
296
+ delim: ' ',
297
+ lookupDelim: '.',
298
+ items: false,
299
+ outputKeys: false,
300
+ group: false,
301
+ merge: null, // --merge -> 'shallow', --deep-merge -> 'deep'
302
+ inputFiles: [],
303
+ validate: false,
304
+ inPlace: false
305
+ };
306
+
307
+ // Turn '-iH' into '-i -H', except for argument-accepting options.
308
+ var args = argv.slice(2); // drop ['node', 'scriptname']
309
+ var newArgs = [];
310
+ var optTakesArg = {
311
+ 'd': true,
312
+ 'o': true,
313
+ 'D': true
314
+ };
315
+ for (var i = 0; i < args.length; i++) {
316
+ if (args[i] === '--') {
317
+ newArgs = newArgs.concat(args.slice(i));
318
+ break;
319
+ }
320
+ if (args[i].charAt(0) === '-' && args[i].charAt(1) !== '-' &&
321
+ args[i].length > 2)
322
+ {
323
+ var splitOpts = args[i].slice(1).split('');
324
+ for (var j = 0; j < splitOpts.length; j++) {
325
+ newArgs.push('-' + splitOpts[j])
326
+ if (optTakesArg[splitOpts[j]]) {
327
+ var optArg = splitOpts.slice(j + 1).join('');
328
+ if (optArg.length) {
329
+ newArgs.push(optArg);
330
+ }
331
+ break;
332
+ }
333
+ }
334
+ } else {
335
+ newArgs.push(args[i]);
336
+ }
337
+ }
338
+ args = newArgs;
339
+
340
+ endOfOptions = false;
341
+ while (args.length > 0) {
342
+ var arg = args.shift();
343
+ if (endOfOptions) {
344
+ parsed.args.push(arg);
345
+ break;
346
+ }
347
+ switch (arg) {
348
+ case '--':
349
+ endOfOptions = true;
350
+ break;
351
+ case '-h': // display help and exit
352
+ case '--help':
353
+ parsed.help = true;
354
+ break;
355
+ case '--version':
356
+ parsed.version = true;
357
+ break;
358
+ case '-q':
359
+ case '--quiet':
360
+ parsed.quiet = true;
361
+ break;
362
+ case '-H': // drop any headers
363
+ parsed.dropHeaders = true;
364
+ break;
365
+ case '-o':
366
+ case '--output':
367
+ var name = args.shift();
368
+ if (!name) {
369
+ throw new Error('no argument given for "-o|--output" option');
370
+ }
371
+ var idx = name.lastIndexOf('-');
372
+ if (idx !== -1) {
373
+ var indent = name.slice(idx + 1);
374
+ if (/^\d+$/.test(indent)) {
375
+ parsed.jsonIndent = Number(indent);
376
+ name = name.slice(0, idx);
377
+ } else if (indent === 'tab') {
378
+ parsed.jsonIndent = '\t';
379
+ name = name.slice(0, idx);
380
+ }
381
+ }
382
+ parsed.outputMode = OM_FROM_NAME[name];
383
+ if (parsed.outputMode === undefined) {
384
+ throw new Error('unknown output mode: "' + name + '"');
385
+ }
386
+ break;
387
+ case '-0':
388
+ parsed.jsonIndent = 0;
389
+ break;
390
+ case '-2':
391
+ parsed.jsonIndent = 2;
392
+ break;
393
+ case '-4':
394
+ parsed.jsonIndent = 4;
395
+ break;
396
+ case '-I':
397
+ case '--in-place':
398
+ parsed.inPlace = true;
399
+ break;
400
+ case '-i': // output with util.inspect
401
+ parsed.outputMode = OM_INSPECT;
402
+ break;
403
+ case '-j': // output with JSON.stringify
404
+ parsed.outputMode = OM_JSON;
405
+ break;
406
+ case '-a':
407
+ case '--array':
408
+ parsed.array = true;
409
+ break;
410
+ case '-A':
411
+ parsed.array = false;
412
+ break;
413
+ case '-d':
414
+ var outputDelim = args.shift()
415
+ try {
416
+ parsed.delim = _parseString(outputDelim);
417
+ } catch (parseErr) {
418
+ throw new Error(format('could not parse delim "%s": %s',
419
+ outputDelim, parseErr.message));
420
+ }
421
+ break;
422
+ case '-D':
423
+ parsed.lookupDelim = args.shift();
424
+ if (parsed.lookupDelim.length !== 1) {
425
+ throw new Error(format(
426
+ 'invalid lookup delim "%s" (must be a single char)',
427
+ parsed.lookupDelim));
428
+ }
429
+ break;
430
+ case '-e':
431
+ case '-E': // DEPRECATED in v9
432
+ parsed.exeSnippets.push(args.shift());
433
+ break;
434
+ case '-c':
435
+ case '-C': // DEPRECATED in v9
436
+ parsed.condSnippets.push(args.shift());
437
+ break;
438
+ case '-M':
439
+ case '--items':
440
+ parsed.items = true;
441
+ break;
442
+ case '-k':
443
+ case '--keys':
444
+ parsed.outputKeys = true;
445
+ break;
446
+ case '-g':
447
+ case '--group':
448
+ parsed.group = true;
449
+ break;
450
+ case '--merge':
451
+ parsed.merge = 'shallow';
452
+ break;
453
+ case '--deep-merge':
454
+ parsed.merge = 'deep';
455
+ break;
456
+ case '-f':
457
+ parsed.inputFiles.push(args.shift());
458
+ break;
459
+ case '-n':
460
+ case '--validate':
461
+ parsed.validate = true;
462
+ break;
463
+ default: // arguments
464
+ if (!endOfOptions && arg.length > 0 && arg[0] === '-') {
465
+ throw new Error('unknown option "' + arg + '"');
466
+ }
467
+ parsed.args.push(arg);
468
+ break;
469
+ }
470
+ }
471
+
472
+ if (parsed.group && parsed.merge) {
473
+ throw new Error('cannot use -g|--group and --merge options together');
474
+ }
475
+ if (parsed.outputKeys && parsed.args.length > 0) {
476
+ throw new Error(
477
+ 'cannot use -k|--keys option and lookup arguments together');
478
+ }
479
+ if (parsed.inPlace && parsed.inputFiles.length !== 1) {
480
+ throw new Error('must specify exactly one file with "-f FILE" to ' +
481
+ 'use -I/--in-place');
482
+ }
483
+ if (parsed.inPlace && parsed.args.length > 0) {
484
+ throw new Error('lookups cannot be specified with in-place editing ' +
485
+ '(-I/--in-place), too easy to lose content');
486
+ }
487
+
488
+ return parsed;
489
+ }
490
+
491
+
492
+
493
+ /**
494
+ * Streams chunks from given file paths or stdin.
495
+ *
496
+ * @param opts {Object} Parsed options.
497
+ * @returns {Object} An emitter that emits 'chunk', 'error', and 'end'.
498
+ * - `emit('chunk', chunk, [obj])` where chunk is a complete block of JSON
499
+ * ready to parse. If `obj` is provided, it is the already parsed
500
+ * JSON.
501
+ * - `emit('error', error)` when an underlying stream emits an error
502
+ * - `emit('end')` when all streams are done
503
+ */
504
+ function chunkEmitter(opts) {
505
+ var emitter = new EventEmitter();
506
+ var streaming = true;
507
+ var chunks = [];
508
+ var leftover = '';
509
+ var finishedHeaders = false;
510
+
511
+ function stripHeaders(s) {
512
+ // Take off a leading HTTP header if any and pass it through.
513
+ while (true) {
514
+ if (s.slice(0, 5) === 'HTTP/') {
515
+ var index = s.indexOf('\r\n\r\n');
516
+ var sepLen = 4;
517
+ if (index == -1) {
518
+ index = s.indexOf('\n\n');
519
+ sepLen = 2;
520
+ }
521
+ if (index != -1) {
522
+ if (!opts.dropHeaders) {
523
+ emit(s.slice(0, index + sepLen));
524
+ }
525
+ var is100Continue = (
526
+ s.slice(0, 21) === 'HTTP/1.1 100 Continue');
527
+ s = s.slice(index + sepLen);
528
+ if (is100Continue) {
529
+ continue;
530
+ }
531
+ finishedHeaders = true;
532
+ }
533
+ } else {
534
+ finishedHeaders = true;
535
+ }
536
+ break;
537
+ }
538
+ //console.warn('stripHeaders done, finishedHeaders=%s', finishedHeaders)
539
+ return s;
540
+ }
541
+
542
+ function emitChunks(block, emitter) {
543
+ //console.warn('emitChunks start: block="%s"', block)
544
+ /* JSSTYLED */
545
+ var splitter = /(})(\s*\n\s*)?({\s*")/;
546
+ var leftTrimmedBlock = block.trimLeft();
547
+ if (leftTrimmedBlock && leftTrimmedBlock[0] !== '{') {
548
+ // Currently only support streaming consecutive *objects*.
549
+ streaming = false;
550
+ chunks.push(block);
551
+ return '';
552
+ }
553
+ /**
554
+ * Example:
555
+ * > '{"a":"b"}\n{"a":"b"}\n{"a":"b"}'.split(/(})(\s*\n\s*)?({\s*")/)
556
+ * [ '{"a":"b"',
557
+ * '}',
558
+ * '\n',
559
+ * '{"',
560
+ * 'a":"b"',
561
+ * '}',
562
+ * '\n',
563
+ * '{"',
564
+ * 'a":"b"}' ]
565
+ */
566
+ var bits = block.split(splitter);
567
+ //console.warn('emitChunks: bits (length %d): %j', bits.length, bits);
568
+ if (bits.length === 1) {
569
+ /*
570
+ * An unwanted side-effect of using a regex to find
571
+ * newline-separated objects *with a regex*, is that we are looking
572
+ * for the end of one object leading into the start of a another.
573
+ * That means that we can end up buffering a complete object until
574
+ * a subsequent one comes in. If the input stream has large delays
575
+ * between objects, then this is unwanted buffering.
576
+ *
577
+ * One solution would be full stream parsing of objects a la
578
+ * <https://github.com/creationix/jsonparse>. This would nicely
579
+ * also remove the artibrary requirement that the input stream be
580
+ * newline separated. jsonparse apparently has some issues tho, so
581
+ * I don't want to use it right now. It also isn't *small* so not
582
+ * sure I want to inline it (`json` doesn't have external deps).
583
+ *
584
+ * An alternative: The block we have so far one of:
585
+ * 1. some JSON that we don't support grouping (e.g. a stream of
586
+ * non-objects),
587
+ * 2. a JSON object fragment, or
588
+ * 3. a complete JSON object (with a possible trailing '{')
589
+ *
590
+ * If #3, then we can just emit this as a chunk right now.
591
+ *
592
+ * TODO(PERF): Try out avoiding the first more complete regex split
593
+ * for a presumed common case of single-line newline-separated JSON
594
+ * objects (e.g. a bunyan log).
595
+ */
596
+ // An object must end with '}'. This is an early out to avoid
597
+ // `JSON.parse` which I'm *presuming* is slower.
598
+ var trimmed = block.split(/\s*\r?\n/)[0];
599
+ if (trimmed[trimmed.length - 1] === '}') {
600
+ var obj;
601
+ try {
602
+ obj = JSON.parse(block);
603
+ } catch (e) {
604
+ /* pass through */
605
+ }
606
+ if (obj !== undefined) {
607
+ // Emit the parsed `obj` to avoid re-parsing it later.
608
+ emitter.emit('chunk', block, obj);
609
+ block = '';
610
+ }
611
+ }
612
+ return block;
613
+ } else {
614
+ var n = bits.length - 2;
615
+ var s;
616
+ s = bits[0] + bits[1];
617
+ emitter.emit('chunk', s, JSON.parse(s));
618
+ for (var i = 3; i < n; i += 4) {
619
+ s = bits[i] + bits[i + 1] + bits[i + 2];
620
+ emitter.emit('chunk', s, JSON.parse(s));
621
+ }
622
+ return bits[n] + bits[n + 1];
623
+ }
624
+ }
625
+
626
+ function addDataListener(stream) {
627
+ stream.on('data', function (chunk) {
628
+ var s = leftover + chunk;
629
+ if (!finishedHeaders) {
630
+ s = stripHeaders(s);
631
+ }
632
+ if (!finishedHeaders) {
633
+ leftover = s;
634
+ } else {
635
+ if (!streaming) {
636
+ chunks.push(chunk);
637
+ return;
638
+ }
639
+ if (chunk.lastIndexOf('\n') >= 0) {
640
+ leftover = emitChunks(s, emitter);
641
+ } else {
642
+ leftover = s;
643
+ }
644
+ }
645
+ });
646
+ }
647
+
648
+ if (opts.inputFiles.length > 0) {
649
+ // Stream each file in order.
650
+ var i = 0;
651
+
652
+ function addErrorListener(file) {
653
+ file.on('error', function (err) {
654
+ emitter.emit(
655
+ 'error',
656
+ format('could not read "%s": %s', opts.inputFiles[i], e)
657
+ );
658
+ });
659
+ }
660
+
661
+ function addEndListener(file) {
662
+ file.on('end', function () {
663
+ if (i < opts.inputFiles.length) {
664
+ var next = opts.inputFiles[i++];
665
+ var nextFile = fs.createReadStream(next,
666
+ {encoding: 'utf8'});
667
+ addErrorListener(nextFile);
668
+ addEndListener(nextFile);
669
+ addDataListener(nextFile);
670
+ } else {
671
+ if (!streaming) {
672
+ emitter.emit('chunk', chunks.join(''));
673
+ } else if (leftover) {
674
+ leftover = emitChunks(leftover, emitter);
675
+ emitter.emit('chunk', leftover);
676
+ }
677
+ emitter.emit('end');
678
+ }
679
+ });
680
+ }
681
+ var first = fs.createReadStream(opts.inputFiles[i++],
682
+ {encoding: 'utf8'});
683
+ addErrorListener(first);
684
+ addEndListener(first);
685
+ addDataListener(first);
686
+ } else {
687
+ // Streaming from stdin.
688
+ var stdin = process.openStdin();
689
+ stdin.setEncoding('utf8');
690
+ addDataListener(stdin);
691
+ stdin.on('end', function () {
692
+ if (!streaming) {
693
+ emitter.emit('chunk', chunks.join(''));
694
+ } else if (leftover) {
695
+ leftover = emitChunks(leftover, emitter);
696
+ emitter.emit('chunk', leftover);
697
+ }
698
+ emitter.emit('end');
699
+ });
700
+ }
701
+ return emitter;
702
+ }
703
+
704
+ /**
705
+ * Get input from either given file paths or stdin. If `opts.inPlace` then
706
+ * this calls the callback once for each `opts.inputFiles`.
707
+ *
708
+ * @param opts {Object} Parsed options.
709
+ * @param callback {Function} `function (err, content, filename)` where err
710
+ * is an error string if there was a problem, `content` is the read
711
+ * content and `filename` is the associated file name from which content
712
+ * was loaded if applicable.
713
+ */
714
+ function getInput(opts, callback) {
715
+ if (opts.inputFiles.length === 0) {
716
+ // Read from stdin.
717
+ var chunks = [];
718
+
719
+ var stdin = process.openStdin();
720
+ stdin.setEncoding('utf8');
721
+ stdin.on('data', function (chunk) {
722
+ chunks.push(chunk);
723
+ });
724
+
725
+ stdin.on('end', function () {
726
+ callback(null, chunks.join(''));
727
+ });
728
+ } else if (opts.inPlace) {
729
+ for (var i = 0; i < opts.inputFiles.length; i++) {
730
+ var file = opts.inputFiles[i];
731
+ var content;
732
+ try {
733
+ content = fs.readFileSync(file, 'utf8');
734
+ } catch (e) {
735
+ callback(e, null, file);
736
+ }
737
+ if (content) {
738
+ callback(null, content, file);
739
+ }
740
+ }
741
+ } else {
742
+ // Read input files.
743
+ var i = 0;
744
+ var chunks = [];
745
+ try {
746
+ for (; i < opts.inputFiles.length; i++) {
747
+ chunks.push(fs.readFileSync(opts.inputFiles[i], 'utf8'));
748
+ }
749
+ } catch (e) {
750
+ return callback(
751
+ format('could not read "%s": %s', opts.inputFiles[i], e));
752
+ }
753
+ callback(null, chunks.join(''),
754
+ (opts.inputFiles.length === 1 ? opts.inputFiles[0] : undefined));
755
+ }
756
+ }
757
+
758
+
759
+ function isInteger(s) {
760
+ return (s.search(/^-?[0-9]+$/) == 0);
761
+ }
762
+
763
+
764
+ /**
765
+ * Parse a lookup string into a list of lookup bits. E.g.:
766
+ *
767
+ * 'a.b.c' -> ["a","b","c"]
768
+ * 'b["a"]' -> ["b","a"]
769
+ *
770
+ * Note: v10 made a backward incompatible change here that limits the supported
771
+ * *bracketed* lookups. A bracketed section of a lookup must be of one of the
772
+ * following forms:
773
+ * ["..."]
774
+ * ['...']
775
+ * [`...`]
776
+ * The quoted string is not evaluated, other than supporting a subset of JS
777
+ * string escapes (e.g. \', \", \n; but not unicode char escapes).
778
+ * See the long block comment below in this function for details.
779
+ *
780
+ * Optionally receives an alternative lookup delimiter (other than '.')
781
+ */
782
+ function parseLookup(lookup, lookupDelim) {
783
+ var debug = function () {};
784
+ // var debug = console.warn;
785
+
786
+ var bits = [];
787
+ debug('\n*** ' + lookup + ' ***');
788
+
789
+ bits = [];
790
+ lookupDelim = lookupDelim || '.';
791
+ var bit = '';
792
+ var states = [null];
793
+ var escaped = false;
794
+ var ch = null;
795
+ for (var i = 0; i < lookup.length; ++i) {
796
+ var ch = lookup[i];
797
+ debug('-- i=' + i + ', ch=' + JSON.stringify(ch) + ' escaped=' +
798
+ JSON.stringify(escaped));
799
+ debug('states: ' + JSON.stringify(states));
800
+
801
+ // Handle a *limited subset* of JS string escapes.
802
+ // JSSTYLED
803
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#Escape_notation
804
+ var SUPPORTED_ESCAPES = {
805
+ '\'': '\'',
806
+ '\"': '\"',
807
+ '\`': '\`',
808
+ '\\': '\\',
809
+ 'n': '\n',
810
+ 'r': '\r',
811
+ 't': '\t',
812
+ 'v': '\v',
813
+ 'b': '\b',
814
+ 'f': '\f'
815
+ };
816
+ if (ch === '\\' && i+1 < lookup.length) {
817
+ var nextCh = lookup[i+1];
818
+ var escapedCh = SUPPORTED_ESCAPES[nextCh];
819
+ if (escapedCh !== undefined) {
820
+ debug('escaped: %j -> %j', ch+nextCh, escapedCh);
821
+ bit += escapedCh;
822
+ i++;
823
+ continue;
824
+ }
825
+ }
826
+
827
+ switch (states[states.length - 1]) {
828
+ case null:
829
+ switch (ch) {
830
+ case '"':
831
+ case '\'':
832
+ states.push(ch);
833
+ bit += ch;
834
+ break;
835
+ case '[':
836
+ states.push(ch);
837
+ if (bit !== '') {
838
+ bits.push(bit);
839
+ bit = ''
840
+ }
841
+ bit += ch;
842
+ break;
843
+ case lookupDelim:
844
+ if (bit !== '') {
845
+ bits.push(bit);
846
+ bit = ''
847
+ }
848
+ break;
849
+ default:
850
+ bit += ch;
851
+ break;
852
+ }
853
+ break;
854
+
855
+ case '[':
856
+ bit += ch;
857
+ switch (ch) {
858
+ case '"':
859
+ case '\'':
860
+ case '[':
861
+ states.push(ch);
862
+ break;
863
+ case ']':
864
+ states.pop();
865
+ if (states[states.length - 1] === null) {
866
+ // `bit` is a bracketed string, `[...]`.
867
+ //
868
+ // The *intent* is to allow specifying an object key
869
+ // that would otherwise get interpreted by `json`s
870
+ // LOOKUP parsing -- typically if the key has a `.` in it.
871
+ //
872
+ // Up to and including json v9, this was handled by eval'ing
873
+ // the given string inside the brackets (via
874
+ // `vm.runInNewContext`). However, trentm/json#144 shows
875
+ // that this is an avenue for command injection. It was
876
+ // never made clear in `json` documentation that one
877
+ // should never use user-provided strings for LOOKUPs, so
878
+ // we should close this vulnerability.
879
+ //
880
+ // Expected usage and documented examples are like this:
881
+ // ["foo.bar"]
882
+ // ['foo.bar']
883
+ // However, older implementation of eval'ing meant that
884
+ // things like the following worked:
885
+ // [42]
886
+ // ["my" + "key"]
887
+ // [(function () { return "mykey" })()]
888
+ //
889
+ // The documentation was never explicit about denying
890
+ // expressions would work. v10 **breaks compatibility**
891
+ // to only support a bracketed string:
892
+ // ["..."]
893
+ // ['...']
894
+ // [`...`] # note: no var interpolation is done
895
+ // and error otherwise.
896
+ var VALID_QUOTES = '"\'`';
897
+ var sQuote = bit[1];
898
+ var eQuote = bit.slice(-2, -1);
899
+ if (VALID_QUOTES.indexOf(sQuote) === -1 ||
900
+ sQuote !== eQuote)
901
+ {
902
+ throw new Error(format('invalid bracketed lookup ' +
903
+ 'string: %j (must be of the form [\'...\'], ' +
904
+ '["..."], or [`...`])', bit));
905
+ }
906
+ bits.push(bit.slice(2, -2));
907
+ bit = ''
908
+ }
909
+ break;
910
+ }
911
+ break;
912
+
913
+ case '"':
914
+ bit += ch;
915
+ switch (ch) {
916
+ case '"':
917
+ states.pop();
918
+ if (states[states.length - 1] === null) {
919
+ bits.push(bit);
920
+ bit = ''
921
+ }
922
+ break;
923
+ }
924
+ break;
925
+
926
+ case '\'':
927
+ bit += ch;
928
+ switch (ch) {
929
+ case '\'':
930
+ states.pop();
931
+ if (states[states.length - 1] === null) {
932
+ bits.push(bit);
933
+ bit = ''
934
+ }
935
+ break;
936
+ }
937
+ break;
938
+ }
939
+ debug('bit: ' + JSON.stringify(bit));
940
+ debug('bits: ' + JSON.stringify(bits));
941
+ }
942
+
943
+ if (bit !== '') {
944
+ bits.push(bit);
945
+ bit = ''
946
+ }
947
+
948
+ // Negative-intify: strings that are negative ints we change to a Number for
949
+ // special handling in `lookupDatum`: Python-style negative array indexing.
950
+ var negIntPat = /^-\d+$/;
951
+ for (var i = 0; i < bits.length; i++) {
952
+ if (negIntPat.test(bits[i])) {
953
+ bits[i] = Number(bits[i]);
954
+ }
955
+ }
956
+
957
+ debug(JSON.stringify(lookup) + ' -> ' + JSON.stringify(bits));
958
+ return bits
959
+ }
960
+
961
+
962
+ /**
963
+ * Parse the given stdin input into:
964
+ * {
965
+ * 'error': ... error object if there was an error ...,
966
+ * 'datum': ... parsed object if content was JSON ...
967
+ * }
968
+ *
969
+ * @param buffer {String} The text to parse as JSON.
970
+ * @param obj {Object} Optional. Set when in streaming mode to avoid
971
+ * re-interpretation of `group`. Also avoids reparsing.
972
+ * @param group {Boolean} Default false. If true, then non-JSON input
973
+ * will be attempted to be 'arrayified' (see inline comment).
974
+ * @param merge {Boolean} Default null. Can be 'shallow' or 'deep'. An
975
+ * attempt will be made to interpret the input as adjacent objects to
976
+ * be merged, last key wins. See inline comment for limitations.
977
+ */
978
+ function parseInput(buffer, obj, group, merge) {
979
+ if (obj) {
980
+ return {
981
+ datum: obj
982
+ };
983
+ } else if (group) {
984
+ /**
985
+ * Special case: Grouping (previously called auto-arrayification)
986
+ * of unjoined list of objects:
987
+ * {"one": 1}{"two": 2}
988
+ * and auto-concatenation of unjoined list of arrays:
989
+ * ["a", "b"]["c", "d"]
990
+ *
991
+ * This can be nice to process a stream of JSON objects generated from
992
+ * multiple calls to another tool or `cat *.json | json`.
993
+ *
994
+ * Rules:
995
+ * - Only JS objects and arrays. Don't see strong need for basic
996
+ * JS types right now and this limitation simplifies.
997
+ * - The break between JS objects has to include a newline:
998
+ * {"one": 1}
999
+ * {"two": 2}
1000
+ * or no spaces at all:
1001
+ * {"one": 1}{"two": 2}
1002
+ * I.e., not this:
1003
+ * {"one": 1} {"two": 2}
1004
+ * This condition should be fine for typical use cases and ensures
1005
+ * no false matches inside JS strings.
1006
+ * - The break between JS *arrays* has to include a newline:
1007
+ * ["one", "two"]
1008
+ * ["three"]
1009
+ * The 'no spaces' case is NOT supported for JS arrays as of v6.0.0
1010
+ * because <https://github.com/trentm/json/issues/55> shows that that
1011
+ * is not safe.
1012
+ */
1013
+ var newBuffer = buffer;
1014
+ /* JSSTYLED */
1015
+ [/(})\s*\n\s*({)/g, /(})({")/g].forEach(function (pat) {
1016
+ newBuffer = newBuffer.replace(pat, '$1,\n$2');
1017
+ });
1018
+ [/(\])\s*\n\s*(\[)/g].forEach(function (pat) {
1019
+ newBuffer = newBuffer.replace(pat, ',\n');
1020
+ });
1021
+ newBuffer = newBuffer.trim();
1022
+ if (newBuffer[0] !== '[') {
1023
+ newBuffer = '[\n' + newBuffer;
1024
+ }
1025
+ if (newBuffer.slice(-1) !== ']') {
1026
+ newBuffer = newBuffer + '\n]\n';
1027
+ }
1028
+ try {
1029
+ return {
1030
+ datum: JSON.parse(newBuffer)
1031
+ };
1032
+ } catch (e2) {
1033
+ return {
1034
+ error: e2
1035
+ };
1036
+ }
1037
+ } else if (merge) {
1038
+ // See the 'Rules' above for limitations on boundaries for 'adjacent'
1039
+ // objects: KISS.
1040
+ var newBuffer = buffer;
1041
+ /* JSSTYLED */
1042
+ [/(})\s*\n\s*({)/g, /(})({")/g].forEach(function (pat) {
1043
+ newBuffer = newBuffer.replace(pat, '$1,\n$2');
1044
+ });
1045
+ newBuffer = '[\n' + newBuffer + '\n]\n';
1046
+ var objs;
1047
+ try {
1048
+ objs = JSON.parse(newBuffer);
1049
+ } catch (e) {
1050
+ return {
1051
+ error: e
1052
+ };
1053
+ }
1054
+ var merged = objs[0];
1055
+ if (merge === 'shallow') {
1056
+ for (var i = 1; i < objs.length; i++) {
1057
+ var obj = objs[i];
1058
+ Object.keys(obj).forEach(function (k) {
1059
+ merged[k] = obj[k];
1060
+ });
1061
+ }
1062
+ } else if (merge === 'deep') {
1063
+ function deepExtend(a, b) {
1064
+ Object.keys(b).forEach(function (k) {
1065
+ if (a[k] && b[k] &&
1066
+ toString.call(a[k]) === '[object Object]' &&
1067
+ toString.call(b[k]) === '[object Object]')
1068
+ {
1069
+ deepExtend(a[k], b[k])
1070
+ } else {
1071
+ a[k] = b[k];
1072
+ }
1073
+ });
1074
+ }
1075
+ for (var i = 1; i < objs.length; i++) {
1076
+ deepExtend(merged, objs[i]);
1077
+ }
1078
+ } else {
1079
+ throw new Error(format('unknown value for "merge": "%s"', merge));
1080
+ }
1081
+ return {
1082
+ datum: merged
1083
+ };
1084
+ } else {
1085
+ try {
1086
+ return {
1087
+ datum: JSON.parse(buffer)
1088
+ };
1089
+ } catch (e) {
1090
+ return {
1091
+ error: e
1092
+ };
1093
+ }
1094
+ }
1095
+ }
1096
+
1097
+
1098
+ /**
1099
+ * Apply a lookup to the given datum.
1100
+ *
1101
+ * @argument datum {Object}
1102
+ * @argument lookup {Array} The parsed lookup (from
1103
+ * `parseLookup(<string>, <string>)`). Might be empty.
1104
+ * @returns {Object} The result of the lookup.
1105
+ */
1106
+ function lookupDatum(datum, lookup) {
1107
+ var d = datum;
1108
+ for (var i = 0; i < lookup.length; i++) {
1109
+ var bit = lookup[i];
1110
+ if (d === null) {
1111
+ return undefined;
1112
+ } else if (typeof (bit) === 'number' && bit < 0) {
1113
+ d = d[d.length + bit];
1114
+ } else {
1115
+ d = d[bit];
1116
+ }
1117
+ if (d === undefined) {
1118
+ return undefined;
1119
+ }
1120
+ }
1121
+ return d;
1122
+ }
1123
+
1124
+
1125
+ /**
1126
+ * Output the given datasets.
1127
+ *
1128
+ * @param datasets {Array} Array of data sets to print, in the form:
1129
+ * `[ [<datum>, <sep>, <alwaysPrintSep>], ... ]`
1130
+ * @param filename {String} The filename to which to write the output. If
1131
+ * not set, then emit to stdout.
1132
+ * @param headers {String} The HTTP header block string, if any, to emit
1133
+ * first.
1134
+ * @param opts {Object} Parsed tool options.
1135
+ */
1136
+ function printDatasets(datasets, filename, headers, opts) {
1137
+ var isTTY = (filename ? false : process.stdout.isTTY)
1138
+ var write = emit;
1139
+ if (filename) {
1140
+ var tmpPath = path.resolve(path.dirname(filename),
1141
+ format('.%s-json-%s-%s.tmp', path.basename(filename), process.pid,
1142
+ Date.now()));
1143
+ var stats = fs.statSync(filename);
1144
+ var f = fs.createWriteStream(tmpPath,
1145
+ {encoding: 'utf8', mode: stats.mode});
1146
+ write = f.write.bind(f);
1147
+ }
1148
+ if (headers && headers.length > 0) {
1149
+ write(headers)
1150
+ }
1151
+ for (var i = 0; i < datasets.length; i++) {
1152
+ var dataset = datasets[i];
1153
+ var output = stringifyDatum(dataset[0], opts, isTTY);
1154
+ var sep = dataset[1];
1155
+ if (output && output.length) {
1156
+ write(output);
1157
+ write(sep);
1158
+ } else if (dataset[2]) {
1159
+ write(sep);
1160
+ }
1161
+ }
1162
+ if (filename) {
1163
+ f.on('open', function () {
1164
+ f.end();
1165
+ fs.renameSync(tmpPath, filename);
1166
+ if (!opts.quiet) {
1167
+ warn('json: updated "%s" in-place', filename);
1168
+ }
1169
+ });
1170
+ }
1171
+ }
1172
+
1173
+
1174
+ /**
1175
+ * Stringify the given datum according to the given output options.
1176
+ */
1177
+ function stringifyDatum(datum, opts, isTTY) {
1178
+ var output = null;
1179
+ switch (opts.outputMode) {
1180
+ case OM_INSPECT:
1181
+ output = util.inspect(datum, false, Infinity, isTTY);
1182
+ break;
1183
+ case OM_JSON:
1184
+ if (typeof (datum) !== 'undefined') {
1185
+ output = JSON.stringify(datum, null, opts.jsonIndent);
1186
+ }
1187
+ break;
1188
+ case OM_COMPACT:
1189
+ // Dev Note: A still relatively experimental attempt at a more
1190
+ // compact ouput somewhat a la Python's repr of a dict. I.e. try to
1191
+ // fit elements on one line as much as reasonable.
1192
+ if (datum === undefined) {
1193
+ // pass
1194
+ } else if (Array.isArray(datum)) {
1195
+ var bits = ['[\n'];
1196
+ datum.forEach(function (d) {
1197
+ bits.push(' ')
1198
+ bits.push(JSON.stringify(d, null, 0).replace(
1199
+ /* JSSTYLED */
1200
+ /,"(?![,:])/g, ', "'));
1201
+ bits.push(',\n');
1202
+ });
1203
+ bits.push(bits.pop().slice(0, -2) + '\n') // drop last comma
1204
+ bits.push(']');
1205
+ output = bits.join('');
1206
+ } else {
1207
+ output = JSON.stringify(datum, null, 0);
1208
+ }
1209
+ break;
1210
+ case OM_JSONY:
1211
+ if (typeof (datum) === 'string') {
1212
+ output = datum;
1213
+ } else if (typeof (datum) !== 'undefined') {
1214
+ output = JSON.stringify(datum, null, opts.jsonIndent);
1215
+ }
1216
+ break;
1217
+ default:
1218
+ throw new Error('unknown output mode: ' + opts.outputMode);
1219
+ }
1220
+ return output;
1221
+ }
1222
+
1223
+
1224
+ /**
1225
+ * Print out a single result, considering input options.
1226
+ *
1227
+ * @deprecated
1228
+ */
1229
+ function printDatum(datum, opts, sep, alwaysPrintSep) {
1230
+ var output = stringifyDatum(datum, opts);
1231
+ if (output && output.length) {
1232
+ emit(output);
1233
+ emit(sep);
1234
+ } else if (alwaysPrintSep) {
1235
+ emit(sep);
1236
+ }
1237
+ }
1238
+
1239
+
1240
+ var stdoutFlushed = true;
1241
+ function emit(s) {
1242
+ // TODO:PERF If this is try/catch is too slow (too granular): move up to
1243
+ // mainline and be sure to only catch this particular error.
1244
+ if (drainingStdout) {
1245
+ return;
1246
+ }
1247
+ try {
1248
+ stdoutFlushed = process.stdout.write(s);
1249
+ } catch (e) {
1250
+ // Handle any exceptions in stdout writing in the 'error' event above.
1251
+ }
1252
+ }
1253
+
1254
+ process.stdout.on('error', function (err) {
1255
+ if (err.code === 'EPIPE') {
1256
+ // See <https://github.com/trentm/json/issues/9>.
1257
+ drainStdoutAndExit(0);
1258
+ } else {
1259
+ warn(err)
1260
+ drainStdoutAndExit(1);
1261
+ }
1262
+ });
1263
+
1264
+
1265
+ /**
1266
+ * A hacked up version of 'process.exit' that will first drain stdout
1267
+ * before exiting. *WARNING: This doesn't stop event processing.* IOW,
1268
+ * callers have to be careful that code following this call isn't
1269
+ * accidentally executed.
1270
+ *
1271
+ * In node v0.6 "process.stdout and process.stderr are blocking when they
1272
+ * refer to regular files or TTY file descriptors." However, this hack might
1273
+ * still be necessary in a shell pipeline.
1274
+ */
1275
+ var drainingStdout = false;
1276
+ function drainStdoutAndExit(code) {
1277
+ if (drainingStdout) {
1278
+ return;
1279
+ }
1280
+ drainingStdout = true;
1281
+ process.stdout.on('drain', function () {
1282
+ process.exit(code);
1283
+ });
1284
+ process.stdout.on('close', function () {
1285
+ process.exit(code);
1286
+ });
1287
+ if (stdoutFlushed) {
1288
+ process.exit(code);
1289
+ }
1290
+ }
1291
+
1292
+
1293
+ /**
1294
+ * Return a function for the given JS code that returns.
1295
+ *
1296
+ * If no 'return' in the given javascript snippet, then assume we are a single
1297
+ * statement and wrap in 'return (...)'. This is for convenience for short
1298
+ * '-c ...' snippets.
1299
+ */
1300
+ function funcWithReturnFromSnippet(js) {
1301
+ // auto-"return"
1302
+ if (js.indexOf('return') === -1) {
1303
+ if (js.substring(js.length - 1) === ';') {
1304
+ js = js.substring(0, js.length - 1);
1305
+ }
1306
+ js = 'return (' + js + ')';
1307
+ }
1308
+ return (new Function(js));
1309
+ }
1310
+
1311
+
1312
+
1313
+ //---- mainline
1314
+
1315
+ function main(argv) {
1316
+ var opts;
1317
+ try {
1318
+ opts = parseArgv(argv);
1319
+ } catch (e) {
1320
+ warn('json: error: %s', e.message)
1321
+ return drainStdoutAndExit(1);
1322
+ }
1323
+ //warn(opts);
1324
+ if (opts.help) {
1325
+ printHelp();
1326
+ return;
1327
+ }
1328
+ if (opts.version) {
1329
+ if (opts.outputMode === OM_JSON) {
1330
+ var v = {
1331
+ version: getVersion(),
1332
+ author: 'Trent Mick',
1333
+ project: 'https://github.com/trentm/json'
1334
+ };
1335
+ console.log(JSON.stringify(v, null, opts.jsonIndent));
1336
+ } else {
1337
+ console.log('json ' + getVersion());
1338
+ console.log('written by Trent Mick');
1339
+ console.log('https://github.com/trentm/json');
1340
+ }
1341
+ return;
1342
+ }
1343
+ var lookupStrs = opts.args;
1344
+
1345
+ // Prepare condition and execution funcs (and vm scripts) for -c/-e.
1346
+ var execVm = Boolean(process.env.JSON_EXEC &&
1347
+ process.env.JSON_EXEC === 'vm');
1348
+ var i;
1349
+ var condFuncs = [];
1350
+ if (!execVm) {
1351
+ for (i = 0; i < opts.condSnippets.length; i++) {
1352
+ condFuncs[i] = funcWithReturnFromSnippet(opts.condSnippets[i]);
1353
+ }
1354
+ }
1355
+ var condScripts = [];
1356
+ if (execVm) {
1357
+ for (i = 0; i < opts.condSnippets.length; i++) {
1358
+ condScripts[i] = vm.createScript(opts.condSnippets[i]);
1359
+ }
1360
+ }
1361
+ var cond = Boolean(condFuncs.length + condScripts.length);
1362
+ var exeFuncs = [];
1363
+ if (!execVm) {
1364
+ for (i = 0; i < opts.exeSnippets.length; i++) {
1365
+ exeFuncs[i] = new Function(opts.exeSnippets[i]);
1366
+ }
1367
+ }
1368
+ var exeScripts = [];
1369
+ if (execVm) {
1370
+ for (i = 0; i < opts.exeSnippets.length; i++) {
1371
+ exeScripts[i] = vm.createScript(opts.exeSnippets[i]);
1372
+ }
1373
+ }
1374
+ var exe = Boolean(exeFuncs.length + exeScripts.length);
1375
+
1376
+ try {
1377
+ var lookups = lookupStrs.map(function (lookup) {
1378
+ return parseLookup(lookup, opts.lookupDelim);
1379
+ });
1380
+ } catch (e) {
1381
+ warn('json: error: %s', e.message)
1382
+ return drainStdoutAndExit(1);
1383
+ }
1384
+
1385
+ if (opts.group && opts.array && opts.outputMode !== OM_JSON) {
1386
+ // streaming
1387
+ var chunker = chunkEmitter(opts);
1388
+ chunker.on('error', function (error) {
1389
+ warn('json: error: %s', err.message);
1390
+ return drainStdoutAndExit(1);
1391
+ });
1392
+ chunker.on('chunk', parseChunk);
1393
+ } else if (opts.inPlace) {
1394
+ assert.equal(opts.inputFiles.length, 1,
1395
+ 'cannot handle more than one file with -I');
1396
+ getInput(opts, function (err, content, filename) {
1397
+ if (err) {
1398
+ warn('json: error: %s', err.message)
1399
+ return drainStdoutAndExit(1);
1400
+ }
1401
+
1402
+ // Take off a leading HTTP header if any and pass it through.
1403
+ var headers = [];
1404
+ while (true) {
1405
+ if (content.slice(0, 5) === 'HTTP/') {
1406
+ var index = content.indexOf('\r\n\r\n');
1407
+ var sepLen = 4;
1408
+ if (index == -1) {
1409
+ index = content.indexOf('\n\n');
1410
+ sepLen = 2;
1411
+ }
1412
+ if (index != -1) {
1413
+ if (!opts.dropHeaders) {
1414
+ headers.push(content.slice(0, index + sepLen));
1415
+ }
1416
+ var is100Continue = (
1417
+ content.slice(0, 21) === 'HTTP/1.1 100 Continue');
1418
+ content = content.slice(index + sepLen);
1419
+ if (is100Continue) {
1420
+ continue;
1421
+ }
1422
+ }
1423
+ }
1424
+ break;
1425
+ }
1426
+ parseChunk(content, undefined, filename, true, headers.join(''));
1427
+ });
1428
+ } else {
1429
+ // not streaming
1430
+ getInput(opts, function (err, buffer, filename) {
1431
+ if (err) {
1432
+ warn('json: error: %s', err.message)
1433
+ return drainStdoutAndExit(1);
1434
+ }
1435
+ // Take off a leading HTTP header if any and pass it through.
1436
+ while (true) {
1437
+ if (buffer.slice(0, 5) === 'HTTP/') {
1438
+ var index = buffer.indexOf('\r\n\r\n');
1439
+ var sepLen = 4;
1440
+ if (index == -1) {
1441
+ index = buffer.indexOf('\n\n');
1442
+ sepLen = 2;
1443
+ }
1444
+ if (index != -1) {
1445
+ if (!opts.dropHeaders) {
1446
+ emit(buffer.slice(0, index + sepLen));
1447
+ }
1448
+ var is100Continue = (
1449
+ buffer.slice(0, 21) === 'HTTP/1.1 100 Continue');
1450
+ buffer = buffer.slice(index + sepLen);
1451
+ if (is100Continue) {
1452
+ continue;
1453
+ }
1454
+ }
1455
+ }
1456
+ break;
1457
+ }
1458
+ parseChunk(buffer, null, filename, false);
1459
+ });
1460
+ }
1461
+
1462
+ /**
1463
+ * Parse a single chunk of JSON. This may be called more than once
1464
+ * (when streaming or when operating on multiple files).
1465
+ *
1466
+ * @param chunk {String} The JSON-encoded string.
1467
+ * @param obj {Object} Optional. For some code paths while streaming `obj`
1468
+ * will be provided. This is an already parsed JSON object.
1469
+ * @param filename {String} Optional. The filename from which this content
1470
+ * came, if relevant.
1471
+ * @param inPlace {Boolean} Optional. If true, then output will be written
1472
+ * to `filename`.
1473
+ * @param headers {String} Optional. Leading HTTP headers, if any to emit.
1474
+ */
1475
+ function parseChunk(chunk, obj, filename, inPlace, headers) {
1476
+ // Expect the chunk to be JSON.
1477
+ if (!chunk.length) {
1478
+ return;
1479
+ }
1480
+ // parseInput() -> {datum: <input object>, error: <error object>}
1481
+ var input = parseInput(chunk, obj, opts.group, opts.merge);
1482
+ if (input.error) {
1483
+ // Doesn't look like JSON. Just print it out and move on.
1484
+ if (!opts.quiet) {
1485
+ // Use JSON-js' "json_parse" parser to get more detail on the
1486
+ // syntax error.
1487
+ var details = '';
1488
+ var normBuffer = chunk.replace(/\r\n|\n|\r/, '\n');
1489
+ try {
1490
+ json_parse(normBuffer);
1491
+ details = input.error;
1492
+ } catch (err) {
1493
+ // err.at has the position. Get line/column from that.
1494
+ var at = err.at - 1; // `err.at` looks to be 1-based.
1495
+ var lines = chunk.split('\n');
1496
+ var line, col, pos = 0;
1497
+ for (line = 0; line < lines.length; line++) {
1498
+ pos += lines[line].length + 1;
1499
+ if (pos > at) {
1500
+ col = at - (pos - lines[line].length - 1);
1501
+ break;
1502
+ }
1503
+ }
1504
+ var spaces = '';
1505
+ for (var i = 0; i < col; i++) {
1506
+ spaces += '.';
1507
+ }
1508
+ details = err.message + ' at line ' + (line + 1) +
1509
+ ', column ' + (col + 1) + ':\n ' +
1510
+ lines[line] + '\n ' + spaces + '^';
1511
+ }
1512
+ warn('json: error: %s is not JSON: %s',
1513
+ filename ? '"' + filename + '"' : 'input', details);
1514
+ }
1515
+ if (!opts.validate) {
1516
+ emit(chunk);
1517
+ if (chunk.length && chunk[chunk.length - 1] !== '\n') {
1518
+ emit('\n');
1519
+ }
1520
+ }
1521
+ return drainStdoutAndExit(1);
1522
+ }
1523
+ if (opts.validate) {
1524
+ return drainStdoutAndExit(0);
1525
+ }
1526
+ var data = input.datum;
1527
+
1528
+ // Process: items (-M, --items)
1529
+ if (opts.items) {
1530
+ if (!Array.isArray(data)) {
1531
+ var key;
1532
+ var array = [];
1533
+ for (key in data) {
1534
+ if (data.hasOwnProperty(key)) {
1535
+ array.push({
1536
+ key: key,
1537
+ value: data[key]
1538
+ });
1539
+ }
1540
+ }
1541
+ data = array;
1542
+ }
1543
+ }
1544
+
1545
+ // Process: executions (-e, -E)
1546
+ var i, j;
1547
+ if (!exe) {
1548
+ /* pass */
1549
+ } else if (opts.array || (opts.array === null && Array.isArray(data))) {
1550
+ var arrayified = false;
1551
+ if (!Array.isArray(data)) {
1552
+ arrayified = true;
1553
+ data = [data];
1554
+ }
1555
+ for (i = 0; i < data.length; i++) {
1556
+ var datum = data[i];
1557
+ for (j = 0; j < exeFuncs.length; j++) {
1558
+ exeFuncs[j].call(datum);
1559
+ }
1560
+ for (j = 0; j < exeScripts.length; j++) {
1561
+ exeScripts[j].runInNewContext(datum);
1562
+ }
1563
+ }
1564
+ if (arrayified) {
1565
+ data = data[0];
1566
+ }
1567
+ } else {
1568
+ for (j = 0; j < exeFuncs.length; j++) {
1569
+ exeFuncs[j].call(data);
1570
+ }
1571
+ for (j = 0; j < exeScripts.length; j++) {
1572
+ exeScripts[j].runInNewContext(data);
1573
+ }
1574
+ }
1575
+
1576
+ // Process: conditionals (-c)
1577
+ if (!cond) {
1578
+ /* pass */
1579
+ } else if (opts.array || (opts.array === null && Array.isArray(data))) {
1580
+ var arrayified = false;
1581
+ if (!Array.isArray(data)) {
1582
+ arrayified = true;
1583
+ data = [data];
1584
+ }
1585
+ var filtered = [];
1586
+ for (i = 0; i < data.length; i++) {
1587
+ var datum = data[i];
1588
+ var datumCopy = objCopy(datum);
1589
+ var keep = true;
1590
+ // TODO(perf): Perhaps drop the 'datumCopy'? "this is a gun"
1591
+ for (j = 0; j < condFuncs.length; j++) {
1592
+ if (!condFuncs[j].call(datumCopy)) {
1593
+ keep = false;
1594
+ break;
1595
+ }
1596
+ }
1597
+ if (keep) {
1598
+ for (j = 0; j < condScripts.length; j++) {
1599
+ if (!condScripts[j].runInNewContext(datumCopy)) {
1600
+ keep = false;
1601
+ break;
1602
+ }
1603
+ }
1604
+ if (keep) {
1605
+ filtered.push(datum);
1606
+ }
1607
+ }
1608
+ }
1609
+ if (arrayified) {
1610
+ data = (filtered.length ? filtered[0] : []);
1611
+ } else {
1612
+ data = filtered;
1613
+ }
1614
+ } else {
1615
+ var keep = true;
1616
+ var dataCopy = objCopy(data);
1617
+ for (j = 0; j < condFuncs.length; j++) {
1618
+ // TODO(perf): Perhaps drop the 'dataCopy'? "this is a gun"
1619
+ if (!condFuncs[j].call(dataCopy)) {
1620
+ keep = false;
1621
+ break;
1622
+ }
1623
+ }
1624
+ if (keep) {
1625
+ for (j = 0; j < condScripts.length; j++) {
1626
+ if (!condScripts[j].runInNewContext(dataCopy)) {
1627
+ keep = false;
1628
+ break;
1629
+ }
1630
+ }
1631
+ }
1632
+ if (!keep) {
1633
+ data = undefined;
1634
+ }
1635
+ }
1636
+
1637
+ // Process: lookups
1638
+ var lookupsAreIndeces = false;
1639
+ if (lookups.length) {
1640
+ if (opts.array) {
1641
+ if (!Array.isArray(data)) data = [data];
1642
+ var table = [];
1643
+ for (j = 0; j < data.length; j++) {
1644
+ var datum = data[j];
1645
+ var row = {};
1646
+ for (i = 0; i < lookups.length; i++) {
1647
+ var lookup = lookups[i];
1648
+ var value = lookupDatum(datum, lookup);
1649
+ if (value !== undefined) {
1650
+ row[lookup.join('.')] = value;
1651
+ }
1652
+ }
1653
+ table.push(row);
1654
+ }
1655
+ data = table;
1656
+ } else {
1657
+ // Special case handling: Note if the 'lookups' are indeces into
1658
+ // an array. This may be used below to change the output
1659
+ // representation.
1660
+ if (Array.isArray(data)) {
1661
+ lookupsAreIndeces = true;
1662
+ for (i = 0; i < lookups.length; i++) {
1663
+ if (lookups[i].length !== 1 ||
1664
+ isNaN(Number(lookups[i])))
1665
+ {
1666
+ lookupsAreIndeces = false;
1667
+ break;
1668
+ }
1669
+ }
1670
+ }
1671
+ var row = {};
1672
+ for (i = 0; i < lookups.length; i++) {
1673
+ var lookup = lookups[i];
1674
+ var value = lookupDatum(data, lookup);
1675
+ if (value !== undefined) {
1676
+ row[lookup.join('.')] = value;
1677
+ }
1678
+ }
1679
+ data = row;
1680
+ }
1681
+ }
1682
+
1683
+ // --keys
1684
+ if (opts.outputKeys) {
1685
+ var data = Object.keys(data);
1686
+ }
1687
+
1688
+ // Output
1689
+ var datasets = [];
1690
+ if (opts.outputMode === OM_JSON) {
1691
+ if (lookups.length === 1 && !opts.array) {
1692
+ /**
1693
+ * Special case: For JSON output of a *single* lookup, *don't*
1694
+ * use the full table structure, else there is no way to get
1695
+ * string quoting for a single value:
1696
+ * $ echo '{"a": [], "b": "[]"}' | json -j a
1697
+ * []
1698
+ * $ echo '{"a": [], "b": "[]"}' | json -j b
1699
+ * '[]'
1700
+ * See <https://github.com/trentm/json/issues/35> for why.
1701
+ */
1702
+ data = data[lookups[0].join('.')];
1703
+ } else if (lookupsAreIndeces) {
1704
+ /**
1705
+ * Special case: Lookups that are all indeces into an input
1706
+ * array are more likely to be wanted as an array of selected
1707
+ * items rather than a 'JSON table' thing that we use otherwise.
1708
+ */
1709
+ var flattened = [];
1710
+ for (i = 0; i < lookups.length; i++) {
1711
+ var lookupStr = lookups[i].join('.');
1712
+ if (data.hasOwnProperty(lookupStr)) {
1713
+ flattened.push(data[lookupStr])
1714
+ }
1715
+ }
1716
+ data = flattened;
1717
+ }
1718
+ // If JSON output mode, then always just output full set of data to
1719
+ // ensure valid JSON output.
1720
+ datasets.push([data, '\n', false]);
1721
+ } else if (lookups.length) {
1722
+ if (opts.array) {
1723
+ // Output `data` as a 'table' of lookup results.
1724
+ for (j = 0; j < data.length; j++) {
1725
+ var row = data[j];
1726
+ for (i = 0; i < lookups.length - 1; i++) {
1727
+ datasets.push([row[lookups[i].join('.')],
1728
+ opts.delim, true]);
1729
+ }
1730
+ datasets.push([row[lookups[i].join('.')], '\n', true]);
1731
+ }
1732
+ } else {
1733
+ for (i = 0; i < lookups.length; i++) {
1734
+ datasets.push([data[lookups[i].join('.')], '\n', false]);
1735
+ }
1736
+ }
1737
+ } else if (opts.array) {
1738
+ if (!Array.isArray(data)) data = [data];
1739
+ for (j = 0; j < data.length; j++) {
1740
+ datasets.push([data[j], '\n', false]);
1741
+ }
1742
+ } else {
1743
+ // Output `data` as is.
1744
+ datasets.push([data, '\n', false]);
1745
+ }
1746
+ printDatasets(datasets, inPlace ? filename : undefined, headers, opts);
1747
+ }
1748
+ }
1749
+
1750
+ if (require.main === module) {
1751
+ // HACK guard for <https://github.com/trentm/json/issues/24>.
1752
+ // We override the `process.stdout.end` guard that core node.js puts in
1753
+ // place. The real fix is that `.end()` shouldn't be called on stdout
1754
+ // in node core. Hopefully node v0.6.9 will fix that. Only guard
1755
+ // for v0.6.0..v0.6.8.
1756
+ var nodeVer = process.versions.node.split('.').map(Number);
1757
+ if ([0, 6, 0] <= nodeVer && nodeVer <= [0, 6, 8]) {
1758
+ var stdout = process.stdout;
1759
+ stdout.end = stdout.destroy = stdout.destroySoon = function () {
1760
+ /* pass */
1761
+ };
1762
+ }
1763
+
1764
+ main(process.argv);
1765
+ }