UNPKG

convex

Version:

Client for the Convex Cloud

52 lines (51 loc) 1.88 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var actions_impl_exports = {}; __export(actions_impl_exports, { setupActionDatabaseClient: () => setupActionDatabaseClient }); module.exports = __toCommonJS(actions_impl_exports); var import_values = require("../../values/index.js"); var import__ = require("../../index.js"); var import_syscall = require("./syscall.js"); function setupActionDatabaseClient(requestId) { return { runQuery: async (name, ...args) => { const syscallArgs = { name, args: (0, import_values.convexToJson)(args), version: import__.version, requestId }; const result = await (0, import_syscall.performAsyncSyscall)("actions/query", syscallArgs); return result; }, runMutation: async (name, ...args) => { const syscallArgs = { name, args: (0, import_values.convexToJson)(args), version: import__.version, requestId }; const result = await (0, import_syscall.performAsyncSyscall)("actions/mutation", syscallArgs); return result; } }; } //# sourceMappingURL=actions_impl.js.map