@uns-kit/core 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-file.d.ts +2 -2
- package/dist/config-file.js +1 -1
- package/dist/examples/data-example.js +5 -5
- package/dist/examples/load-test-data.js +3 -3
- package/dist/examples/table-example.js +4 -4
- package/dist/examples/uns-gateway.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/tools/auth/auth-client.js +2 -2
- package/dist/tools/auth/index.d.ts +1 -1
- package/dist/tools/auth/index.js +1 -1
- package/dist/tools/generate-config-schema.js +3 -3
- package/dist/tools/initialize.js +1 -1
- package/dist/tools/make.js +1 -1
- package/dist/tools/pull-request.js +2 -2
- package/dist/tools/refresh-uns.js +3 -3
- package/dist/tools/update-rtt.js +1 -1
- package/dist/tools/update-tools.js +1 -1
- package/dist/uns/handover-manager.d.ts +5 -5
- package/dist/uns/handover-manager.js +4 -4
- package/dist/uns/process-config.js +1 -1
- package/dist/uns/process-name-service.js +2 -2
- package/dist/uns/status-monitor.d.ts +1 -1
- package/dist/uns/status-monitor.js +3 -3
- package/dist/uns/uns-interfaces.d.ts +4 -4
- package/dist/uns/uns-packet.d.ts +1 -1
- package/dist/uns/uns-packet.js +2 -2
- package/dist/uns/uns-proxy-process.d.ts +2 -2
- package/dist/uns/uns-proxy-process.js +9 -9
- package/dist/uns/uns-proxy.d.ts +2 -2
- package/dist/uns/uns-proxy.js +3 -3
- package/dist/uns-config/config-schema.js +3 -3
- package/dist/uns-config/secret-resolver.d.ts +3 -3
- package/dist/uns-config/secret-resolver.js +2 -2
- package/dist/uns-config/uns-core-schema.js +2 -2
- package/dist/uns-grpc/uns-gateway-cli.js +1 -1
- package/dist/uns-grpc/uns-gateway-server.js +6 -6
- package/dist/uns-mqtt/mqtt-proxy.d.ts +4 -4
- package/dist/uns-mqtt/mqtt-proxy.js +3 -3
- package/dist/uns-mqtt/mqtt-worker-init.js +1 -1
- package/dist/uns-mqtt/mqtt-worker.d.ts +2 -2
- package/dist/uns-mqtt/mqtt-worker.js +4 -4
- package/dist/uns-mqtt/throttled-queue.js +2 -2
- package/dist/uns-mqtt/uns-mqtt-proxy.d.ts +2 -2
- package/dist/uns-mqtt/uns-mqtt-proxy.js +6 -6
- package/dist/uns-mqtt/ws-proxy.js +1 -1
- package/package.json +1 -1
package/dist/config-file.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppConfig } from "./app-config";
|
|
2
|
-
import { type ResolvedAppConfig, type SecretResolverOptions } from "./uns-config/secret-resolver";
|
|
1
|
+
import type { AppConfig } from "./app-config.js";
|
|
2
|
+
import { type ResolvedAppConfig, type SecretResolverOptions } from "./uns-config/secret-resolver.js";
|
|
3
3
|
export declare class ConfigFile {
|
|
4
4
|
private static rawCache?;
|
|
5
5
|
private static rawPath?;
|
package/dist/config-file.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { clearSecretResolverCaches, resolveConfigSecrets, } from "./uns-config/secret-resolver";
|
|
3
|
+
import { clearSecretResolverCaches, resolveConfigSecrets, } from "./uns-config/secret-resolver.js";
|
|
4
4
|
const hasOptions = (options) => !!options && Object.values(options).some(value => value !== undefined);
|
|
5
5
|
export class ConfigFile {
|
|
6
6
|
static rawCache;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Change this file according to your specifications and rename it to index.ts
|
|
3
3
|
*/
|
|
4
|
-
import UnsProxyProcess from "../uns/uns-proxy-process";
|
|
5
|
-
import { ConfigFile } from "../config-file";
|
|
6
|
-
import logger from "../logger";
|
|
7
|
-
import { PhysicalMeasurements } from "../uns/uns-measurements";
|
|
8
|
-
import { UnsPacket } from "../uns/uns-packet";
|
|
4
|
+
import UnsProxyProcess from "../uns/uns-proxy-process.js";
|
|
5
|
+
import { ConfigFile } from "../config-file.js";
|
|
6
|
+
import logger from "../logger.js";
|
|
7
|
+
import { PhysicalMeasurements } from "../uns/uns-measurements.js";
|
|
8
|
+
import { UnsPacket } from "../uns/uns-packet.js";
|
|
9
9
|
/**
|
|
10
10
|
* Load the configuration from a file.
|
|
11
11
|
* On the server, this file is provided by the `uns-datahub-controller`.
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* In the development environment, you are responsible for creating and maintaining this file and its contents.
|
|
5
5
|
*/
|
|
6
6
|
import readline from "readline";
|
|
7
|
-
import { ConfigFile } from "../config-file";
|
|
8
|
-
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy";
|
|
9
|
-
import logger from "../logger";
|
|
7
|
+
import { ConfigFile } from "../config-file.js";
|
|
8
|
+
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy.js";
|
|
9
|
+
import logger from "../logger.js";
|
|
10
10
|
/**
|
|
11
11
|
* This script initializes an MQTT output proxy for load testing purposes.
|
|
12
12
|
* It sets up a connection to the specified MQTT broker and configures
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Change this file according to your specifications and rename it to index.ts
|
|
3
3
|
*/
|
|
4
|
-
import UnsProxyProcess from "../uns/uns-proxy-process";
|
|
5
|
-
import { ConfigFile } from "../config-file";
|
|
6
|
-
import logger from "../logger";
|
|
7
|
-
import { UnsPacket } from "../uns/uns-packet";
|
|
4
|
+
import UnsProxyProcess from "../uns/uns-proxy-process.js";
|
|
5
|
+
import { ConfigFile } from "../config-file.js";
|
|
6
|
+
import logger from "../logger.js";
|
|
7
|
+
import { UnsPacket } from "../uns/uns-packet.js";
|
|
8
8
|
/**
|
|
9
9
|
* Load the configuration from a file.
|
|
10
10
|
* On the server, this file is provided by the `uns-datahub-controller`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as UnsProxyProcess } from "./uns/uns-proxy-process";
|
|
2
|
-
export type { UnsProxyProcessPlugin, UnsProxyProcessPluginApi, UnsProxyProcessPluginMethod, UnsProxyProcessPluginMethods, } from "./uns/uns-proxy-process";
|
|
3
|
-
export * from "./uns/uns-interfaces";
|
|
4
|
-
export { ConfigFile } from "./config-file";
|
|
5
|
-
export { default as logger } from "./logger";
|
|
1
|
+
export { default as UnsProxyProcess } from "./uns/uns-proxy-process.js";
|
|
2
|
+
export type { UnsProxyProcessPlugin, UnsProxyProcessPluginApi, UnsProxyProcessPluginMethod, UnsProxyProcessPluginMethods, } from "./uns/uns-proxy-process.js";
|
|
3
|
+
export * from "./uns/uns-interfaces.js";
|
|
4
|
+
export { ConfigFile } from "./config-file.js";
|
|
5
|
+
export { default as logger } from "./logger.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as UnsProxyProcess } from "./uns/uns-proxy-process";
|
|
2
|
-
export * from "./uns/uns-interfaces";
|
|
3
|
-
export { ConfigFile } from "./config-file";
|
|
4
|
-
export { default as logger } from "./logger";
|
|
1
|
+
export { default as UnsProxyProcess } from "./uns/uns-proxy-process.js";
|
|
2
|
+
export * from "./uns/uns-interfaces.js";
|
|
3
|
+
export { ConfigFile } from "./config-file.js";
|
|
4
|
+
export { default as logger } from "./logger.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigFile } from "../../config-file";
|
|
2
|
-
import { SecureStoreFactory } from "./secure-store";
|
|
1
|
+
import { ConfigFile } from "../../config-file.js";
|
|
2
|
+
import { SecureStoreFactory } from "./secure-store.js";
|
|
3
3
|
import jwt from "jsonwebtoken";
|
|
4
4
|
import readline from "readline";
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AuthClient } from "./auth-client";
|
|
1
|
+
export { AuthClient } from "./auth-client.js";
|
package/dist/tools/auth/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AuthClient } from "./auth-client";
|
|
1
|
+
export { AuthClient } from "./auth-client.js";
|
|
@@ -3,9 +3,9 @@ import path from "node:path";
|
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
5
5
|
import { zodToTs, printNode } from "zod-to-ts";
|
|
6
|
-
import { composeConfigSchema } from "../uns-config/schema-tools";
|
|
7
|
-
import { unsCoreSchema } from "../uns-config/uns-core-schema";
|
|
8
|
-
import { projectExtrasSchema as coreProjectExtrasSchema } from "../config/project.config.extension";
|
|
6
|
+
import { composeConfigSchema } from "../uns-config/schema-tools.js";
|
|
7
|
+
import { unsCoreSchema } from "../uns-config/uns-core-schema.js";
|
|
8
|
+
import { projectExtrasSchema as coreProjectExtrasSchema } from "../config/project.config.extension.js";
|
|
9
9
|
function write(filePath, data) {
|
|
10
10
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
11
11
|
fs.writeFileSync(filePath, data);
|
package/dist/tools/initialize.js
CHANGED
|
@@ -5,7 +5,7 @@ import readline from "node:readline";
|
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { CleanOptions, simpleGit } from "simple-git";
|
|
7
7
|
import fs from "fs-extra";
|
|
8
|
-
import { basePath } from "./base-path";
|
|
8
|
+
import { basePath } from "./base-path.js";
|
|
9
9
|
const git = simpleGit("./").clean(CleanOptions.FORCE);
|
|
10
10
|
export const packageJsonPath = path.join(basePath, "package.json");
|
|
11
11
|
const orgUrl = "https://sijit@dev.azure.com/sijit";
|
package/dist/tools/make.js
CHANGED
|
@@ -8,8 +8,8 @@ import * as path from "path";
|
|
|
8
8
|
import * as prettier from "prettier";
|
|
9
9
|
import { CleanOptions, simpleGit } from "simple-git";
|
|
10
10
|
import util from "util";
|
|
11
|
-
import { ConfigFile } from "../config-file";
|
|
12
|
-
import { basePath } from "../base-path";
|
|
11
|
+
import { ConfigFile } from "../config-file.js";
|
|
12
|
+
import { basePath } from "../base-path.js";
|
|
13
13
|
const rl = readline.createInterface({
|
|
14
14
|
input: process.stdin,
|
|
15
15
|
output: process.stdout,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GraphQLClient, gql, ClientError } from "graphql-request";
|
|
2
|
-
import { basePath } from "./base-path";
|
|
2
|
+
import { basePath } from "./base-path.js";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import * as fs from 'fs';
|
|
5
|
-
import { ConfigFile } from "../config-file";
|
|
6
|
-
import { AuthClient } from "./auth/index";
|
|
5
|
+
import { ConfigFile } from "../config-file.js";
|
|
6
|
+
import { AuthClient } from "./auth/index.js";
|
|
7
7
|
const config = await ConfigFile.loadConfig();
|
|
8
8
|
// Helper function to write content to a file
|
|
9
9
|
async function writeToFile(filePath, content) {
|
package/dist/tools/update-rtt.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UnsEvents } from "./uns-interfaces";
|
|
2
|
-
import { HandoverManagerEventEmitter } from "./handover-manager-event-emitter";
|
|
3
|
-
import { HandoverManagerEvents } from "../uns-mqtt/mqtt-interfaces";
|
|
4
|
-
import MqttProxy from "../uns-mqtt/mqtt-proxy";
|
|
5
|
-
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy";
|
|
1
|
+
import { UnsEvents } from "./uns-interfaces.js";
|
|
2
|
+
import { HandoverManagerEventEmitter } from "./handover-manager-event-emitter.js";
|
|
3
|
+
import { HandoverManagerEvents } from "../uns-mqtt/mqtt-interfaces.js";
|
|
4
|
+
import MqttProxy from "../uns-mqtt/mqtt-proxy.js";
|
|
5
|
+
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy.js";
|
|
6
6
|
/**
|
|
7
7
|
* HandoverManager is responsible for all handover-related logic,
|
|
8
8
|
* including handling incoming MQTT messages, issuing handover requests,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import logger from "../logger";
|
|
2
|
-
import { HandoverManagerEventEmitter } from "./handover-manager-event-emitter";
|
|
3
|
-
import { MqttTopicBuilder } from "../uns-mqtt/mqtt-topic-builder";
|
|
4
|
-
import { ACTIVE_TIMEOUT, PACKAGE_INFO } from "./process-config";
|
|
1
|
+
import logger from "../logger.js";
|
|
2
|
+
import { HandoverManagerEventEmitter } from "./handover-manager-event-emitter.js";
|
|
3
|
+
import { MqttTopicBuilder } from "../uns-mqtt/mqtt-topic-builder.js";
|
|
4
|
+
import { ACTIVE_TIMEOUT, PACKAGE_INFO } from "./process-config.js";
|
|
5
5
|
/**
|
|
6
6
|
* HandoverManager is responsible for all handover-related logic,
|
|
7
7
|
* including handling incoming MQTT messages, issuing handover requests,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// process-config.ts
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
|
-
import { basePath } from "../base-path";
|
|
4
|
+
import { basePath } from "../base-path.js";
|
|
5
5
|
// Path to the process name file
|
|
6
6
|
export const PROCESS_NAME_FILE = path.join(basePath, "uns-process-name.conf");
|
|
7
7
|
// Path to package.json to retrieve package name and version
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "fs";
|
|
2
|
-
import { PROCESS_NAME_FILE } from "./process-config";
|
|
3
|
-
import logger from "../logger";
|
|
2
|
+
import { PROCESS_NAME_FILE } from "./process-config.js";
|
|
3
|
+
import logger from "../logger.js";
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves a persistent process name.
|
|
6
6
|
* - Checks if a process name is provided via command-line args.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// status-monitor.ts
|
|
2
|
-
import logger from "../logger";
|
|
3
|
-
import { DataSizeMeasurements } from "./uns-measurements";
|
|
4
|
-
import { UnsPacket } from "./uns-packet";
|
|
2
|
+
import logger from "../logger.js";
|
|
3
|
+
import { DataSizeMeasurements } from "./uns-measurements.js";
|
|
4
|
+
import { UnsPacket } from "./uns-packet.js";
|
|
5
5
|
export class StatusMonitor {
|
|
6
6
|
mqttProxy;
|
|
7
7
|
processStatusTopic;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UnsAttributeType } from "../graphql/schema";
|
|
2
|
-
import { MeasurementUnit } from "./uns-measurements";
|
|
3
|
-
import { UnsTags } from "./uns-tags";
|
|
4
|
-
import { UnsTopics } from "./uns-topics";
|
|
1
|
+
import { UnsAttributeType } from "../graphql/schema.js";
|
|
2
|
+
import { MeasurementUnit } from "./uns-measurements.js";
|
|
3
|
+
import { UnsTags } from "./uns-tags.js";
|
|
4
|
+
import { UnsTopics } from "./uns-topics.js";
|
|
5
5
|
export type ISO8601 = `${number}-${string}-${string}T${string}:${string}:${string}.${string}Z`;
|
|
6
6
|
export declare function isIOS8601Type(value: string): value is ISO8601;
|
|
7
7
|
export type UnsAttribute = string;
|
package/dist/uns/uns-packet.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUnsPacket, ISO8601, IUnsMessage, IUnsPackatParameters } from "./uns-interfaces";
|
|
1
|
+
import { IUnsPacket, ISO8601, IUnsMessage, IUnsPackatParameters } from "./uns-interfaces.js";
|
|
2
2
|
export declare class UnsPacket {
|
|
3
3
|
/**
|
|
4
4
|
* The given TypeScript function parseMqttPacket is used to parse an MQTT packet,
|
package/dist/uns/uns-packet.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as crypto from "crypto";
|
|
2
2
|
import * as zlib from "zlib";
|
|
3
|
-
import logger from '../logger';
|
|
4
|
-
import { isIOS8601Type } from "./uns-interfaces";
|
|
3
|
+
import logger from '../logger.js';
|
|
4
|
+
import { isIOS8601Type } from "./uns-interfaces.js";
|
|
5
5
|
// Version of the packet library
|
|
6
6
|
const unsPacketVersion = "1.2.0";
|
|
7
7
|
export class UnsPacket {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IUnsParameters, IUnsProcessParameters } from "./uns-interfaces";
|
|
2
|
-
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy";
|
|
1
|
+
import { IUnsParameters, IUnsProcessParameters } from "./uns-interfaces.js";
|
|
2
|
+
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy.js";
|
|
3
3
|
/**
|
|
4
4
|
* UnsProxyProcess is responsible for managing the process lifecycle,
|
|
5
5
|
* configuring MQTT (subscriptions and publishing for status updates), and
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import logger from "../logger";
|
|
2
|
-
import MqttProxy from "../uns-mqtt/mqtt-proxy";
|
|
3
|
-
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy";
|
|
4
|
-
import { HandoverManager } from "./handover-manager";
|
|
1
|
+
import logger from "../logger.js";
|
|
2
|
+
import MqttProxy from "../uns-mqtt/mqtt-proxy.js";
|
|
3
|
+
import UnsMqttProxy from "../uns-mqtt/uns-mqtt-proxy.js";
|
|
4
|
+
import { HandoverManager } from "./handover-manager.js";
|
|
5
5
|
// Import configuration and initialization modules.
|
|
6
|
-
import { PACKAGE_INFO, MQTT_UPDATE_INTERVAL } from "./process-config";
|
|
7
|
-
import { getProcessName } from "./process-name-service";
|
|
8
|
-
import { MqttTopicBuilder } from "../uns-mqtt/mqtt-topic-builder";
|
|
9
|
-
import { StatusMonitor } from "./status-monitor";
|
|
10
|
-
import { UnsPacket } from "./uns-packet";
|
|
6
|
+
import { PACKAGE_INFO, MQTT_UPDATE_INTERVAL } from "./process-config.js";
|
|
7
|
+
import { getProcessName } from "./process-name-service.js";
|
|
8
|
+
import { MqttTopicBuilder } from "../uns-mqtt/mqtt-topic-builder.js";
|
|
9
|
+
import { StatusMonitor } from "./status-monitor.js";
|
|
10
|
+
import { UnsPacket } from "./uns-packet.js";
|
|
11
11
|
class UnsProxyProcess {
|
|
12
12
|
active = false;
|
|
13
13
|
processStatusTopic;
|
package/dist/uns/uns-proxy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IApiObject, ITopicObject, UnsEvents } from "./uns-interfaces";
|
|
2
|
-
import { UnsEventEmitter } from "./uns-event-emitter";
|
|
1
|
+
import { IApiObject, ITopicObject, UnsEvents } from "./uns-interfaces.js";
|
|
2
|
+
import { UnsEventEmitter } from "./uns-event-emitter.js";
|
|
3
3
|
export default class UnsProxy {
|
|
4
4
|
private publishInterval;
|
|
5
5
|
event: UnsEventEmitter<UnsEvents>;
|
package/dist/uns/uns-proxy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import logger from "../logger";
|
|
2
|
-
import { UnsEventEmitter } from "./uns-event-emitter";
|
|
3
|
-
import { UnsPacket } from "./uns-packet";
|
|
1
|
+
import logger from "../logger.js";
|
|
2
|
+
import { UnsEventEmitter } from "./uns-event-emitter.js";
|
|
3
|
+
import { UnsPacket } from "./uns-packet.js";
|
|
4
4
|
export default class UnsProxy {
|
|
5
5
|
publishInterval = null;
|
|
6
6
|
event = new UnsEventEmitter();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { composeConfigSchema } from "./schema-tools";
|
|
2
|
-
import { unsCoreSchema } from "./uns-core-schema";
|
|
3
|
-
import { projectExtrasSchema } from "../config/project.config.extension";
|
|
1
|
+
import { composeConfigSchema } from "./schema-tools.js";
|
|
2
|
+
import { unsCoreSchema } from "./uns-core-schema.js";
|
|
3
|
+
import { projectExtrasSchema } from "../config/project.config.extension.js";
|
|
4
4
|
// Plain strict object for generators (no Effects, no dynamic imports)
|
|
5
5
|
export const baseSchema = composeConfigSchema(unsCoreSchema, projectExtrasSchema).strict();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NetworkInterfaceInfo } from "node:os";
|
|
2
|
-
import type { AppConfig } from "../app-config";
|
|
3
|
-
import { type SecretPlaceholder } from "./secret-placeholders";
|
|
4
|
-
import { type HostPlaceholder } from "./host-placeholders";
|
|
2
|
+
import type { AppConfig } from "../app-config.js";
|
|
3
|
+
import { type SecretPlaceholder } from "./secret-placeholders.js";
|
|
4
|
+
import { type HostPlaceholder } from "./host-placeholders.js";
|
|
5
5
|
export type SecretValueResolved = string | undefined;
|
|
6
6
|
export type HostValueResolved = string | undefined;
|
|
7
7
|
type SecretPlaceholderCandidate = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
|
-
import { isSecretPlaceholder, } from "./secret-placeholders";
|
|
3
|
-
import { isHostPlaceholder, } from "./host-placeholders";
|
|
2
|
+
import { isSecretPlaceholder, } from "./secret-placeholders.js";
|
|
3
|
+
import { isHostPlaceholder, } from "./host-placeholders.js";
|
|
4
4
|
const envCache = new Map();
|
|
5
5
|
const infisicalCache = new Map();
|
|
6
6
|
const structuredCloneFallback = (value) => typeof structuredClone === "function"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/uns-config/uns-core-schema.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { secretValueSchema } from "./secret-placeholders";
|
|
4
|
-
import { hostValueSchema } from "./host-placeholders";
|
|
3
|
+
import { secretValueSchema } from "./secret-placeholders.js";
|
|
4
|
+
import { hostValueSchema } from "./host-placeholders.js";
|
|
5
5
|
const mqttChannelSchema = z.object({
|
|
6
6
|
host: hostValueSchema,
|
|
7
7
|
username: z.string().optional(),
|
|
@@ -3,12 +3,12 @@ import protoLoader from "@grpc/proto-loader";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import getPort from "get-port";
|
|
5
5
|
import { readFileSync } from "fs";
|
|
6
|
-
import { basePath } from "../base-path";
|
|
7
|
-
import logger from "../logger";
|
|
8
|
-
import { ConfigFile } from "../config-file";
|
|
9
|
-
import UnsProxyProcess from "../uns/uns-proxy-process";
|
|
10
|
-
import { MessageMode } from "../uns-mqtt/uns-mqtt-proxy";
|
|
11
|
-
import { UnsPacket } from "../uns/uns-packet";
|
|
6
|
+
import { basePath } from "../base-path.js";
|
|
7
|
+
import logger from "../logger.js";
|
|
8
|
+
import { ConfigFile } from "../config-file.js";
|
|
9
|
+
import UnsProxyProcess from "../uns/uns-proxy-process.js";
|
|
10
|
+
import { MessageMode } from "../uns-mqtt/uns-mqtt-proxy.js";
|
|
11
|
+
import { UnsPacket } from "../uns/uns-packet.js";
|
|
12
12
|
import { randomUUID } from "crypto";
|
|
13
13
|
const GATEWAY_PROTO = path.resolve("python/proto/uns-gateway.proto");
|
|
14
14
|
export class UnsGatewayServer {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import mqtt from "mqtt";
|
|
2
|
-
import { UnsEvents } from "../uns/uns-interfaces";
|
|
3
|
-
import { UnsEventEmitter } from "../uns/uns-event-emitter";
|
|
4
|
-
import { IMqttParameters } from "./mqtt-interfaces";
|
|
5
|
-
import { MqttWorker } from "./mqtt-worker";
|
|
2
|
+
import { UnsEvents } from "../uns/uns-interfaces.js";
|
|
3
|
+
import { UnsEventEmitter } from "../uns/uns-event-emitter.js";
|
|
4
|
+
import { IMqttParameters } from "./mqtt-interfaces.js";
|
|
5
|
+
import { MqttWorker } from "./mqtt-worker.js";
|
|
6
6
|
export default class MqttProxy {
|
|
7
7
|
event: UnsEventEmitter<UnsEvents>;
|
|
8
8
|
statusTopic: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mqtt from "mqtt";
|
|
2
|
-
import logger from "../logger";
|
|
3
|
-
import { UnsEventEmitter } from "../uns/uns-event-emitter";
|
|
4
|
-
import { DataSizeMeasurements, PhysicalMeasurements } from "../uns/uns-measurements";
|
|
2
|
+
import logger from "../logger.js";
|
|
3
|
+
import { UnsEventEmitter } from "../uns/uns-event-emitter.js";
|
|
4
|
+
import { DataSizeMeasurements, PhysicalMeasurements } from "../uns/uns-measurements.js";
|
|
5
5
|
export default class MqttProxy {
|
|
6
6
|
event = new UnsEventEmitter();
|
|
7
7
|
statusTopic;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMqttWorkerData } from "./mqtt-interfaces";
|
|
2
|
-
import { ThrottledPublisher, ThrottledSubscriber } from "./throttled-queue";
|
|
1
|
+
import { IMqttWorkerData } from "./mqtt-interfaces.js";
|
|
2
|
+
import { ThrottledPublisher, ThrottledSubscriber } from "./throttled-queue.js";
|
|
3
3
|
export declare class MqttWorker {
|
|
4
4
|
private mqttProxy;
|
|
5
5
|
protected publisher: ThrottledPublisher;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
2
|
import { parentPort } from "worker_threads";
|
|
3
|
-
import { basePath } from "../base-path";
|
|
4
|
-
import logger from "../logger";
|
|
5
|
-
import MqttProxy from "./mqtt-proxy";
|
|
6
|
-
import { ThrottledPublisher, ThrottledSubscriber } from "./throttled-queue";
|
|
3
|
+
import { basePath } from "../base-path.js";
|
|
4
|
+
import logger from "../logger.js";
|
|
5
|
+
import MqttProxy from "./mqtt-proxy.js";
|
|
6
|
+
import { ThrottledPublisher, ThrottledSubscriber } from "./throttled-queue.js";
|
|
7
7
|
export class MqttWorker {
|
|
8
8
|
mqttProxy;
|
|
9
9
|
publisher;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHash } from "crypto";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
import { basePath } from "../base-path";
|
|
5
|
-
import logger from "../logger";
|
|
4
|
+
import { basePath } from "../base-path.js";
|
|
5
|
+
import logger from "../logger.js";
|
|
6
6
|
/**
|
|
7
7
|
* Abstract base class that encapsulates common functionality for managing
|
|
8
8
|
* a throttled in‑memory queue with an optional disk persistence.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMqttMessage, IUnsPacket, IUnsParameters, UnsEvents } from "../uns/uns-interfaces";
|
|
2
|
-
import UnsProxy from "../uns/uns-proxy";
|
|
1
|
+
import { IMqttMessage, IUnsPacket, IUnsParameters, UnsEvents } from "../uns/uns-interfaces.js";
|
|
2
|
+
import UnsProxy from "../uns/uns-proxy.js";
|
|
3
3
|
export declare enum MessageMode {
|
|
4
4
|
Raw = "raw",// Send only the original message
|
|
5
5
|
Delta = "delta",// Send only the delta message
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { readFileSync } from "fs";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { Worker } from "worker_threads";
|
|
4
|
-
import { basePath } from "../base-path";
|
|
5
|
-
import logger from "../logger";
|
|
6
|
-
import { UnsPacket } from "../uns/uns-packet";
|
|
7
|
-
import { MqttTopicBuilder } from "./mqtt-topic-builder";
|
|
8
|
-
import UnsProxy from "../uns/uns-proxy";
|
|
9
|
-
import { UnsAttributeType } from "../graphql/schema";
|
|
4
|
+
import { basePath } from "../base-path.js";
|
|
5
|
+
import logger from "../logger.js";
|
|
6
|
+
import { UnsPacket } from "../uns/uns-packet.js";
|
|
7
|
+
import { MqttTopicBuilder } from "./mqtt-topic-builder.js";
|
|
8
|
+
import UnsProxy from "../uns/uns-proxy.js";
|
|
9
|
+
import { UnsAttributeType } from "../graphql/schema.js";
|
|
10
10
|
const packageJsonPath = path.join(basePath, "package.json");
|
|
11
11
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
12
12
|
export var MessageMode;
|