softkave-node-utils 0.5.2 → 0.6.0

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,9 +1,7 @@
1
1
  export declare const getClientConfig: () => {
2
- publicURL: string | undefined;
3
- fimidxAppId: string;
2
+ fimidxProjectId: string;
4
3
  fimidxClientToken: string;
5
- fimidxServerUrl: string | undefined;
6
- nodeEnv: string;
7
4
  fimidxLoggerEnabled: boolean;
5
+ fimidxServerUrl?: string | undefined;
8
6
  };
9
7
  //# sourceMappingURL=getClientConfig.d.ts.map
@@ -1,23 +1,20 @@
1
- import assert from 'assert';
1
+ import { z } from 'zod';
2
+ const fimidxProjectId = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_PROJECT_ID;
3
+ const fimidxClientToken = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_CLIENT_TOKEN;
4
+ const fimidxLoggerEnabled = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_ENABLED;
5
+ const fimidxServerUrl = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_SERVER_URL;
6
+ const clientConfigSchema = z.object({
7
+ fimidxProjectId: z.string(),
8
+ fimidxClientToken: z.string(),
9
+ fimidxLoggerEnabled: z.boolean().default(false),
10
+ fimidxServerUrl: z.string().url().optional(),
11
+ });
2
12
  export const getClientConfig = () => {
3
- const publicURL = process.env.NEXT_PUBLIC_URL;
4
- const fimidxAppId = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_APP_ID;
5
- const fimidxClientToken = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_CLIENT_TOKEN;
6
- const fimidxServerUrl = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_SERVER_URL;
7
- const nodeEnv = process.env.NEXT_PUBLIC_APP_ENV;
8
- const fimidxLoggerEnabled = process.env.NEXT_PUBLIC_FIMIDX_LOGGER_ENABLED === 'true';
9
- // assert.ok(publicURL, 'NEXT_PUBLIC_URL is not set');
10
- assert.ok(fimidxAppId, 'NEXT_PUBLIC_FIMIDX_LOGGER_APP_ID is not set');
11
- assert.ok(fimidxClientToken, 'NEXT_PUBLIC_FIMIDX_LOGGER_CLIENT_TOKEN is not set');
12
- // assert.ok(fimidxServerUrl, "NEXT_PUBLIC_FIMIDX_LOGGER_SERVER_URL is not set");
13
- assert.ok(nodeEnv, 'NEXT_PUBLIC_APP_ENV is not set');
14
- return {
15
- publicURL,
16
- fimidxAppId,
13
+ return clientConfigSchema.parse({
14
+ fimidxProjectId,
17
15
  fimidxClientToken,
16
+ fimidxLoggerEnabled: fimidxLoggerEnabled === 'true',
18
17
  fimidxServerUrl,
19
- nodeEnv,
20
- fimidxLoggerEnabled,
21
- };
18
+ });
22
19
  };
23
20
  //# sourceMappingURL=getClientConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getClientConfig.js","sourceRoot":"","sources":["../../src/common/getClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;IACjE,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;IAC7E,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;IACzE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAChD,MAAM,mBAAmB,GACvB,OAAO,CAAC,GAAG,CAAC,iCAAiC,KAAK,MAAM,CAAC;IAE3D,sDAAsD;IACtD,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,6CAA6C,CAAC,CAAC;IACtE,MAAM,CAAC,EAAE,CACP,iBAAiB,EACjB,mDAAmD,CACpD,CAAC;IACF,iFAAiF;IACjF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;IAErD,OAAO;QACL,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,eAAe;QACf,OAAO;QACP,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"getClientConfig.js","sourceRoot":"","sources":["../../src/common/getClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;AACzE,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;AAC7E,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC;AAC1E,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC;AAEzE,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC/C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,kBAAkB,CAAC,KAAK,CAAC;QAC9B,eAAe;QACf,iBAAiB;QACjB,mBAAmB,EAAE,mBAAmB,KAAK,MAAM;QACnD,eAAe;KAChB,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,11 +1,10 @@
1
1
  import { FimidxConsoleLikeLogger } from 'fimidx';
