daiki-fca 0.0.1

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.

Potentially problematic release.


This version of daiki-fca might be problematic. Click here for more details.

Files changed (296) hide show
  1. package/.cache/nix/binary-cache-v6.sqlite +0 -0
  2. package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
  3. package/.cache/replit/env/latest +121 -0
  4. package/.cache/replit/env/latest.json +1 -0
  5. package/.cache/replit/modules/nix.res +1 -0
  6. package/.cache/replit/modules/nodejs-20.res +1 -0
  7. package/.cache/replit/modules/replit.res +1 -0
  8. package/.cache/replit/modules.stamp +0 -0
  9. package/.cache/replit/nix/env.json +1 -0
  10. package/.cache/typescript/5.6/node_modules/.package-lock.json +188 -0
  11. package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
  12. package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
  13. package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
  14. package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
  15. package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
  16. package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
  17. package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
  18. package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
  19. package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +21 -0
  20. package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +15 -0
  21. package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +318 -0
  22. package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +71 -0
  23. package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
  24. package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
  25. package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
  26. package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
  27. package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
  28. package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
  29. package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
  30. package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
  31. package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
  32. package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  33. package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
  34. package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
  35. package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
  36. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  37. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
  38. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  39. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  40. package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
  41. package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
  42. package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
  43. package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +597 -0
  44. package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  45. package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
  46. package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
  47. package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
  48. package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
  49. package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
  50. package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
  51. package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4343 -0
  52. package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +511 -0
  53. package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  54. package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
  55. package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
  56. package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
  57. package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
  58. package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
  59. package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +621 -0
  60. package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1005 -0
  61. package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
  62. package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
  63. package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
  64. package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
  65. package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1996 -0
  66. package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
  67. package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
  68. package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
  69. package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
  70. package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
  71. package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
  72. package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +349 -0
  73. package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
  74. package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
  75. package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
  76. package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
  77. package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
  78. package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
  79. package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
  80. package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
  81. package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
  82. package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
  83. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  84. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  85. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
  86. package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
  87. package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
  88. package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2397 -0
  89. package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
  90. package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
  91. package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
  92. package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
  93. package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
  94. package/.cache/typescript/5.6/node_modules/@types/node-cron/LICENSE +21 -0
  95. package/.cache/typescript/5.6/node_modules/@types/node-cron/README.md +76 -0
  96. package/.cache/typescript/5.6/node_modules/@types/node-cron/index.d.ts +57 -0
  97. package/.cache/typescript/5.6/node_modules/@types/node-cron/package.json +50 -0
  98. package/.cache/typescript/5.6/node_modules/@types/npmlog/LICENSE +21 -0
  99. package/.cache/typescript/5.6/node_modules/@types/npmlog/README.md +15 -0
  100. package/.cache/typescript/5.6/node_modules/@types/npmlog/index.d.ts +84 -0
  101. package/.cache/typescript/5.6/node_modules/@types/npmlog/package.json +32 -0
  102. package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
  103. package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
  104. package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
  105. package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
  106. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
  107. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
  108. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
  109. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
  110. package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
  111. package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
  112. package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
  113. package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
  114. package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
  115. package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
  116. package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
  117. package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
  118. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  119. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
  120. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
  121. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  122. package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
  123. package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
  124. package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
  125. package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
  126. package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
  127. package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
  128. package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
  129. package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
  130. package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
  131. package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
  132. package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
  133. package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
  134. package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
  135. package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
  136. package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
  137. package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
  138. package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  139. package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
  140. package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
  141. package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
  142. package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
  143. package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
  144. package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
  145. package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
  146. package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
  147. package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
  148. package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
  149. package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
  150. package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
  151. package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
  152. package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
  153. package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
  154. package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
  155. package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
  156. package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
  157. package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
  158. package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
  159. package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
  160. package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
  161. package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
  162. package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
  163. package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
  164. package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
  165. package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
  166. package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +21 -0
  167. package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
  168. package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
  169. package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
  170. package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
  171. package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
  172. package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
  173. package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
  174. package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
  175. package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
  176. package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  177. package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
  178. package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  179. package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
  180. package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
  181. package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
  182. package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
  183. package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
  184. package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
  185. package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  186. package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
  187. package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
  188. package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
  189. package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
  190. package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
  191. package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
  192. package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
  193. package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
  194. package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  195. package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
  196. package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
  197. package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
  198. package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
  199. package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
  200. package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
  201. package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
  202. package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
  203. package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
  204. package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
  205. package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
  206. package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
  207. package/.cache/typescript/5.6/package-lock.json +202 -0
  208. package/.cache/typescript/5.6/package.json +1 -0
  209. package/.replit +8 -0
  210. package/LICENSE +21 -0
  211. package/index.js +460 -0
  212. package/package.json +46 -0
  213. package/replit.nix +3 -0
  214. package/src/Screenshot.js +83 -0
  215. package/src/addExternalModule.js +25 -0
  216. package/src/addUserToGroup.js +115 -0
  217. package/src/changeAdminStatus.js +103 -0
  218. package/src/changeArchivedStatus.js +55 -0
  219. package/src/changeAvatar.js +136 -0
  220. package/src/changeAvatarV2.js +86 -0
  221. package/src/changeAvt.js +85 -0
  222. package/src/changeBio.js +76 -0
  223. package/src/changeBlockedStatus.js +49 -0
  224. package/src/changeBlockedStatusMqtt.js +80 -0
  225. package/src/changeCover.js +72 -0
  226. package/src/changeGroupImage.js +135 -0
  227. package/src/changeName.js +79 -0
  228. package/src/changeNickname.js +59 -0
  229. package/src/changeThreadColor.js +65 -0
  230. package/src/changeThreadEmoji.js +55 -0
  231. package/src/changeUsername.js +59 -0
  232. package/src/createCommentPost.js +230 -0
  233. package/src/createNewGroup.js +88 -0
  234. package/src/createPoll.js +71 -0
  235. package/src/createPost.js +276 -0
  236. package/src/deleteMessage.js +56 -0
  237. package/src/deleteThread.js +56 -0
  238. package/src/editMessage.js +68 -0
  239. package/src/editMessageOld.js +67 -0
  240. package/src/follow.js +74 -0
  241. package/src/forwardAttachment.js +60 -0
  242. package/src/getAccess.js +112 -0
  243. package/src/getAvatarUser.js +78 -0
  244. package/src/getCurrentUserID.js +7 -0
  245. package/src/getEmojiUrl.js +29 -0
  246. package/src/getFriendsList.js +83 -0
  247. package/src/getMessage.js +835 -0
  248. package/src/getRegion.js +7 -0
  249. package/src/getThreadHistory.js +680 -0
  250. package/src/getThreadHistoryDeprecated.js +71 -0
  251. package/src/getThreadInfo.js +232 -0
  252. package/src/getThreadInfoDeprecated.js +56 -0
  253. package/src/getThreadList.js +213 -0
  254. package/src/getThreadListDeprecated.js +46 -0
  255. package/src/getThreadPictures.js +59 -0
  256. package/src/getUID.js +119 -0
  257. package/src/getUserID.js +61 -0
  258. package/src/getUserInfo.js +66 -0
  259. package/src/handleFriendRequest.js +46 -0
  260. package/src/handleMessageRequest.js +47 -0
  261. package/src/httpGet.js +49 -0
  262. package/src/httpPost.js +48 -0
  263. package/src/listenMqtt.js +827 -0
  264. package/src/listenMqtt.txt +827 -0
  265. package/src/logout.js +75 -0
  266. package/src/markAsDelivered.js +47 -0
  267. package/src/markAsRead.js +70 -0
  268. package/src/markAsReadAll.js +40 -0
  269. package/src/markAsSeen.js +48 -0
  270. package/src/muteThread.js +45 -0
  271. package/src/postFormData.txt +46 -0
  272. package/src/refreshFb_dtsg.js +89 -0
  273. package/src/removeUserFromGroup.js +79 -0
  274. package/src/resolvePhotoUrl.js +45 -0
  275. package/src/searchForThread.js +53 -0
  276. package/src/searchStickers.js +53 -0
  277. package/src/sendMessage.js +329 -0
  278. package/src/sendMessageMqtt.js +322 -0
  279. package/src/sendTypingIndicator.js +101 -0
  280. package/src/sendTypingIndicatorV2.js +28 -0
  281. package/src/setMessageReaction.js +122 -0
  282. package/src/setMessageReactionMqtt.js +62 -0
  283. package/src/setPostReaction.js +112 -0
  284. package/src/setStoryReaction.js +64 -0
  285. package/src/setTitle.js +90 -0
  286. package/src/shareContact.js +110 -0
  287. package/src/shareLink.js +59 -0
  288. package/src/stopListenMqtt.js +23 -0
  289. package/src/threadColors.js +131 -0
  290. package/src/unfriend.js +52 -0
  291. package/src/unsendMessage.js +45 -0
  292. package/src/uploadAttachment.js +94 -0
  293. package/test/example-config.json +18 -0
  294. package/test/test-page.js +140 -0
  295. package/test/test.js +385 -0
  296. package/utils.js +2876 -0
