@uns-kit/api 0.0.3 → 0.0.5

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.
@@ -1,5 +1,5 @@
1
1
  import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
2
- import unsApiPlugin from "./uns-api-plugin";
2
+ import unsApiPlugin from "./uns-api-plugin.js";
3
3
  import { ConfigFile } from "@uns-kit/core/config-file";
4
4
  /**
5
5
  * Load the configuration from a file.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { default } from "./uns-api-plugin";
2
- export { UnsApiProxy, type UnsProxyProcessWithApi } from "./uns-api-plugin";
3
- export * from "./api-interfaces";
1
+ export { default } from "./uns-api-plugin.js";
2
+ export { UnsApiProxy, type UnsProxyProcessWithApi } from "./uns-api-plugin.js";
3
+ export * from "./api-interfaces.js";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { default } from "./uns-api-plugin";
2
- export { UnsApiProxy } from "./uns-api-plugin";
3
- export * from "./api-interfaces";
1
+ export { default } from "./uns-api-plugin.js";
2
+ export { UnsApiProxy } from "./uns-api-plugin.js";
3
+ export * from "./api-interfaces.js";
@@ -1,6 +1,6 @@
1
1
  import type { IApiProxyOptions } from "@uns-kit/core/uns/uns-interfaces";
2
2
  import UnsProxyProcess, { type UnsProxyProcessPlugin } from "@uns-kit/core/uns/uns-proxy-process";
3
- import UnsApiProxy from "./uns-api-proxy";
3
+ import UnsApiProxy from "./uns-api-proxy.js";
4
4
  declare const unsApiPlugin: UnsProxyProcessPlugin;
5
5
  export default unsApiPlugin;
6
6
  export { UnsApiProxy };
@@ -1,5 +1,5 @@
1
1
  import UnsProxyProcess from "@uns-kit/core/uns/uns-proxy-process";
2
- import UnsApiProxy from "./uns-api-proxy";
2
+ import UnsApiProxy from "./uns-api-proxy.js";
3
3
  const apiProxyRegistry = new WeakMap();
4
4
  const getApiProxies = (instance) => {
5
5
  let proxies = apiProxyRegistry.get(instance);
@@ -9,7 +9,7 @@ import { MqttTopicBuilder } from "@uns-kit/core/uns-mqtt/mqtt-topic-builder";
9
9
  import { UnsPacket } from "@uns-kit/core/uns/uns-packet";
10
10
  import UnsProxy from "@uns-kit/core/uns/uns-proxy";
11
11
  import { UnsTopicMatcher } from "@uns-kit/core/uns/uns-topic-matcher";
12
- import App from "./app";
12
+ import App from "./app.js";
13
13
  const packageJsonPath = path.join(basePath, "package.json");
14
14
  const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
15
15
  export default class UnsApiProxy extends UnsProxy {
@@ -28,7 +28,7 @@ export default class UnsApiProxy extends UnsProxy {
28
28
  this.instanceName = instanceName;
29
29
  this.processName = processName;
30
30
  // Create the topic builder using packageJson values and the processName.
31
- this.topicBuilder = new MqttTopicBuilder(`uns-infra/${packageJson.name}/${packageJson.version}/${processName}/`);
31
+ this.topicBuilder = new MqttTopicBuilder(`uns-infra/${MqttTopicBuilder.sanitizeTopicPart(packageJson.name)}/${MqttTopicBuilder.sanitizeTopicPart(packageJson.version)}/${MqttTopicBuilder.sanitizeTopicPart(processName)}/`);
32
32
  // Generate the processStatusTopic using the builder.
33
33
  this.processStatusTopic = this.topicBuilder.getProcessStatusTopic();
34
34
  // Derive the instanceStatusTopic by appending the instance name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uns-kit/api",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Express-powered API gateway plugin for UnsProxyProcess with JWT/JWKS support.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "cookie-parser": "^1.4.7",
32
32
  "express": "^5.1.0",
33
33
  "multer": "^2.0.2",
34
- "@uns-kit/core": "0.0.13"
34
+ "@uns-kit/core": "0.0.16"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/jsonwebtoken": "^9.0.10",