fca-smart-shankar 1.5.6 → 12.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.
- package/.cache/nix/binary-cache-v6.sqlite +0 -0
- package/.cache/replit/env/latest +116 -47
- package/.cache/replit/env/latest.json +1 -1
- package/.cache/replit/modules/nix.res +1 -0
- package/.cache/replit/modules/nodejs-20.res +1 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.cache/typescript/5.6/node_modules/.package-lock.json +171 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +318 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +71 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
- package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
- package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
- package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
- package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
- package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
- package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
- package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
- package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
- package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
- package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
- package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
- package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
- package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
- package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
- package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
- package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
- package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
- package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
- package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
- package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
- package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
- package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
- package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
- package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
- package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
- package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
- package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
- package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
- package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
- package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
- package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
- package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
- package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
- package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
- package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
- package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
- package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
- package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
- package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
- package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
- package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
- package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
- package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
- package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
- package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
- package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
- package/{LICENSE → .cache/typescript/5.6/node_modules/undici-types/LICENSE} +1 -1
- package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
- package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
- package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
- package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
- package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
- package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
- package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
- package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
- package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
- package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
- package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
- package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
- package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
- package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
- package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
- package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
- package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
- package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
- package/.cache/typescript/5.6/package-lock.json +183 -0
- package/.cache/typescript/5.6/package.json +1 -0
- package/.replit +3 -3
- package/LICENSE-MIT +21 -0
- package/README.md +199 -1
- package/index.js +452 -425
- package/package.json +40 -87
- package/replit.nix +3 -0
- package/src/addExternalModule.js +14 -5
- package/src/addUserToGroup.js +57 -21
- package/src/changeAdminStatus.js +46 -22
- package/src/changeArchivedStatus.js +26 -12
- package/src/changeAvatar.js +136 -0
- package/src/{changeAvt.js → changeAvatarV2.js} +4 -3
- package/src/changeBio.js +26 -15
- package/src/changeBlockedStatus.js +22 -9
- package/src/changeBlockedStatusMqtt.js +80 -0
- package/src/changeCover.js +73 -0
- package/src/changeGroupImage.js +55 -26
- package/src/changeName.js +79 -0
- package/src/changeNickname.js +28 -14
- package/src/changeThreadColor.js +22 -19
- package/src/changeThreadEmoji.js +25 -12
- package/src/changeUsername.js +59 -0
- package/src/createCommentPost.js +230 -0
- package/src/createNewGroup.js +36 -18
- package/src/createPoll.js +28 -17
- package/src/createPost.js +276 -0
- package/src/data/getThreadInfo.json +1 -0
- package/src/deleteMessage.js +25 -14
- package/src/deleteThread.js +26 -13
- package/src/editMessage.js +56 -50
- package/src/editMessageOld.js +67 -0
- package/src/follow.js +74 -0
- package/src/forwardAttachment.js +28 -16
- package/src/getAccess.js +112 -0
- package/src/getAvatarUser.js +78 -0
- package/src/getCurrentUserID.js +3 -3
- package/src/getEmojiUrl.js +10 -8
- package/src/getFriendsList.js +25 -15
- package/src/getMessage.js +813 -81
- package/src/getRegion.js +7 -0
- package/src/getThreadHistory.js +241 -98
- package/src/getThreadHistoryDeprecated.js +93 -0
- package/src/getThreadInfo.js +90 -287
- package/src/getThreadInfoDeprecated.js +80 -0
- package/src/getThreadList.js +215 -158
- package/src/getThreadListDeprecated.js +75 -0
- package/src/getThreadPictures.js +40 -20
- package/src/getUID.js +113 -50
- package/src/getUserID.js +18 -14
- package/src/getUserInfo.js +35 -75
- package/src/handleFriendRequest.js +25 -14
- package/src/handleMessageRequest.js +37 -21
- package/src/httpGet.js +36 -20
- package/src/httpPost.js +37 -20
- package/src/httpPostFormData.js +53 -24
- package/src/listenMqtt.js +421 -654
- package/src/listenNotification.js +85 -0
- package/src/logout.js +24 -17
- package/src/markAsDelivered.js +23 -16
- package/src/markAsRead.js +43 -28
- package/src/markAsReadAll.js +22 -15
- package/src/markAsSeen.js +29 -19
- package/src/muteThread.js +18 -13
- package/src/pinMessage.js +59 -0
- package/src/refreshFb_dtsg.js +89 -0
- package/src/removeUserFromGroup.js +48 -18
- package/src/resolvePhotoUrl.js +22 -14
- package/src/searchForThread.js +23 -13
- package/src/searchStickers.js +53 -0
- package/src/sendMessage.js +180 -122
- package/src/sendMessageMqtt.js +322 -0
- package/src/sendTypingIndicator.js +42 -21
- package/src/sendTypingIndicatorV2.js +28 -0
- package/src/setMessageReaction.js +33 -20
- package/src/setMessageReactionMqtt.js +62 -0
- package/src/setPostReaction.js +105 -95
- package/src/setProfileGuard.js +45 -0
- package/src/setStoryReaction.js +64 -0
- package/src/setTitle.js +35 -19
- package/src/shareContact.js +92 -37
- package/src/shareLink.js +6 -5
- package/src/stopListenMqtt.js +23 -0
- package/src/threadColors.js +110 -18
- package/src/unfriend.js +20 -11
- package/src/unsendMessage.js +15 -10
- package/src/uploadAttachment.js +94 -0
- package/test/test-page.js +1 -1
- package/test/test.js +1 -1
- package/utils.js +1237 -2896
- package/.cache/replit/modules/nodejs-14.res +0 -1
- package/.cache/replit/modules/web.res +0 -1
- package/.cache/typescript/5.5/package.json +0 -1
- package/.config/configstore/update-notifier-npm.json +0 -4
- package/.gitattributes +0 -2
- package/.upm/store.json +0 -1
- package/Extra/Bypass/956/index.js +0 -234
- package/Extra/Bypass/test/aaaa.json +0 -170
- package/Extra/Bypass/test/index.js +0 -188
- package/Extra/Database/index.js +0 -469
- package/Extra/ExtraAddons.js +0 -82
- package/Extra/ExtraFindUID.js +0 -62
- package/Extra/ExtraGetThread.js +0 -365
- package/Extra/ExtraScreenShot.js +0 -430
- package/Extra/ExtraUptimeRobot.js +0 -38
- package/Extra/Html/Classic/script.js +0 -119
- package/Extra/Html/Classic/style.css +0 -8
- package/Extra/Security/Base/Step_1.js +0 -6
- package/Extra/Security/Base/Step_2.js +0 -22
- package/Extra/Security/Base/Step_3.js +0 -22
- package/Extra/Security/Base/index.js +0 -191
- package/Extra/Security/Index.js +0 -5
- package/Extra/Security/Step_1.js +0 -6
- package/Extra/Security/Step_2.js +0 -22
- package/Extra/Security/Step_3.js +0 -22
- package/Extra/Src/Change_Environment.js +0 -24
- package/Extra/Src/Check_Update.js +0 -67
- package/Extra/Src/History.js +0 -115
- package/Extra/Src/Instant_Update.js +0 -65
- package/Extra/Src/Last-Run.js +0 -65
- package/Extra/Src/Premium.js +0 -81
- package/Extra/Src/Release_Memory.js +0 -160
- package/Extra/Src/Websocket.js +0 -213
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/test.js +0 -28
- package/Extra/Src/uuid.js +0 -137
- package/Func/AcceptAgreement.js +0 -31
- package/Func/ClearCache.js +0 -64
- package/Func/ReportV1.js +0 -54
- package/Language/index.json +0 -222
- package/Main.js +0 -1266
- package/SECURITY.md +0 -18
- package/broadcast.js +0 -44
- package/logger.js +0 -66
- package/src/Dev_Horizon_Data.js +0 -125
- package/src/Dev_getThreadInfoOLD.js +0 -422
- package/src/Dev_shareTest2.js +0 -68
- package/src/Dev_shareTest3.js +0 -71
- package/src/Premium.js +0 -25
- package/src/Screenshot.js +0 -83
- package/src/getAccessToken.js +0 -28
- package/src/getThreadInfoOLD.js +0 -422
- package/src/getThreadMain.js +0 -220
- package/src/getUserInfoMain.js +0 -65
- package/src/getUserInfoV2.js +0 -32
- package/src/getUserInfoV3.js +0 -63
- package/src/getUserInfoV4.js +0 -55
- package/src/getUserInfoV5.js +0 -61
- package/src/listenMqttV1.js +0 -846
- package/src/sendMqttMessage.js +0 -71
- package/test/Database_Test.js +0 -4
- package/test/Db2.js +0 -530
- package/test/Horizon_Database/A_README.md +0 -1
- package/test/Horizon_Database/Database.db +0 -0
- package/test/data/shareAttach.js +0 -146
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +0 -7
- package/test/env/.env +0 -0
- package/test/example-db.db +0 -0
- package/test/memoryleak.js +0 -18
- package/test/testname.js +0 -1342
- package/test/testv2.js +0 -3
- /package/{Extra/Security/AES_256_GCM/index.js → .cache/nix/binary-cache-v6.sqlite-journal} +0 -0
package/Extra/ExtraScreenShot.js
DELETED
@@ -1,430 +0,0 @@
|
|
1
|
-
/* global document */
|
2
|
-
'use strict';
|
3
|
-
const {promisify} = require('util');
|
4
|
-
const fs = require('fs');
|
5
|
-
const fileUrl = require('file-url');
|
6
|
-
const puppeteer = require('puppeteer');
|
7
|
-
const toughCookie = require('tough-cookie');
|
8
|
-
|
9
|
-
const writeFile = promisify(fs.writeFile);
|
10
|
-
|
11
|
-
const isUrl = string => /^(https?|file):\/\/|^data:/.test(string);
|
12
|
-
|
13
|
-
const scrollToElement = (element, options) => {
|
14
|
-
const isOverflown = element => {
|
15
|
-
return (
|
16
|
-
element.scrollHeight > element.clientHeight ||
|
17
|
-
element.scrollWidth > element.clientWidth
|
18
|
-
);
|
19
|
-
};
|
20
|
-
|
21
|
-
const findScrollParent = element => {
|
22
|
-
if (element === undefined) {
|
23
|
-
return;
|
24
|
-
}
|
25
|
-
|
26
|
-
if (isOverflown(element)) {
|
27
|
-
return element;
|
28
|
-
}
|
29
|
-
|
30
|
-
return findScrollParent(element.parentElement);
|
31
|
-
};
|
32
|
-
|
33
|
-
const calculateOffset = (rect, options) => {
|
34
|
-
if (options === undefined) {
|
35
|
-
return {
|
36
|
-
x: rect.left,
|
37
|
-
y: rect.top
|
38
|
-
};
|
39
|
-
}
|
40
|
-
|
41
|
-
const offset = options.offset || 0;
|
42
|
-
|
43
|
-
switch (options.offsetFrom) {
|
44
|
-
case 'top':
|
45
|
-
return {
|
46
|
-
x: rect.left,
|
47
|
-
y: rect.top + offset
|
48
|
-
};
|
49
|
-
case 'right':
|
50
|
-
return {
|
51
|
-
x: rect.left - offset,
|
52
|
-
y: rect.top
|
53
|
-
};
|
54
|
-
case 'bottom':
|
55
|
-
return {
|
56
|
-
x: rect.left,
|
57
|
-
y: rect.top - offset
|
58
|
-
};
|
59
|
-
case 'left':
|
60
|
-
return {
|
61
|
-
x: rect.left + offset,
|
62
|
-
y: rect.top
|
63
|
-
};
|
64
|
-
default:
|
65
|
-
throw new Error('Invalid `scrollToElement.offsetFrom` value');
|
66
|
-
}
|
67
|
-
};
|
68
|
-
|
69
|
-
const rect = element.getBoundingClientRect();
|
70
|
-
const offset = calculateOffset(rect, options);
|
71
|
-
const parent = findScrollParent(element);
|
72
|
-
|
73
|
-
if (parent !== undefined) {
|
74
|
-
parent.scrollIntoView(true);
|
75
|
-
parent.scrollTo(offset.x, offset.y);
|
76
|
-
}
|
77
|
-
};
|
78
|
-
|
79
|
-
const disableAnimations = () => {
|
80
|
-
const rule = `
|
81
|
-
*,
|
82
|
-
::before,
|
83
|
-
::after {
|
84
|
-
animation: initial !important;
|
85
|
-
transition: initial !important;
|
86
|
-
}
|
87
|
-
`;
|
88
|
-
|
89
|
-
const style = document.createElement('style');
|
90
|
-
document.body.append(style);
|
91
|
-
|
92
|
-
style.sheet.insertRule(rule);
|
93
|
-
};
|
94
|
-
|
95
|
-
const getBoundingClientRect = element => {
|
96
|
-
const {top, left, height, width, x, y} = element.getBoundingClientRect();
|
97
|
-
return {top, left, height, width, x, y};
|
98
|
-
};
|
99
|
-
|
100
|
-
const parseCookie = (url, cookie) => {
|
101
|
-
if (typeof cookie === 'object') {
|
102
|
-
return cookie;
|
103
|
-
}
|
104
|
-
|
105
|
-
const jar = new toughCookie.CookieJar(undefined, {rejectPublicSuffixes: false});
|
106
|
-
jar.setCookieSync(cookie, url);
|
107
|
-
const returnValue = jar.serializeSync().cookies[0];
|
108
|
-
|
109
|
-
// Use this instead of the above when the following issue is fixed:
|
110
|
-
// https://github.com/salesforce/tough-cookie/issues/149
|
111
|
-
// const ret = toughCookie.parse(cookie).serializeSync();
|
112
|
-
|
113
|
-
returnValue.name = returnValue.key;
|
114
|
-
delete returnValue.key;
|
115
|
-
|
116
|
-
if (returnValue.expires) {
|
117
|
-
returnValue.expires = Math.floor(new Date(returnValue.expires) / 1000);
|
118
|
-
}
|
119
|
-
|
120
|
-
return returnValue;
|
121
|
-
};
|
122
|
-
|
123
|
-
const imagesHaveLoaded = () => [...document.images].map(element => element.complete);
|
124
|
-
|
125
|
-
const captureWebsite = async (input, options) => {
|
126
|
-
options = {
|
127
|
-
inputType: 'url',
|
128
|
-
width: 1920,
|
129
|
-
height: 1080,
|
130
|
-
scaleFactor: 2,
|
131
|
-
fullPage: false,
|
132
|
-
defaultBackground: true,
|
133
|
-
timeout: 60, // The Puppeteer default of 30 is too short
|
134
|
-
delay: 0,
|
135
|
-
debug: false,
|
136
|
-
darkMode: true,
|
137
|
-
launchOptions: { devtools:true },
|
138
|
-
_keepAlive: true,
|
139
|
-
isJavaScriptEnabled: true,
|
140
|
-
inset: 0,
|
141
|
-
args: ["--webview-disable-safebrowsing-support",
|
142
|
-
"--disable-web-security"],
|
143
|
-
ignoreHTTPSErrors: true,
|
144
|
-
...options
|
145
|
-
};
|
146
|
-
|
147
|
-
const isHTMLContent = options.inputType === 'html';
|
148
|
-
|
149
|
-
input = isHTMLContent || isUrl(input) ? input : fileUrl(input);
|
150
|
-
|
151
|
-
const timeoutInSeconds = options.timeout * 1000;
|
152
|
-
|
153
|
-
const viewportOptions = {
|
154
|
-
width: options.width,
|
155
|
-
height: options.height,
|
156
|
-
deviceScaleFactor: options.scaleFactor
|
157
|
-
};
|
158
|
-
|
159
|
-
const screenshotOptions = {};
|
160
|
-
|
161
|
-
if (options.type) {
|
162
|
-
screenshotOptions.type = options.type;
|
163
|
-
}
|
164
|
-
|
165
|
-
if (options.quality) {
|
166
|
-
screenshotOptions.quality = options.quality * 100;
|
167
|
-
}
|
168
|
-
|
169
|
-
if (options.fullPage) {
|
170
|
-
screenshotOptions.fullPage = options.fullPage;
|
171
|
-
}
|
172
|
-
|
173
|
-
if (typeof options.defaultBackground === 'boolean') {
|
174
|
-
screenshotOptions.omitBackground = !options.defaultBackground;
|
175
|
-
}
|
176
|
-
|
177
|
-
const launchOptions = {...options.launchOptions};
|
178
|
-
|
179
|
-
if (options.debug) {
|
180
|
-
launchOptions.headless = false;
|
181
|
-
launchOptions.slowMo = 100;
|
182
|
-
}
|
183
|
-
|
184
|
-
const browser = options._browser || await puppeteer.launch(launchOptions);
|
185
|
-
const page = await browser.newPage();
|
186
|
-
|
187
|
-
if (options.preloadFunction) {
|
188
|
-
await page.evaluateOnNewDocument(options.preloadFunction);
|
189
|
-
}
|
190
|
-
|
191
|
-
await page.setJavaScriptEnabled(options.isJavaScriptEnabled);
|
192
|
-
|
193
|
-
if (options.debug) {
|
194
|
-
page.on('console', message => {
|
195
|
-
let {url, lineNumber, columnNumber} = message.location();
|
196
|
-
lineNumber = lineNumber ? `:${lineNumber}` : '';
|
197
|
-
columnNumber = columnNumber ? `:${columnNumber}` : '';
|
198
|
-
const location = url ? ` (${url}${lineNumber}${columnNumber})` : '';
|
199
|
-
console.log(`\nPage log:${location}\n${message.text()}\n`);
|
200
|
-
});
|
201
|
-
|
202
|
-
page.on('pageerror', error => {
|
203
|
-
console.log('\nPage error:', error, '\n');
|
204
|
-
});
|
205
|
-
|
206
|
-
// TODO: Add more events from https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#event-requestfailed
|
207
|
-
}
|
208
|
-
|
209
|
-
if (options.authentication) {
|
210
|
-
await page.authenticate(options.authentication);
|
211
|
-
}
|
212
|
-
|
213
|
-
if (options.cookies) {
|
214
|
-
const cookies = options.cookies.map(cookie => parseCookie(isHTMLContent ? 'about:blank' : input, cookie));
|
215
|
-
await page.setCookie(...cookies);
|
216
|
-
}
|
217
|
-
|
218
|
-
if (options.headers) {
|
219
|
-
await page.setExtraHTTPHeaders(options.headers);
|
220
|
-
}
|
221
|
-
|
222
|
-
if (options.userAgent) {
|
223
|
-
await page.setUserAgent(options.userAgent);
|
224
|
-
}
|
225
|
-
|
226
|
-
await page.setViewport(viewportOptions);
|
227
|
-
|
228
|
-
if (options.emulateDevice) {
|
229
|
-
if (!(options.emulateDevice in puppeteer.devices)) {
|
230
|
-
throw new Error(`The device name \`${options.emulateDevice}\` is not supported`);
|
231
|
-
}
|
232
|
-
|
233
|
-
await page.emulate(puppeteer.devices[options.emulateDevice]);
|
234
|
-
}
|
235
|
-
|
236
|
-
await page.emulateMediaFeatures([{
|
237
|
-
name: 'prefers-color-scheme',
|
238
|
-
value: options.darkMode ? 'dark' : 'light'
|
239
|
-
}]);
|
240
|
-
|
241
|
-
await page[isHTMLContent ? 'setContent' : 'goto'](input, {
|
242
|
-
timeout: timeoutInSeconds,
|
243
|
-
waitUntil: 'networkidle2'
|
244
|
-
});
|
245
|
-
if (options.disableAnimations) {
|
246
|
-
await page.evaluate(disableAnimations, options.disableAnimations);
|
247
|
-
}
|
248
|
-
|
249
|
-
if (options.hideElements) {
|
250
|
-
await page.addStyleTag({
|
251
|
-
content: `${options.hideElements.join(', ')} { visibility: hidden !important; }`
|
252
|
-
});
|
253
|
-
}
|
254
|
-
|
255
|
-
if (options.removeElements) {
|
256
|
-
await page.addStyleTag({
|
257
|
-
content: `${options.removeElements.join(', ')} { display: none !important; }`
|
258
|
-
});
|
259
|
-
}
|
260
|
-
|
261
|
-
if (options.clickElement) {
|
262
|
-
await page.click(options.clickElement);
|
263
|
-
}
|
264
|
-
|
265
|
-
const getInjectKey = (ext, value) => isUrl(value) ? 'url' : (value.endsWith(`.${ext}`) ? 'path' : 'content');
|
266
|
-
|
267
|
-
if (!options.isJavaScriptEnabled) {
|
268
|
-
// Enable JavaScript again for `modules` and `scripts`.
|
269
|
-
await page.setJavaScriptEnabled(true);
|
270
|
-
}
|
271
|
-
|
272
|
-
if (options.modules) {
|
273
|
-
await Promise.all(options.modules.map(module_ => {
|
274
|
-
return page.addScriptTag({
|
275
|
-
[getInjectKey('js', module_)]: module_,
|
276
|
-
type: 'module'
|
277
|
-
});
|
278
|
-
}));
|
279
|
-
}
|
280
|
-
|
281
|
-
if (options.scripts) {
|
282
|
-
await Promise.all(options.scripts.map(script => {
|
283
|
-
return page.addScriptTag({
|
284
|
-
[getInjectKey('js', script)]: script
|
285
|
-
});
|
286
|
-
}));
|
287
|
-
}
|
288
|
-
|
289
|
-
if (options.styles) {
|
290
|
-
await Promise.all(options.styles.map(style => {
|
291
|
-
return page.addStyleTag({
|
292
|
-
[getInjectKey('css', style)]: style
|
293
|
-
});
|
294
|
-
}));
|
295
|
-
}
|
296
|
-
|
297
|
-
if (options.waitForElement) {
|
298
|
-
await page.waitForSelector(options.waitForElement, {
|
299
|
-
visible: true,
|
300
|
-
timeout: timeoutInSeconds
|
301
|
-
});
|
302
|
-
}
|
303
|
-
|
304
|
-
if (options.beforeScreenshot) {
|
305
|
-
await options.beforeScreenshot(page, browser);
|
306
|
-
}
|
307
|
-
|
308
|
-
if (options.element) {
|
309
|
-
await page.waitForSelector(options.element, {
|
310
|
-
visible: true,
|
311
|
-
timeout: timeoutInSeconds
|
312
|
-
});
|
313
|
-
screenshotOptions.clip = await page.$eval(options.element, getBoundingClientRect);
|
314
|
-
screenshotOptions.fullPage = false;
|
315
|
-
}
|
316
|
-
|
317
|
-
if (options.delay) {
|
318
|
-
await page.waitForTimeout(options.delay * 1000);
|
319
|
-
}
|
320
|
-
|
321
|
-
if (options.scrollToElement) {
|
322
|
-
// eslint-disable-next-line unicorn/prefer-ternary
|
323
|
-
if (typeof options.scrollToElement === 'object') {
|
324
|
-
await page.$eval(options.scrollToElement.element, scrollToElement, options.scrollToElement);
|
325
|
-
} else {
|
326
|
-
await page.$eval(options.scrollToElement, scrollToElement);
|
327
|
-
}
|
328
|
-
}
|
329
|
-
|
330
|
-
if (screenshotOptions.fullPage) {
|
331
|
-
// Get the height of the rendered page
|
332
|
-
const bodyHandle = await page.$('body');
|
333
|
-
const bodyBoundingHeight = await bodyHandle.boundingBox();
|
334
|
-
await bodyHandle.dispose();
|
335
|
-
|
336
|
-
// Scroll one viewport at a time, pausing to let content load
|
337
|
-
const viewportHeight = viewportOptions.height;
|
338
|
-
let viewportIncrement = 0;
|
339
|
-
while (viewportIncrement + viewportHeight < bodyBoundingHeight) {
|
340
|
-
const navigationPromise = page.waitForNavigation({waitUntil: 'networkidle0'});
|
341
|
-
/* eslint-disable no-await-in-loop */
|
342
|
-
await page.evaluate(_viewportHeight => {
|
343
|
-
/* eslint-disable no-undef */
|
344
|
-
window.scrollBy(0, _viewportHeight);
|
345
|
-
/* eslint-enable no-undef */
|
346
|
-
}, viewportHeight);
|
347
|
-
await navigationPromise;
|
348
|
-
/* eslint-enable no-await-in-loop */
|
349
|
-
viewportIncrement += viewportHeight;
|
350
|
-
}
|
351
|
-
|
352
|
-
// Scroll back to top
|
353
|
-
await page.evaluate(_ => {
|
354
|
-
/* eslint-disable no-undef */
|
355
|
-
window.scrollTo(0, 0);
|
356
|
-
/* eslint-enable no-undef */
|
357
|
-
});
|
358
|
-
|
359
|
-
// Some extra delay to let images load
|
360
|
-
await page.waitForFunction(imagesHaveLoaded, {timeout: timeoutInSeconds});
|
361
|
-
}
|
362
|
-
|
363
|
-
if (options.inset && !screenshotOptions.fullPage) {
|
364
|
-
const inset = {top: 0, right: 0, bottom: 0, left: 0};
|
365
|
-
for (const key of Object.keys(inset)) {
|
366
|
-
if (typeof options.inset === 'number') {
|
367
|
-
inset[key] = options.inset;
|
368
|
-
} else {
|
369
|
-
inset[key] = options.inset[key] || 0;
|
370
|
-
}
|
371
|
-
}
|
372
|
-
|
373
|
-
let clipOptions = screenshotOptions.clip;
|
374
|
-
|
375
|
-
if (!clipOptions) {
|
376
|
-
clipOptions = await page.evaluate(() => ({
|
377
|
-
x: 0,
|
378
|
-
y: 0,
|
379
|
-
/* eslint-disable no-undef */
|
380
|
-
height: window.innerHeight,
|
381
|
-
width: window.innerWidth
|
382
|
-
/* eslint-enable no-undef */
|
383
|
-
}));
|
384
|
-
}
|
385
|
-
|
386
|
-
const x = clipOptions.x + inset.left;
|
387
|
-
const y = clipOptions.y + inset.top;
|
388
|
-
const width = clipOptions.width - (inset.left + inset.right);
|
389
|
-
const height = clipOptions.height - (inset.top + inset.bottom);
|
390
|
-
|
391
|
-
if (width === 0 || height === 0) {
|
392
|
-
await page.close();
|
393
|
-
|
394
|
-
throw new Error('When using the `clip` option, the width or height of the screenshot cannot be equal to 0.');
|
395
|
-
}
|
396
|
-
|
397
|
-
screenshotOptions.clip = {x, y, width, height};
|
398
|
-
}
|
399
|
-
|
400
|
-
const buffer = await page.screenshot(screenshotOptions);
|
401
|
-
|
402
|
-
await page.close();
|
403
|
-
|
404
|
-
if (!options._keepAlive) {
|
405
|
-
await browser.close();
|
406
|
-
}
|
407
|
-
|
408
|
-
return buffer;
|
409
|
-
};
|
410
|
-
|
411
|
-
module.exports.file = async (url, filePath, options = {}) => {
|
412
|
-
const screenshot = await captureWebsite(url, options);
|
413
|
-
|
414
|
-
await writeFile(filePath, screenshot, {
|
415
|
-
flag: options.overwrite ? 'w' : 'wx'
|
416
|
-
});
|
417
|
-
};
|
418
|
-
|
419
|
-
module.exports.buffer = async (url, options) => captureWebsite(url, options);
|
420
|
-
|
421
|
-
module.exports.base64 = async (url, options) => {
|
422
|
-
const screenshot = await captureWebsite(url, options);
|
423
|
-
return screenshot.toString('base64');
|
424
|
-
};
|
425
|
-
|
426
|
-
module.exports.devices = Object.values(puppeteer.devices).map(device => device.name);
|
427
|
-
|
428
|
-
if (process.env.NODE_ENV === 'test') {
|
429
|
-
module.exports._startBrowser = puppeteer.launch.bind(puppeteer);
|
430
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const logger = require("../logger");
|
4
|
-
module.exports = function() {
|
5
|
-
var Logger = global.Fca.Require.logger;
|
6
|
-
switch (process.platform) {
|
7
|
-
case 'win32': {
|
8
|
-
if (global.Fca.Require.FastConfig.Uptime) {
|
9
|
-
logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
|
10
|
-
}
|
11
|
-
break;
|
12
|
-
}
|
13
|
-
case 'darwin': {
|
14
|
-
if (global.Fca.Require.FastConfig.Uptime) {
|
15
|
-
logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
|
16
|
-
}
|
17
|
-
break;
|
18
|
-
}
|
19
|
-
case 'linux':
|
20
|
-
if (process.env.REPL_SLUG) {
|
21
|
-
var Value = global.Fca.Require.FastConfig;
|
22
|
-
var Fetch = global.Fca.Require.Fetch;
|
23
|
-
if (Value.Uptime) {
|
24
|
-
logger.Normal(global.Fca.Require.Language.ExtraUpTime.Uptime);//
|
25
|
-
return setInterval(function() {
|
26
|
-
Fetch.get(`https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co`);
|
27
|
-
},10*1000);
|
28
|
-
}
|
29
|
-
else return;
|
30
|
-
}
|
31
|
-
else {
|
32
|
-
Logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
|
33
|
-
}
|
34
|
-
break;
|
35
|
-
default:
|
36
|
-
Logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
|
37
|
-
}
|
38
|
-
};
|
@@ -1,119 +0,0 @@
|
|
1
|
-
var c = document.getElementById("myCanvas");
|
2
|
-
var ctx = c.getContext("2d");
|
3
|
-
var mask;
|
4
|
-
|
5
|
-
var pointCount = 500;
|
6
|
-
var str = "Horizon";
|
7
|
-
var fontStr = "bold 100pt Helvetica Neue, Helvetica, Arial, sans-serif";
|
8
|
-
|
9
|
-
ctx.font = fontStr;
|
10
|
-
ctx.textAlign = "auto";
|
11
|
-
c.width = (ctx.measureText(str).width);
|
12
|
-
c.height = 100; // Set to font size
|
13
|
-
|
14
|
-
var whitePixels = [];
|
15
|
-
var points = [];
|
16
|
-
var point = function(x,y,vx,vy){
|
17
|
-
this.x = x;
|
18
|
-
this.y = y;
|
19
|
-
this.vx = vx || 1;
|
20
|
-
this.vy = vy || 1;
|
21
|
-
};
|
22
|
-
point.prototype.update = function() {
|
23
|
-
ctx.beginPath();
|
24
|
-
ctx.fillStyle = "#95a5a6";
|
25
|
-
ctx.arc(this.x,this.y,1,0,2*Math.PI);
|
26
|
-
ctx.fill();
|
27
|
-
ctx.closePath();
|
28
|
-
|
29
|
-
// Change direction if running into black pixel
|
30
|
-
if (this.x+this.vx >= c.width || this.x+this.vx < 0 || mask.data[coordsToI(this.x+this.vx, this.y, mask.width)] != 255) {
|
31
|
-
this.vx *= -1;
|
32
|
-
this.x += this.vx*2;
|
33
|
-
}
|
34
|
-
if (this.y+this.vy >= c.height || this.y+this.vy < 0 || mask.data[coordsToI(this.x, this.y+this.vy, mask.width)] != 255) {
|
35
|
-
this.vy *= -1;
|
36
|
-
this.y += this.vy*2;
|
37
|
-
}
|
38
|
-
|
39
|
-
for (var k = 0, m = points.length; k<m; k++) {
|
40
|
-
if (points[k]===this) continue;
|
41
|
-
|
42
|
-
var d = Math.sqrt(Math.pow(this.x-points[k].x,2)+Math.pow(this.y-points[k].y,2));
|
43
|
-
if (d < 5) {
|
44
|
-
ctx.lineWidth = .2;
|
45
|
-
ctx.beginPath();
|
46
|
-
ctx.moveTo(this.x,this.y);
|
47
|
-
ctx.lineTo(points[k].x,points[k].y);
|
48
|
-
ctx.stroke();
|
49
|
-
}
|
50
|
-
if (d < 20) {
|
51
|
-
ctx.lineWidth = .1;
|
52
|
-
ctx.beginPath();
|
53
|
-
ctx.moveTo(this.x,this.y);
|
54
|
-
ctx.lineTo(points[k].x,points[k].y);
|
55
|
-
ctx.stroke();
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
|
-
this.x += this.vx;
|
60
|
-
this.y += this.vy;
|
61
|
-
};
|
62
|
-
|
63
|
-
function loop() {
|
64
|
-
ctx.clearRect(0,0,c.width,c.height);
|
65
|
-
for (var k = 0, m = points.length; k < m; k++) {
|
66
|
-
points[k].update();
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
function init() {
|
71
|
-
// Draw text
|
72
|
-
ctx.beginPath();
|
73
|
-
ctx.fillStyle = "#000";
|
74
|
-
ctx.rect(0,0,c.width,c.height);
|
75
|
-
ctx.fill();
|
76
|
-
ctx.font = fontStr;
|
77
|
-
ctx.textAlign = "left";
|
78
|
-
ctx.fillStyle = "#fff";
|
79
|
-
ctx.fillText(str,0,c.height/2+(c.height / 2));
|
80
|
-
ctx.closePath();
|
81
|
-
|
82
|
-
// Save mask
|
83
|
-
mask = ctx.getImageData(0,0,c.width,c.height);
|
84
|
-
|
85
|
-
// Draw background
|
86
|
-
ctx.clearRect(0,0,c.width,c.height);
|
87
|
-
|
88
|
-
// Save all white pixels in an array
|
89
|
-
for (var i = 0; i < mask.data.length; i += 4) {
|
90
|
-
if (mask.data[i] == 255 && mask.data[i+1] == 255 && mask.data[i+2] == 255 && mask.data[i+3] == 255) {
|
91
|
-
whitePixels.push([iToX(i,mask.width),iToY(i,mask.width)]);
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
for (var k = 0; k < pointCount; k++) {
|
96
|
-
addPoint();
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
function addPoint() {
|
101
|
-
var spawn = whitePixels[Math.floor(Math.random()*whitePixels.length)];
|
102
|
-
|
103
|
-
var p = new point(spawn[0],spawn[1], Math.floor(Math.random()*2-1), Math.floor(Math.random()*2-1));
|
104
|
-
points.push(p);
|
105
|
-
}
|
106
|
-
|
107
|
-
function iToX(i,w) {
|
108
|
-
return ((i%(4*w))/4);
|
109
|
-
}
|
110
|
-
function iToY(i,w) {
|
111
|
-
return (Math.floor(i/(4*w)));
|
112
|
-
}
|
113
|
-
function coordsToI(x,y,w) {
|
114
|
-
return ((mask.width*y)+x)*4;
|
115
|
-
|
116
|
-
}
|
117
|
-
|
118
|
-
setInterval(loop,50);
|
119
|
-
init();
|
@@ -1,6 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var CryptoJS = require("crypto-js");
|
4
|
-
module.exports.EncryptState = function EncryptState(Data,PassWord) { return CryptoJS.AES.encrypt(Data, PassWord).toString(); };
|
5
|
-
|
6
|
-
module.exports.DecryptState = function DecryptState(Data,PassWord) { return CryptoJS.AES.decrypt(Data, PassWord).toString(CryptoJS.enc.Utf8); };
|
@@ -1,22 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var CryptoJS = require("crypto-js");
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Encrypt the text using the CryptoJS library and return the encrypted text as a Base64 string.
|
7
|
-
* @param Data - The data to be encrypted.
|
8
|
-
* @returns A string of characters that represent the encrypted data.
|
9
|
-
*/
|
10
|
-
module.exports.Encrypt = function Encrypt(Data) {
|
11
|
-
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(Data));
|
12
|
-
};
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Decrypt the data using the CryptoJS library, and return the decrypted data as a string.
|
16
|
-
* @param Data - The data to be decrypted.
|
17
|
-
* @returns The decrypted data.
|
18
|
-
*/
|
19
|
-
|
20
|
-
module.exports.Decrypt = function Decrypt(Data) {
|
21
|
-
return CryptoJS.enc.Base64.parse(Data).toString(CryptoJS.enc.Utf8);
|
22
|
-
};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const crypto = require('crypto');
|
4
|
-
const aes = require("aes-js");
|
5
|
-
|
6
|
-
module.exports.encryptState = function encryptState(data, key) {
|
7
|
-
let hashEngine = crypto.createHash("sha256");
|
8
|
-
let hashKey = hashEngine.update(key).digest();
|
9
|
-
let bytes = aes.utils.utf8.toBytes(data);
|
10
|
-
let aesCtr = new aes.ModeOfOperation.ctr(hashKey);
|
11
|
-
let encryptedData = aesCtr.encrypt(bytes);
|
12
|
-
return aes.utils.hex.fromBytes(encryptedData);
|
13
|
-
};
|
14
|
-
|
15
|
-
module.exports.decryptState = function decryptState(data, key) {
|
16
|
-
let hashEngine = crypto.createHash("sha256");
|
17
|
-
let hashKey = hashEngine.update(key).digest();
|
18
|
-
let encryptedBytes = aes.utils.hex.toBytes(data);
|
19
|
-
let aesCtr = new aes.ModeOfOperation.ctr(hashKey);
|
20
|
-
let decryptedData = aesCtr.decrypt(encryptedBytes);
|
21
|
-
return aes.utils.utf8.fromBytes(decryptedData);
|
22
|
-
};
|