diff --git a/lib/debug.js b/lib/debug.js index 9b33353..97fb056 100644 --- a/lib/debug.js +++ b/lib/debug.js @@ -4,7 +4,7 @@ * Copyright 2022 AMRC. */ -import util from "util"; +import * as util from "util"; export class Debug { constructor (opts) { diff --git a/lib/deps.js b/lib/deps.js index 1d28b2d..2a0f746 100644 --- a/lib/deps.js +++ b/lib/deps.js @@ -32,6 +32,6 @@ export async function build_node_fetch () { return (url, opts) => got_fetch(`${url}`, opts); } -import sparkplug_payload from "sparkplug-payload"; +import * as sparkplug_payload from "sparkplug-payload"; export const SpB = sparkplug_payload.get("spBv1.0"); diff --git a/lib/service/auth.js b/lib/service/auth.js index 4f034f6..e966dd9 100644 --- a/lib/service/auth.js +++ b/lib/service/auth.js @@ -4,7 +4,7 @@ * Copyright 2022 AMRC. */ -import semver from "semver"; +import * as semver from "semver"; import { Address } from "../sparkplug/util.js"; diff --git a/lib/service/configdb-watcher.js b/lib/service/configdb-watcher.js index 39558ae..a317c1a 100644 --- a/lib/service/configdb-watcher.js +++ b/lib/service/configdb-watcher.js @@ -7,7 +7,7 @@ * required dependency on rxjs. */ -import rx from "rxjs"; +import * as rx from "rxjs"; export class ConfigDBWatcher { constructor (configdb, device) { diff --git a/lib/service/configdb.js b/lib/service/configdb.js index 301a0de..181a731 100644 --- a/lib/service/configdb.js +++ b/lib/service/configdb.js @@ -4,7 +4,7 @@ * Copyright 2022 AMRC. */ -import format from "util"; +import { format } from "util"; import { App, Service, Null as Null_UUID } from "../uuids.js"; diff --git a/lib/service/mqtt.js b/lib/service/mqtt.js index aab4c0e..74f15a7 100644 --- a/lib/service/mqtt.js +++ b/lib/service/mqtt.js @@ -4,8 +4,6 @@ * Copyright 2022 AMRC */ -import timers from "timers/promises"; - import { BasicSparkplugNode } from "../sparkplug/basic-node.js"; import { GSS, MQTT } from "../deps.js"; @@ -183,6 +181,7 @@ export default class MQTTInterface extends ServiceInterface { * make the Sparkplug Node code an optional dep in the future. */ async basic_sparkplug_node (opts) { return new BasicSparkplugNode({ + debug: this.debug, ...opts, mqttFactory: will => this.mqtt_client({ ...opts, will }), }); diff --git a/lib/service/service-interface.js b/lib/service/service-interface.js index 6b49423..e7f88a6 100644 --- a/lib/service/service-interface.js +++ b/lib/service/service-interface.js @@ -4,7 +4,7 @@ * Copyright 2022 AMRC. */ -import content_type from "content-type"; +import * as content_type from "content-type"; import Optional from "optional-js"; import { Service } from "../uuids.js"; diff --git a/package.json b/package.json index 4de8a3d..7fd7d06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@amrc-factoryplus/service-client", - "version": "1.3.5", + "version": "1.3.6", "description": "", "main": "lib/index.js", "type": "module",