punchout-simulator 0.3.0 → 0.3.1
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/server/cli.js +13 -2
- package/dist/web/assets/{cssMode-UKotGf5X.js → cssMode-uoWbxmRA.js} +1 -1
- package/dist/web/assets/{freemarker2-0DRATxLT.js → freemarker2-DNR9Witk.js} +1 -1
- package/dist/web/assets/{handlebars-U7ip3Hjn.js → handlebars-Cz4BZbpY.js} +1 -1
- package/dist/web/assets/{html-pMwW-Db1.js → html-B08afy-k.js} +1 -1
- package/dist/web/assets/{htmlMode-BZiR_DER.js → htmlMode-DwllrnDj.js} +1 -1
- package/dist/web/assets/{index-fwAo3vG0.js → index-BzgSetIt.js} +162 -162
- package/dist/web/assets/{index-sN4D-IAg.css → index-DLIyRG88.css} +1 -1
- package/dist/web/assets/{javascript-BNQzFVRF.js → javascript-CSO3Lh8M.js} +1 -1
- package/dist/web/assets/{jsonMode-CSAIHDlB.js → jsonMode-BQc0D6l3.js} +1 -1
- package/dist/web/assets/{liquid--vvS9GUJ.js → liquid-D_Cq8kS0.js} +1 -1
- package/dist/web/assets/{mdx-BJDQflEF.js → mdx-9UNHMbIw.js} +1 -1
- package/dist/web/assets/{python-CepodNht.js → python-BziTtpp-.js} +1 -1
- package/dist/web/assets/{razor-BQksENSs.js → razor-CqSSZBI0.js} +1 -1
- package/dist/web/assets/{tsMode-BRKq1Rx4.js → tsMode-BXILR9lc.js} +1 -1
- package/dist/web/assets/{typescript-V-bP8GlZ.js → typescript-lG76zlZP.js} +1 -1
- package/dist/web/assets/{xml-Bgme81_M.js → xml-D1mrwtCd.js} +1 -1
- package/dist/web/assets/{yaml-CkpLYd3y.js → yaml-DWKj4dJQ.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
package/dist/server/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/server/cli.ts
|
|
4
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
4
5
|
import { fileURLToPath } from "url";
|
|
5
6
|
import { serve } from "@hono/node-server";
|
|
6
7
|
import { nanoid as nanoid7 } from "nanoid";
|
|
@@ -24,6 +25,9 @@ function setRuntime(r) {
|
|
|
24
25
|
function getToken() {
|
|
25
26
|
return runtime.token;
|
|
26
27
|
}
|
|
28
|
+
function getVersion() {
|
|
29
|
+
return runtime.version;
|
|
30
|
+
}
|
|
27
31
|
function getPublicUrl() {
|
|
28
32
|
return runtime.publicUrl.replace(/\/$/, "");
|
|
29
33
|
}
|
|
@@ -2030,7 +2034,7 @@ ${body}` : body;
|
|
|
2030
2034
|
dataRoute.get("/health", (c) => c.json({ ok: true }));
|
|
2031
2035
|
dataRoute.get(
|
|
2032
2036
|
"/runtime",
|
|
2033
|
-
(c) => c.json({ publicUrl: getPublicUrl(), callbackUrl: `${getPublicUrl()}/punchout/return
|
|
2037
|
+
(c) => c.json({ publicUrl: getPublicUrl(), callbackUrl: `${getPublicUrl()}/punchout/return`, version: getVersion() })
|
|
2034
2038
|
);
|
|
2035
2039
|
dataRoute.get("/sessions", (c) => c.json(listSessions()));
|
|
2036
2040
|
dataRoute.get("/sessions/:id", (c) => c.json(readSession(c.req.param("id"))));
|
|
@@ -2477,6 +2481,13 @@ function hostnameOf(url) {
|
|
|
2477
2481
|
return "";
|
|
2478
2482
|
}
|
|
2479
2483
|
}
|
|
2484
|
+
function readVersion() {
|
|
2485
|
+
try {
|
|
2486
|
+
return JSON.parse(readFileSync3(new URL("../../package.json", import.meta.url), "utf8")).version;
|
|
2487
|
+
} catch {
|
|
2488
|
+
return void 0;
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2480
2491
|
function printHelp() {
|
|
2481
2492
|
console.log(`punchout-simulator \u2014 test cXML PunchOut integrations as a virtual counterparty
|
|
2482
2493
|
|
|
@@ -2503,7 +2514,7 @@ async function main() {
|
|
|
2503
2514
|
const exposed = !LOOPBACK.has(hostnameOf(publicUrl)) || !LOOPBACK.has(bindHost);
|
|
2504
2515
|
const token = flags.token || (exposed ? nanoid7(24) : void 0);
|
|
2505
2516
|
setDataDir(flags.dataDir);
|
|
2506
|
-
setRuntime({ port: flags.port, publicUrl, token });
|
|
2517
|
+
setRuntime({ port: flags.port, publicUrl, token, version: readVersion() });
|
|
2507
2518
|
await initConfig();
|
|
2508
2519
|
if (flags.seed) await seedDemoIfEmpty();
|
|
2509
2520
|
const webRoot = flags.dev ? void 0 : fileURLToPath(new URL("../web", import.meta.url));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as et}from"./index-
|
|
1
|
+
import{m as et}from"./index-BzgSetIt.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as f}from"./index-
|
|
1
|
+
import{m as f}from"./index-BzgSetIt.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as l}from"./index-
|
|
1
|
+
import{m as l}from"./index-BzgSetIt.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as s}from"./index-
|
|
1
|
+
import{m as s}from"./index-BzgSetIt.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as lt}from"./index-
|
|
1
|
+
import{m as lt}from"./index-BzgSetIt.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|