1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ClientMsg = void 0;\nconst protobuf_encode_js_1 = require(\"../shared/protobuf_encode.js\");\nconst util_js_1 = require(\"../util.js\");\nfunction ClientMsg(w, msg) {\n if (msg.type === \"hello\") {\n w.message(1, msg, HelloMsg);\n } else if (msg.type === \"request\") {\n w.message(2, msg, RequestMsg);\n } else {\n throw (0, util_js_1.impossible)(msg, \"Impossible type of ClientMsg\");\n }\n}\nexports.ClientMsg = ClientMsg;\nfunction HelloMsg(w, msg) {\n if (msg.jwt !== undefined) {\n w.string(1, msg.jwt);\n }\n}\nfunction RequestMsg(w, msg) {\n w.int32(1, msg.requestId);\n const request = msg.request;\n if (request.type === \"open_stream\") {\n w.message(2, request, OpenStreamReq);\n } else if (request.type === \"close_stream\") {\n w.message(3, request, CloseStreamReq);\n } else if (request.type === \"execute\") {\n w.message(4, request, ExecuteReq);\n } else if (request.type === \"batch\") {\n w.message(5, request, BatchReq);\n } else if (request.type === \"open_cursor\") {\n w.message(6, request, OpenCursorReq);\n } else if (request.type === \"close_cursor\") {\n w.message(7, request, CloseCursorReq);\n } else if (request.type === \"fetch_cursor\") {\n w.message(8, request, FetchCursorReq);\n } else if (request.type === \"sequence\") {\n w.message(9, request, SequenceReq);\n } else if (request.type === \"describe\") {\n w.message(10, request, DescribeReq);\n } else if (request.type === \"store_sql\") {\n w.message(11, request, StoreSqlReq);\n } else if (request.type === \"close_sql\") {\n w.message(12, request, CloseSqlReq);\n } else if (request.type === \"get_autocommit\") {\n w.message(13, request, GetAutocommitReq);\n } else {\n throw (0, util_js_1.impossible)(request, \"Impossible type of Request\");\n }\n}\nfunction OpenStreamReq(w, msg) {\n w.int32(1, msg.streamId);\n}\nfunction CloseStreamReq(w, msg) {\n w.int32(1, msg.streamId);\n}\nfunction ExecuteReq(w, msg) {\n w.int32(1, msg.streamId);\n w.message(2, msg.stmt, protobuf_encode_js_1.Stmt);\n}\nfunction BatchReq(w, msg) {\n w.int32(1, msg.streamId);\n w.message(2, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction OpenCursorReq(w, msg) {\n w.int32(1, msg.streamId);\n w.int32(2, msg.cursorId);\n w.message(3, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction CloseCursorReq(w, msg) {\n w.int32(1, msg.cursorId);\n}\nfunction FetchCursorReq(w, msg) {\n w.int32(1, msg.cursorId);\n w.uint32(2, msg.maxCount);\n}\nfunction SequenceReq(w, msg) {\n w.int32(1, msg.streamId);\n if (msg.sql !== undefined) {\n w.string(2, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(3, msg.sqlId);\n }\n}\nfunction DescribeReq(w, msg) {\n w.int32(1, msg.streamId);\n if (msg.sql !== undefined) {\n w.string(2, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(3, msg.sqlId);\n }\n}\nfunction StoreSqlReq(w, msg) {\n w.int32(1, msg.sqlId);\n w.string(2, msg.sql);\n}\nfunction CloseSqlReq(w, msg) {\n w.int32(1, msg.sqlId);\n}\nfunction GetAutocommitReq(w, msg) {\n w.int32(1, msg.streamId);\n}","map":{"version":3,"names":["Object","defineProperty","exports","value","ClientMsg","protobuf_encode_js_1","require","util_js_1","w","msg","type","message","HelloMsg","RequestMsg","impossible","jwt","undefined","string","int32","requestId","request","OpenStreamReq","CloseStreamReq","ExecuteReq","BatchReq","OpenCursorReq","CloseCursorReq","FetchCursorReq","SequenceReq","DescribeReq","StoreSqlReq","CloseSqlReq","GetAutocommitReq","streamId","stmt","Stmt","batch","Batch","cursorId","uint32","maxCount","sql","sqlId"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-cjs/ws/protobuf_encode.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientMsg = void 0;\nconst protobuf_encode_js_1 = require(\"../shared/protobuf_encode.js\");\nconst util_js_1 = require(\"../util.js\");\nfunction ClientMsg(w, msg) {\n if (msg.type === \"hello\") {\n w.message(1, msg, HelloMsg);\n }\n else if (msg.type === \"request\") {\n w.message(2, msg, RequestMsg);\n }\n else {\n throw (0, util_js_1.impossible)(msg, \"Impossible type of ClientMsg\");\n }\n}\nexports.ClientMsg = ClientMsg;\nfunction HelloMsg(w, msg) {\n if (msg.jwt !== undefined) {\n w.string(1, msg.jwt);\n }\n}\nfunction RequestMsg(w, msg) {\n w.int32(1, msg.requestId);\n const request = msg.request;\n if (request.type === \"open_stream\") {\n w.message(2, request, OpenStreamReq);\n }\n else if (request.type === \"close_stream\") {\n w.message(3, request, CloseStreamReq);\n }\n else if (request.type === \"execute\") {\n w.message(4, request, ExecuteReq);\n }\n else if (request.type === \"batch\") {\n w.message(5, request, BatchReq);\n }\n else if (request.type === \"open_cursor\") {\n w.message(6, request, OpenCursorReq);\n }\n else if (request.type === \"close_cursor\") {\n w.message(7, request, CloseCursorReq);\n }\n else if (request.type === \"fetch_cursor\") {\n w.message(8, request, FetchCursorReq);\n }\n else if (request.type === \"sequence\") {\n w.message(9, request, SequenceReq);\n }\n else if (request.type === \"describe\") {\n w.message(10, request, DescribeReq);\n }\n else if (request.type === \"store_sql\") {\n w.message(11, request, StoreSqlReq);\n }\n else if (request.type === \"close_sql\") {\n w.message(12, request, CloseSqlReq);\n }\n else if (request.type === \"get_autocommit\") {\n w.message(13, request, GetAutocommitReq);\n }\n else {\n throw (0, util_js_1.impossible)(request, \"Impossible type of Request\");\n }\n}\nfunction OpenStreamReq(w, msg) {\n w.int32(1, msg.streamId);\n}\nfunction CloseStreamReq(w, msg) {\n w.int32(1, msg.streamId);\n}\nfunction ExecuteReq(w, msg) {\n w.int32(1, msg.streamId);\n w.message(2, msg.stmt, protobuf_encode_js_1.Stmt);\n}\nfunction BatchReq(w, msg) {\n w.int32(1, msg.streamId);\n w.message(2, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction OpenCursorReq(w, msg) {\n w.int32(1, msg.streamId);\n w.int32(2, msg.cursorId);\n w.message(3, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction CloseCursorReq(w, msg) {\n w.int32(1, msg.cursorId);\n}\nfunction FetchCursorReq(w, msg) {\n w.int32(1, msg.cursorId);\n w.uint32(2, msg.maxCount);\n}\nfunction SequenceReq(w, msg) {\n w.int32(1, msg.streamId);\n if (msg.sql !== undefined) {\n w.string(2, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(3, msg.sqlId);\n }\n}\nfunction DescribeReq(w, msg) {\n w.int32(1, msg.streamId);\n if (msg.sql !== undefined) {\n w.string(2, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(3, msg.sqlId);\n }\n}\nfunction StoreSqlReq(w, msg) {\n w.int32(1, msg.sqlId);\n w.string(2, msg.sql);\n}\nfunction CloseSqlReq(w, msg) {\n w.int32(1, msg.sqlId);\n}\nfunction GetAutocommitReq(w, msg) {\n w.int32(1, msg.streamId);\n}\n"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,SAAS,GAAG,KAAK,CAAC;AAC1B,MAAMC,oBAAoB,GAAGC,OAAO,CAAC,8BAA8B,CAAC;AACpE,MAAMC,SAAS,GAAGD,OAAO,CAAC,YAAY,CAAC;AACvC,SAASF,SAASA,CAACI,CAAC,EAAEC,GAAG,EAAE;EACvB,IAAIA,GAAG,CAACC,IAAI,KAAK,OAAO,EAAE;IACtBF,CAAC,CAACG,OAAO,CAAC,CAAC,EAAEF,GAAG,EAAEG,QAAQ,CAAC;EAC/B,CAAC,MACI,IAAIH,GAAG,CAACC,IAAI,KAAK,SAAS,EAAE;IAC7BF,CAAC,CAACG,OAAO,CAAC,CAAC,EAAEF,GAAG,EAAEI,UAAU,CAAC;EACjC,CAAC,MACI;IACD,MAAM,CAAC,CAAC,EAAEN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AC;EACxB;EACA,IAAIhC,GAAG,CAACiC,KAAK,KAAK1B,SAAS,EAAE;IACzBR,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACiC,KAAK,CAAC;EACzB;AACJ;AACA,SAASb,WAAWA,CAACrB,CAAC,EAAEC,GAAG,EAAE;EACzBD,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACwB,QAAQ,CAAC;EACxB,IAAIxB,GAAG,CAACgC,GAAG,KAAKzB,SAAS,EAAE;IACvBR,CAAC,CAACS,MAAM,CAAC,CAAC,EAAER,GAAG,CAACgC,GAAG,CAAC;EACxB;EACA,IAAIhC,GAAG,CAACiC,KAAK,KAAK1B,SAAS,EAAE;IACzBR,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACiC,KAAK,CAAC;EACzB;AACJ;AACA,SAASZ,WAAWA,CAACtB,CAAC,EAAEC,GAAG,EAAE;EACzBD,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACiC,KAAK,CAAC;EACrBlC,CAAC,CAACS,MAAM,CAAC,CAAC,EAAER,GAAG,CAACgC,GAAG,CAAC;AACxB;AACA,SAASV,WAAWA,CAACvB,CAAC,EAAEC,GAAG,EAAE;EACzBD,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACiC,KAAK,CAAC;AACzB;AACA,SAASV,gBAAgBA,CAACxB,CAAC,EAAEC,GAAG,EAAE;EAC9BD,CAAC,CAACU,KAAK,CAAC,CAAC,EAAET,GAAG,CAACwB,QAAQ,CAAC;AAC5B","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]} |