@oneaddress/setup 1.1.8 → 1.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -835,7 +835,7 @@ var _R = ["\u2588\u2588\u2588\u2588\u2588\u2588 ", "\u2588\u2588 \u2588\u2588"
835
835
  var _S = [" \u2588\u2588\u2588\u2588\u2588\u2588", "\u2588\u2588 ", "\u2588\u2588 ", " \u2588\u2588\u2588\u2588\u2588 ", " \u2588\u2588", " \u2588\u2588", "\u2588\u2588\u2588\u2588\u2588\u2588 "];
836
836
  var ONE_ROWS = Array.from({ length: 7 }, (_2, i) => [_O[i], _N[i], _E[i]].join(" "));
837
837
  var ADDR_ROWS = Array.from({ length: 7 }, (_2, i) => [_A[i], _D2[i], _D2[i], _R[i], _E[i], _S[i], _S[i]].join(" "));
838
- var WIZARD_VERSION = true ? "1.1.8" : "?";
838
+ var WIZARD_VERSION = true ? "1.1.9" : "?";
839
839
  function printHeader() {
840
840
  const BAR_LEN = 85;
841
841
  const TOP_BAR = fn("\u250C") + dm("\u2500".repeat(BAR_LEN)) + fn("\u2510");
@@ -1080,6 +1080,15 @@ export async function verifyAddress(customer: Customer, address: Address): Promi
1080
1080
  * \u2551 To wire up your database: edit src/store.ts instead. \u2551
1081
1081
  * \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
1082
1082
  */
1083
+ // Node.js 22.5+ required for the built-in node:sqlite module used by src/store.ts.
1084
+ // Fail fast with a clear message rather than a cryptic ERR_UNSUPPORTED_FEATURE later.
1085
+ const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
1086
+ if (nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 5)) {
1087
+ console.error(\`[startup] Node.js 22.5+ is required (you are running \${process.version}).\`);
1088
+ console.error('[startup] Upgrade Node.js: https://nodejs.org/en/download');
1089
+ process.exit(1);
1090
+ }
1091
+
1083
1092
  import 'dotenv/config';
1084
1093
  import express, { Request, Response } from 'express';
1085
1094
  import { verifySignature, decryptAddress, isFreshTimestamp } from '@oneaddress/partner-sdk';
@@ -3031,8 +3040,17 @@ async function runConformance(webhookUrl, _partnerId, webhookSecret) {
3031
3040
  body: validBody,
3032
3041
  signal: AbortSignal.timeout(8e3)
3033
3042
  });
3034
- const gotOk = res.ok;
3035
- const pass = t.expectOk ? gotOk : !gotOk;
3043
+ let bodyOk = true;
3044
+ if (t.expectOk) {
3045
+ try {
3046
+ const json = await res.json();
3047
+ bodyOk = json.ok === true;
3048
+ } catch {
3049
+ bodyOk = false;
3050
+ }
3051
+ }
3052
+ const gotOk = res.ok && bodyOk;
3053
+ const pass = t.expectOk ? gotOk : !res.ok;
3036
3054
  if (pass) {
3037
3055
  v2.success(` \u2713 ${t.name} (${res.status})`);
3038
3056
  passed++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneaddress/setup",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "Interactive setup wizard for OneAddress partner webhook integrations",
5
5
  "main": "dist/index.js",
6
6
  "bin": {