UNPKG

@cocalc/server

Version:

CoCalc server functionality: functions used by either the hub and the next.js server

36 lines (30 loc) 1.43 kB
"use strict"; /* Use the project hub socket API to communicate with the project. The supported messages are implemented here in the project: cocalc/src/packages/project/servers/hub/handle-message.ts and messages must be defined as in cocalc/src/packages/util/message.js and they include: - ping: for testing; returns a pong - heartbeat: used for maintaining the connection - named_server_port: finding out the port used by jupyter, jupyterlab, etc. - project_exec: run shell command - read_file_from_project: reads file and stores it as a blob in the database. blob expires in 24 hours. - write_file_to_project: write abitrary file to disk in project (goes via a blob) - write_text_file_to_project: write a text file, whose contents is in the message, to the project. - print_to_pdf: tells sage worksheet to print - send_signal: send a signal to a process */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const handle_message_1 = require("./handle-message"); const connect_1 = __importDefault(require("./connect")); async function call({ project_id, mesg, }) { const socket = await (0, connect_1.default)(project_id); return await (0, handle_message_1.callProjectMessage)({ mesg, socket }); } exports.default = call; //# sourceMappingURL=call.js.map