|
|
@@ -1,4 +1,3 @@
|
|
|
-// scripts/manual-api-client-flow.mjs
|
|
|
/**
|
|
|
* Manual API verification script for RHL-008.
|
|
|
*
|
|
|
@@ -17,7 +16,16 @@
|
|
|
* --branch=NL01
|
|
|
*/
|
|
|
|
|
|
-import {
|
|
|
+import * as apiClientNs from "../lib/frontend/apiClient.js";
|
|
|
+
|
|
|
+/**
|
|
|
+ * Compatibility layer:
|
|
|
+ * - If apiClient.js is loaded as CommonJS, Node exposes it as { default: module.exports }.
|
|
|
+ * - If apiClient.js is loaded as ESM, Node exposes named exports directly.
|
|
|
+ */
|
|
|
+const apiClient = apiClientNs.default ?? apiClientNs;
|
|
|
+
|
|
|
+const {
|
|
|
apiFetch,
|
|
|
login,
|
|
|
logout,
|
|
|
@@ -27,7 +35,7 @@ import {
|
|
|
getDays,
|
|
|
getFiles,
|
|
|
ApiClientError,
|
|
|
-} from "../lib/frontend/apiClient.js";
|
|
|
+} = apiClient;
|
|
|
|
|
|
function getArg(name, fallback = null) {
|
|
|
const prefix = `--${name}=`;
|