import express = require('express'); const updateState = (req: express.Request, res: express.Response): void => { // Do whater you want with req and response res.send('ok'); }; import { sevenLocalPubSubService } from '../localPubSub'; // Application links const shop: { [index: string]: string } = { staging: 'https://staging.seven-shop.7platform.net/?debugMode=true&ar=true', production: 'https://seven-shop.7platform.net/?debugMode=true&ar=true' }; const terminal: { [index: string]: string } = { staging: 'https://staging.seven-terminal.7platform.net/?debugMode=true&ar=true', production: 'https://seven-terminal.7platform.net/?debugMode=true&ar=true' }; export = { routes: { sps: [ { port: 7007, route: '/', response: { printers: [ { printer: { index: 10, languages: [], type: 'pos', queueName: 'srp320', model: 'Bixolon Srp320', manufacturer: 'Bixolon' } }, { printer: { index: 4, languages: [], type: 'pos', queueName: 'tsp100', model: 'StarTSP100', manufacturer: 'Star' } } ] }, method: 'get' }, { port: 7007, route: '/status', response: { jobs: 0, online: true, paused: false, printer_status: { online: true }, stopped: false }, method: 'get' }, { port: 7007, route: '/add_job', response: (req: express.Request, res: express.Response):void => { sevenLocalPubSubService.sendSocketMessage({ channel: 'SevenCLI.Print', type: 'printData', data: req.body }); res.status(200).send(); }, method: 'post' }, { port: 7007, route: '/get_printers', response: { printers: [ { Id: 88, Name: 'Star TSP100' }, { Id: 25, Name: 'Bixolon SRP-350plus' }, { Id: 35, Name: 'Custom KubeII' }, { Id: 30, Name: 'Custom Q3' }, { Id: 18, Name: 'Epson TM-T20II/TM-T20IV' }, { Id: 39, Name: 'Epson TM-T88IV' }, { Id: 2, Name: 'Generic Serial-Parallel 42' }, { Id: 29, Name: 'Nippon NP-3411D' }, { Id: 26, Name: 'Bixolon SRP-350 Plus II' }, { Id: 3, Name: 'Generic Serial-Parallel' }, { Id: 90, Name: 'Star TSP100/TSP650 Starline' }, { Id: 9, Name: 'XPrinter XP-T260M' }, { Id: 21, Name: 'Custom TL80' }, { Id: 31, Name: 'Custom VKP80II' }, { Id: 33, Name: 'Epson TM-T20' }, { Id: 87, Name: 'Star TSP100 ESCPOS 48' }, { Id: 89, Name: 'Starline Serial-Parallel' }, { Id: 10, Name: 'XPrinter XP-T80' }, { Id: 36, Name: 'Bixolon SRP-350' }, { Id: 11, Name: 'Sanei Electric ST1-K31' }, { Id: 66, Name: 'Bixolon E302' }, { Id: 34, Name: 'E-Pos TEP-220' }, { Id: 38, Name: 'Epson TM-T88III' }, { Id: 41, Name: 'Ocom OCPP-808' }, { Id: 12, Name: 'Posiflex PP-6900' }, { Id: 86, Name: 'Star TSP100 ESCPOS 42' }, { Id: 28, Name: 'Bixolon SRP-350III' }, { Id: 7, Name: 'Citizen CT-S4000' }, { Id: 16, Name: 'Custom TG2480H' }, { Id: 27, Name: 'Bixolon SRP-350 Plus III' }, { Id: 32, Name: 'Bixolon SRP-350II' }, { Id: 17, Name: 'Citizen CT-S310II' }, { Id: 80, Name: 'Datecs DPP-250' }, { Id: 8, Name: 'Epson TM-T70/TM-T88V' }, { Id: 20, Name: 'Rongta RP80-USE' }, { Id: 23, Name: 'Transact Epic880' }, { Id: 24, Name: 'Datecs EP-2000' }, { Id: 15, Name: 'Beijing Spirit Technology Development Co. SP-POS88V' } ] }, method: 'get' } ], nps: [ { port: 8080, route: '/detection', response: { Printers: [ { Type: '0x001f', Id: 10, Vendor: '0x1504', Name: 'Bixolon Srp320', Port: 'usb', logo_loaded: true }, { deviceUri: 'usb://Star/TSP143%20(STR_T-001)', Id: 4, Name: 'StarTSP100', logo_loaded: false } ] }, method: 'get' }, { port: 8080, route: '/stat/10', response: { Connected: true, Online: true, Paper: true, printer_id: 10 }, method: 'get' }, { port: 8080, route: '/stat/4', response: { Connected: true, Online: true, Paper: true, printer_id: '4', skipDiagnostics: true }, method: 'get' }, { port: 8080, route: '/stop_printer_checker/1', response: {}, method: 'get' }, { port: 8080, route: '/start_printer_checker/10', response: {}, method: 'get' }, { port: 8080, route: '/get_printers', response: { Printers: [ { Vendor: '0x2730', Device: '0x2008', Name: 'Citizen', Id: 8 }, { Vendor: '0x10c5', Device: '0x0007', Name: 'Sanei Electric', Id: 12 }, { Type: '0x001f', Id: 10, Vendor: '0x1504', Name: 'Bixolon Srp320', Port: 'usb' }, { deviceUri: 'usb://Star/TSP143%20(STR_T-001)', Id: 4, Name: 'StarTSP100' } ] }, method: 'get' }, { port: 8080, route: '/device_profiles', method: 'get', response: { '502d0d28-12a6-4327-9774-9cc0c3e4f4df': { device: { token: 'HbhxFVG8JbhBjgqlk0i5eimAXFhVw3o8rEM2Y1CqQUk=', uuid: 'a1a68d98-ddab-44c3-acba-02535b1e83f8', name: 'pandzic', deviceId: 9309 }, betshop: { uuid: '34827c72-ef9d-46e1-87aa-20d5c320419d', name: 'PF - Minja2', companyId: 1, displayId: 'Minja', betshopId: 1357, companyName: 'Prva Firma', companyUuid: 'b99752b3-443c-4c80-b559-945a95c4b805' } } } }, { port: 8080, route: '/add_device_profile', method: 'post', response: { ok: true } }, { port: 8080, route: '/local_devices_list', method: 'get', response: { localDevices: [{ discoveryCode: 'None', deviceName: 'Linux Sta', ipAddress: '192.168.34.160' }, { discoveryCode: 'None', deviceName: 'BMK', ipAddress: '192.168.34.190' }, { discoveryCode: 'None', deviceName: 'RTE - iv t', ipAddress: '192.168.34.167' }] } }, { port: 8080, route: '/device_power', method: 'post', response: { action: 'poweroff', token: 'wgo2eusv30khttq7pl4tybko7c0sp76s' } }, { port: 8080, route: '/restart_apps', method: 'post', response: { action: 'restart', token: 'wgo2eusv30khttq7pl4tybko7c0sp76s' } }, { port: 8080, route: '/printjob', method: 'post', response: {}, } ], connectionChecker: [ { port: 5051, route: '/get_status', response: { ok: 'true' }, method: 'get' }, ], fiscalPrint: [ { port: 8083, route: '/', method: 'get', response: { company: 'Livebet1x2', fiscalDeviceModel: 'DP-150', fiscalDriver: 'fiscalwire', printerStatus: '', ipAddress: 'None', settings: { ipAddress: 'None' }, availableSettings: { ipAddress: { required: true, type: 'string' } } } }, { port: 8083, route: '/fetchPrintedTickets', response: { tickets: [ { ticketStatus: 'finished', ticketId: '0X1QPCSQD', ticketpayin: 50.00, ticketDateTime: '2017-05-12 10:04:37', ticketAction: 'add' }, { ticketStatus: 'finished', ticketId: 'X217Q29II', ticketpayin: '50.00', ticketDateTime: '2017-05-12 10:08:39', ticketAction: 'cancel' } ] }, method: 'post' }, { port: 8083, route: '/get_licence_key', response: { pcName: 'ecr_DB4100000158', checksum: 'f6aaa44ea2637ce516d7fe787d6360b5e4ebaa', bdID: 24267057, commonAttr: { brand: '', cui: 24267057, societate: '' }, attributes: { Licenta_Module: [], DateContact: [ { valoare: 'management@vector-group.ro', tip: 'Email' }, { valoare: '0753083480', tip: 'Tel' } ], Licenta_App: [ { data_expirare: '2023-09-25', name: 'ecr_DB4100000158', sequence: 1, hdd_id: 'DB4100000158', main_version: 2018, tip_aplicatie: 'fiscalWireBasic' } ] }, clientName: 'Navigator Software SRL Corunca' }, method: 'get' }, ], appState: [ { route: '/update-state', response: updateState, method: 'get' }, ], }, applications: { shop, terminal, }, };