Stop exporting SmsInput, which nothing exported takes
Mirror / push (push) Has been cancelled
Test / lint (pull_request) Successful in 22s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 30s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 30s
Test / test (26) (pull_request) Successful in 30s
Mirror / push (push) Has been cancelled
Test / lint (pull_request) Successful in 22s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 30s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 30s
Test / test (26) (pull_request) Successful in 30s
This commit is contained in:
@@ -74,6 +74,8 @@
|
|||||||
`alert_on_message_delivery` and `broadcast_area_identifier`, the names they read back under. The
|
`alert_on_message_delivery` and `broadcast_area_identifier`, the names they read back under. The
|
||||||
two alternate names are gone from `tlvs` too, which is now typed by `TlvName`: narrow a `string` with `isTlvName()` before indexing it.
|
two alternate names are gone from `tlvs` too, which is now typed by `TlvName`: narrow a `string` with `isTlvName()` before indexing it.
|
||||||
- `cmds.broadcast_sm_resp.tlvMap` is removed; nothing read it.
|
- `cmds.broadcast_sm_resp.tlvMap` is removed; nothing read it.
|
||||||
|
- The `SmsInput` type is no longer exported; nothing exported took one. Read the `Sms` an `sms`
|
||||||
|
event carries.
|
||||||
- `session.boundAs` and `session.peerInterfaceVersion` are read-only, and `session.loggedIn` is
|
- `session.boundAs` and `session.peerInterfaceVersion` are read-only, and `session.loggedIn` is
|
||||||
removed: read `session.boundAs !== undefined`. A session you wire yourself records the bind it
|
removed: read `session.boundAs !== undefined`. A session you wire yourself records the bind it
|
||||||
accepted or had accepted with `session.bound(bindType, declaredVersion)`, which returns `err` for a
|
accepted or had accepted with `session.bound(bindType, declaredVersion)`, which returns `err` for a
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import { IdleWaiters } from './idle-waiters.ts';
|
|||||||
import { createSms } from './sms.ts';
|
import { createSms } from './sms.ts';
|
||||||
import { retainedOctets } from './retained-pdu.ts';
|
import { retainedOctets } from './retained-pdu.ts';
|
||||||
|
|
||||||
type Send = (input: PduObjectInput) => Promise<Result<{ pduObj: PduObject }>>;
|
|
||||||
|
|
||||||
export type HeldMessagesOptions = {
|
export type HeldMessagesOptions = {
|
||||||
link: LinkLife;
|
link: LinkLife;
|
||||||
log: SmppLog;
|
log: SmppLog;
|
||||||
@@ -19,7 +17,7 @@ export type HeldMessagesOptions = {
|
|||||||
/** Injected so expiry can be exercised without a wall clock. */
|
/** Injected so expiry can be exercised without a wall clock. */
|
||||||
now?: (() => number) | undefined;
|
now?: (() => number) | undefined;
|
||||||
/** Past a drain's refusal, for a receipt the drain is itself waiting for. */
|
/** Past a drain's refusal, for a receipt the drain is itself waiting for. */
|
||||||
sendPastDrain: Send;
|
sendPastDrain: SmsHandlers['send'];
|
||||||
session: Session;
|
session: Session;
|
||||||
timeout: number;
|
timeout: number;
|
||||||
};
|
};
|
||||||
@@ -34,9 +32,9 @@ function keyOf(pduObjs: PduObject[]): string | undefined {
|
|||||||
type HoldRoute = Pick<HeldMessagesOptions, 'link' | 'sendPastDrain' | 'session'>;
|
type HoldRoute = Pick<HeldMessagesOptions, 'link' | 'sendPastDrain' | 'session'>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One message offered to the application, and the handlers its `Sms` answers through. A drain waits on it until the first of: `answered()`,
|
* One message offered to the application, and the handlers its `Sms` answers through. A drain
|
||||||
* every listener that took it rejecting, no listener taking it or one throwing, a later message on
|
* waits on it until the first of: `answered()`, every listener that took it rejecting, no listener
|
||||||
* its sequence number, its deadline, or the link going.
|
* taking it or one throwing, a later message on its sequence number, its deadline, or the link going.
|
||||||
*/
|
*/
|
||||||
export class MessageHold implements SmsHandlers {
|
export class MessageHold implements SmsHandlers {
|
||||||
private readonly generation: number;
|
private readonly generation: number;
|
||||||
@@ -160,14 +158,12 @@ export class HeldMessages {
|
|||||||
this.offered.get(message)?.listenerGaveUp();
|
this.offered.get(message)?.listenerGaveUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called by `MessageHold`; everything else asks the hold. */
|
|
||||||
holds(pduObjs: PduObject[]): boolean {
|
holds(pduObjs: PduObject[]): boolean {
|
||||||
const key = keyOf(pduObjs);
|
const key = keyOf(pduObjs);
|
||||||
|
|
||||||
return key !== undefined && this.held.get(key) === pduObjs;
|
return key !== undefined && this.held.get(key) === pduObjs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called by `MessageHold`; everything else releases through the hold. */
|
|
||||||
release(pduObjs: PduObject[]): void {
|
release(pduObjs: PduObject[]): void {
|
||||||
const key = keyOf(pduObjs);
|
const key = keyOf(pduObjs);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import type { Concat } from './concat.ts';
|
import type { Concat } from './concat.ts';
|
||||||
import type { DlrMerger } from './dlr-merger.ts';
|
import type { DlrMerger } from './dlr-merger.ts';
|
||||||
import type { ErrorName } from './defs/errors.ts';
|
import type { ErrorName } from './defs/errors.ts';
|
||||||
|
import type { HeldMessagesOptions } from './held-messages.ts';
|
||||||
import type { LinkLife } from './link-life.ts';
|
import type { LinkLife } from './link-life.ts';
|
||||||
import type { LostGroup, Refusal } from './reassembly.ts';
|
import type { LostGroup, Refusal } from './reassembly.ts';
|
||||||
import type { OnRequest } from './session-options.ts';
|
import type { OnRequest } from './session-options.ts';
|
||||||
import type { PduObject, PduObjectInput } from './pdu.ts';
|
import type { PduObject } from './pdu.ts';
|
||||||
import type { Result, VoidResult } from './result.ts';
|
import type { VoidResult } from './result.ts';
|
||||||
import type { Session } from './session.ts';
|
import type { Session } from './session.ts';
|
||||||
import type { SmppLog } from './log.ts';
|
import type { SmppLog } from './log.ts';
|
||||||
import type { SmsIdFormat } from './sms-id.ts';
|
import type { SmsIdFormat } from './sms-id.ts';
|
||||||
@@ -50,8 +51,7 @@ export type IncomingRequestsOptions = {
|
|||||||
maxReassembly?: number | undefined;
|
maxReassembly?: number | undefined;
|
||||||
onRequest?: OnRequest | undefined;
|
onRequest?: OnRequest | undefined;
|
||||||
reassemblyTimeout?: number | undefined;
|
reassemblyTimeout?: number | undefined;
|
||||||
/** Past a drain's refusal, for a receipt the drain is itself waiting for. */
|
sendPastDrain: HeldMessagesOptions['sendPastDrain'];
|
||||||
sendPastDrain: (input: PduObjectInput) => Promise<Result<{ pduObj: PduObject }>>;
|
|
||||||
session: Session;
|
session: Session;
|
||||||
smsIdFormat?: SmsIdFormat | undefined;
|
smsIdFormat?: SmsIdFormat | undefined;
|
||||||
systemId?: string | undefined;
|
systemId?: string | undefined;
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ export { uuidv7 } from './uuid.ts';
|
|||||||
|
|
||||||
export type { BindType, ClientOptions } from './client.ts';
|
export type { BindType, ClientOptions } from './client.ts';
|
||||||
export type { Dlr, Receipt } from './dlr.ts';
|
export type { Dlr, Receipt } from './dlr.ts';
|
||||||
export type { SendDlrResult, SendRespOptions, Sms, SmsInput } from './sms.ts';
|
export type { SendDlrResult, SendRespOptions, Sms } from './sms.ts';
|
||||||
export type { Concat } from './concat.ts';
|
export type { Concat } from './concat.ts';
|
||||||
export type { ConcatInfo } from './udh.ts';
|
export type { ConcatInfo } from './udh.ts';
|
||||||
export type { Result, VoidResult } from './result.ts';
|
export type { Result, VoidResult } from './result.ts';
|
||||||
|
|||||||
Reference in New Issue
Block a user