encrypted queryraw

This commit is contained in:
Rizky 2024-04-18 13:49:25 +07:00
parent 6a133b8f8e
commit 72038b9f68
4 changed files with 54 additions and 41 deletions

File diff suppressed because one or more lines are too long

View File

@ -67,6 +67,7 @@
"tinycolor2": "^1.6.0",
"ua-parser-js": "^1.0.37",
"uuid": "9.0.1",
"pako": "^2.1.0",
"wasm-gzip": "^2.0.3",
"web-utils": "workspace:*",
"y-pojo": "^0.0.8",
@ -74,6 +75,7 @@
"yjs-types": "^0.0.1"
},
"devDependencies": {
"@types/pako": "^2.0.3",
"@types/lodash.concat": "^4.5.8",
"@types/lodash.find": "^4.6.8",
"@types/lodash.findindex": "^4.6.8",

View File

@ -1,5 +1,6 @@
import hash_sum from "hash-sum";
import { fetchViaProxy } from "../proxy";
import pako from "pako";
export const dbProxy = (dburl: string) => {
const name = "";
@ -63,12 +64,19 @@ export const dbProxy = (dburl: string) => {
if (table.startsWith("$")) {
return (...params: any[]) => {
const bytes = pako.gzip(JSON.stringify(params));
return fetchSendDb(
{
name,
action: "query",
table,
params,
params: btoa(
bytes.reduce(
(acc, current) => acc + String.fromCharCode(current),
""
)
),
},
dburl
);

BIN
bun.lockb

Binary file not shown.