@maiyunnet/kebab 7.5.0 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/README.sc.md +201 -0
- package/doc/README.tc.md +203 -0
- package/doc/icon.png +0 -0
- package/doc/kebab-rag.md +23161 -0
- package/doc/sc/api/index/index.md +47 -0
- package/doc/sc/api/index/interfaces/IConfig.md +165 -0
- package/doc/sc/api/index/interfaces/IConfigAi.md +29 -0
- package/doc/sc/api/index/interfaces/IConfigConst.md +201 -0
- package/doc/sc/api/index/interfaces/IConfigDb.md +59 -0
- package/doc/sc/api/index/interfaces/IConfigDns.md +27 -0
- package/doc/sc/api/index/interfaces/IConfigJwt.md +51 -0
- package/doc/sc/api/index/interfaces/IConfigKv.md +59 -0
- package/doc/sc/api/index/interfaces/IConfigLang.md +27 -0
- package/doc/sc/api/index/interfaces/IConfigS3.md +53 -0
- package/doc/sc/api/index/interfaces/IConfigSql.md +19 -0
- package/doc/sc/api/index/interfaces/IConfigTurnstile.md +51 -0
- package/doc/sc/api/index/interfaces/IConfigVector.md +51 -0
- package/doc/sc/api/index/interfaces/IPostFile.md +43 -0
- package/doc/sc/api/index/interfaces/IUrlParse.md +97 -0
- package/doc/sc/api/index/interfaces/IVhost.md +43 -0
- package/doc/sc/api/index/type-aliases/DbValue.md +13 -0
- package/doc/sc/api/index/type-aliases/Json.md +13 -0
- package/doc/sc/api/index/variables/CERT_CWD.md +11 -0
- package/doc/sc/api/index/variables/CONF_CWD.md +11 -0
- package/doc/sc/api/index/variables/FTMP_CWD.md +11 -0
- package/doc/sc/api/index/variables/IND_CWD.md +11 -0
- package/doc/sc/api/index/variables/LIB_CWD.md +11 -0
- package/doc/sc/api/index/variables/LIB_PATH.md +11 -0
- package/doc/sc/api/index/variables/LOG_CWD.md +11 -0
- package/doc/sc/api/index/variables/MOD_CWD.md +11 -0
- package/doc/sc/api/index/variables/ROOT_CWD.md +13 -0
- package/doc/sc/api/index/variables/ROOT_PATH.md +13 -0
- package/doc/sc/api/index/variables/SYS_PATH.md +11 -0
- package/doc/sc/api/index/variables/VER.md +13 -0
- package/doc/sc/api/index/variables/VHOST_CWD.md +11 -0
- package/doc/sc/api/index/variables/WWW_CWD.md +11 -0
- package/doc/sc/api/index.md +48 -0
- package/doc/sc/api/lib/ai/classes/Ai.md +103 -0
- package/doc/sc/api/lib/ai/enumerations/ESERVICE.md +61 -0
- package/doc/sc/api/lib/ai/functions/get.md +29 -0
- package/doc/sc/api/lib/ai/index.md +23 -0
- package/doc/sc/api/lib/ai/interfaces/IOptions.md +65 -0
- package/doc/sc/api/lib/buffer/classes/Reader.md +177 -0
- package/doc/sc/api/lib/buffer/classes/Writer.md +147 -0
- package/doc/sc/api/lib/buffer/functions/getReader.md +25 -0
- package/doc/sc/api/lib/buffer/functions/getWriter.md +25 -0
- package/doc/sc/api/lib/buffer/index.md +17 -0
- package/doc/sc/api/lib/captcha/classes/Captcha.md +79 -0
- package/doc/sc/api/lib/captcha/functions/get.md +37 -0
- package/doc/sc/api/lib/captcha/index.md +15 -0
- package/doc/sc/api/lib/consistent/classes/Consistent.md +135 -0
- package/doc/sc/api/lib/consistent/functions/addToCircle.md +37 -0
- package/doc/sc/api/lib/consistent/functions/fast.md +37 -0
- package/doc/sc/api/lib/consistent/functions/findInCircle.md +37 -0
- package/doc/sc/api/lib/consistent/functions/get.md +21 -0
- package/doc/sc/api/lib/consistent/functions/getRange.md +37 -0
- package/doc/sc/api/lib/consistent/functions/hash.md +25 -0
- package/doc/sc/api/lib/consistent/index.md +20 -0
- package/doc/sc/api/lib/core/functions/checkType.md +37 -0
- package/doc/sc/api/lib/core/functions/clone.md +31 -0
- package/doc/sc/api/lib/core/functions/convert62.md +25 -0
- package/doc/sc/api/lib/core/functions/debug.md +31 -0
- package/doc/sc/api/lib/core/functions/display.md +31 -0
- package/doc/sc/api/lib/core/functions/emptyObject.md +31 -0
- package/doc/sc/api/lib/core/functions/exec.md +31 -0
- package/doc/sc/api/lib/core/functions/getLog.md +71 -0
- package/doc/sc/api/lib/core/functions/ip.md +27 -0
- package/doc/sc/api/lib/core/functions/log.md +37 -0
- package/doc/sc/api/lib/core/functions/ls.md +39 -0
- package/doc/sc/api/lib/core/functions/muid.md +59 -0
- package/doc/sc/api/lib/core/functions/objectSort.md +31 -0
- package/doc/sc/api/lib/core/functions/passThroughAppend.md +37 -0
- package/doc/sc/api/lib/core/functions/purify.md +25 -0
- package/doc/sc/api/lib/core/functions/rand.md +37 -0
- package/doc/sc/api/lib/core/functions/random.md +37 -0
- package/doc/sc/api/lib/core/functions/realIP.md +29 -0
- package/doc/sc/api/lib/core/functions/removeGlobal.md +31 -0
- package/doc/sc/api/lib/core/functions/sendNpm.md +31 -0
- package/doc/sc/api/lib/core/functions/sendPm2.md +37 -0
- package/doc/sc/api/lib/core/functions/sendReload.md +24 -0
- package/doc/sc/api/lib/core/functions/sendRestart.md +24 -0
- package/doc/sc/api/lib/core/functions/setCookie.md +43 -0
- package/doc/sc/api/lib/core/functions/setGlobal.md +37 -0
- package/doc/sc/api/lib/core/functions/sleep.md +25 -0
- package/doc/sc/api/lib/core/functions/unconvert62.md +25 -0
- package/doc/sc/api/lib/core/functions/updateCode.md +49 -0
- package/doc/sc/api/lib/core/functions/write.md +31 -0
- package/doc/sc/api/lib/core/functions/writeEventStreamHead.md +21 -0
- package/doc/sc/api/lib/core/functions/writeHead.md +37 -0
- package/doc/sc/api/lib/core/index.md +66 -0
- package/doc/sc/api/lib/core/interfaces/ICookieOptions.md +59 -0
- package/doc/sc/api/lib/core/interfaces/ILogOptions.md +75 -0
- package/doc/sc/api/lib/core/type-aliases/TPm2Action.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_L.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_LN.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_LU.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_LUN.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_LUNS.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_N.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_U.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_UN.md +13 -0
- package/doc/sc/api/lib/core/variables/RANDOM_V.md +13 -0
- package/doc/sc/api/lib/core/variables/REAL_IP_CF.md +13 -0
- package/doc/sc/api/lib/core/variables/REAL_IP_X.md +13 -0
- package/doc/sc/api/lib/core/variables/global.md +13 -0
- package/doc/sc/api/lib/core/variables/globalConfig.md +47 -0
- package/doc/sc/api/lib/cron/functions/getRegulars.md +17 -0
- package/doc/sc/api/lib/cron/functions/regular.md +31 -0
- package/doc/sc/api/lib/cron/index.md +17 -0
- package/doc/sc/api/lib/cron/interfaces/IRegular.md +59 -0
- package/doc/sc/api/lib/cron/interfaces/IRegularData.md +101 -0
- package/doc/sc/api/lib/crypto/functions/aesDecrypt.md +91 -0
- package/doc/sc/api/lib/crypto/functions/aesEncrypt.md +95 -0
- package/doc/sc/api/lib/crypto/functions/base64Decode.md +59 -0
- package/doc/sc/api/lib/crypto/functions/base64Encode.md +25 -0
- package/doc/sc/api/lib/crypto/functions/cipherDecrypt.md +49 -0
- package/doc/sc/api/lib/crypto/functions/cipherEncrypt.md +49 -0
- package/doc/sc/api/lib/crypto/functions/gcmDecrypt.md +71 -0
- package/doc/sc/api/lib/crypto/functions/gcmEncrypt.md +71 -0
- package/doc/sc/api/lib/crypto/functions/generateKeyPair.md +61 -0
- package/doc/sc/api/lib/crypto/functions/hashHmac.md +79 -0
- package/doc/sc/api/lib/crypto/functions/hashHmacFile.md +79 -0
- package/doc/sc/api/lib/crypto/functions/privateDecrypt.md +31 -0
- package/doc/sc/api/lib/crypto/functions/privateEncrypt.md +31 -0
- package/doc/sc/api/lib/crypto/functions/publicDecrypt.md +31 -0
- package/doc/sc/api/lib/crypto/functions/publicEncrypt.md +31 -0
- package/doc/sc/api/lib/crypto/functions/sign.md +83 -0
- package/doc/sc/api/lib/crypto/functions/sm4Decrypt.md +91 -0
- package/doc/sc/api/lib/crypto/functions/sm4Encrypt.md +91 -0
- package/doc/sc/api/lib/crypto/functions/uuid.md +25 -0
- package/doc/sc/api/lib/crypto/functions/verify.md +43 -0
- package/doc/sc/api/lib/crypto/index.md +40 -0
- package/doc/sc/api/lib/crypto/variables/AES_256_CBC.md +13 -0
- package/doc/sc/api/lib/crypto/variables/AES_256_CTR.md +13 -0
- package/doc/sc/api/lib/crypto/variables/AES_256_ECB.md +13 -0
- package/doc/sc/api/lib/crypto/variables/AES_256_GCM.md +13 -0
- package/doc/sc/api/lib/crypto/variables/SM4_CBC.md +11 -0
- package/doc/sc/api/lib/crypto/variables/SM4_CFB.md +13 -0
- package/doc/sc/api/lib/crypto/variables/SM4_ECB.md +13 -0
- package/doc/sc/api/lib/db/conn/classes/Connection.md +315 -0
- package/doc/sc/api/lib/db/conn/index.md +11 -0
- package/doc/sc/api/lib/db/enumerations/ESERVICE.md +27 -0
- package/doc/sc/api/lib/db/functions/get.md +37 -0
- package/doc/sc/api/lib/db/index.md +50 -0
- package/doc/sc/api/lib/db/interfaces/IData.md +57 -0
- package/doc/sc/api/lib/db/interfaces/IPacket.md +75 -0
- package/doc/sc/api/lib/db/pool/classes/Pool.md +143 -0
- package/doc/sc/api/lib/db/pool/functions/getConnectionList.md +17 -0
- package/doc/sc/api/lib/db/pool/index.md +19 -0
- package/doc/sc/api/lib/db/pool/interfaces/IConnectionInfo.md +91 -0
- package/doc/sc/api/lib/db/tran/classes/Transaction.md +137 -0
- package/doc/sc/api/lib/db/tran/index.md +11 -0
- package/doc/sc/api/lib/dns/classes/Dns.md +187 -0
- package/doc/sc/api/lib/dns/enumerations/ERECORDLINE.md +59 -0
- package/doc/sc/api/lib/dns/enumerations/ERECORDTYPE.md +67 -0
- package/doc/sc/api/lib/dns/enumerations/ESERVICE.md +27 -0
- package/doc/sc/api/lib/dns/functions/get.md +29 -0
- package/doc/sc/api/lib/dns/index.md +27 -0
- package/doc/sc/api/lib/dns/interfaces/IAddDomainRecord.md +27 -0
- package/doc/sc/api/lib/dns/interfaces/IDomainList.md +43 -0
- package/doc/sc/api/lib/dns/interfaces/IOptions.md +41 -0
- package/doc/sc/api/lib/fs/functions/chmod.md +31 -0
- package/doc/sc/api/lib/fs/functions/copyFile.md +31 -0
- package/doc/sc/api/lib/fs/functions/copyFolder.md +37 -0
- package/doc/sc/api/lib/fs/functions/createReadStream.md +31 -0
- package/doc/sc/api/lib/fs/functions/createWriteStream.md +31 -0
- package/doc/sc/api/lib/fs/functions/getContent.md +63 -0
- package/doc/sc/api/lib/fs/functions/isDir.md +25 -0
- package/doc/sc/api/lib/fs/functions/isFile.md +25 -0
- package/doc/sc/api/lib/fs/functions/mkdir.md +31 -0
- package/doc/sc/api/lib/fs/functions/pipe.md +39 -0
- package/doc/sc/api/lib/fs/functions/putContent.md +47 -0
- package/doc/sc/api/lib/fs/functions/readDir.md +29 -0
- package/doc/sc/api/lib/fs/functions/readLink.md +31 -0
- package/doc/sc/api/lib/fs/functions/readToResponse.md +43 -0
- package/doc/sc/api/lib/fs/functions/rename.md +31 -0
- package/doc/sc/api/lib/fs/functions/rmdir.md +25 -0
- package/doc/sc/api/lib/fs/functions/rmdirDeep.md +25 -0
- package/doc/sc/api/lib/fs/functions/stats.md +25 -0
- package/doc/sc/api/lib/fs/functions/symlink.md +37 -0
- package/doc/sc/api/lib/fs/functions/unlink.md +25 -0
- package/doc/sc/api/lib/fs/index.md +30 -0
- package/doc/sc/api/lib/kv/classes/Kv.md +1161 -0
- package/doc/sc/api/lib/kv/functions/get.md +41 -0
- package/doc/sc/api/lib/kv/index.md +20 -0
- package/doc/sc/api/lib/kv/interfaces/IConnectionInfo.md +43 -0
- package/doc/sc/api/lib/kv/interfaces/IZRangeOptions.md +52 -0
- package/doc/sc/api/lib/lan/functions/card.md +17 -0
- package/doc/sc/api/lib/lan/functions/scan.md +17 -0
- package/doc/sc/api/lib/lan/index.md +12 -0
- package/doc/sc/api/lib/lang/functions/getCodeByAccept.md +25 -0
- package/doc/sc/api/lib/lang/index.md +17 -0
- package/doc/sc/api/lib/lang/variables/codes.md +13 -0
- package/doc/sc/api/lib/lang/variables/map.md +13 -0
- package/doc/sc/api/lib/lang/variables/names.md +11 -0
- package/doc/sc/api/lib/net/formdata/classes/FormData.md +157 -0
- package/doc/sc/api/lib/net/formdata/index.md +15 -0
- package/doc/sc/api/lib/net/formdata/interfaces/IItem.md +55 -0
- package/doc/sc/api/lib/net/functions/buildCookieQuery.md +31 -0
- package/doc/sc/api/lib/net/functions/fetch.md +31 -0
- package/doc/sc/api/lib/net/functions/filterHeaders.md +37 -0
- package/doc/sc/api/lib/net/functions/get.md +31 -0
- package/doc/sc/api/lib/net/functions/getCa.md +17 -0
- package/doc/sc/api/lib/net/functions/getFormData.md +17 -0
- package/doc/sc/api/lib/net/functions/mproxy.md +38 -0
- package/doc/sc/api/lib/net/functions/mproxyData.md +25 -0
- package/doc/sc/api/lib/net/functions/open.md +23 -0
- package/doc/sc/api/lib/net/functions/post.md +37 -0
- package/doc/sc/api/lib/net/functions/postJson.md +37 -0
- package/doc/sc/api/lib/net/functions/postJsonResponseJson.md +39 -0
- package/doc/sc/api/lib/net/functions/request.md +33 -0
- package/doc/sc/api/lib/net/functions/resetCookieSession.md +25 -0
- package/doc/sc/api/lib/net/functions/rproxy.md +37 -0
- package/doc/sc/api/lib/net/functions/setCookie.md +63 -0
- package/doc/sc/api/lib/net/index.md +37 -0
- package/doc/sc/api/lib/net/interfaces/ICookie.md +69 -0
- package/doc/sc/api/lib/net/interfaces/IMproxyOptions.md +85 -0
- package/doc/sc/api/lib/net/interfaces/IRequestOptions.md +133 -0
- package/doc/sc/api/lib/net/interfaces/IRproxyOptions.md +107 -0
- package/doc/sc/api/lib/net/request/classes/Request.md +297 -0
- package/doc/sc/api/lib/net/request/index.md +11 -0
- package/doc/sc/api/lib/net/response/classes/Response.md +109 -0
- package/doc/sc/api/lib/net/response/index.md +11 -0
- package/doc/sc/api/lib/net/type-aliases/THttpHeaders.md +27 -0
- package/doc/sc/api/lib/s3/classes/S3.md +220 -0
- package/doc/sc/api/lib/s3/enumerations/ESERVICE.md +43 -0
- package/doc/sc/api/lib/s3/functions/get.md +29 -0
- package/doc/sc/api/lib/s3/index.md +23 -0
- package/doc/sc/api/lib/s3/interfaces/IOptions.md +71 -0
- package/doc/sc/api/lib/scan/classes/Scan.md +127 -0
- package/doc/sc/api/lib/scan/functions/get.md +33 -0
- package/doc/sc/api/lib/scan/functions/scanned.md +37 -0
- package/doc/sc/api/lib/scan/functions/setData.md +35 -0
- package/doc/sc/api/lib/scan/index.md +22 -0
- package/doc/sc/api/lib/scan/interfaces/IOptions.md +43 -0
- package/doc/sc/api/lib/scan/interfaces/IStaticOptions.md +35 -0
- package/doc/sc/api/lib/session/classes/Session.md +103 -0
- package/doc/sc/api/lib/session/index.md +15 -0
- package/doc/sc/api/lib/session/interfaces/IOptions.md +41 -0
- package/doc/sc/api/lib/socket/functions/rwebsocket.md +37 -0
- package/doc/sc/api/lib/socket/index.md +15 -0
- package/doc/sc/api/lib/socket/interfaces/IRwebsocketOptions.md +91 -0
- package/doc/sc/api/lib/sql/classes/Sql.md +791 -0
- package/doc/sc/api/lib/sql/enumerations/EJSON.md +61 -0
- package/doc/sc/api/lib/sql/enumerations/ESERVICE.md +27 -0
- package/doc/sc/api/lib/sql/functions/aoMix.md +25 -0
- package/doc/sc/api/lib/sql/functions/column.md +35 -0
- package/doc/sc/api/lib/sql/functions/format.md +37 -0
- package/doc/sc/api/lib/sql/functions/get.md +43 -0
- package/doc/sc/api/lib/sql/index.md +23 -0
- package/doc/sc/api/lib/ssh/classes/Connection.md +123 -0
- package/doc/sc/api/lib/ssh/functions/get.md +25 -0
- package/doc/sc/api/lib/ssh/index.md +19 -0
- package/doc/sc/api/lib/ssh/interfaces/IExtOptions.md +33 -0
- package/doc/sc/api/lib/ssh/sftp/classes/Connection.md +628 -0
- package/doc/sc/api/lib/ssh/sftp/index.md +11 -0
- package/doc/sc/api/lib/ssh/shell/classes/Connection.md +189 -0
- package/doc/sc/api/lib/ssh/shell/index.md +11 -0
- package/doc/sc/api/lib/text/functions/getFilename.md +25 -0
- package/doc/sc/api/lib/text/functions/htmlescape.md +25 -0
- package/doc/sc/api/lib/text/functions/int2str.md +42 -0
- package/doc/sc/api/lib/text/functions/isAscii.md +25 -0
- package/doc/sc/api/lib/text/functions/isDomain.md +27 -0
- package/doc/sc/api/lib/text/functions/isEMail.md +23 -0
- package/doc/sc/api/lib/text/functions/isFalsy.md +25 -0
- package/doc/sc/api/lib/text/functions/isIPv4.md +23 -0
- package/doc/sc/api/lib/text/functions/isIPv6.md +23 -0
- package/doc/sc/api/lib/text/functions/isIdCardCN.md +25 -0
- package/doc/sc/api/lib/text/functions/isPhoneCN.md +25 -0
- package/doc/sc/api/lib/text/functions/isRealPath.md +25 -0
- package/doc/sc/api/lib/text/functions/isTruthy.md +31 -0
- package/doc/sc/api/lib/text/functions/logicalOr.md +41 -0
- package/doc/sc/api/lib/text/functions/match.md +31 -0
- package/doc/sc/api/lib/text/functions/nlReplace.md +31 -0
- package/doc/sc/api/lib/text/functions/parseDomain.md +25 -0
- package/doc/sc/api/lib/text/functions/parseJson.md +25 -0
- package/doc/sc/api/lib/text/functions/parseUrl.md +23 -0
- package/doc/sc/api/lib/text/functions/queryParse.md +25 -0
- package/doc/sc/api/lib/text/functions/queryStringify.md +69 -0
- package/doc/sc/api/lib/text/functions/sizeFormat.md +31 -0
- package/doc/sc/api/lib/text/functions/str2int.md +36 -0
- package/doc/sc/api/lib/text/functions/stringifyBuffer.md +25 -0
- package/doc/sc/api/lib/text/functions/stringifyJson.md +31 -0
- package/doc/sc/api/lib/text/functions/stringifyResult.md +25 -0
- package/doc/sc/api/lib/text/functions/trimJson.md +23 -0
- package/doc/sc/api/lib/text/functions/urlAtom.md +25 -0
- package/doc/sc/api/lib/text/functions/urlResolve.md +31 -0
- package/doc/sc/api/lib/text/index.md +55 -0
- package/doc/sc/api/lib/text/interfaces/IDomain.md +43 -0
- package/doc/sc/api/lib/text/type-aliases/TFalsy.md +13 -0
- package/doc/sc/api/lib/text/variables/REGEXP_ASCII.md +13 -0
- package/doc/sc/api/lib/text/variables/REGEXP_DOMAIN.md +11 -0
- package/doc/sc/api/lib/text/variables/REGEXP_EMAIL.md +11 -0
- package/doc/sc/api/lib/text/variables/REGEXP_IPV4.md +11 -0
- package/doc/sc/api/lib/text/variables/REGEXP_IPV6.md +11 -0
- package/doc/sc/api/lib/time/classes/Time.md +125 -0
- package/doc/sc/api/lib/time/functions/format.md +37 -0
- package/doc/sc/api/lib/time/functions/get.md +27 -0
- package/doc/sc/api/lib/time/functions/isMs.md +25 -0
- package/doc/sc/api/lib/time/functions/stamp.md +31 -0
- package/doc/sc/api/lib/time/index.md +28 -0
- package/doc/sc/api/lib/time/interfaces/IOptions.md +29 -0
- package/doc/sc/api/lib/time/variables/DAY.md +13 -0
- package/doc/sc/api/lib/time/variables/HOUR.md +13 -0
- package/doc/sc/api/lib/time/variables/YEAR.md +13 -0
- package/doc/sc/api/lib/turnstile/enumerations/EFACTORY.md +27 -0
- package/doc/sc/api/lib/turnstile/functions/verify.md +35 -0
- package/doc/sc/api/lib/turnstile/index.md +15 -0
- package/doc/sc/api/lib/vector/classes/Vector.md +141 -0
- package/doc/sc/api/lib/vector/functions/get.md +25 -0
- package/doc/sc/api/lib/vector/index.md +19 -0
- package/doc/sc/api/lib/vector/interfaces/IOptions.md +61 -0
- package/doc/sc/api/lib/ws/classes/Socket.md +331 -0
- package/doc/sc/api/lib/ws/enumerations/EFrameReceiveMode.md +35 -0
- package/doc/sc/api/lib/ws/enumerations/EOpcode.md +59 -0
- package/doc/sc/api/lib/ws/functions/connect.md +31 -0
- package/doc/sc/api/lib/ws/functions/createServer.md +45 -0
- package/doc/sc/api/lib/ws/functions/mproxy.md +38 -0
- package/doc/sc/api/lib/ws/functions/rproxy.md +37 -0
- package/doc/sc/api/lib/ws/functions/rsocket.md +37 -0
- package/doc/sc/api/lib/ws/index.md +30 -0
- package/doc/sc/api/lib/ws/interfaces/IConnectOptions.md +95 -0
- package/doc/sc/api/lib/ws/interfaces/IMproxyOptions.md +87 -0
- package/doc/sc/api/lib/ws/interfaces/IRproxyOptions.md +105 -0
- package/doc/sc/api/lib/zip/classes/Zip.md +392 -0
- package/doc/sc/api/lib/zip/functions/get.md +25 -0
- package/doc/sc/api/lib/zip/index.md +29 -0
- package/doc/sc/api/lib/zip/interfaces/IZipInputByType.md +81 -0
- package/doc/sc/api/lib/zip/interfaces/IZipItem.md +65 -0
- package/doc/sc/api/lib/zip/interfaces/IZipMetadata.md +25 -0
- package/doc/sc/api/lib/zip/interfaces/IZipOutputByType.md +81 -0
- package/doc/sc/api/lib/zip/interfaces/IZipStats.md +49 -0
- package/doc/sc/api/lib/zip/type-aliases/TZipInputFileFormat.md +11 -0
- package/doc/sc/api/lib/zip/type-aliases/TZipInputType.md +11 -0
- package/doc/sc/api/lib/zip/type-aliases/TZipOutputType.md +11 -0
- package/doc/sc/api/lib/zlib/functions/brotliCompress.md +31 -0
- package/doc/sc/api/lib/zlib/functions/brotliDecompress.md +25 -0
- package/doc/sc/api/lib/zlib/functions/compress.md +37 -0
- package/doc/sc/api/lib/zlib/functions/createBrotliCompress.md +25 -0
- package/doc/sc/api/lib/zlib/functions/createBrotliDecompress.md +17 -0
- package/doc/sc/api/lib/zlib/functions/createCompress.md +31 -0
- package/doc/sc/api/lib/zlib/functions/createDecompress.md +25 -0
- package/doc/sc/api/lib/zlib/functions/createDeflate.md +25 -0
- package/doc/sc/api/lib/zlib/functions/createGunzip.md +17 -0
- package/doc/sc/api/lib/zlib/functions/createGzip.md +25 -0
- package/doc/sc/api/lib/zlib/functions/createInflate.md +17 -0
- package/doc/sc/api/lib/zlib/functions/decompress.md +31 -0
- package/doc/sc/api/lib/zlib/functions/deflate.md +31 -0
- package/doc/sc/api/lib/zlib/functions/gunzip.md +25 -0
- package/doc/sc/api/lib/zlib/functions/gzip.md +31 -0
- package/doc/sc/api/lib/zlib/functions/inflate.md +25 -0
- package/doc/sc/api/lib/zlib/index.md +31 -0
- package/doc/sc/api/lib/zlib/interfaces/ICompress.md +27 -0
- package/doc/sc/api/lib/zlib/interfaces/ICompressBuffer.md +27 -0
- package/doc/sc/api/main/index.md +7 -0
- package/doc/sc/api/sys/ctr/classes/Ctr.md +1242 -0
- package/doc/sc/api/sys/ctr/functions/clearLocaleData.md +17 -0
- package/doc/sc/api/sys/ctr/index.md +15 -0
- package/doc/sc/api/sys/mod/classes/Rows.md +165 -0
- package/doc/sc/api/sys/mod/classes/default.md +2175 -0
- package/doc/sc/api/sys/mod/index.md +21 -0
- package/doc/sc/api/sys/mod/interfaces/IModUnionItem.md +25 -0
- package/doc/sc/api/sys/mod/interfaces/IRows.md +57 -0
- package/doc/sc/api/sys/mod/type-aliases/TOnlyProperties.md +19 -0
- package/doc/sc/api/sys/route/functions/clearKebabConfigs.md +17 -0
- package/doc/sc/api/sys/route/functions/getFormData.md +47 -0
- package/doc/sc/api/sys/route/functions/getPost.md +25 -0
- package/doc/sc/api/sys/route/functions/run.md +83 -0
- package/doc/sc/api/sys/route/functions/unlinkUploadFiles.md +25 -0
- package/doc/sc/api/sys/route/functions/waitCtr.md +26 -0
- package/doc/sc/api/sys/route/index.md +16 -0
- package/doc/sc/quick-start.md +30 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/text.d.ts +12 -1
- package/lib/text.js +13 -15
- package/package.json +1 -1
- package/sys/child.js +9 -3
- package/sys/master.js +1 -1
- package/www/example/ctr/test.d.ts +1 -1
- package/www/example/ctr/test.js +17 -7
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../index.md) / sys/mod
|
|
6
|
+
|
|
7
|
+
# sys/mod
|
|
8
|
+
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
- [default](classes/default.md)
|
|
12
|
+
- [Rows](classes/Rows.md)
|
|
13
|
+
|
|
14
|
+
## Interfaces
|
|
15
|
+
|
|
16
|
+
- [IModUnionItem](interfaces/IModUnionItem.md)
|
|
17
|
+
- [IRows](interfaces/IRows.md)
|
|
18
|
+
|
|
19
|
+
## Type Aliases
|
|
20
|
+
|
|
21
|
+
- [TOnlyProperties](type-aliases/TOnlyProperties.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/mod](../index.md) / IModUnionItem
|
|
6
|
+
|
|
7
|
+
# Interface: IModUnionItem
|
|
8
|
+
|
|
9
|
+
Defined in: [sys/mod.ts:1766](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1766)
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### field
|
|
14
|
+
|
|
15
|
+
> **field**: `string`
|
|
16
|
+
|
|
17
|
+
Defined in: [sys/mod.ts:1767](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1767)
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### where?
|
|
22
|
+
|
|
23
|
+
> `optional` **where**: `any`
|
|
24
|
+
|
|
25
|
+
Defined in: [sys/mod.ts:1768](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1768)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/mod](../index.md) / IRows
|
|
6
|
+
|
|
7
|
+
# Interface: IRows\<T\>
|
|
8
|
+
|
|
9
|
+
Defined in: [sys/mod.ts:1760](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1760)
|
|
10
|
+
|
|
11
|
+
## Extends
|
|
12
|
+
|
|
13
|
+
- `Iterable`\<`T`\>
|
|
14
|
+
|
|
15
|
+
## Type Parameters
|
|
16
|
+
|
|
17
|
+
### T
|
|
18
|
+
|
|
19
|
+
`T`
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
### length
|
|
24
|
+
|
|
25
|
+
> `readonly` **length**: `number`
|
|
26
|
+
|
|
27
|
+
Defined in: [sys/mod.ts:1761](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1761)
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### item()
|
|
32
|
+
|
|
33
|
+
> **item**(`index`): `T`
|
|
34
|
+
|
|
35
|
+
Defined in: [sys/mod.ts:1762](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1762)
|
|
36
|
+
|
|
37
|
+
#### Parameters
|
|
38
|
+
|
|
39
|
+
##### index
|
|
40
|
+
|
|
41
|
+
`number`
|
|
42
|
+
|
|
43
|
+
#### Returns
|
|
44
|
+
|
|
45
|
+
`T`
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### toArray()
|
|
50
|
+
|
|
51
|
+
> **toArray**(): `Record`\<`string`, `any`\>[]
|
|
52
|
+
|
|
53
|
+
Defined in: [sys/mod.ts:1763](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1763)
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`Record`\<`string`, `any`\>[]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/mod](../index.md) / TOnlyProperties
|
|
6
|
+
|
|
7
|
+
# Type Alias: TOnlyProperties\<T\>
|
|
8
|
+
|
|
9
|
+
> **TOnlyProperties**\<`T`\> = `{ [K in keyof T as T[K] extends (args: any[]) => any ? never : K]: T[K] }`
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/mod.ts:14](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L14)
|
|
12
|
+
|
|
13
|
+
只获取变量
|
|
14
|
+
|
|
15
|
+
## Type Parameters
|
|
16
|
+
|
|
17
|
+
### T
|
|
18
|
+
|
|
19
|
+
`T`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / clearKebabConfigs
|
|
6
|
+
|
|
7
|
+
# Function: clearKebabConfigs()
|
|
8
|
+
|
|
9
|
+
> **clearKebabConfigs**(): `void`
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:30](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L30)
|
|
12
|
+
|
|
13
|
+
清除已经加载的虚拟主机配置文件
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
`void`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / getFormData
|
|
6
|
+
|
|
7
|
+
# Function: getFormData()
|
|
8
|
+
|
|
9
|
+
> **getFormData**(`req`, `events`): `Promise`\<`false` \| \{ `files`: `Record`\<`string`, [`IPostFile`](../../../index/interfaces/IPostFile.md) \| [`IPostFile`](../../../index/interfaces/IPostFile.md)[]\>; `post`: `Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>; \}\>
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:932](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L932)
|
|
12
|
+
|
|
13
|
+
获取 formdata 的 post
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### req
|
|
18
|
+
|
|
19
|
+
请求头
|
|
20
|
+
|
|
21
|
+
`IncomingMessage` | `Http2ServerRequest`
|
|
22
|
+
|
|
23
|
+
### events
|
|
24
|
+
|
|
25
|
+
文件处理情况
|
|
26
|
+
|
|
27
|
+
#### onfiledata?
|
|
28
|
+
|
|
29
|
+
(`chunk`) => `void`
|
|
30
|
+
|
|
31
|
+
文件上传时触发,仅 start 返回 true 时触发
|
|
32
|
+
|
|
33
|
+
#### onfileend?
|
|
34
|
+
|
|
35
|
+
() => `void`
|
|
36
|
+
|
|
37
|
+
文件上传结束时触发,仅 start 返回 true 时触发
|
|
38
|
+
|
|
39
|
+
#### onfilestart?
|
|
40
|
+
|
|
41
|
+
(`name`) => `boolean` \| `undefined`
|
|
42
|
+
|
|
43
|
+
文件开始上传时触发,返回 true 则跳过该文件的保存
|
|
44
|
+
|
|
45
|
+
## Returns
|
|
46
|
+
|
|
47
|
+
`Promise`\<`false` \| \{ `files`: `Record`\<`string`, [`IPostFile`](../../../index/interfaces/IPostFile.md) \| [`IPostFile`](../../../index/interfaces/IPostFile.md)[]\>; `post`: `Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>; \}\>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / getPost
|
|
6
|
+
|
|
7
|
+
# Function: getPost()
|
|
8
|
+
|
|
9
|
+
> **getPost**(`req`): `Promise`\<\{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:866](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L866)
|
|
12
|
+
|
|
13
|
+
获取 post 对象(通常已自动获取),如果是文件上传(formdata)的情况则不获取
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### req
|
|
18
|
+
|
|
19
|
+
请求对象
|
|
20
|
+
|
|
21
|
+
`IncomingMessage` | `Http2ServerRequest`
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<\{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / run
|
|
6
|
+
|
|
7
|
+
# Function: run()
|
|
8
|
+
|
|
9
|
+
> **run**(`data`): `Promise`\<`boolean`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:76](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L76)
|
|
12
|
+
|
|
13
|
+
若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### data
|
|
18
|
+
|
|
19
|
+
传导的数据
|
|
20
|
+
|
|
21
|
+
#### head?
|
|
22
|
+
|
|
23
|
+
`Buffer`\<`ArrayBufferLike`\>
|
|
24
|
+
|
|
25
|
+
WebSocket 的 head 数据
|
|
26
|
+
|
|
27
|
+
#### path
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
前面不带 /,末尾不一定,以用户请求为准
|
|
32
|
+
|
|
33
|
+
#### req
|
|
34
|
+
|
|
35
|
+
`IncomingMessage` \| `Http2ServerRequest`
|
|
36
|
+
|
|
37
|
+
#### res?
|
|
38
|
+
|
|
39
|
+
`Http2ServerResponse`\<`Http2ServerRequest`\> \| `ServerResponse`\<`IncomingMessage`\>
|
|
40
|
+
|
|
41
|
+
#### rootPath
|
|
42
|
+
|
|
43
|
+
`string`
|
|
44
|
+
|
|
45
|
+
虚拟主机当前动态目录的绝对根目录,末尾带 /
|
|
46
|
+
|
|
47
|
+
#### socket?
|
|
48
|
+
|
|
49
|
+
`Socket`
|
|
50
|
+
|
|
51
|
+
WebSocket 连接的 socket 对象
|
|
52
|
+
|
|
53
|
+
#### timer?
|
|
54
|
+
|
|
55
|
+
\{ `callback`: () => `void`; `timeout`: `number`; `timer`: `Timeout`; \}
|
|
56
|
+
|
|
57
|
+
timeout timer
|
|
58
|
+
|
|
59
|
+
#### timer.callback
|
|
60
|
+
|
|
61
|
+
() => `void`
|
|
62
|
+
|
|
63
|
+
#### timer.timeout
|
|
64
|
+
|
|
65
|
+
`number`
|
|
66
|
+
|
|
67
|
+
#### timer.timer
|
|
68
|
+
|
|
69
|
+
`Timeout`
|
|
70
|
+
|
|
71
|
+
#### uri
|
|
72
|
+
|
|
73
|
+
[`IUrlParse`](../../../index/interfaces/IUrlParse.md)
|
|
74
|
+
|
|
75
|
+
#### urlBase
|
|
76
|
+
|
|
77
|
+
`string`
|
|
78
|
+
|
|
79
|
+
base url,如 /abc/vhost/,前后都带 /
|
|
80
|
+
|
|
81
|
+
## Returns
|
|
82
|
+
|
|
83
|
+
`Promise`\<`boolean`\>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / unlinkUploadFiles
|
|
6
|
+
|
|
7
|
+
# Function: unlinkUploadFiles()
|
|
8
|
+
|
|
9
|
+
> **unlinkUploadFiles**(`cctr`): `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:825](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L825)
|
|
12
|
+
|
|
13
|
+
删除本次请求所有已上传的临时文件
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### cctr
|
|
18
|
+
|
|
19
|
+
Ctr 对象 或 files
|
|
20
|
+
|
|
21
|
+
[`Ctr`](../../ctr/classes/Ctr.md) | `Record`\<`string`, [`IPostFile`](../../../index/interfaces/IPostFile.md) \| [`IPostFile`](../../../index/interfaces/IPostFile.md)[]\>
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../../index.md) / [sys/route](../index.md) / waitCtr
|
|
6
|
+
|
|
7
|
+
# Function: waitCtr()
|
|
8
|
+
|
|
9
|
+
> **waitCtr**(`cctr`): `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [sys/route.ts:845](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L845)
|
|
12
|
+
|
|
13
|
+
等待异步任务结束,并删除临时文件,如果结束后还有事务没关闭,则会在本函数中打印控制台并且写入 log 文件
|
|
14
|
+
此时其实已经给客户端返回了,此处等待不消耗客户端的等待时间
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
### cctr
|
|
19
|
+
|
|
20
|
+
[`Ctr`](../../ctr/classes/Ctr.md)
|
|
21
|
+
|
|
22
|
+
要等待的控制器
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[**Documents for @maiyunnet/kebab**](../../index.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[Documents for @maiyunnet/kebab](../../index.md) / sys/route
|
|
6
|
+
|
|
7
|
+
# sys/route
|
|
8
|
+
|
|
9
|
+
## Functions
|
|
10
|
+
|
|
11
|
+
- [clearKebabConfigs](functions/clearKebabConfigs.md)
|
|
12
|
+
- [getFormData](functions/getFormData.md)
|
|
13
|
+
- [getPost](functions/getPost.md)
|
|
14
|
+
- [run](functions/run.md)
|
|
15
|
+
- [unlinkUploadFiles](functions/unlinkUploadFiles.md)
|
|
16
|
+
- [waitCtr](functions/waitCtr.md)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 快速开始
|
|
2
|
+
|
|
3
|
+
## 安装
|
|
4
|
+
|
|
5
|
+
执行 `npm i @maiyunnet/kebab` 安装最新版,安装后,执行 `npx kebab init` 进行初始化,然后执行 `npx kebab` 启动项目。
|
|
6
|
+
|
|
7
|
+
也可以使用 pm2 启动项目,执行 `pm2 start npx --name "kebab" -- kebab` 即可。
|
|
8
|
+
|
|
9
|
+
## 目录
|
|
10
|
+
|
|
11
|
+
项目初始化后,会生成一些基础文件和目录,介绍如下:
|
|
12
|
+
|
|
13
|
+
- `conf/`: 配置
|
|
14
|
+
- `cert/`: 证书
|
|
15
|
+
- `vhost/`: 虚拟主机配置
|
|
16
|
+
- `cert.json`: 框架自动引入的证书配置
|
|
17
|
+
- `config.json`: 框架的所有配置内容(如 db、kv 等连接信息也在本文件)
|
|
18
|
+
- `ftmp/`: 上传文件的临时存放
|
|
19
|
+
- `ind/`: 独立应用,可用 npx kebab --ind xxx 启动
|
|
20
|
+
- `lib/`: 用户编写的库
|
|
21
|
+
- `log/`: 日志
|
|
22
|
+
- `mod/`: 用户定义的模型
|
|
23
|
+
- `www/`: 网站根目录
|
|
24
|
+
- `站点名或网址` - 例如 example.com、example,可多层
|
|
25
|
+
- `ctr/`: 控制器目录
|
|
26
|
+
- `data/`: 数据目录,存放语言文件等
|
|
27
|
+
- `locale/`: 语言文件目录
|
|
28
|
+
- `stc/`: 静态资源目录
|
|
29
|
+
- `view/`: 视图目录,存放 ejs 文件
|
|
30
|
+
- `ws/`: WebSocket 目录
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '7.
|
|
9
|
+
export const VER = '7.6.1';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/text.d.ts
CHANGED
|
@@ -95,9 +95,20 @@ export declare function isIdCardCN(idcard: string): boolean;
|
|
|
95
95
|
/**
|
|
96
96
|
* --- 将对象转换为 query string ---
|
|
97
97
|
* @param query 要转换的对象
|
|
98
|
-
* @param encode
|
|
98
|
+
* @param encode 是否转义,默认为 true
|
|
99
99
|
*/
|
|
100
100
|
export declare function queryStringify(query: Record<string, any>, encode?: boolean): string;
|
|
101
|
+
/**
|
|
102
|
+
* --- 将对象转换为 query string ---
|
|
103
|
+
* @param query 要转换的对象
|
|
104
|
+
* @param options 选项
|
|
105
|
+
*/
|
|
106
|
+
export declare function queryStringify(query: Record<string, any>, options: {
|
|
107
|
+
/** --- 等号分隔符,默认 = --- */
|
|
108
|
+
'equal'?: string;
|
|
109
|
+
/** --- 连字符分隔符,默认 & --- */
|
|
110
|
+
'hyphen'?: string;
|
|
111
|
+
}): string;
|
|
101
112
|
/**
|
|
102
113
|
* --- 将 query string 转换为对象 ---
|
|
103
114
|
* @param query 要转换的字符串
|
package/lib/text.js
CHANGED
|
@@ -336,26 +336,24 @@ export function isIdCardCN(idcard) {
|
|
|
336
336
|
// --- 比较校验码 ---
|
|
337
337
|
return verifyCode === verifyCodeList[Number(mod)];
|
|
338
338
|
}
|
|
339
|
-
/**
|
|
340
|
-
* --- 将对象转换为 query string ---
|
|
341
|
-
* @param query 要转换的对象
|
|
342
|
-
* @param encode 是否转义
|
|
343
|
-
*/
|
|
344
339
|
export function queryStringify(query, encode = true) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
340
|
+
let isEncode = true;
|
|
341
|
+
let equal = '=';
|
|
342
|
+
let hyphen = '&';
|
|
343
|
+
if (typeof encode === 'object') {
|
|
344
|
+
equal = encode.equal ?? '=';
|
|
345
|
+
hyphen = encode.hyphen ?? '&';
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
isEncode = encode;
|
|
352
349
|
}
|
|
353
350
|
return Object.entries(query).map(([k, v]) => {
|
|
351
|
+
const key = isEncode ? encodeURIComponent(k) : k;
|
|
354
352
|
if (Array.isArray(v)) {
|
|
355
|
-
return v.map(
|
|
353
|
+
return v.map(i => `${key}${equal}${isEncode ? encodeURIComponent(i) : i}`).join(hyphen);
|
|
356
354
|
}
|
|
357
|
-
return `${
|
|
358
|
-
}).join(
|
|
355
|
+
return `${key}${equal}${isEncode ? encodeURIComponent(v) : v}`;
|
|
356
|
+
}).join(hyphen);
|
|
359
357
|
}
|
|
360
358
|
/**
|
|
361
359
|
* --- 将 query string 转换为对象 ---
|
package/package.json
CHANGED
package/sys/child.js
CHANGED
|
@@ -107,7 +107,9 @@ async function run() {
|
|
|
107
107
|
const host = (req.headers[':authority'] ?? req.headers['host'] ?? '');
|
|
108
108
|
if (!host) {
|
|
109
109
|
lCore.writeHead(res, 403);
|
|
110
|
-
res.end('403 Forbidden')
|
|
110
|
+
res.end('403 Forbidden', () => {
|
|
111
|
+
req.socket.destroy();
|
|
112
|
+
});
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
113
115
|
wrapWithLinkCount(host + req.url, () => requestHandler(req, res, true), '[CHILD][http2][request]');
|
|
@@ -126,7 +128,9 @@ async function run() {
|
|
|
126
128
|
if (!host) {
|
|
127
129
|
res.setHeader('x-kebab-error', '0');
|
|
128
130
|
lCore.writeHead(res, 403);
|
|
129
|
-
res.end()
|
|
131
|
+
res.end('403 Forbidden', () => {
|
|
132
|
+
req.socket.destroy();
|
|
133
|
+
});
|
|
130
134
|
return;
|
|
131
135
|
}
|
|
132
136
|
wrapWithLinkCount(host + (req.url ?? ''), () => requestHandler(req, res, false), '[CHILD][http][request]');
|
|
@@ -188,7 +192,9 @@ async function requestHandler(req, res, https) {
|
|
|
188
192
|
if (!vhost) {
|
|
189
193
|
res.setHeader('x-kebab-error', '1');
|
|
190
194
|
lCore.writeHead(res, 403);
|
|
191
|
-
res.end()
|
|
195
|
+
res.end('403 Forbidden', () => {
|
|
196
|
+
req.socket.destroy();
|
|
197
|
+
});
|
|
192
198
|
return;
|
|
193
199
|
/*
|
|
194
200
|
const text = '<h1>Kebab: No permissions</h1>host: ' + (req.headers[':authority'] as string | undefined ?? req.headers['host'] ?? '') + '<br>url: ' + (lText.htmlescape(req.url ?? ''));
|
package/sys/master.js
CHANGED
|
@@ -238,7 +238,7 @@ function createRpcListener() {
|
|
|
238
238
|
// --- 特殊文件不能覆盖 ---
|
|
239
239
|
continue;
|
|
240
240
|
}
|
|
241
|
-
if (fname.endsWith('.js.map') || fname.endsWith('.ts') || fname.endsWith('.gitignore')) {
|
|
241
|
+
if (fname.endsWith('.js.map') || fname.endsWith('.ts') || fname.endsWith('.gitignore') || fname.endsWith('.DS_Store')) {
|
|
242
242
|
// --- 测试或开发文件不覆盖 ---
|
|
243
243
|
continue;
|
|
244
244
|
}
|
package/www/example/ctr/test.js
CHANGED
|
@@ -2874,7 +2874,7 @@ const rtn = cons.migration(rows, newTables);</pre>`);
|
|
|
2874
2874
|
echo.push(JSON.stringify(rtn));
|
|
2875
2875
|
return echo.join('') + '<br><br>' + this._getEnd();
|
|
2876
2876
|
}
|
|
2877
|
-
text() {
|
|
2877
|
+
async text() {
|
|
2878
2878
|
const echo = `<pre>json_encode(lText.parseUrl('HtTp://uSer:pAss@sUBDom.TopdOm23.CoM:29819/Adm@xw2Ksiz/dszas?Mdi=KdiMs1&a=JDd#hehHe'))</pre>
|
|
2879
2879
|
${lText.htmlescape(JSON.stringify(lText.parseUrl('HtTp://uSer:pAss@sUBDom.TopdOm23.CoM:29819/Adm@xw2Ksiz/dszas?Mdi=KdiMs1&a=JDd#hehHe')))}
|
|
2880
2880
|
<pre>json_encode(lText.parseUrl('HtTp://uSer@sUBDom.TopdOm23.CoM/Admx%20w2Ksiz/dszas'))</pre>
|
|
@@ -2940,19 +2940,29 @@ ${JSON.stringify(lText.isDomain('www.xxx.com.cn'))}
|
|
|
2940
2940
|
<pre>lText.isDomain('com');</pre>
|
|
2941
2941
|
${JSON.stringify(lText.isDomain('com'))}
|
|
2942
2942
|
<pre>lText.parseDomain('www.xxx.com.cn');</pre>
|
|
2943
|
-
${JSON.stringify(lText.parseDomain('www.xxx.com.cn'))}
|
|
2943
|
+
${JSON.stringify(await lText.parseDomain('www.xxx.com.cn'))}
|
|
2944
2944
|
<pre>lText.parseDomain('www.xxx.us');</pre>
|
|
2945
|
-
${JSON.stringify(lText.parseDomain('www.xxx.us'))}
|
|
2945
|
+
${JSON.stringify(await lText.parseDomain('www.xxx.us'))}
|
|
2946
2946
|
<pre>lText.parseDomain('xxx.co.jp');</pre>
|
|
2947
|
-
${JSON.stringify(lText.parseDomain('xxx.co.jp'))}
|
|
2947
|
+
${JSON.stringify(await lText.parseDomain('xxx.co.jp'))}
|
|
2948
2948
|
<pre>lText.parseDomain('js.cn');</pre>
|
|
2949
|
-
${JSON.stringify(lText.parseDomain('js.cn'))}
|
|
2949
|
+
${JSON.stringify(await lText.parseDomain('js.cn'))}
|
|
2950
2950
|
<pre>lText.parseDomain('xxx.cn');</pre>
|
|
2951
|
-
${JSON.stringify(lText.parseDomain('xxx.cn'))}
|
|
2951
|
+
${JSON.stringify(await lText.parseDomain('xxx.cn'))}
|
|
2952
2952
|
<pre>lText.parseJson('{"num":90071992547409993149,"num2":3242354,"num3":"16565","str":"abc","bool":false}');</pre>
|
|
2953
2953
|
${lText.stringifyJson(lText.parseJson('{"num":90071992547409993149,"num2":3242354,"num3":"16565","str":"abc","bool":false}'))}
|
|
2954
2954
|
<pre>lText.isIdCardCN('110101200007284901')</pre>
|
|
2955
|
-
${JSON.stringify(lText.isIdCardCN('110101200007284901'))}
|
|
2955
|
+
${JSON.stringify(lText.isIdCardCN('110101200007284901'))}
|
|
2956
|
+
<pre>lText.queryStringify({'a': 1, 'b': '2'});</pre>
|
|
2957
|
+
${lText.queryStringify({ 'a': 1, 'b': '2' })}
|
|
2958
|
+
<pre>lText.queryStringify({ 'a': 1, 'b': '2' }, false);</pre>
|
|
2959
|
+
${lText.queryStringify({ 'a': 1, 'b': '2' }, false)}
|
|
2960
|
+
<pre>lText.queryStringify({ 'a': 1, 'b': '2' }, { 'equal': ':', 'hyphen': '|' });</pre>
|
|
2961
|
+
${lText.queryStringify({ 'a': 1, 'b': '2' }, { 'equal': ':', 'hyphen': '|' })}
|
|
2962
|
+
<pre>lText.queryStringify({ 'a': [1, 2], 'b': '3' }, { 'equal': ':', 'hyphen': '|' });</pre>
|
|
2963
|
+
${lText.queryStringify({ 'a': [1, 2], 'b': '3' }, { 'equal': ':', 'hyphen': '|' })}
|
|
2964
|
+
<pre>lText.queryStringify({ 'a': [1, 2], 'b': '3' }, { 'equal': '', 'hyphen': '' });</pre>
|
|
2965
|
+
${lText.queryStringify({ 'a': [1, 2], 'b': '3' }, { 'equal': '', 'hyphen': '' })}`;
|
|
2956
2966
|
return echo + '<br><br>' + this._getEnd();
|
|
2957
2967
|
}
|
|
2958
2968
|
time() {
|