fca-shadow 0.0.1-security → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fca-shadow might be problematic. Click here for more details.
- package/.1obgge4cxlazf1346921747~ +0 -0
- package/CHANGELOG.md +2 -0
- package/DOCS.md +1738 -0
- package/GetThreads/GetThreadInfo.js +128 -0
- package/GetThreads/Last-Run.js +65 -0
- package/LICENSE-MIT +21 -0
- package/README.md +132 -3
- package/StateCrypt.js +96 -0
- package/broadcast.js +22 -0
- package/index.html +1200 -0
- package/index.js +684 -0
- package/languages/index.json +150 -0
- package/lib/getInfoNew.js +34 -0
- package/lib/getToken.js +44 -0
- package/logger.js +23 -0
- package/package/database/SyntheticDatabase.sqlite +0 -0
- package/package/database/index.js +358 -0
- package/package/database/node_modules/lodash/_baseGet/README.md +20 -0
- package/package/database/node_modules/lodash/_baseGet/index.js +74 -0
- package/package/database/node_modules/lodash/_baseGet/package.json +18 -0
- package/package/database/node_modules/lodash/add.js +22 -0
- package/package/database/node_modules/lodash/after.js +42 -0
- package/package/database/node_modules/lodash/array.js +67 -0
- package/package/database/node_modules/lodash/ary.js +29 -0
- package/package/database/node_modules/lodash/assign.js +58 -0
- package/package/database/node_modules/lodash/assignIn.js +40 -0
- package/package/database/node_modules/lodash/assignInWith.js +38 -0
- package/package/database/node_modules/lodash/assignWith.js +37 -0
- package/package/database/node_modules/lodash/at.js +23 -0
- package/package/database/node_modules/lodash/attempt.js +35 -0
- package/package/database/node_modules/lodash/before.js +40 -0
- package/package/database/node_modules/lodash/bind.js +57 -0
- package/package/database/node_modules/lodash/bindAll.js +41 -0
- package/package/database/node_modules/lodash/bindKey.js +68 -0
- package/package/database/node_modules/lodash/camelCase.js +29 -0
- package/package/database/node_modules/lodash/capitalize.js +23 -0
- package/package/database/node_modules/lodash/castArray.js +44 -0
- package/package/database/node_modules/lodash/ceil.js +26 -0
- package/package/database/node_modules/lodash/chain.js +38 -0
- package/package/database/node_modules/lodash/chunk.js +50 -0
- package/package/database/node_modules/lodash/clamp.js +39 -0
- package/package/database/node_modules/lodash/clone.js +36 -0
- package/package/database/node_modules/lodash/cloneDeep.js +29 -0
- package/package/database/node_modules/lodash/cloneDeepWith.js +40 -0
- package/package/database/node_modules/lodash/cloneWith.js +42 -0
- package/package/database/node_modules/lodash/collection.js +30 -0
- package/package/database/node_modules/lodash/commit.js +33 -0
- package/package/database/node_modules/lodash/compact.js +31 -0
- package/package/database/node_modules/lodash/concat.js +43 -0
- package/package/database/node_modules/lodash/cond.js +60 -0
- package/package/database/node_modules/lodash/conforms.js +35 -0
- package/package/database/node_modules/lodash/conformsTo.js +32 -0
- package/package/database/node_modules/lodash/constant.js +26 -0
- package/package/database/node_modules/lodash/core.js +3877 -0
- package/package/database/node_modules/lodash/core.min.js +29 -0
- package/package/database/node_modules/lodash/countBy.js +40 -0
- package/package/database/node_modules/lodash/create.js +43 -0
- package/package/database/node_modules/lodash/curry.js +57 -0
- package/package/database/node_modules/lodash/curryRight.js +54 -0
- package/package/database/node_modules/lodash/date.js +3 -0
- package/package/database/node_modules/lodash/debounce.js +191 -0
- package/package/database/node_modules/lodash/deburr.js +45 -0
- package/package/database/node_modules/lodash/defaultTo.js +25 -0
- package/package/database/node_modules/lodash/defaults.js +64 -0
- package/package/database/node_modules/lodash/defaultsDeep.js +30 -0
- package/package/database/node_modules/lodash/defer.js +26 -0
- package/package/database/node_modules/lodash/delay.js +28 -0
- package/package/database/node_modules/lodash/difference.js +33 -0
- package/package/database/node_modules/lodash/differenceBy.js +44 -0
- package/package/database/node_modules/lodash/differenceWith.js +40 -0
- package/package/database/node_modules/lodash/divide.js +22 -0
- package/package/database/node_modules/lodash/drop.js +38 -0
- package/package/database/node_modules/lodash/dropRight.js +39 -0
- package/package/database/node_modules/lodash/dropRightWhile.js +45 -0
- package/package/database/node_modules/lodash/dropWhile.js +45 -0
- package/package/database/node_modules/lodash/each.js +1 -0
- package/package/database/node_modules/lodash/eachRight.js +1 -0
- package/package/database/node_modules/lodash/endsWith.js +43 -0
- package/package/database/node_modules/lodash/entries.js +1 -0
- package/package/database/node_modules/lodash/entriesIn.js +1 -0
- package/package/database/node_modules/lodash/eq.js +37 -0
- package/package/database/node_modules/lodash/escape.js +43 -0
- package/package/database/node_modules/lodash/escapeRegExp.js +32 -0
- package/package/database/node_modules/lodash/every.js +56 -0
- package/package/database/node_modules/lodash/extend.js +1 -0
- package/package/database/node_modules/lodash/extendWith.js +1 -0
- package/package/database/node_modules/lodash/fill.js +45 -0
- package/package/database/node_modules/lodash/filter.js +52 -0
- package/package/database/node_modules/lodash/find.js +42 -0
- package/package/database/node_modules/lodash/findIndex.js +55 -0
- package/package/database/node_modules/lodash/findKey.js +44 -0
- package/package/database/node_modules/lodash/findLast.js +25 -0
- package/package/database/node_modules/lodash/findLastIndex.js +59 -0
- package/package/database/node_modules/lodash/findLastKey.js +44 -0
- package/package/database/node_modules/lodash/first.js +1 -0
- package/package/database/node_modules/lodash/flake.lock +40 -0
- package/package/database/node_modules/lodash/flake.nix +20 -0
- package/package/database/node_modules/lodash/flatMap.js +29 -0
- package/package/database/node_modules/lodash/flatMapDeep.js +31 -0
- package/package/database/node_modules/lodash/flatMapDepth.js +31 -0
- package/package/database/node_modules/lodash/flatten.js +22 -0
- package/package/database/node_modules/lodash/flattenDeep.js +25 -0
- package/package/database/node_modules/lodash/flattenDepth.js +33 -0
- package/package/database/node_modules/lodash/flip.js +28 -0
- package/package/database/node_modules/lodash/floor.js +26 -0
- package/package/database/node_modules/lodash/flow.js +27 -0
- package/package/database/node_modules/lodash/flowRight.js +26 -0
- package/package/database/node_modules/lodash/forEach.js +41 -0
- package/package/database/node_modules/lodash/forEachRight.js +31 -0
- package/package/database/node_modules/lodash/forIn.js +39 -0
- package/package/database/node_modules/lodash/forInRight.js +37 -0
- package/package/database/node_modules/lodash/forOwn.js +36 -0
- package/package/database/node_modules/lodash/forOwnRight.js +34 -0
- package/package/database/node_modules/lodash/fp/F.js +1 -0
- package/package/database/node_modules/lodash/fp/add.js +5 -0
- package/package/database/node_modules/lodash/fp/after.js +5 -0
- package/package/database/node_modules/lodash/fp/all.js +1 -0
- package/package/database/node_modules/lodash/fp/allPass.js +1 -0
- package/package/database/node_modules/lodash/fp/always.js +1 -0
- package/package/database/node_modules/lodash/fp/any.js +1 -0
- package/package/database/node_modules/lodash/fp/anyPass.js +1 -0
- package/package/database/node_modules/lodash/fp/apply.js +1 -0
- package/package/database/node_modules/lodash/fp/array.js +2 -0
- package/package/database/node_modules/lodash/fp/ary.js +5 -0
- package/package/database/node_modules/lodash/fp/assign.js +5 -0
- package/package/database/node_modules/lodash/fp/assignAll.js +5 -0
- package/package/database/node_modules/lodash/fp/assignAllWith.js +5 -0
- package/package/database/node_modules/lodash/fp/assignIn.js +5 -0
- package/package/database/node_modules/lodash/fp/assignInAll.js +5 -0
- package/package/database/node_modules/lodash/fp/assignInAllWith.js +5 -0
- package/package/database/node_modules/lodash/fp/assignInWith.js +5 -0
- package/package/database/node_modules/lodash/fp/assignWith.js +5 -0
- package/package/database/node_modules/lodash/fp/assoc.js +1 -0
- package/package/database/node_modules/lodash/fp/assocPath.js +1 -0
- package/package/database/node_modules/lodash/fp/at.js +5 -0
- package/package/database/node_modules/lodash/fp/attempt.js +5 -0
- package/package/database/node_modules/lodash/fp/before.js +5 -0
- package/package/database/node_modules/lodash/fp/bind.js +5 -0
- package/package/database/node_modules/lodash/fp/bindAll.js +5 -0
- package/package/database/node_modules/lodash/fp/bindKey.js +5 -0
- package/package/database/node_modules/lodash/fp/camelCase.js +5 -0
- package/package/database/node_modules/lodash/fp/capitalize.js +5 -0
- package/package/database/node_modules/lodash/fp/castArray.js +5 -0
- package/package/database/node_modules/lodash/fp/ceil.js +5 -0
- package/package/database/node_modules/lodash/fp/chain.js +5 -0
- package/package/database/node_modules/lodash/fp/chunk.js +5 -0
- package/package/database/node_modules/lodash/fp/clamp.js +5 -0
- package/package/database/node_modules/lodash/fp/clone.js +5 -0
- package/package/database/node_modules/lodash/fp/cloneDeep.js +5 -0
- package/package/database/node_modules/lodash/fp/cloneDeepWith.js +5 -0
- package/package/database/node_modules/lodash/fp/cloneWith.js +5 -0
- package/package/database/node_modules/lodash/fp/collection.js +2 -0
- package/package/database/node_modules/lodash/fp/commit.js +5 -0
- package/package/database/node_modules/lodash/fp/compact.js +5 -0
- package/package/database/node_modules/lodash/fp/complement.js +1 -0
- package/package/database/node_modules/lodash/fp/compose.js +1 -0
- package/package/database/node_modules/lodash/fp/concat.js +5 -0
- package/package/database/node_modules/lodash/fp/cond.js +5 -0
- package/package/database/node_modules/lodash/fp/conforms.js +1 -0
- package/package/database/node_modules/lodash/fp/conformsTo.js +5 -0
- package/package/database/node_modules/lodash/fp/constant.js +5 -0
- package/package/database/node_modules/lodash/fp/contains.js +1 -0
- package/package/database/node_modules/lodash/fp/convert.js +18 -0
- package/package/database/node_modules/lodash/fp/countBy.js +5 -0
- package/package/database/node_modules/lodash/fp/create.js +5 -0
- package/package/database/node_modules/lodash/fp/curry.js +5 -0
- package/package/database/node_modules/lodash/fp/curryN.js +5 -0
- package/package/database/node_modules/lodash/fp/curryRight.js +5 -0
- package/package/database/node_modules/lodash/fp/curryRightN.js +5 -0
- package/package/database/node_modules/lodash/fp/date.js +2 -0
- package/package/database/node_modules/lodash/fp/debounce.js +5 -0
- package/package/database/node_modules/lodash/fp/deburr.js +5 -0
- package/package/database/node_modules/lodash/fp/defaultTo.js +5 -0
- package/package/database/node_modules/lodash/fp/defaults.js +5 -0
- package/package/database/node_modules/lodash/fp/defaultsAll.js +5 -0
- package/package/database/node_modules/lodash/fp/defaultsDeep.js +5 -0
- package/package/database/node_modules/lodash/fp/defaultsDeepAll.js +5 -0
- package/package/database/node_modules/lodash/fp/defer.js +5 -0
- package/package/database/node_modules/lodash/fp/delay.js +5 -0
- package/package/database/node_modules/lodash/fp/difference.js +5 -0
- package/package/database/node_modules/lodash/fp/differenceBy.js +5 -0
- package/package/database/node_modules/lodash/fp/differenceWith.js +5 -0
- package/package/database/node_modules/lodash/fp/dissoc.js +1 -0
- package/package/database/node_modules/lodash/fp/dissocPath.js +1 -0
- package/package/database/node_modules/lodash/fp/divide.js +5 -0
- package/package/database/node_modules/lodash/fp/drop.js +5 -0
- package/package/database/node_modules/lodash/fp/dropLast.js +1 -0
- package/package/database/node_modules/lodash/fp/dropLastWhile.js +1 -0
- package/package/database/node_modules/lodash/fp/dropRight.js +5 -0
- package/package/database/node_modules/lodash/fp/dropRightWhile.js +5 -0
- package/package/database/node_modules/lodash/fp/dropWhile.js +5 -0
- package/package/database/node_modules/lodash/fp/each.js +1 -0
- package/package/database/node_modules/lodash/fp/eachRight.js +1 -0
- package/package/database/node_modules/lodash/fp/endsWith.js +5 -0
- package/package/database/node_modules/lodash/fp/entries.js +1 -0
- package/package/database/node_modules/lodash/fp/entriesIn.js +1 -0
- package/package/database/node_modules/lodash/fp/eq.js +5 -0
- package/package/database/node_modules/lodash/fp/equals.js +1 -0
- package/package/database/node_modules/lodash/fp/escape.js +5 -0
- package/package/database/node_modules/lodash/fp/escapeRegExp.js +5 -0
- package/package/database/node_modules/lodash/fp/every.js +5 -0
- package/package/database/node_modules/lodash/fp/extend.js +1 -0
- package/package/database/node_modules/lodash/fp/extendAll.js +1 -0
- package/package/database/node_modules/lodash/fp/extendAllWith.js +1 -0
- package/package/database/node_modules/lodash/fp/extendWith.js +1 -0
- package/package/database/node_modules/lodash/fp/fill.js +5 -0
- package/package/database/node_modules/lodash/fp/filter.js +5 -0
- package/package/database/node_modules/lodash/fp/find.js +5 -0
- package/package/database/node_modules/lodash/fp/findFrom.js +5 -0
- package/package/database/node_modules/lodash/fp/findIndex.js +5 -0
- package/package/database/node_modules/lodash/fp/findIndexFrom.js +5 -0
- package/package/database/node_modules/lodash/fp/findKey.js +5 -0
- package/package/database/node_modules/lodash/fp/findLast.js +5 -0
- package/package/database/node_modules/lodash/fp.js +2 -0
- package/package/database/node_modules/lodash/fromPairs.js +28 -0
- package/package/database/node_modules/lodash/function.js +25 -0
- package/package/database/node_modules/lodash/functions.js +31 -0
- package/package/database/node_modules/lodash/functionsIn.js +31 -0
- package/package/database/node_modules/lodash/get.js +33 -0
- package/package/database/node_modules/node-fetch/CHANGELOG.md +266 -0
- package/package/database/node_modules/node-fetch/LICENSE.md +22 -0
- package/package/database/node_modules/node-fetch/README.md +583 -0
- package/package/database/node_modules/node-fetch/browser.js +23 -0
- package/package/database/node_modules/node-fetch/lib/index.es.js +1633 -0
- package/package/database/node_modules/node-fetch/lib/index.js +1642 -0
- package/package/database/node_modules/node-fetch/lib/index.mjs +1631 -0
- package/package/database/node_modules/node-fetch/package.json +70 -0
- package/package/database/node_modules/sqlite3/CHANGELOG.md +313 -0
- package/package/database/node_modules/sqlite3/CONTRIBUTING.md +57 -0
- package/package/database/node_modules/sqlite3/LICENSE +25 -0
- package/package/database/node_modules/sqlite3/README.md +259 -0
- package/package/database/node_modules/sqlite3/binding.gyp +66 -0
- package/package/database/node_modules/sqlite3/deps/common-sqlite.gypi +60 -0
- package/package/database/node_modules/sqlite3/deps/extract.js +10 -0
- package/package/database/node_modules/sqlite3/deps/sqlite-autoconf-3380200.tar.gz +0 -0
- package/package/database/node_modules/sqlite3/deps/sqlite3.gyp +121 -0
- package/package/database/node_modules/sqlite3/lib/binding/napi-v6-linux-x64/node_sqlite3.node +0 -0
- package/package/database/node_modules/sqlite3/lib/index.js +1 -0
- package/package/database/node_modules/sqlite3/lib/sqlite3-binding.js +5 -0
- package/package/database/node_modules/sqlite3/lib/sqlite3.js +205 -0
- package/package/database/node_modules/sqlite3/lib/trace.js +38 -0
- package/package/database/node_modules/sqlite3/package.json +82 -0
- package/package/database/node_modules/sqlite3/sqlite3.js +1 -0
- package/package/database/node_modules/sqlite3/src/async.h +82 -0
- package/package/database/node_modules/sqlite3/src/backup.cc +420 -0
- package/package/database/node_modules/sqlite3/src/backup.h +221 -0
- package/package/database/node_modules/sqlite3/src/database.cc +738 -0
- package/package/database/node_modules/sqlite3/src/database.h +206 -0
- package/package/database/node_modules/sqlite3/src/gcc-preinclude.h +6 -0
- package/package/database/node_modules/sqlite3/src/macros.h +212 -0
- package/package/database/node_modules/sqlite3/src/node_sqlite3.cc +115 -0
- package/package/database/node_modules/sqlite3/src/statement.cc +947 -0
- package/package/database/node_modules/sqlite3/src/statement.h +249 -0
- package/package/database/node_modules/sqlite3/src/threading.h +48 -0
- package/package/database/package.json +31 -0
- package/package/database/readme.md +8 -0
- package/package/database/test.js +3 -0
- package/package/horizon-sp/README.md +11 -0
- package/package/horizon-sp/index.js +41 -0
- package/package/horizon-sp/logger.js +16 -0
- package/package/horizon-sp/node_modules/.package-lock.json +140 -0
- package/package/horizon-sp/node_modules/asynckit/LICENSE +21 -0
- package/package/horizon-sp/node_modules/asynckit/README.md +233 -0
- package/package/horizon-sp/node_modules/asynckit/bench.js +76 -0
- package/package/horizon-sp/node_modules/asynckit/index.js +6 -0
- package/package/horizon-sp/node_modules/asynckit/lib/abort.js +29 -0
- package/package/horizon-sp/node_modules/asynckit/lib/async.js +34 -0
- package/package/horizon-sp/node_modules/asynckit/lib/defer.js +26 -0
- package/package/horizon-sp/node_modules/asynckit/lib/iterate.js +75 -0
- package/package/horizon-sp/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/package/horizon-sp/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/package/horizon-sp/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/package/horizon-sp/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/package/horizon-sp/node_modules/asynckit/lib/state.js +37 -0
- package/package/horizon-sp/node_modules/asynckit/lib/streamify.js +141 -0
- package/package/horizon-sp/node_modules/asynckit/lib/terminator.js +29 -0
- package/package/horizon-sp/node_modules/asynckit/package.json +63 -0
- package/package/horizon-sp/node_modules/asynckit/parallel.js +43 -0
- package/package/horizon-sp/node_modules/asynckit/serial.js +17 -0
- package/package/horizon-sp/node_modules/asynckit/serialOrdered.js +75 -0
- package/package/horizon-sp/node_modules/asynckit/stream.js +21 -0
- package/package/horizon-sp/node_modules/axios/CHANGELOG.md +410 -0
- package/package/horizon-sp/node_modules/axios/LICENSE +7 -0
- package/package/horizon-sp/node_modules/axios/MIGRATION_GUIDE.md +3 -0
- package/package/horizon-sp/node_modules/axios/README.md +1310 -0
- package/package/horizon-sp/node_modules/axios/SECURITY.md +6 -0
- package/package/horizon-sp/node_modules/axios/index.d.cts +524 -0
- package/package/horizon-sp/node_modules/axios/index.d.ts +539 -0
- package/package/horizon-sp/node_modules/axios/index.js +41 -0
- package/package/horizon-sp/node_modules/axios/lib/adapters/README.md +37 -0
- package/package/horizon-sp/node_modules/axios/lib/adapters/adapters.js +59 -0
- package/package/horizon-sp/node_modules/axios/lib/adapters/http.js +608 -0
- package/package/horizon-sp/node_modules/axios/lib/adapters/xhr.js +249 -0
- package/package/horizon-sp/node_modules/axios/lib/axios.js +86 -0
- package/package/horizon-sp/node_modules/axios/lib/cancel/CancelToken.js +121 -0
- package/package/horizon-sp/node_modules/axios/lib/cancel/CanceledError.js +25 -0
- package/package/horizon-sp/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/package/horizon-sp/node_modules/axios/lib/core/Axios.js +197 -0
- package/package/horizon-sp/node_modules/axios/lib/core/AxiosError.js +100 -0
- package/package/horizon-sp/node_modules/axios/lib/core/AxiosHeaders.js +274 -0
- package/package/horizon-sp/node_modules/axios/lib/core/InterceptorManager.js +71 -0
- package/package/horizon-sp/node_modules/axios/lib/core/README.md +8 -0
- package/package/horizon-sp/node_modules/axios/lib/core/buildFullPath.js +21 -0
- package/package/horizon-sp/node_modules/axios/lib/core/dispatchRequest.js +81 -0
- package/package/horizon-sp/node_modules/axios/lib/core/mergeConfig.js +105 -0
- package/package/horizon-sp/node_modules/axios/lib/core/settle.js +27 -0
- package/package/horizon-sp/node_modules/axios/lib/core/transformData.js +28 -0
- package/package/horizon-sp/node_modules/axios/lib/defaults/index.js +166 -0
- package/package/horizon-sp/node_modules/axios/lib/defaults/transitional.js +7 -0
- package/package/horizon-sp/node_modules/axios/lib/env/README.md +3 -0
- package/package/horizon-sp/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/package/horizon-sp/node_modules/axios/lib/env/data.js +1 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/AxiosTransformStream.js +191 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/README.md +7 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/bind.js +7 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/buildURL.js +63 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/combineURLs.js +15 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/cookies.js +52 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/formDataToJSON.js +92 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/null.js +2 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/spread.js +28 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/throttle.js +33 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/toFormData.js +229 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
- package/package/horizon-sp/node_modules/axios/lib/helpers/validator.js +91 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/browser/index.js +63 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/index.js +3 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/package/horizon-sp/node_modules/axios/lib/platform/node/index.js +12 -0
- package/package/horizon-sp/node_modules/axios/lib/utils.js +677 -0
- package/package/horizon-sp/node_modules/axios/package.json +197 -0
- package/package/horizon-sp/node_modules/child_process/README.md +9 -0
- package/package/horizon-sp/node_modules/child_process/package.json +20 -0
- package/package/horizon-sp/node_modules/combined-stream/License +19 -0
- package/package/horizon-sp/node_modules/combined-stream/Readme.md +138 -0
- package/package/horizon-sp/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/package/horizon-sp/node_modules/combined-stream/package.json +25 -0
- package/package/horizon-sp/node_modules/delayed-stream/License +19 -0
- package/package/horizon-sp/node_modules/delayed-stream/Makefile +7 -0
- package/package/horizon-sp/node_modules/delayed-stream/Readme.md +141 -0
- package/package/horizon-sp/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/package/horizon-sp/node_modules/delayed-stream/package.json +27 -0
- package/package/horizon-sp/node_modules/follow-redirects/LICENSE +18 -0
- package/package/horizon-sp/node_modules/follow-redirects/README.md +155 -0
- package/package/horizon-sp/node_modules/follow-redirects/debug.js +15 -0
- package/package/horizon-sp/node_modules/follow-redirects/http.js +1 -0
- package/package/horizon-sp/node_modules/follow-redirects/https.js +1 -0
- package/package/horizon-sp/node_modules/follow-redirects/index.js +621 -0
- package/package/horizon-sp/node_modules/follow-redirects/package.json +59 -0
- package/package/horizon-sp/node_modules/form-data/License +19 -0
- package/package/horizon-sp/node_modules/form-data/README.md.bak +358 -0
- package/package/horizon-sp/node_modules/form-data/Readme.md +358 -0
- package/package/horizon-sp/node_modules/form-data/index.d.ts +62 -0
- package/package/horizon-sp/node_modules/form-data/lib/browser.js +2 -0
- package/package/horizon-sp/node_modules/form-data/lib/form_data.js +501 -0
- package/package/horizon-sp/node_modules/form-data/lib/populate.js +10 -0
- package/package/horizon-sp/node_modules/form-data/package.json +68 -0
- package/package/horizon-sp/node_modules/fs-extra/LICENSE +15 -0
- package/package/horizon-sp/node_modules/fs-extra/README.md +290 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/copy/copy-sync.js +161 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/copy/copy.js +238 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/file.js +69 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/ensure/symlink.js +82 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/esm.mjs +68 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/fs/index.js +140 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/index.js +16 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/json/index.js +16 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/move/index.js +7 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/move/move-sync.js +54 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/move/move.js +75 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/output-file/index.js +40 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/remove/index.js +17 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/util/stat.js +154 -0
- package/package/horizon-sp/node_modules/fs-extra/lib/util/utimes.js +26 -0
- package/package/horizon-sp/node_modules/fs-extra/package.json +71 -0
- package/package/horizon-sp/node_modules/graceful-fs/LICENSE +15 -0
- package/package/horizon-sp/node_modules/graceful-fs/README.md +143 -0
- package/package/horizon-sp/node_modules/graceful-fs/clone.js +23 -0
- package/package/horizon-sp/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/package/horizon-sp/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/package/horizon-sp/node_modules/graceful-fs/package.json +50 -0
- package/package/horizon-sp/node_modules/graceful-fs/polyfills.js +355 -0
- package/package/horizon-sp/node_modules/jsonfile/CHANGELOG.md +171 -0
- package/package/horizon-sp/node_modules/jsonfile/LICENSE +15 -0
- package/package/horizon-sp/node_modules/jsonfile/README.md +230 -0
- package/package/horizon-sp/node_modules/jsonfile/index.js +88 -0
- package/package/horizon-sp/node_modules/jsonfile/package.json +40 -0
- package/package/horizon-sp/node_modules/jsonfile/utils.js +14 -0
- package/package/horizon-sp/node_modules/mime-db/HISTORY.md +507 -0
- package/package/horizon-sp/node_modules/mime-db/LICENSE +23 -0
- package/package/horizon-sp/node_modules/mime-db/README.md +100 -0
- package/package/horizon-sp/node_modules/mime-db/db.json +8519 -0
- package/package/horizon-sp/node_modules/mime-db/index.js +12 -0
- package/package/horizon-sp/node_modules/mime-db/package.json +60 -0
- package/package/horizon-sp/node_modules/mime-types/HISTORY.md +397 -0
- package/package/horizon-sp/node_modules/mime-types/LICENSE +23 -0
- package/package/horizon-sp/node_modules/mime-types/README.md +113 -0
- package/package/horizon-sp/node_modules/mime-types/index.js +188 -0
- package/package/horizon-sp/node_modules/mime-types/package.json +44 -0
- package/package/horizon-sp/node_modules/proxy-from-env/LICENSE +20 -0
- package/package/horizon-sp/node_modules/proxy-from-env/README.md +131 -0
- package/package/horizon-sp/node_modules/proxy-from-env/index.js +108 -0
- package/package/horizon-sp/node_modules/proxy-from-env/package.json +34 -0
- package/package/horizon-sp/node_modules/proxy-from-env/test.js +483 -0
- package/package/horizon-sp/node_modules/universalify/LICENSE +20 -0
- package/package/horizon-sp/node_modules/universalify/README.md +76 -0
- package/package/horizon-sp/node_modules/universalify/index.js +24 -0
- package/package/horizon-sp/node_modules/universalify/package.json +34 -0
- package/package/horizon-sp/package-lock.json +150 -0
- package/package/horizon-sp/package.json +20 -0
- package/package.json +134 -3
- package/src/ReportV1.js +55 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +78 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +86 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/data/getThreadInfo.json +31985 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +33 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadHistoryDeprecated.js +71 -0
- package/src/getThreadInfo.js +193 -0
- package/src/getThreadInfoDeprecated.js +56 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadMain.js +219 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +66 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +36 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +629 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +321 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +1246 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(_defaultFuncs, _api, _ctx) {
|
4
|
+
// Currently the only colors that can be passed to api.changeThreadColor(); may change if Facebook adds more
|
5
|
+
return {
|
6
|
+
////MessengerBlue: null,
|
7
|
+
////Viking: "#44bec7",
|
8
|
+
////GoldenPoppy: "#ffc300",
|
9
|
+
////RadicalRed: "#fa3c4c",
|
10
|
+
////Shocking: "#d696bb",
|
11
|
+
////PictonBlue: "#6699cc",
|
12
|
+
////FreeSpeechGreen: "#13cf13",
|
13
|
+
////Pumpkin: "#ff7e29",
|
14
|
+
////LightCoral: "#e68585",
|
15
|
+
////MediumSlateBlue: "#7646ff",
|
16
|
+
////DeepSkyBlue: "#20cef5",
|
17
|
+
////Fern: "#67b868",
|
18
|
+
////Cameo: "#d4a88c",
|
19
|
+
////BrilliantRose: "#ff5ca1",
|
20
|
+
////BilobaFlower: "#a695c7"
|
21
|
+
DefaultBlue: "196241301102133",
|
22
|
+
HotPink: "169463077092846",
|
23
|
+
AquaBlue: "2442142322678320",
|
24
|
+
BrightPurple: "234137870477637",
|
25
|
+
CoralPink: "980963458735625",
|
26
|
+
Orange: "175615189761153",
|
27
|
+
Green: "2136751179887052",
|
28
|
+
LavenderPurple: "2058653964378557",
|
29
|
+
Red: "2129984390566328",
|
30
|
+
Yellow: "174636906462322",
|
31
|
+
TealBlue: "1928399724138152",
|
32
|
+
Aqua: "417639218648241",
|
33
|
+
Mango: "930060997172551",
|
34
|
+
Berry: "164535220883264",
|
35
|
+
Citrus: "370940413392601",
|
36
|
+
Candy: "205488546921017",
|
37
|
+
StarWars: "809305022860427"
|
38
|
+
};
|
39
|
+
};
|
package/src/unfriend.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function unfriend(userID, callback) {
|
8
|
+
var resolveFunc = function () { };
|
9
|
+
var rejectFunc = function () { };
|
10
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
11
|
+
resolveFunc = resolve;
|
12
|
+
rejectFunc = reject;
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!callback) {
|
16
|
+
callback = function (err, friendList) {
|
17
|
+
if (err) return rejectFunc(err);
|
18
|
+
resolveFunc(friendList);
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
var form = {
|
23
|
+
uid: userID,
|
24
|
+
unref: "bd_friends_tab",
|
25
|
+
floc: "friends_tab",
|
26
|
+
"nctr[_mod]": "pagelet_timeline_app_collection_" + ctx.userID + ":2356318349:2"
|
27
|
+
};
|
28
|
+
|
29
|
+
defaultFuncs
|
30
|
+
.post("https://www.facebook.com/ajax/profile/removefriendconfirm.php", ctx.jar, form)
|
31
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
32
|
+
.then(function (resData) {
|
33
|
+
if (resData.error) throw resData;
|
34
|
+
return callback();
|
35
|
+
})
|
36
|
+
.catch(function (err) {
|
37
|
+
log.error("unfriend", err);
|
38
|
+
return callback(err);
|
39
|
+
});
|
40
|
+
|
41
|
+
return returnPromise;
|
42
|
+
};
|
43
|
+
};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function unsendMessage(messageID, callback) {
|
8
|
+
var resolveFunc = function () { };
|
9
|
+
var rejectFunc = function () { };
|
10
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
11
|
+
resolveFunc = resolve;
|
12
|
+
rejectFunc = reject;
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!callback) {
|
16
|
+
callback = function (err, friendList) {
|
17
|
+
if (err) return rejectFunc(err);
|
18
|
+
resolveFunc(friendList);
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
var form = {
|
23
|
+
message_id: messageID
|
24
|
+
};
|
25
|
+
|
26
|
+
defaultFuncs
|
27
|
+
.post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
|
28
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
29
|
+
.then(function (resData) {
|
30
|
+
if (resData.error) throw resData;
|
31
|
+
return callback();
|
32
|
+
})
|
33
|
+
.catch(function (err) {
|
34
|
+
log.error("unsendMessage", err);
|
35
|
+
return callback(err);
|
36
|
+
});
|
37
|
+
|
38
|
+
return returnPromise;
|
39
|
+
};
|
40
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// Instructions: Copy this file to test-config.json, fill in your test data
|
2
|
+
// and remove all comments (JSON doesn't support comments).
|
3
|
+
// Run the test with `npm test` after installing the devDependencies (mocha).
|
4
|
+
{
|
5
|
+
// Test user login information
|
6
|
+
"user" : {
|
7
|
+
"id" : "00000000000000",
|
8
|
+
"email" : "example@test.com",
|
9
|
+
"password" : "qwerty"
|
10
|
+
},
|
11
|
+
// Array of at least 2 other user IDs (not the same as the test user)
|
12
|
+
"userIDs" : [
|
13
|
+
"11111111111111",
|
14
|
+
"22222222222222"
|
15
|
+
],
|
16
|
+
// Id of page to which test user is an admin
|
17
|
+
"pageID": "3333333333333"
|
18
|
+
}
|
@@ -0,0 +1,140 @@
|
|
1
|
+
var login = require('../index.js');
|
2
|
+
var fs = require('fs');
|
3
|
+
var assert = require('assert');
|
4
|
+
|
5
|
+
var conf = JSON.parse(process.env.testconfig || fs.readFileSync('test/test-config.json', 'utf8'));
|
6
|
+
var credentials = {
|
7
|
+
email: conf.user.email,
|
8
|
+
password: conf.user.password,
|
9
|
+
};
|
10
|
+
|
11
|
+
var userIDs = conf.userIDs;
|
12
|
+
|
13
|
+
var options = {
|
14
|
+
selfListen: true,
|
15
|
+
listenEvents: true,
|
16
|
+
logLevel: "silent",
|
17
|
+
pageID: conf.pageID
|
18
|
+
};
|
19
|
+
var getType = require('../utils').getType;
|
20
|
+
|
21
|
+
var userID = conf.user.id;
|
22
|
+
|
23
|
+
var groupChatID;
|
24
|
+
var groupChatName;
|
25
|
+
|
26
|
+
function checkErr(done){
|
27
|
+
return function(err) {
|
28
|
+
if (err) done(err);
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
// describe('Login As Page:', function() {
|
33
|
+
// var api = null;
|
34
|
+
// process.on('SIGINT', () => api && !api.logout() && console.log("Logged out :)"));
|
35
|
+
// var tests = [];
|
36
|
+
// var stopListening;
|
37
|
+
// this.timeout(20000);
|
38
|
+
|
39
|
+
// function listen(done, matcher) {
|
40
|
+
// tests.push({matcher:matcher, done:done});
|
41
|
+
// }
|
42
|
+
|
43
|
+
// before(function(done) {
|
44
|
+
// login(credentials, options, function (err, localAPI) {
|
45
|
+
// if(err) return done(err);
|
46
|
+
|
47
|
+
// assert(localAPI);
|
48
|
+
// api = localAPI;
|
49
|
+
// stopListening = api.listen(function (err, msg) {
|
50
|
+
// if (err) throw err;
|
51
|
+
// // Removes matching function and calls corresponding done
|
52
|
+
// tests = tests.filter(function(test) {
|
53
|
+
// return !(test.matcher(msg) && (test.done() || true));
|
54
|
+
// });
|
55
|
+
// });
|
56
|
+
|
57
|
+
// done();
|
58
|
+
// });
|
59
|
+
// });
|
60
|
+
|
61
|
+
// it('should login without error', function (){
|
62
|
+
// assert(api);
|
63
|
+
// });
|
64
|
+
|
65
|
+
// it('should get the right user ID', function (){
|
66
|
+
// assert(userID == api.getCurrentUserID());
|
67
|
+
// });
|
68
|
+
|
69
|
+
// it('should send text message object (user)', function (done){
|
70
|
+
// var body = "text-msg-obj-" + Date.now();
|
71
|
+
// listen(done, msg =>
|
72
|
+
// msg.type === 'message' &&
|
73
|
+
// msg.body === body &&
|
74
|
+
// msg.isGroup === false
|
75
|
+
// );
|
76
|
+
// api.sendMessage({body: body}, userID, checkErr(done));
|
77
|
+
// });
|
78
|
+
|
79
|
+
// it('should send sticker message object (user)', function (done){
|
80
|
+
// var stickerID = '767334526626290';
|
81
|
+
// listen(done, msg =>
|
82
|
+
// msg.type === 'message' &&
|
83
|
+
// msg.attachments.length > 0 &&
|
84
|
+
// msg.attachments[0].type === 'sticker' &&
|
85
|
+
// msg.attachments[0].stickerID === stickerID &&
|
86
|
+
// msg.isGroup === false
|
87
|
+
// );
|
88
|
+
// api.sendMessage({sticker: stickerID}, userID, checkErr(done));
|
89
|
+
// });
|
90
|
+
|
91
|
+
// it('should send basic string (user)', function (done){
|
92
|
+
// var body = "basic-str-" + Date.now();
|
93
|
+
// listen(done, msg =>
|
94
|
+
// msg.type === 'message' &&
|
95
|
+
// msg.body === body &&
|
96
|
+
// msg.isGroup === false
|
97
|
+
// );
|
98
|
+
// api.sendMessage(body, userID, checkErr(done));
|
99
|
+
// });
|
100
|
+
|
101
|
+
// it('should send typing indicator', function (done) {
|
102
|
+
// var stopType = api.sendTypingIndicator(userID, function(err) {
|
103
|
+
// checkErr(done)(err);
|
104
|
+
// stopType();
|
105
|
+
// done();
|
106
|
+
// });
|
107
|
+
// });
|
108
|
+
|
109
|
+
// it('should get the right user info', function (done) {
|
110
|
+
// api.getUserInfo(userID, function(err, data) {
|
111
|
+
// checkErr(done)(err);
|
112
|
+
// var user = data[userID];
|
113
|
+
// assert(user.name);
|
114
|
+
// assert(user.firstName);
|
115
|
+
// assert(user.vanity !== null);
|
116
|
+
// assert(user.profileUrl);
|
117
|
+
// assert(user.gender);
|
118
|
+
// assert(user.type);
|
119
|
+
// assert(!user.isFriend);
|
120
|
+
// done();
|
121
|
+
// });
|
122
|
+
// });
|
123
|
+
|
124
|
+
// it('should get the list of friends', function (done) {
|
125
|
+
// api.getFriendsList(function(err, data) {
|
126
|
+
// checkErr(done)(err);
|
127
|
+
// assert(getType(data) === "Array");
|
128
|
+
// data.map(function(v) {parseInt(v);});
|
129
|
+
// done();
|
130
|
+
// });
|
131
|
+
// });
|
132
|
+
|
133
|
+
// it('should log out', function (done) {
|
134
|
+
// api.logout(done);
|
135
|
+
// });
|
136
|
+
|
137
|
+
// after(function (){
|
138
|
+
// if (stopListening) stopListening();
|
139
|
+
// });
|
140
|
+
// });
|
package/test/test.js
ADDED
@@ -0,0 +1,385 @@
|
|
1
|
+
var login = require('../index.js');
|
2
|
+
var fs = require('fs');
|
3
|
+
var assert = require('assert');
|
4
|
+
|
5
|
+
var conf = JSON.parse(process.env.testconfig || fs.readFileSync('test/test-config.json', 'utf8'));
|
6
|
+
var credentials = {
|
7
|
+
email: conf.user.email,
|
8
|
+
password: conf.user.password,
|
9
|
+
};
|
10
|
+
|
11
|
+
var userIDs = conf.userIDs;
|
12
|
+
|
13
|
+
var options = { selfListen: true, listenEvents: true, logLevel: "silent"};
|
14
|
+
var pageOptions = {logLevel: 'silent', pageID: conf.pageID};
|
15
|
+
var getType = require('../utils').getType;
|
16
|
+
var formatDeltaMessage = require('../utils').formatDeltaMessage;
|
17
|
+
var shareAttachmentFixture = require('./data/shareAttach');
|
18
|
+
|
19
|
+
var userID = conf.user.id;
|
20
|
+
|
21
|
+
var groupChatID;
|
22
|
+
var groupChatName;
|
23
|
+
|
24
|
+
function checkErr(done){
|
25
|
+
return function(err) {
|
26
|
+
if (err) done(err);
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
describe('Login:', function() {
|
31
|
+
var api = null;
|
32
|
+
process.on('SIGINT', () => api && !api.logout() && console.log("Logged out :)"));
|
33
|
+
var tests = [];
|
34
|
+
var stopListening;
|
35
|
+
this.timeout(20000);
|
36
|
+
|
37
|
+
function listen(done, matcher) {
|
38
|
+
tests.push({matcher:matcher, done:done});
|
39
|
+
}
|
40
|
+
|
41
|
+
before(function(done) {
|
42
|
+
login(credentials, options, function (err, localAPI) {
|
43
|
+
if(err) return done(err);
|
44
|
+
|
45
|
+
assert(localAPI);
|
46
|
+
api = localAPI;
|
47
|
+
stopListening = api.listen(function (err, msg) {
|
48
|
+
if (err) throw err;
|
49
|
+
if (msg.type === "message") {
|
50
|
+
assert(msg.senderID && !isNaN(msg.senderID));
|
51
|
+
assert(msg.threadID && !isNaN(msg.threadID));
|
52
|
+
assert(msg.timestamp && !isNaN(msg.timestamp));
|
53
|
+
assert(msg.messageID != null && msg.messageID.length > 0);
|
54
|
+
assert(msg.body != null || msg.attachments.length > 0);
|
55
|
+
}
|
56
|
+
// Removes matching function and calls corresponding done
|
57
|
+
tests = tests.filter(function(test) {
|
58
|
+
return !(test.matcher(msg) && (test.done() || true));
|
59
|
+
});
|
60
|
+
});
|
61
|
+
|
62
|
+
done();
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
it('should login without error', function (){
|
67
|
+
assert(api);
|
68
|
+
});
|
69
|
+
|
70
|
+
it('should get the current user ID', function (){
|
71
|
+
assert(userID === api.getCurrentUserID());
|
72
|
+
});
|
73
|
+
|
74
|
+
it('should send text message object (user)', function (done){
|
75
|
+
var body = "text-msg-obj-" + Date.now();
|
76
|
+
listen(done, msg =>
|
77
|
+
msg.type === 'message' &&
|
78
|
+
msg.body === body &&
|
79
|
+
msg.isGroup === false
|
80
|
+
);
|
81
|
+
api.sendMessage({body: body}, userID, checkErr(done));
|
82
|
+
});
|
83
|
+
|
84
|
+
it('should send sticker message object (user)', function (done){
|
85
|
+
var stickerID = '767334526626290';
|
86
|
+
listen(done, msg =>
|
87
|
+
msg.type === 'message' &&
|
88
|
+
msg.attachments.length > 0 &&
|
89
|
+
msg.attachments[0].type === 'sticker' &&
|
90
|
+
msg.attachments[0].stickerID === stickerID &&
|
91
|
+
msg.isGroup === false
|
92
|
+
);
|
93
|
+
api.sendMessage({sticker: stickerID}, userID, checkErr(done));
|
94
|
+
});
|
95
|
+
|
96
|
+
it('should send basic string (user)', function (done){
|
97
|
+
var body = "basic-str-" + Date.now();
|
98
|
+
listen(done, msg =>
|
99
|
+
msg.type === 'message' &&
|
100
|
+
msg.body === body &&
|
101
|
+
msg.isGroup === false
|
102
|
+
);
|
103
|
+
api.sendMessage(body, userID, checkErr(done));
|
104
|
+
});
|
105
|
+
|
106
|
+
it('should get thread info (user)', function (done){
|
107
|
+
api.getThreadInfo(userID, (err, info) => {
|
108
|
+
if (err) done(err);
|
109
|
+
|
110
|
+
assert(info.participantIDs != null && info.participantIDs.length > 0);
|
111
|
+
assert(!info.participantIDs.some(isNaN));
|
112
|
+
assert(!info.participantIDs.some(v => v.length == 0));
|
113
|
+
assert(info.name != null);
|
114
|
+
assert(info.messageCount != null && !isNaN(info.messageCount));
|
115
|
+
assert(info.hasOwnProperty('emoji'));
|
116
|
+
assert(info.hasOwnProperty('nicknames'));
|
117
|
+
assert(info.hasOwnProperty('color'));
|
118
|
+
done();
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
|
123
|
+
it('should get the history of the chat (user)', function (done) {
|
124
|
+
api.getThreadHistory(userID, 5, null, function(err, data) {
|
125
|
+
checkErr(done)(err);
|
126
|
+
assert(getType(data) === "Array");
|
127
|
+
assert(data.every(function(v) {return getType(v) == "Object";}));
|
128
|
+
done();
|
129
|
+
});
|
130
|
+
});
|
131
|
+
|
132
|
+
it('should get the history of the chat (user) (graphql)', function (done) {
|
133
|
+
api.getThreadHistoryGraphQL(userID, 5, null, function(err, data) {
|
134
|
+
checkErr(done)(err);
|
135
|
+
assert(getType(data) === "Array");
|
136
|
+
assert(data.every(function(v) {return getType(v) == "Object";}));
|
137
|
+
done();
|
138
|
+
});
|
139
|
+
});
|
140
|
+
|
141
|
+
it('should create a chat', function (done){
|
142
|
+
var body = "new-chat-" + Date.now();
|
143
|
+
var inc = 0;
|
144
|
+
|
145
|
+
function doneHack(){
|
146
|
+
if (inc === 1) return done();
|
147
|
+
inc++;
|
148
|
+
}
|
149
|
+
|
150
|
+
listen(doneHack, msg =>
|
151
|
+
msg.type === 'message' && msg.body === body
|
152
|
+
);
|
153
|
+
api.sendMessage(body, userIDs, function(err, info){
|
154
|
+
checkErr(done)(err);
|
155
|
+
groupChatID = info.threadID;
|
156
|
+
doneHack();
|
157
|
+
});
|
158
|
+
});
|
159
|
+
|
160
|
+
it('should send text message object (group)', function (done){
|
161
|
+
var body = "text-msg-obj-" + Date.now();
|
162
|
+
listen(done, msg =>
|
163
|
+
msg.type === 'message' &&
|
164
|
+
msg.body === body &&
|
165
|
+
msg.isGroup === true
|
166
|
+
);
|
167
|
+
api.sendMessage({body: body}, groupChatID, function(err, info){
|
168
|
+
checkErr(done)(err);
|
169
|
+
assert(groupChatID === info.threadID);
|
170
|
+
});
|
171
|
+
});
|
172
|
+
|
173
|
+
it('should send basic string (group)', function (done){
|
174
|
+
var body = "basic-str-" + Date.now();
|
175
|
+
listen(done, msg =>
|
176
|
+
msg.type === 'message' &&
|
177
|
+
msg.body === body &&
|
178
|
+
msg.isGroup === true
|
179
|
+
);
|
180
|
+
api.sendMessage(body, groupChatID, function(err, info) {
|
181
|
+
checkErr(done)(err);
|
182
|
+
assert(groupChatID === info.threadID);
|
183
|
+
});
|
184
|
+
});
|
185
|
+
|
186
|
+
it('should send sticker message object (group)', function (done){
|
187
|
+
var stickerID = '767334526626290';
|
188
|
+
listen(done, function (msg) {
|
189
|
+
return msg.type === 'message' &&
|
190
|
+
msg.attachments.length > 0 &&
|
191
|
+
msg.attachments[0].type === 'sticker' &&
|
192
|
+
msg.attachments[0].stickerID === stickerID;
|
193
|
+
});
|
194
|
+
api.sendMessage({sticker: stickerID}, groupChatID, function (err, info) {
|
195
|
+
assert(groupChatID === info.threadID);
|
196
|
+
checkErr(done)(err);
|
197
|
+
});
|
198
|
+
});
|
199
|
+
|
200
|
+
it('should send an attachment with a body (group)', function (done){
|
201
|
+
var body = "attach-" + Date.now();
|
202
|
+
var attach = [];
|
203
|
+
attach.push(fs.createReadStream("test/data/test.txt"));
|
204
|
+
attach.push(fs.createReadStream("test/data/test.png"));
|
205
|
+
listen(done, function (msg) {
|
206
|
+
return msg.type === 'message' && msg.body === body;
|
207
|
+
});
|
208
|
+
api.sendMessage({attachment: attach, body: body}, groupChatID, function(err, info){
|
209
|
+
checkErr(done)(err);
|
210
|
+
assert(groupChatID === info.threadID);
|
211
|
+
});
|
212
|
+
});
|
213
|
+
|
214
|
+
it('should get the history of the chat (group)', function (done) {
|
215
|
+
api.getThreadHistory(groupChatID, 5, null, function(err, data) {
|
216
|
+
checkErr(done)(err);
|
217
|
+
assert(getType(data) === "Array");
|
218
|
+
assert(data.every(function(v) {return getType(v) == "Object";}));
|
219
|
+
done();
|
220
|
+
});
|
221
|
+
});
|
222
|
+
|
223
|
+
it('should get the history of the chat (group) (graphql)', function (done) {
|
224
|
+
api.getThreadHistoryGraphQL(groupChatID, 5, null, function(err, data) {
|
225
|
+
checkErr(done)(err);
|
226
|
+
assert(getType(data) === "Array");
|
227
|
+
assert(data.every(function(v) {return getType(v) == "Object";}));
|
228
|
+
done();
|
229
|
+
});
|
230
|
+
});
|
231
|
+
|
232
|
+
|
233
|
+
it('should change chat title', function (done){
|
234
|
+
var title = 'test-chat-title-' + Date.now();
|
235
|
+
listen(done, function (msg) {
|
236
|
+
return msg.type === 'event' &&
|
237
|
+
msg.logMessageType === 'log:thread-name' &&
|
238
|
+
msg.logMessageData.name === title;
|
239
|
+
});
|
240
|
+
groupChatName = title;
|
241
|
+
api.setTitle(title, groupChatID, checkErr(done));
|
242
|
+
});
|
243
|
+
|
244
|
+
it('should kick user', function (done) {
|
245
|
+
var id = userIDs[0];
|
246
|
+
listen(done, function (msg) {
|
247
|
+
return msg.type === 'event' &&
|
248
|
+
msg.logMessageType === 'log:unsubscribe' &&
|
249
|
+
msg.logMessageData.leftParticipantFbId === id;
|
250
|
+
});
|
251
|
+
api.removeUserFromGroup(id, groupChatID, checkErr(done));
|
252
|
+
});
|
253
|
+
|
254
|
+
it('should add user', function (done) {
|
255
|
+
var id = userIDs[0];
|
256
|
+
listen(done, function (msg) {
|
257
|
+
return (msg.type === 'event' &&
|
258
|
+
msg.logMessageType === 'log:subscribe' &&
|
259
|
+
msg.logMessageData.addedParticipants.length > 0 &&
|
260
|
+
msg.logMessageData.addedParticipants[0].userFbId === id);
|
261
|
+
});
|
262
|
+
// TODO: we don't check for errors inside this because FB changed and
|
263
|
+
// returns an error, even though we receive the event that the user was
|
264
|
+
// added
|
265
|
+
api.addUserToGroup(id, groupChatID, function() {});
|
266
|
+
});
|
267
|
+
|
268
|
+
xit('should get thread info (group)', function (done){
|
269
|
+
api.getThreadInfo(groupChatID, (err, info) => {
|
270
|
+
if (err) done(err);
|
271
|
+
|
272
|
+
assert(info.participantIDs != null && info.participantIDs.length > 0);
|
273
|
+
assert(!info.participantIDs.some(isNaN));
|
274
|
+
assert(!info.participantIDs.some(v => v.length == 0));
|
275
|
+
assert(info.name != null);
|
276
|
+
assert(info.messageCount != null && !isNaN(info.messageCount));
|
277
|
+
assert(info.hasOwnProperty('emoji'));
|
278
|
+
assert(info.hasOwnProperty('nicknames'));
|
279
|
+
assert(info.hasOwnProperty('color'));
|
280
|
+
done();
|
281
|
+
});
|
282
|
+
});
|
283
|
+
|
284
|
+
it('should retrieve a list of threads', function (done) {
|
285
|
+
api.getThreadList(0, 20, function(err, res) {
|
286
|
+
checkErr(done)(err);
|
287
|
+
|
288
|
+
// This checks to see if the group chat we just made
|
289
|
+
// is in the list... it should be.
|
290
|
+
assert(res.some(function (v) {
|
291
|
+
return (
|
292
|
+
v.threadID === groupChatID &&
|
293
|
+
userIDs.every(function (val) {
|
294
|
+
return v.participants.indexOf(val) > -1;
|
295
|
+
}) &&
|
296
|
+
v.name === groupChatName
|
297
|
+
);
|
298
|
+
}));
|
299
|
+
done();
|
300
|
+
});
|
301
|
+
});
|
302
|
+
|
303
|
+
it('should mark as read', function (done){
|
304
|
+
api.markAsRead(groupChatID, done);
|
305
|
+
});
|
306
|
+
|
307
|
+
it('should send typing indicator', function (done) {
|
308
|
+
var stopType = api.sendTypingIndicator(groupChatID, function(err) {
|
309
|
+
checkErr(done)(err);
|
310
|
+
stopType();
|
311
|
+
done();
|
312
|
+
});
|
313
|
+
});
|
314
|
+
|
315
|
+
|
316
|
+
it('should get the right user info', function (done) {
|
317
|
+
api.getUserInfo(userID, function(err, data) {
|
318
|
+
checkErr(done)(err);
|
319
|
+
var user = data[userID];
|
320
|
+
assert(user.name);
|
321
|
+
assert(user.firstName);
|
322
|
+
assert(user.vanity !== null);
|
323
|
+
assert(user.profileUrl);
|
324
|
+
assert(user.gender);
|
325
|
+
assert(user.type);
|
326
|
+
assert(!user.isFriend);
|
327
|
+
done();
|
328
|
+
});
|
329
|
+
});
|
330
|
+
|
331
|
+
it('should get the user ID', function(done) {
|
332
|
+
api.getUserInfo(userIDs[0], function(err, data) {
|
333
|
+
checkErr(done)(err);
|
334
|
+
var user = data[userIDs[0]];
|
335
|
+
api.getUserID(user.name, function(err, data) {
|
336
|
+
checkErr(done)(err);
|
337
|
+
assert(getType(data) === "Array");
|
338
|
+
assert(data.some(function(val) {
|
339
|
+
return val.userID === userIDs[0];
|
340
|
+
}));
|
341
|
+
done();
|
342
|
+
});
|
343
|
+
});
|
344
|
+
});
|
345
|
+
|
346
|
+
it('should get the list of friends', function (done) {
|
347
|
+
api.getFriendsList(function(err, data) {
|
348
|
+
try {
|
349
|
+
checkErr(done)(err);
|
350
|
+
assert(getType(data) === "Array");
|
351
|
+
data.map(v => {
|
352
|
+
assert(getType(v.firstName) === "String");
|
353
|
+
assert(getType(v.gender) === "String");
|
354
|
+
assert(getType(v.userID) === "String");
|
355
|
+
assert(getType(v.isFriend) === "Boolean");
|
356
|
+
assert(getType(v.fullName) === "String");
|
357
|
+
assert(getType(v.profilePicture) === "String");
|
358
|
+
assert(getType(v.type) === "String");
|
359
|
+
assert(v.hasOwnProperty("profileUrl")); // This can be null if the account is disabled
|
360
|
+
assert(getType(v.isBirthday) === "Boolean");
|
361
|
+
})
|
362
|
+
done();
|
363
|
+
} catch(e){
|
364
|
+
done(e);
|
365
|
+
}
|
366
|
+
});
|
367
|
+
});
|
368
|
+
|
369
|
+
it('should parse share attachment correctly', function () {
|
370
|
+
var formatted = formatDeltaMessage(shareAttachmentFixture);
|
371
|
+
assert(formatted.attachments[0].type === "share");
|
372
|
+
assert(formatted.attachments[0].title === "search engines");
|
373
|
+
assert(formatted.attachments[0].target.items[0].name === "search engines");
|
374
|
+
assert(formatted.attachments[0].target.items[0].call_to_actions.length === 3);
|
375
|
+
assert(formatted.attachments[0].target.items[0].call_to_actions[0].title === "Google");
|
376
|
+
});
|
377
|
+
|
378
|
+
it('should log out', function (done) {
|
379
|
+
api.logout(done);
|
380
|
+
});
|
381
|
+
|
382
|
+
after(function (){
|
383
|
+
if (stopListening) stopListening();
|
384
|
+
});
|
385
|
+
});
|