cynx-lib 1.3.95 → 1.3.97

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.95",
3
+ "version": "1.3.97",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/utils/index.cjs CHANGED
@@ -32,7 +32,6 @@ __export(index_exports, {
32
32
  durationUtil: () => import_duration.default,
33
33
  oidcUtil: () => import_oidc.default,
34
34
  realtimeUtil: () => import_realtime.default,
35
- serverUtil: () => import_server.default,
36
35
  sessionManagerUtil: () => import_session_manager.default,
37
36
  sessionUtil: () => import_session.default,
38
37
  storageUtil: () => import_storage.default,
@@ -61,15 +60,12 @@ var import_session = __toESM(require("./utils/session.cjs"), 1);
61
60
  var import_session_manager = __toESM(require("./utils/session_manager.cjs"), 1);
62
61
  var import_ui = __toESM(require("./utils/ui.cjs"), 1);
63
62
  var import_db = __toESM(require("./utils/db.cjs"), 1);
64
- __reExport(index_exports, require("./utils/server.cjs"), module.exports);
65
- var import_server = __toESM(require("./utils/server.cjs"), 1);
66
63
  // Annotate the CommonJS export names for ESM import in node:
67
64
  0 && (module.exports = {
68
65
  dbUtil,
69
66
  durationUtil,
70
67
  oidcUtil,
71
68
  realtimeUtil,
72
- serverUtil,
73
69
  sessionManagerUtil,
74
70
  sessionUtil,
75
71
  storageUtil,
@@ -85,6 +81,5 @@ var import_server = __toESM(require("./utils/server.cjs"), 1);
85
81
  ...require("./utils/session.cjs"),
86
82
  ...require("./utils/session_manager.cjs"),
87
83
  ...require("./utils/ui.cjs"),
88
- ...require("./utils/db.cjs"),
89
- ...require("./utils/server.cjs")
84
+ ...require("./utils/db.cjs")
90
85
  });
package/utils/index.js CHANGED
@@ -20,5 +20,3 @@ export { default as sessionUtil } from './utils/session.js';
20
20
  export { default as sessionManagerUtil } from './utils/session_manager.js';
21
21
  export { default as uiUtil } from './utils/ui.js';
22
22
  export { default as dbUtil } from './utils/db.js';
23
- export * from './utils/server.js';
24
- export { default as serverUtil } from './utils/server.js';
@@ -42,13 +42,14 @@ var import_fs = __toESM(require("fs"), 1);
42
42
  var import_path = __toESM(require("path"), 1);
43
43
  var import_os = __toESM(require("os"), 1);
44
44
  var import_http = __toESM(require("http"), 1);
45
- var import_child_process = require("child_process");
46
45
  let cachedCommit = null;
47
46
  let cachedBuildInfo = null;
48
47
  const bootTime = (/* @__PURE__ */ new Date()).toISOString();
49
48
  function execGit(cmd, cwd) {
50
49
  try {
51
- const stdout = (0, import_child_process.execSync)(cmd, {
50
+ const execSyncFn = typeof require !== "undefined" ? require("child_process").execSync : null;
51
+ if (!execSyncFn) return "";
52
+ const stdout = execSyncFn(cmd, {
52
53
  cwd: cwd || process.cwd(),
53
54
  stdio: ["ignore", "pipe", "ignore"],
54
55
  timeout: 2e3,
@@ -17,7 +17,7 @@ import fs from 'fs';
17
17
  import path from 'path';
18
18
  import os from 'os';
19
19
  import http from 'http';
20
- import { execSync } from 'child_process';
20
+
21
21
 
22
22
  let cachedCommit = null;
23
23
  let cachedBuildInfo = null;
@@ -28,7 +28,9 @@ const bootTime = new Date().toISOString();
28
28
  */
29
29
  export function execGit(cmd, cwd) {
30
30
  try {
31
- const stdout = execSync(cmd, {
31
+ const execSyncFn = typeof require !== 'undefined' ? require('child_process').execSync : null;
32
+ if (!execSyncFn) return '';
33
+ const stdout = execSyncFn(cmd, {
32
34
  cwd: cwd || process.cwd(),
33
35
  stdio: ['ignore', 'pipe', 'ignore'],
34
36
  timeout: 2000,
@@ -1241,8 +1241,15 @@ class StorageManager {
1241
1241
  return r.rows.map((row) => this.formatFileRecord(row));
1242
1242
  }
1243
1243
  }
1244
- function createStorageManager(options = {}) {
1245
- return new StorageManager(options);
1244
+ function createStorageManager(queryOrOptions = {}, storagesTable, filesTable) {
1245
+ if (typeof queryOrOptions === "function") {
1246
+ return new StorageManager({
1247
+ query: queryOrOptions,
1248
+ storagesTable,
1249
+ filesTable
1250
+ });
1251
+ }
1252
+ return new StorageManager(queryOrOptions);
1246
1253
  }
1247
1254
  var storage_manager_default = {
1248
1255
  StorageManager,
@@ -1421,8 +1421,15 @@ export class StorageManager {
1421
1421
  * @param {object} options
1422
1422
  * @returns {StorageManager}
1423
1423
  */
1424
- export function createStorageManager(options = {}) {
1425
- return new StorageManager(options);
1424
+ export function createStorageManager(queryOrOptions = {}, storagesTable, filesTable) {
1425
+ if (typeof queryOrOptions === 'function') {
1426
+ return new StorageManager({
1427
+ query: queryOrOptions,
1428
+ storagesTable,
1429
+ filesTable,
1430
+ });
1431
+ }
1432
+ return new StorageManager(queryOrOptions);
1426
1433
  }
1427
1434
 
1428
1435
  export {