Move src into codec, protocol, messages, session, client and server
Mirror / push (push) Has been cancelled
Test / lint (pull_request) Successful in 22s
Test / test (18) (pull_request) Successful in 32s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 29s
Test / test (26) (pull_request) Successful in 36s

This commit is contained in:
2026-09-30 20:15:04 +02:00
parent 108eb1e5b2
commit 980e9d4569
79 changed files with 573 additions and 610 deletions
+2 -2
View File
@@ -3,8 +3,8 @@ import { readFileSync } from 'node:fs';
import test, { after, describe } from 'node:test';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import type { SmppServer } from '../src/server.ts';
import { server } from '../src/server.ts';
import type { SmppServer } from '../src/server/server.ts';
import { server } from '../src/server/server.ts';
const CLOUDHOPPER_HOST = process.env.CLOUDHOPPER_HOST ?? 'cloudhopper:8080';
const SMPP_PORT = Number(process.env.SMPP_PORT ?? '2775');
+1 -1
View File
@@ -32,7 +32,7 @@ services:
dumbclient-netns:
condition: service_started
# S9's comparison run: window below maxHeldMessages (1000, session-options.ts), where nothing
# S9's comparison run: window below maxHeldMessages (1000, options.ts), where nothing
# should ever be throttled - see findings/07-load.md.
dumbclient-w500:
build: ./interop-tests/peers/dumbclient
+3 -3
View File
@@ -3,7 +3,7 @@ import test, { after, describe } from 'node:test';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import type { LogMethod, SmppLog } from '../src/log.ts';
import { server } from '../src/server.ts';
import { server } from '../src/server/server.ts';
const SMPP_PORT = Number(process.env.SMPP_PORT ?? '2775');
/** Slower than every scenario's submission rate (2000/s for the window runs), so a real backlog
@@ -206,7 +206,7 @@ after(async () => {
// S9 (target 11) and the backpressure-at-server scenario: window 2000 at a high rate against a
// handler slowed enough to build a real backlog. window500 is the same shape with a window below
// maxHeldMessages (1000, session-options.ts defaults.maxHeldMessages), the bound past which a
// maxHeldMessages (1000, options.ts defaults.maxHeldMessages), the bound past which a
// peer's window is answered ESME_RTHROTTLED. smpp-dumb-client counts a throttled message as sent
// and never resends it, so window 2000 accounts for 20,000 as answered plus throttled.
const throttleMessage = 'session - unanswered messages at their bound, asking the peer to retry';
@@ -270,7 +270,7 @@ describe('S6 - idle peer, no enquire_link at all', () => {
assert.ok(bound, 'dumb-idle never submitted its one message');
// idleTimeout is 40s from the last byte the peer sent (its submit_sm), never from our own
// writes (link-timers.ts resets only on inbound data). This test may start running well
// writes (session/keepalive.ts resets only on inbound data). This test may start running well
// past that mark on its own (S9 above can take a minute) - statsFor(...).closed is set from
// a 'close' listener attached at session-creation time, so a close from before this test
// even started is still seen; budget is slack for a session that is still open, not a clock.
+8 -8
View File
@@ -1,18 +1,18 @@
import assert from 'node:assert/strict';
import http from 'node:http';
import test, { after, describe } from 'node:test';
import type { Dlr } from '../src/dlr.ts';
import type { EncodingName } from '../src/defs/encodings.ts';
import type { PduObject } from '../src/pdu.ts';
import type { Dlr } from '../src/protocol/receipt.ts';
import type { EncodingName } from '../src/codec/encodings.ts';
import type { PduObject } from '../src/codec/pdu.ts';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { ConcatReference } from '../src/udh.ts';
import { client } from '../src/client.ts';
import { ConcatReference } from '../src/protocol/udh.ts';
import { client } from '../src/client/client.ts';
import { closeAfter } from '../test/teardown.ts';
import { paramText } from '../src/defs/types.ts';
import { server } from '../src/server.ts';
import { paramText } from '../src/codec/field-types.ts';
import { server } from '../src/server/server.ts';
import { encodeMessage, splitMessage } from '../src/message.ts';
import { submitSmParams } from '../src/send-sms.ts';
import { submitSmParams } from '../src/messages/submit.ts';
const PEER_HOST = process.env.PEER_HOST ?? 'jasmin';
const PEER_PORT = Number(process.env.PEER_PORT ?? '2775');
+1 -1
View File
@@ -5,7 +5,7 @@ import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { PduRefusedError } from '../src/index.ts';
import { bareTlvHeader, pduBytes } from '../test/raw-pdus.ts';
import { server } from '../src/server.ts';
import { server } from '../src/server/server.ts';
const JSMPP_HOST = process.env.JSMPP_HOST ?? 'jsmpp:8080';
const SMPP_PORT = Number(process.env.SMPP_PORT ?? '2775');
+8 -8
View File
@@ -1,17 +1,17 @@
import assert from 'node:assert/strict';
import http from 'node:http';
import test, { after, describe } from 'node:test';
import type { MessageState } from '../src/defs/constants.ts';
import type { Dlr } from '../src/dlr.ts';
import type { MessageState } from '../src/codec/constants.ts';
import type { Dlr } from '../src/protocol/receipt.ts';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { ConcatReference } from '../src/udh.ts';
import { consts } from '../src/defs/constants.ts';
import { detect, encodings } from '../src/defs/encodings.ts';
import { paramText } from '../src/defs/types.ts';
import { server } from '../src/server.ts';
import { ConcatReference } from '../src/protocol/udh.ts';
import { consts } from '../src/codec/constants.ts';
import { detect, encodings } from '../src/codec/encodings.ts';
import { paramText } from '../src/codec/field-types.ts';
import { server } from '../src/server/server.ts';
import { splitMessage } from '../src/message.ts';
import { submitSmParams } from '../src/send-sms.ts';
import { submitSmParams } from '../src/messages/submit.ts';
// smsbox HTTP hosts, one per variant - all point at the same node:2775 SMPP server.
const MAIN_SMSBOX = process.env.MAIN_SMSBOX ?? 'kannel-smsbox:13013';
+1 -1
View File
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
import test, { after, describe } from 'node:test';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { paramText } from '../src/defs/types.ts';
import { paramText } from '../src/codec/field-types.ts';
import { isCommand, server } from '../src/index.ts';
const DRIVER = process.env.PHP_DRIVER ?? 'php:8080';
+2 -2
View File
@@ -2,8 +2,8 @@ import assert from 'node:assert/strict';
import test, { after, describe } from 'node:test';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { encodings } from '../src/defs/encodings.ts';
import { paramText } from '../src/defs/types.ts';
import { encodings } from '../src/codec/encodings.ts';
import { paramText } from '../src/codec/field-types.ts';
import { isCommand, server } from '../src/index.ts';
const DRIVER = process.env.PYTHON_DRIVER ?? 'python:8080';
+2 -2
View File
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import test, { after, describe } from 'node:test';
import type { Session } from '../src/session.ts';
import { server } from '../src/server.ts';
import { server } from '../src/server/server.ts';
const SMPP_PORT = Number(process.env.SMPP_PORT ?? '2775');
@@ -54,7 +54,7 @@ describe('smppload (blocked)', () => {
const refusal = await waitFor(() => sessionErr, 10_000);
assert.ok(refusal);
// maxPduLength (pdu-refusal.ts) is 1MiB; the corrupted command_length (0x2a shifted into the
// maxPduLength (codec/refusal.ts) is 1MiB; the corrupted command_length (0x2a shifted into the
// high bytes) reads as roughly 2.75M, so this is the "unreadable stream" teardown, not the
// "one bad PDU, link stays up" path - see AGENTS.md, "A stream this library cannot frame...".
assert.match(refusal.message, /Refusing a cmd_length of \d+/);
+8 -8
View File
@@ -1,16 +1,16 @@
import assert from 'node:assert/strict';
import test, { describe } from 'node:test';
import type { Dlr } from '../src/dlr.ts';
import type { EncodingName } from '../src/defs/encodings.ts';
import type { MessageDlr } from '../src/dlr-merger.ts';
import type { PduObject } from '../src/pdu.ts';
import type { Dlr } from '../src/protocol/receipt.ts';
import type { EncodingName } from '../src/codec/encodings.ts';
import type { MessageDlr } from '../src/messages/receipt-merge.ts';
import type { PduObject } from '../src/codec/pdu.ts';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { client } from '../src/client.ts';
import { client } from '../src/client/client.ts';
import { closeAfter } from '../test/teardown.ts';
import { consts } from '../src/defs/constants.ts';
import { paramText } from '../src/defs/types.ts';
import { server } from '../src/server.ts';
import { consts } from '../src/codec/constants.ts';
import { paramText } from '../src/codec/field-types.ts';
import { server } from '../src/server/server.ts';
const PEER_HOST = process.env.PEER_HOST ?? 'smppsim';
const PEER_PORT = Number(process.env.PEER_PORT ?? '2775');
+2 -2
View File
@@ -1,9 +1,9 @@
import assert from 'node:assert/strict';
import test, { describe } from 'node:test';
import type { Dlr } from '../src/dlr.ts';
import type { Dlr } from '../src/protocol/receipt.ts';
import type { Session } from '../src/session.ts';
import type { Sms } from '../src/sms.ts';
import { client } from '../src/client.ts';
import { client } from '../src/client/client.ts';
import { closeAfter } from '../test/teardown.ts';
const PEER_HOST = process.env.PEER_HOST ?? 'smscsim';