2
2
  import { getClientConfig } from '../getClientConfig.js';
3
3
  import { fimidxLogger } from './fimidx-logger.js';
4
- const { nodeEnv, fimidxLoggerEnabled } = getClientConfig();
4
+ const { fimidxLoggerEnabled } = getClientConfig();
5
5
  export const fimidxConsoleLogger = new FimidxConsoleLikeLogger({
6
6
  fimidxLogger: fimidxLogger,
7
- // Enable console fallback in development
8
- enableConsoleFallback: nodeEnv === 'development',
9
- enabled: fimidxLoggerEnabled,
7
+ enableConsoleFallback: true,
8
+ logToFimidx: fimidxLoggerEnabled,
10
9
  });
11
10
  //# sourceMappingURL=fimidx-console-logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fimidx-console-logger.js","sourceRoot":"","sources":["../../../src/common/logger/fimidx-console-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,MAAM,EAAC,OAAO,EAAE,mBAAmB,EAAC,GAAG,eAAe,EAAE,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,uBAAuB,CAAC;IAC7D,YAAY,EAAE,YAAY;IAC1B,yCAAyC;IACzC,qBAAqB,EAAE,OAAO,KAAK,aAAa;IAChD,OAAO,EAAE,mBAAmB;CAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"fimidx-console-logger.js","sourceRoot":"","sources":["../../../src/common/logger/fimidx-console-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,MAAM,EAAC,mBAAmB,EAAC,GAAG,eAAe,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,uBAAuB,CAAC;IAC7D,YAAY,EAAE,YAAY;IAC1B,qBAAqB,EAAE,IAAI;IAC3B,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { FimidxLogger } from 'fimidx';
2
2
  import { getClientConfig } from '../getClientConfig.js';
3
- const { fimidxAppId, fimidxClientToken } = getClientConfig();
3
+ const { fimidxProjectId, fimidxClientToken, fimidxServerUrl } = getClientConfig();
4
4
  export const fimidxLogger = new FimidxLogger({
5
- appId: fimidxAppId,
5
+ projectId: fimidxProjectId,
6
6
  clientToken: fimidxClientToken,
7
7
  consoleLogOnError: true,
8
8
  logRemoteErrors: true,
9
+ ...(fimidxServerUrl ? { serverURL: fimidxServerUrl } : {}),
9
10
  });
10
11
  //# sourceMappingURL=fimidx-logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fimidx-logger.js","sourceRoot":"","sources":["../../../src/common/logger/fimidx-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,MAAM,EAAC,WAAW,EAAE,iBAAiB,EAAC,GAAG,eAAe,EAAE,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;IAC3C,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,iBAAiB;IAC9B,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;CACtB,CAAC,CAAC"}
1
+ {"version":3,"file":"fimidx-logger.js","sourceRoot":"","sources":["../../../src/common/logger/fimidx-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,MAAM,EAAC,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAC,GAAG,eAAe,EAAE,CAAC;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;IAC3C,SAAS,EAAE,eAAe;IAC1B,WAAW,EAAE,iBAAiB;IAC9B,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAC,SAAS,EAAE,eAAe,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;CACzD,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "softkave-node-utils",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Softkave Node.js utilities",
5
5
  "author": {
6
6
  "email": "ywordk@gmail.com",
@@ -62,12 +62,12 @@
62
62
  "peerDependencies": {
63
63
  "@types/lodash-es": "^4.17.12",
64
64
  "@types/node": "^20",
65
- "fimidx": "^0.5.0",
65
+ "fimidx": "^0.7.0",
66
66
  "lodash-es": "^4.17.21",
67
- "next": "15.2.8",
67
+ "next": "15.5.9",
68
68
  "softkave-js-utils": "^0.17.1",
69
69
  "zod": "^4.1.11",
70
- "mongoose": "^8.19.0",
70
+ "mongoose": "^9.1.6",
71
71
  "jsonwebtoken": "^9.0.2",
72
72
  "typescript": "^5.9.3",
73
73
  "@types/jsonwebtoken": "^9.0.10"