minitel-cloudflare-worker
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,10 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const minitel_standalone_1 = require("minitel-standalone"); | ||
const __1 = require(".."); | ||
exports.default = (0, __1.createMinipaviHandler)((stream) => { | ||
const minitel = new minitel_standalone_1.Minitel(stream, {}); | ||
minitel.appendChild(new minitel_standalone_1.TextNode('Hello world!', {}, minitel)); | ||
import { Minitel, TextNode } from 'minitel-standalone'; | ||
import { createMinipaviHandler } from '../index.js'; | ||
export default createMinipaviHandler((stream) => { | ||
const minitel = new Minitel(stream, {}); | ||
minitel.appendChild(new TextNode('Hello world!', {}, minitel)); | ||
minitel.renderToStream(); | ||
setTimeout(() => stream.end(), 10_000); | ||
}); |
@@ -1,16 +0,13 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createMinipaviHandler = createMinipaviHandler; | ||
const zod_1 = require("zod"); | ||
const node_stream_1 = require("node:stream"); | ||
const paviSchema = zod_1.z.object({ | ||
PAVI: zod_1.z.object({ | ||
version: zod_1.z.string().regex(/^(\d+\.)*\d+$/g), | ||
uniqueId: zod_1.z.string().regex(/^\d+$/g), | ||
remoteAddr: zod_1.z.string(), | ||
typesocket: zod_1.z.enum(['websocketssl', 'websocket', 'other']), | ||
versionminitel: zod_1.z.string().regex(/^\x01.{3}\x04$/g), | ||
content: zod_1.z.array(zod_1.z.string()), | ||
context: zod_1.z.any(), | ||
fctn: zod_1.z.enum([ | ||
import { z } from 'zod'; | ||
import { Duplex } from 'node:stream'; | ||
const paviSchema = z.object({ | ||
PAVI: z.object({ | ||
version: z.string().regex(/^(\d+\.)*\d+$/g), | ||
uniqueId: z.string().regex(/^\d+$/g), | ||
remoteAddr: z.string(), | ||
typesocket: z.enum(['websocketssl', 'websocket', 'other']), | ||
versionminitel: z.string().regex(/^\x01.{3}\x04$/g), | ||
content: z.array(z.string()), | ||
context: z.any(), | ||
fctn: z.enum([ | ||
'ENVOI', | ||
@@ -34,5 +31,5 @@ 'SUITE', | ||
}), | ||
URLPARAMS: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(), | ||
URLPARAMS: z.record(z.string(), z.string()).optional(), | ||
}); | ||
function createMinipaviHandler(minitelFactory, options = {}) { | ||
export function createMinipaviHandler(minitelFactory, options = {}) { | ||
const fullOptions = { | ||
@@ -57,3 +54,3 @@ version: '1.0', | ||
server.accept(); | ||
const stream = new node_stream_1.Duplex(); | ||
const stream = new Duplex(); | ||
server.addEventListener('message', (event) => stream.write(event.data)); | ||
@@ -60,0 +57,0 @@ stream.on('data', (data) => server.send(data)); |
{ | ||
"name": "minitel-cloudflare-worker", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A cloudflare worker for access through MiniPAVI", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"scripts": { | ||
@@ -24,3 +25,2 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
"dependencies": { | ||
"minitel-standalone": "^1.9.4", | ||
"zod": "^3.23.8" | ||
@@ -30,2 +30,3 @@ }, | ||
"@cloudflare/workers-types": "^4.20240725.0", | ||
"minitel-standalone": "^1.9.5", | ||
"prettier": "3.3.3", | ||
@@ -32,0 +33,0 @@ "typescript": "^5.5.4" |
import { Minitel, TextNode } from 'minitel-standalone'; | ||
import { createMinipaviHandler } from '..'; | ||
import { createMinipaviHandler } from '../index.js'; | ||
@@ -4,0 +4,0 @@ export default createMinipaviHandler( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
Yes
26073
4
378
- Removedminitel-standalone@^1.9.4
- Removedminitel-standalone@1.10.2(transitive)
- Removedword-wrap@1.2.5(transitive)