@@ -0,0 +1,349 @@
1
+ /**
2
+ * The `node:sqlite` module facilitates working with SQLite databases.
3
+ * To access it:
4
+ *
5
+ * ```js
6
+ * import sqlite from 'node:sqlite';
7
+ * ```
8
+ *
9
+ * This module is only available under the `node:` scheme. The following will not
10
+ * work:
11
+ *
12
+ * ```js
13
+ * import sqlite from 'node:sqlite';
14
+ * ```
15
+ *
16
+ * The following example shows the basic usage of the `node:sqlite` module to open
17
+ * an in-memory database, write data to the database, and then read the data back.
18
+ *
19
+ * ```js
20
+ * import { DatabaseSync } from 'node:sqlite';
21
+ * const database = new DatabaseSync(':memory:');
22
+ *
23
+ * // Execute SQL statements from strings.
24
+ * database.exec(`
25
+ * CREATE TABLE data(
26
+ * key INTEGER PRIMARY KEY,
27
+ * value TEXT
28
+ * ) STRICT
29
+ * `);
30
+ * // Create a prepared statement to insert data into the database.
31
+ * const insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
32
+ * // Execute the prepared statement with bound values.
33
+ * insert.run(1, 'hello');
34
+ * insert.run(2, 'world');
35
+ * // Create a prepared statement to read data from the database.
36
+ * const query = database.prepare('SELECT * FROM data ORDER BY key');
37
+ * // Execute the prepared statement and log the result set.
38
+ * console.log(query.all());
39
+ * // Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ]
40
+ * ```
41
+ * @since v22.5.0
42
+ * @experimental
43
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/sqlite.js)
44
+ */
45
+ declare module "node:sqlite" {
46
+ interface DatabaseSyncOptions {
47
+ /**
48
+ * If `true`, the database is opened by the constructor. When
49
+ * this value is `false`, the database must be opened via the `open()` method.
50
+ * @since v22.5.0
51
+ * @default true
52
+ */
53
+ open?: boolean | undefined;
54
+ /**
55
+ * If `true`, foreign key constraints
56
+ * are enabled. This is recommended but can be disabled for compatibility with
57
+ * legacy database schemas. The enforcement of foreign key constraints can be
58
+ * enabled and disabled after opening the database using
59
+ * [`PRAGMA foreign_keys`](https://www.sqlite.org/pragma.html#pragma_foreign_keys).
60
+ * @since v22.10.0
61
+ * @default true
62
+ */
63
+ enableForeignKeyConstraints?: boolean | undefined;
64
+ /**
65
+ * If `true`, SQLite will accept
66
+ * [double-quoted string literals](https://www.sqlite.org/quirks.html#dblquote).
67
+ * This is not recommended but can be
68
+ * enabled for compatibility with legacy database schemas.
69
+ * @since v22.10.0
70
+ * @default false
71
+ */
72
+ enableDoubleQuotedStringLiterals?: boolean | undefined;
73
+ /**
74
+ * If `true`, the database is opened in read-only mode.
75
+ * If the database does not exist, opening it will fail.
76
+ * @since v22.12.0
77
+ * @default false
78
+ */
79
+ readOnly?: boolean | undefined;
80
+ }
81
+ interface CreateSessionOptions {
82
+ /**
83
+ * A specific table to track changes for. By default, changes to all tables are tracked.
84
+ * @since v22.12.0
85
+ */
86
+ table?: string | undefined;
87
+ /**
88
+ * Name of the database to track. This is useful when multiple databases have been added using
89
+ * [`ATTACH DATABASE`](https://www.sqlite.org/lang_attach.html).
90
+ * @since v22.12.0
91
+ * @default 'main'
92
+ */
93
+ db?: string | undefined;
94
+ }
95
+ interface ApplyChangesetOptions {
96
+ /**
97
+ * Skip changes that, when targeted table name is supplied to this function, return a truthy value.
98
+ * By default, all changes are attempted.
99
+ * @since v22.12.0
100
+ */
101
+ filter?: ((tableName: string) => boolean) | undefined;
102
+ /**
103
+ * Determines how conflicts are handled. **Default**: `SQLITE_CHANGESET_ABORT`.
104
+ * @since v22.12.0
105
+ */
106
+ onConflict?: number | undefined;
107
+ }
108
+ /**
109
+ * This class represents a single [connection](https://www.sqlite.org/c3ref/sqlite3.html) to a SQLite database. All APIs
110
+ * exposed by this class execute synchronously.
111
+ * @since v22.5.0
112
+ */
113
+ class DatabaseSync {
114
+ /**
115
+ * Constructs a new `DatabaseSync` instance.
116
+ * @param location The location of the database.
117
+ * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html).
118
+ * To use a file-backed database, the location should be a file path.
119
+ * To use an in-memory database, the location should be the special name `':memory:'`.
120
+ * @param options Configuration options for the database connection.
121
+ */
122
+ constructor(location: string, options?: DatabaseSyncOptions);
123
+ /**
124
+ * Closes the database connection. An exception is thrown if the database is not
125
+ * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html).
126
+ * @since v22.5.0
127
+ */
128
+ close(): void;
129
+ /**
130
+ * This method allows one or more SQL statements to be executed without returning
131
+ * any results. This method is useful when executing SQL statements read from a
132
+ * file. This method is a wrapper around [`sqlite3_exec()`](https://www.sqlite.org/c3ref/exec.html).
133
+ * @since v22.5.0
134
+ * @param sql A SQL string to execute.
135
+ */
136
+ exec(sql: string): void;
137
+ /**
138
+ * Opens the database specified in the `location` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via
139
+ * the constructor. An exception is thrown if the database is already open.
140
+ * @since v22.5.0
141
+ */
142
+ open(): void;
143
+ /**
144
+ * Compiles a SQL statement into a [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This method is a wrapper
145
+ * around [`sqlite3_prepare_v2()`](https://www.sqlite.org/c3ref/prepare.html).
146
+ * @since v22.5.0
147
+ * @param sql A SQL string to compile to a prepared statement.
148
+ * @return The prepared statement.
149
+ */
150
+ prepare(sql: string): StatementSync;
151
+ /**
152
+ * Creates and attaches a session to the database. This method is a wrapper around
153
+ * [`sqlite3session_create()`](https://www.sqlite.org/session/sqlite3session_create.html) and
154
+ * [`sqlite3session_attach()`](https://www.sqlite.org/session/sqlite3session_attach.html).
155
+ * @param options The configuration options for the session.
156
+ * @returns A session handle.
157
+ * @since v22.12.0
158
+ */
159
+ createSession(options?: CreateSessionOptions): Session;
160
+ /**
161
+ * An exception is thrown if the database is not
162
+ * open. This method is a wrapper around
163
+ * [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html).
164
+ *
165
+ * ```js
166
+ * const sourceDb = new DatabaseSync(':memory:');
167
+ * const targetDb = new DatabaseSync(':memory:');
168
+ *
169
+ * sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
170
+ * targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
171
+ *
172
+ * const session = sourceDb.createSession();
173
+ *
174
+ * const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
175
+ * insert.run(1, 'hello');
176
+ * insert.run(2, 'world');
177
+ *
178
+ * const changeset = session.changeset();
179
+ * targetDb.applyChangeset(changeset);
180
+ * // Now that the changeset has been applied, targetDb contains the same data as sourceDb.
181
+ * ```
182
+ * @param changeset A binary changeset or patchset.
183
+ * @param options The configuration options for how the changes will be applied.
184
+ * @returns Whether the changeset was applied succesfully without being aborted.
185
+ * @since v22.12.0
186
+ */
187
+ applyChangeset(changeset: Uint8Array, options?: ApplyChangesetOptions): boolean;
188
+ }
189
+ /**
190
+ * @since v22.12.0
191
+ */
192
+ interface Session {
193
+ /**
194
+ * Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times.
195
+ * An exception is thrown if the database or the session is not open. This method is a wrapper around
196
+ * [`sqlite3session_changeset()`](https://www.sqlite.org/session/sqlite3session_changeset.html).
197
+ * @returns Binary changeset that can be applied to other databases.
198
+ * @since v22.12.0
199
+ */
200
+ changeset(): Uint8Array;
201
+ /**
202
+ * Similar to the method above, but generates a more compact patchset. See
203
+ * [Changesets and Patchsets](https://www.sqlite.org/sessionintro.html#changesets_and_patchsets)
204
+ * in the documentation of SQLite. An exception is thrown if the database or the session is not open. This method is a
205
+ * wrapper around
206
+ * [`sqlite3session_patchset()`](https://www.sqlite.org/session/sqlite3session_patchset.html).
207
+ * @returns Binary patchset that can be applied to other databases.
208
+ * @since v22.12.0
209
+ */
210
+ patchset(): Uint8Array;
211
+ /**
212
+ * Closes the session. An exception is thrown if the database or the session is not open. This method is a
213
+ * wrapper around
214
+ * [`sqlite3session_delete()`](https://www.sqlite.org/session/sqlite3session_delete.html).
215
+ */
216
+ close(): void;
217
+ }
218
+ type SupportedValueType = null | number | bigint | string | Uint8Array;
219
+ interface StatementResultingChanges {
220
+ /**
221
+ * The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement.
222
+ * This field is either a number or a `BigInt` depending on the prepared statement's configuration.
223
+ * This property is the result of [`sqlite3_changes64()`](https://www.sqlite.org/c3ref/changes.html).
224
+ */
225
+ changes: number | bigint;
226
+ /**
227
+ * The most recently inserted rowid.
228
+ * This field is either a number or a `BigInt` depending on the prepared statement's configuration.
229
+ * This property is the result of [`sqlite3_last_insert_rowid()`](https://www.sqlite.org/c3ref/last_insert_rowid.html).
230
+ */
231
+ lastInsertRowid: number | bigint;
232
+ }
233
+ /**
234
+ * This class represents a single [prepared statement](https://www.sqlite.org/c3ref/stmt.html). This class cannot be
235
+ * instantiated via its constructor. Instead, instances are created via the`database.prepare()` method. All APIs exposed by this class execute
236
+ * synchronously.
237
+ *
238
+ * A prepared statement is an efficient binary representation of the SQL used to
239
+ * create it. Prepared statements are parameterizable, and can be invoked multiple
240
+ * times with different bound values. Parameters also offer protection against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks. For these reasons, prepared statements are
241
+ * preferred
242
+ * over hand-crafted SQL strings when handling user input.
243
+ * @since v22.5.0
244
+ */
245
+ class StatementSync {
246
+ private constructor();
247
+ /**
248
+ * This method executes a prepared statement and returns all results as an array of
249
+ * objects. If the prepared statement does not return any results, this method
250
+ * returns an empty array. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using
251
+ * the values in `namedParameters` and `anonymousParameters`.
252
+ * @since v22.5.0
253
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
254
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
255
+ * @return An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of
256
+ * the row.
257
+ */
258
+ all(...anonymousParameters: SupportedValueType[]): unknown[];
259
+ all(
260
+ namedParameters: Record<string, SupportedValueType>,
261
+ ...anonymousParameters: SupportedValueType[]
262
+ ): unknown[];
263
+ /**
264
+ * The source SQL text of the prepared statement with parameter
265
+ * placeholders replaced by the values that were used during the most recent
266
+ * execution of this prepared statement. This property is a wrapper around
267
+ * [`sqlite3_expanded_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html).
268
+ * @since v22.5.0
269
+ */
270
+ readonly expandedSQL: string;
271
+ /**
272
+ * This method executes a prepared statement and returns the first result as an
273
+ * object. If the prepared statement does not return any results, this method
274
+ * returns `undefined`. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the
275
+ * values in `namedParameters` and `anonymousParameters`.
276
+ * @since v22.5.0
277
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
278
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
279
+ * @return An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no
280
+ * rows were returned from the database then this method returns `undefined`.
281
+ */
282
+ get(...anonymousParameters: SupportedValueType[]): unknown;
283
+ get(namedParameters: Record<string, SupportedValueType>, ...anonymousParameters: SupportedValueType[]): unknown;
284
+ /**
285
+ * This method executes a prepared statement and returns an object summarizing the
286
+ * resulting changes. The prepared statement [parameters are bound](https://www.sqlite.org/c3ref/bind_blob.html) using the
287
+ * values in `namedParameters` and `anonymousParameters`.
288
+ * @since v22.5.0
289
+ * @param namedParameters An optional object used to bind named parameters. The keys of this object are used to configure the mapping.
290
+ * @param anonymousParameters Zero or more values to bind to anonymous parameters.
291
+ */
292
+ run(...anonymousParameters: SupportedValueType[]): StatementResultingChanges;
293
+ run(
294
+ namedParameters: Record<string, SupportedValueType>,
295
+ ...anonymousParameters: SupportedValueType[]
296
+ ): StatementResultingChanges;
297
+ /**
298
+ * The names of SQLite parameters begin with a prefix character. By default,`node:sqlite` requires that this prefix character is present when binding
299
+ * parameters. However, with the exception of dollar sign character, these
300
+ * prefix characters also require extra quoting when used in object keys.
301
+ *
302
+ * To improve ergonomics, this method can be used to also allow bare named
303
+ * parameters, which do not require the prefix character in JavaScript code. There
304
+ * are several caveats to be aware of when enabling bare named parameters:
305
+ *
306
+ * * The prefix character is still required in SQL.
307
+ * * The prefix character is still allowed in JavaScript. In fact, prefixed names
308
+ * will have slightly better binding performance.
309
+ * * Using ambiguous named parameters, such as `$k` and `@k`, in the same prepared
310
+ * statement will result in an exception as it cannot be determined how to bind
311
+ * a bare name.
312
+ * @since v22.5.0
313
+ * @param enabled Enables or disables support for binding named parameters without the prefix character.
314
+ */
315
+ setAllowBareNamedParameters(enabled: boolean): void;
316
+ /**
317
+ * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript
318
+ * numbers by default. However, SQLite `INTEGER`s can store values larger than
319
+ * JavaScript numbers are capable of representing. In such cases, this method can
320
+ * be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no
321
+ * impact on database write operations where numbers and `BigInt`s are both
322
+ * supported at all times.
323
+ * @since v22.5.0
324
+ * @param enabled Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database.
325
+ */
326
+ setReadBigInts(enabled: boolean): void;
327
+ /**
328
+ * The source SQL text of the prepared statement. This property is a
329
+ * wrapper around [`sqlite3_sql()`](https://www.sqlite.org/c3ref/expanded_sql.html).
330
+ * @since v22.5.0
331
+ */
332
+ readonly sourceSQL: string;
333
+ }
334
+ /**
335
+ * Conflicting changes are omitted.
336
+ * @since v22.12.0
337
+ */
338
+ const SQLITE_CHANGESET_OMIT: number;
339
+ /**
340
+ * Conflicting changes replace existing values.
341
+ * @since v22.12.0
342
+ */
343
+ const SQLITE_CHANGESET_REPLACE: number;
344
+ /**
345
+ * Abort when a change encounters a conflict and roll back databsase.
346
+ * @since v22.12.0
347
+ */
348
+ const SQLITE_CHANGESET_ABORT: number;
349
+ }
@@ -0,0 +1,12 @@
1
+ declare module "stream/consumers" {
2
+ import { Blob as NodeBlob } from "node:buffer";
3
+ import { Readable } from "node:stream";
4
+ function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<Buffer>;
5
+ function text(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<string>;
6
+ function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<ArrayBuffer>;
7
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<NodeBlob>;
8
+ function json(stream: NodeJS.ReadableStream | Readable | AsyncIterable<any>): Promise<unknown>;
9
+ }
10
+ declare module "node:stream/consumers" {
11
+ export * from "stream/consumers";
12
+ }
@@ -0,0 +1,90 @@
1
+ declare module "stream/promises" {
2
+ import {
3
+ FinishedOptions as _FinishedOptions,
4
+ PipelineDestination,
5
+ PipelineOptions,
6
+ PipelinePromise,
7
+ PipelineSource,
8
+ PipelineTransform,
9
+ } from "node:stream";
10
+ interface FinishedOptions extends _FinishedOptions {
11
+ /**
12
+ * If true, removes the listeners registered by this function before the promise is fulfilled.
13
+ * @default false
14
+ */
15
+ cleanup?: boolean | undefined;
16
+ }
17
+ function finished(
18
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
19
+ options?: FinishedOptions,
20
+ ): Promise<void>;
21
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
22
+ source: A,
23
+ destination: B,
24
+ options?: PipelineOptions,
25
+ ): PipelinePromise<B>;
26
+ function pipeline<
27
+ A extends PipelineSource<any>,
28
+ T1 extends PipelineTransform<A, any>,
29
+ B extends PipelineDestination<T1, any>,
30
+ >(
31
+ source: A,
32
+ transform1: T1,
33
+ destination: B,
34
+ options?: PipelineOptions,
35
+ ): PipelinePromise<B>;
36
+ function pipeline<
37
+ A extends PipelineSource<any>,
38
+ T1 extends PipelineTransform<A, any>,
39
+ T2 extends PipelineTransform<T1, any>,
40
+ B extends PipelineDestination<T2, any>,
41
+ >(
42
+ source: A,
43
+ transform1: T1,
44
+ transform2: T2,
45
+ destination: B,
46
+ options?: PipelineOptions,
47
+ ): PipelinePromise<B>;
48
+ function pipeline<
49
+ A extends PipelineSource<any>,
50
+ T1 extends PipelineTransform<A, any>,
51
+ T2 extends PipelineTransform<T1, any>,
52
+ T3 extends PipelineTransform<T2, any>,
53
+ B extends PipelineDestination<T3, any>,
54
+ >(
55
+ source: A,
56
+ transform1: T1,
57
+ transform2: T2,
58
+ transform3: T3,
59
+ destination: B,
60
+ options?: PipelineOptions,
61
+ ): PipelinePromise<B>;
62
+ function pipeline<
63
+ A extends PipelineSource<any>,
64
+ T1 extends PipelineTransform<A, any>,
65
+ T2 extends PipelineTransform<T1, any>,
66
+ T3 extends PipelineTransform<T2, any>,
67
+ T4 extends PipelineTransform<T3, any>,
68
+ B extends PipelineDestination<T4, any>,
69
+ >(
70
+ source: A,
71
+ transform1: T1,
72
+ transform2: T2,
73
+ transform3: T3,
74
+ transform4: T4,
75
+ destination: B,
76
+ options?: PipelineOptions,
77
+ ): PipelinePromise<B>;
78
+ function pipeline(
79
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
80
+ options?: PipelineOptions,
81
+ ): Promise<void>;
82
+ function pipeline(
83
+ stream1: NodeJS.ReadableStream,
84
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
85
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
86
+ ): Promise<void>;
87
+ }
88
+ declare module "node:stream/promises" {
89
+ export * from "stream/promises";
90
+ }