@blokjs/shared 0.2.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/__tests__/unit/GlobalError.test.ts +93 -0
  3. package/__tests__/unit/GlobalLogger.test.ts +77 -0
  4. package/__tests__/unit/Metrics.test.ts +77 -0
  5. package/__tests__/unit/NodeBase.test.ts +286 -0
  6. package/__tests__/unit/Trigger.test.ts +23 -0
  7. package/__tests__/unit/utils/CpuUsage.test.ts +102 -0
  8. package/__tests__/unit/utils/Mapper.test.ts +124 -0
  9. package/__tests__/unit/utils/MemoryUsage.test.ts +121 -0
  10. package/__tests__/unit/utils/Time.test.ts +60 -0
  11. package/dist/GlobalError.d.ts +11 -0
  12. package/dist/GlobalError.js +29 -0
  13. package/dist/GlobalError.js.map +1 -0
  14. package/dist/GlobalLogger.d.ts +11 -0
  15. package/dist/GlobalLogger.js +16 -0
  16. package/dist/GlobalLogger.js.map +1 -0
  17. package/dist/Metrics.d.ts +18 -0
  18. package/dist/Metrics.js +40 -0
  19. package/dist/Metrics.js.map +1 -0
  20. package/dist/NodeBase.d.ts +26 -0
  21. package/dist/NodeBase.js +98 -0
  22. package/dist/NodeBase.js.map +1 -0
  23. package/dist/Trigger.d.ts +7 -0
  24. package/dist/Trigger.js +3 -0
  25. package/dist/Trigger.js.map +1 -0
  26. package/dist/index.d.ts +16 -0
  27. package/dist/index.js +8 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/types/ConfigContext.d.ts +5 -0
  30. package/dist/types/ConfigContext.js +2 -0
  31. package/dist/types/ConfigContext.js.map +1 -0
  32. package/dist/types/Context.d.ts +25 -0
  33. package/dist/types/Context.js +2 -0
  34. package/dist/types/Context.js.map +1 -0
  35. package/dist/types/EnvContext.d.ts +5 -0
  36. package/dist/types/EnvContext.js +2 -0
  37. package/dist/types/EnvContext.js.map +1 -0
  38. package/dist/types/ErrorContext.d.ts +9 -0
  39. package/dist/types/ErrorContext.js +2 -0
  40. package/dist/types/ErrorContext.js.map +1 -0
  41. package/dist/types/FunctionContext.d.ts +4 -0
  42. package/dist/types/FunctionContext.js +2 -0
  43. package/dist/types/FunctionContext.js.map +1 -0
  44. package/dist/types/LoggerContext.d.ts +9 -0
  45. package/dist/types/LoggerContext.js +2 -0
  46. package/dist/types/LoggerContext.js.map +1 -0
  47. package/dist/types/NodeConfigContext.d.ts +5 -0
  48. package/dist/types/NodeConfigContext.js +2 -0
  49. package/dist/types/NodeConfigContext.js.map +1 -0
  50. package/dist/types/ParamsDictionary.d.ts +3 -0
  51. package/dist/types/ParamsDictionary.js +2 -0
  52. package/dist/types/ParamsDictionary.js.map +1 -0
  53. package/dist/types/RequestContext.d.ts +5 -0
  54. package/dist/types/RequestContext.js +2 -0
  55. package/dist/types/RequestContext.js.map +1 -0
  56. package/dist/types/ResponseContext.d.ts +8 -0
  57. package/dist/types/ResponseContext.js +2 -0
  58. package/dist/types/ResponseContext.js.map +1 -0
  59. package/dist/types/Step.d.ts +10 -0
  60. package/dist/types/Step.js +2 -0
  61. package/dist/types/Step.js.map +1 -0
  62. package/dist/types/VarsContext.d.ts +5 -0
  63. package/dist/types/VarsContext.js +2 -0
  64. package/dist/types/VarsContext.js.map +1 -0
  65. package/dist/utils/CpuUsage.d.ts +19 -0
  66. package/dist/utils/CpuUsage.js +57 -0
  67. package/dist/utils/CpuUsage.js.map +1 -0
  68. package/dist/utils/Mapper.d.ts +10 -0
  69. package/dist/utils/Mapper.js +56 -0
  70. package/dist/utils/Mapper.js.map +1 -0
  71. package/dist/utils/MemoryUsage.d.ts +17 -0
  72. package/dist/utils/MemoryUsage.js +36 -0
  73. package/dist/utils/MemoryUsage.js.map +1 -0
  74. package/dist/utils/MetricsBase.d.ts +24 -0
  75. package/dist/utils/MetricsBase.js +3 -0
  76. package/dist/utils/MetricsBase.js.map +1 -0
  77. package/dist/utils/Time.d.ts +10 -0
  78. package/dist/utils/Time.js +24 -0
  79. package/dist/utils/Time.js.map +1 -0
  80. package/dist/utils/index.d.ts +5 -0
  81. package/dist/utils/index.js +6 -0
  82. package/dist/utils/index.js.map +1 -0
  83. package/package.json +34 -0
  84. package/tsconfig.json +19 -0
  85. package/vitest.config.ts +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeBase.js","sourceRoot":"","sources":["../src/NodeBase.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,WAAW,MAAM,eAAe,CAAC;AASxC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAgB,QAAQ;IAC9B,IAAI,GAAG,KAAK,CAAC;IACb,IAAI,GAAG,EAAE,CAAC;IACV,WAAW,GAAG,EAAE,CAAC;IACjB,MAAM,GAAG,IAAI,CAAC;IACd,IAAI,GAAG,KAAK,CAAC;IACb,cAAc,GAAqB,EAAE,CAAC;IACtC,OAAO,GAAG,KAAK,CAAC;IAEhB,KAAK,CAAC,OAAO,CAAC,GAAY,EAAE,IAAW;QAC7C,IAAI,QAAQ,GAAoB;YAC/B,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;SACX,CAAC;QAEF,MAAM,MAAM,GAAsB,GAAG,CAAC,MAAsC,CAAC;QAC7E,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAE7C,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE/B,IAAI,QAAQ,CAAC,KAAK;YAAE,MAAM,QAAQ,CAAC,KAAK,CAAC;QACzC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAExB,OAAO,QAAQ,CAAC;IACjB,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EAAE,CAAC;gBAChC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC9B,CAAC;QACF,CAAC;QAED,IAAI,MAAM,CAAC,IAAI;YAAE,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,MAAM,CAAC,KAAK;YAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,MAAM,CAAC,IAAI;YAAE,YAAY,CAAC,OAAO,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAE3F,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ type TriggerType = {
2
+ listen(): void;
3
+ };
4
+ export default abstract class Trigger implements TriggerType {
5
+ abstract listen(): void;
6
+ }
7
+ export {};
@@ -0,0 +1,3 @@
1
+ export default class Trigger {
2
+ }
3
+ //# sourceMappingURL=Trigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trigger.js","sourceRoot":"","sources":["../src/Trigger.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAgB,OAAO;CAEpC"}
@@ -0,0 +1,16 @@
1
+ import GlobalError from "./GlobalError";
2
+ import GlobalLogger from "./GlobalLogger";
3
+ import { Metrics, type MetricsType } from "./Metrics";
4
+ import NodeBase from "./NodeBase";
5
+ import Trigger from "./Trigger";
6
+ import ConfigContext from "./types/ConfigContext";
7
+ import Context from "./types/Context";
8
+ import ErrorContext from "./types/ErrorContext";
9
+ import FunctionContext from "./types/FunctionContext";
10
+ import LoggerContext from "./types/LoggerContext";
11
+ import NodeConfigContext from "./types/NodeConfigContext";
12
+ import RequestContext from "./types/RequestContext";
13
+ import ResponseContext from "./types/ResponseContext";
14
+ import Step from "./types/Step";
15
+ import MemoryUsage from "./utils/MemoryUsage";
16
+ export { NodeBase, Context, RequestContext, ResponseContext, ErrorContext, LoggerContext, ConfigContext, Trigger, NodeConfigContext, FunctionContext, Step, GlobalLogger, GlobalError, Metrics, MemoryUsage, type MetricsType, };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import GlobalError from "./GlobalError";
2
+ import GlobalLogger from "./GlobalLogger";
3
+ import { Metrics } from "./Metrics";
4
+ import NodeBase from "./NodeBase";
5
+ import Trigger from "./Trigger";
6
+ import MemoryUsage from "./utils/MemoryUsage";
7
+ export { NodeBase, Trigger, GlobalLogger, GlobalError, Metrics, MemoryUsage, };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAUhC,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EACN,QAAQ,EAOR,OAAO,EAIP,YAAY,EACZ,WAAW,EACX,OAAO,EACP,WAAW,GAEX,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type NodeConfigContext from "./NodeConfigContext";
2
+ type ConfigContext = {
3
+ nodes?: NodeConfigContext;
4
+ };
5
+ export default ConfigContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ConfigContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigContext.js","sourceRoot":"","sources":["../../src/types/ConfigContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import type GlobalLogger from "../GlobalLogger";
2
+ import type ConfigContext from "./ConfigContext";
3
+ import type EnvContext from "./EnvContext";
4
+ import type ErrorContext from "./ErrorContext";
5
+ import type FunctionContext from "./FunctionContext";
6
+ import type LoggerContext from "./LoggerContext";
7
+ import type RequestContext from "./RequestContext";
8
+ import type ResponseContext from "./ResponseContext";
9
+ import type VarsContext from "./VarsContext";
10
+ type Context = {
11
+ id: string;
12
+ workflow_name?: string;
13
+ workflow_path?: string;
14
+ request: RequestContext;
15
+ response: ResponseContext;
16
+ error: ErrorContext;
17
+ logger: LoggerContext;
18
+ config: ConfigContext;
19
+ func?: FunctionContext;
20
+ vars?: VarsContext;
21
+ env?: EnvContext;
22
+ eventLogger: GlobalLogger | unknown;
23
+ _PRIVATE_: unknown;
24
+ };
25
+ export default Context;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/types/Context.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type ParamsDictionary from "./ParamsDictionary";
2
+ type EnvContext = {
3
+ [key: string]: ParamsDictionary;
4
+ };
5
+ export default EnvContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EnvContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvContext.js","sourceRoot":"","sources":["../../src/types/EnvContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type ParamsDictionary from "./ParamsDictionary";
2
+ type ErrorContext = {
3
+ message: string[] | string;
4
+ code?: number;
5
+ json?: ParamsDictionary;
6
+ stack?: string;
7
+ name?: string;
8
+ };
9
+ export default ErrorContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ErrorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorContext.js","sourceRoot":"","sources":["../../src/types/ErrorContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ type FunctionContext = {
2
+ [key: string]: unknown;
3
+ };
4
+ export default FunctionContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FunctionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FunctionContext.js","sourceRoot":"","sources":["../../src/types/FunctionContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ type LoggerContext = {
2
+ log(message: string): void;
3
+ getLogs(): string[];
4
+ getLogsAsText(): string;
5
+ getLogsAsBase64(): string;
6
+ logLevel(level: string, message: string): void;
7
+ error(message: string, stack: string): void;
8
+ };
9
+ export default LoggerContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LoggerContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoggerContext.js","sourceRoot":"","sources":["../../src/types/LoggerContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type ParamsDictionary from "./ParamsDictionary";
2
+ type NodeConfigContext = {
3
+ [key: string]: ParamsDictionary;
4
+ };
5
+ export default NodeConfigContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NodeConfigContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeConfigContext.js","sourceRoot":"","sources":["../../src/types/NodeConfigContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export default interface ParamsDictionary {
2
+ [key: string]: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ParamsDictionary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamsDictionary.js","sourceRoot":"","sources":["../../src/types/ParamsDictionary.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type ParamsDictionary from "./ParamsDictionary";
2
+ type RequestContext = {
3
+ [key: string]: ParamsDictionary;
4
+ };
5
+ export default RequestContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RequestContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestContext.js","sourceRoot":"","sources":["../../src/types/RequestContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type BlueprintError from "../GlobalError";
2
+ type ResponseContext = {
3
+ data: unknown;
4
+ error: BlueprintError | null;
5
+ success?: boolean;
6
+ contentType?: string;
7
+ };
8
+ export default ResponseContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResponseContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseContext.js","sourceRoot":"","sources":["../../src/types/ResponseContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type Context from "./Context";
2
+ type Step = {
3
+ name: string;
4
+ node: string;
5
+ type: string;
6
+ active?: boolean;
7
+ stop?: boolean;
8
+ run(ctx: Context): Promise<unknown>;
9
+ };
10
+ export default Step;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Step.js","sourceRoot":"","sources":["../../src/types/Step.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type ParamsDictionary from "./ParamsDictionary";
2
+ type VarsContext = {
3
+ [key: string]: ParamsDictionary;
4
+ };
5
+ export default VarsContext;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=VarsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VarsContext.js","sourceRoot":"","sources":["../../src/types/VarsContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import MetricsBase, { type CpuUsageType } from "./MetricsBase";
2
+ export default class CpuMetrics extends MetricsBase {
3
+ private numCPUs;
4
+ private cpuModel;
5
+ private startUsage;
6
+ private endUsage;
7
+ start(): void;
8
+ stop(): void;
9
+ getAverage(): number;
10
+ getMetrics(): CpuUsageType;
11
+ measureCpu(): MeasureCpuType;
12
+ }
13
+ type MeasureCpuType = {
14
+ idle: number;
15
+ total: number;
16
+ model: string;
17
+ cpus: number;
18
+ };
19
+ export {};
@@ -0,0 +1,57 @@
1
+ // @ts-ignore
2
+ import os from "node:os";
3
+ import MetricsBase from "./MetricsBase";
4
+ export default class CpuMetrics extends MetricsBase {
5
+ numCPUs = 0;
6
+ cpuModel = "";
7
+ startUsage = {};
8
+ endUsage = {};
9
+ start() {
10
+ const cpus = os.cpus();
11
+ this.cpuModel = cpus[0].model;
12
+ this.numCPUs = cpus.length;
13
+ this.startUsage = this.measureCpu();
14
+ }
15
+ stop() {
16
+ this.endUsage = this.measureCpu();
17
+ }
18
+ getAverage() {
19
+ const idleDifference = this.endUsage.idle - this.startUsage.idle;
20
+ const totalDifference = this.endUsage.total - this.startUsage.total;
21
+ const percentageCpu = 100 - (100 * idleDifference) / totalDifference;
22
+ return percentageCpu;
23
+ }
24
+ getMetrics() {
25
+ const average = this.getAverage();
26
+ const usage = (average * this.numCPUs) / 100;
27
+ return {
28
+ total: this.numCPUs,
29
+ average: average,
30
+ usage: usage,
31
+ model: this.cpuModel,
32
+ };
33
+ }
34
+ measureCpu() {
35
+ const cpus = os.cpus();
36
+ let idleMs = 0;
37
+ let totalMs = 0;
38
+ const total = cpus.length;
39
+ for (let i = 0, len = cpus.length; i < len; i++) {
40
+ const cpu = cpus[i];
41
+ totalMs += cpu.times.idle;
42
+ totalMs += cpu.times.irq;
43
+ totalMs += cpu.times.nice;
44
+ totalMs += cpu.times.sys;
45
+ totalMs += cpu.times.user;
46
+ idleMs += cpu.times.idle;
47
+ }
48
+ const model = {
49
+ idle: idleMs / total,
50
+ total: totalMs / total,
51
+ model: cpus[0].model,
52
+ cpus: total,
53
+ };
54
+ return model;
55
+ }
56
+ }
57
+ //# sourceMappingURL=CpuUsage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CpuUsage.js","sourceRoot":"","sources":["../../src/utils/CpuUsage.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAoB,MAAM,SAAS,CAAC;AAC3C,OAAO,WAAkC,MAAM,eAAe,CAAC;AAE/D,M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AAM,GAAG,CAAC,CAAC;QACf,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAE1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACjD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAEpB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;YACzB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;YACzB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAE1B,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QAC1B,CAAC;QAED,MAAM,KAAK,GAAmB;YAC7B,IAAI,EAAE,MAAM,GAAG,KAAK;YACpB,KAAK,EAAE,OAAO,GAAG,KAAK;YACtB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;YACpB,IAAI,EAAE,KAAK;SACX,CAAC;QAEF,OAAO,KAAK,CAAC;IACd,CAAC;CACD"}
@@ -0,0 +1,10 @@
1
+ import type Context from "../types/Context";
2
+ import type ParamsDictionary from "../types/ParamsDictionary";
3
+ declare class Mapper {
4
+ replaceObjectStrings(obj: ParamsDictionary, ctx: Context, data: ParamsDictionary): void;
5
+ replaceString: (strData: string, ctx: Context, data: ParamsDictionary) => string;
6
+ private runJs;
7
+ private jsMapper;
8
+ }
9
+ declare const _default: Mapper;
10
+ export default _default;
@@ -0,0 +1,56 @@
1
+ import _ from "lodash";
2
+ class Mapper {
3
+ replaceObjectStrings(obj, ctx, data) {
4
+ for (const key in obj) {
5
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
6
+ const value = obj[key];
7
+ if (typeof value === "string") {
8
+ obj[key] = this.replaceString(value, ctx, data);
9
+ }
10
+ else if (typeof value === "object") {
11
+ this.replaceObjectStrings(value, ctx, data);
12
+ }
13
+ }
14
+ }
15
+ }
16
+ replaceString = (strData, ctx, data) => {
17
+ let str = strData;
18
+ // if (str.length > 15000) {
19
+ // throw new Error("Input too long");
20
+ // }
21
+ const regex = /\${(.*?)}/g;
22
+ const matches = str.match(regex);
23
+ if (matches) {
24
+ for (const match of matches) {
25
+ try {
26
+ const key = match.replace(/\${/g, "").replace(/}/g, "");
27
+ const value = _.get(data, key) || this.runJs(key, ctx, data);
28
+ // if (value) str = this.parseBasedOnType(str.replace(match, value), typeof value);
29
+ str = str.replace(match, value);
30
+ }
31
+ catch (e) {
32
+ console.log("Mapper Error 1", e);
33
+ }
34
+ }
35
+ }
36
+ const result = this.jsMapper(str, ctx, data);
37
+ return result;
38
+ };
39
+ runJs(str, ctx, data = {}, func = {}, vars = {}) {
40
+ return Function("ctx", "data", "func", "vars", `"use strict";return (${str});`)(ctx, data, func, vars);
41
+ }
42
+ jsMapper(str, ctx, data) {
43
+ try {
44
+ if (typeof str === "string" && str.startsWith("js/")) {
45
+ const fn = str.replace("js/", "");
46
+ return this.runJs(fn, ctx, data, ctx.func, ctx.vars);
47
+ }
48
+ }
49
+ catch (error) {
50
+ console.log("Mapper Error 2", error);
51
+ }
52
+ return str;
53
+ }
54
+ }
55
+ export default new Mapper();
56
+ //# sourceMappingURL=Mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Mapper.js","sourceRoot":"","sources":["../../src/utils/Mapper.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAMvB,MAAM,MAAM;IACJ,oBAAoB,CAAC,GAAqB,EAAE,GAAY,EAAE,IAAsB;QACtF,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;YACvB,IAAI,MAAM,CAAC,SAAS,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,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;gBAClC,CAAC;YACF,CAAC;QACF,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAW,CAAC;QACvD,OAAO,MAAM,CAAC;IACf,CAAC,CAAC;IAEM,KAAK,CACZ,GAAW,EACX,GAAY,EACZ,OAAyB,EAAE,EAC3B,OAAwB,EAAE,EAC1B,OAAoB,EAAE;QAEtB,OAAO,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxG,CAAC;IAEO,QAAQ,CAAC,GAAW,EAAE,GAAY,EAAE,IAAsB;QACjE,IAAI,CAAC;YACJ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtD,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAClC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;CACD;AAED,eAAe,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import MetricsBase from "./MetricsBase";
2
+ export default class MemoryUsage extends MetricsBase {
3
+ protected min_val: number;
4
+ protected max_val: number;
5
+ protected total_val: number;
6
+ protected counter: number;
7
+ start(): void;
8
+ stop(): void;
9
+ getMetrics(): {
10
+ total: number;
11
+ min: number;
12
+ max: number;
13
+ global_memory: number;
14
+ global_free_memory: number;
15
+ };
16
+ clear(): void;
17
+ }
@@ -0,0 +1,36 @@
1
+ // @ts-ignore
2
+ import os from "node:os";
3
+ import MetricsBase from "./MetricsBase";
4
+ export default class MemoryUsage extends MetricsBase {
5
+ min_val = 0;
6
+ max_val = 0;
7
+ total_val = 0;
8
+ counter = 0;
9
+ start() {
10
+ const usage = process.memoryUsage().heapUsed;
11
+ const val = usage / 1000000;
12
+ this.total_val += val;
13
+ if (this.min_val === 0)
14
+ this.min_val = val;
15
+ this.min_val = this.min_val > val ? val : this.min_val;
16
+ this.max_val = this.max_val < val ? val : this.max_val;
17
+ this.counter++;
18
+ }
19
+ stop() { }
20
+ getMetrics() {
21
+ return {
22
+ total: this.total_val / this.counter,
23
+ min: this.min_val,
24
+ max: this.max_val,
25
+ global_memory: os.totalmem() / 1000000,
26
+ global_free_memory: os.freemem() / 1000000,
27
+ };
28
+ }
29
+ clear() {
30
+ this.total_val = 0;
31
+ this.min_val = 0;
32
+ this.max_val = 0;
33
+ this.counter = 0;
34
+ }
35
+ }
36
+ //# sourceMappingURL=MemoryUsage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemoryUsage.js","sourceRoot":"","sources":["../../src/utils/MemoryUsage.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IACzC,OAAO,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,CAAC,CAAC;IACZ,SAAS,GAAG,CAAC,CAAC;IACd,OAAO,GAAG,CAAC,CAAC;IAEf,KAAK;QACX,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAC7C,MAAM,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC;QAE5B,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC;QAEtB,IAAI,IAAI,CAAC,OAAO,KAAK,CAAC;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAEvD,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAEM,IAAI,KAAI,CAAC;IAET,UAAU;QAChB,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO;YACpC,GAAG,EAAE,IAAI,CAAC,OAAO;YACjB,GAAG,EAAE,IAAI,CAAC,OAAO;YACjB,aAAa,EAAE,EAAE,CAAC,QAAQ,EAAE,GAAG,OAAO;YACtC,kBAAkB,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,OAAO;SAC1C,CAAC;IACH,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IAClB,CAAC;CACD"}
@@ -0,0 +1,24 @@
1
+ export default abstract class MetricsBase {
2
+ abstract start(ms?: number): void;
3
+ abstract stop(): void;
4
+ abstract getMetrics(): MemoryUsageType | TimeUsageType | CpuUsageType;
5
+ }
6
+ type MemoryUsageType = {
7
+ total: number;
8
+ min: number;
9
+ max: number;
10
+ global_memory: number;
11
+ global_free_memory: number;
12
+ };
13
+ type TimeUsageType = {
14
+ startTime: string;
15
+ endTime: string;
16
+ duration: number;
17
+ };
18
+ type CpuUsageType = {
19
+ average: number;
20
+ total: number;
21
+ model: string;
22
+ usage: number;
23
+ };
24
+ export type { MemoryUsageType, TimeUsageType, CpuUsageType };
@@ -0,0 +1,3 @@
1
+ export default class MetricsBase {
2
+ }
3
+ //# sourceMappingURL=MetricsBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricsBase.js","sourceRoot":"","sources":["../../src/utils/MetricsBase.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAgB,WAAW;CAIxC"}
@@ -0,0 +1,10 @@
1
+ import MetricsBase, { type TimeUsageType } from "./MetricsBase";
2
+ export default class Time extends MetricsBase {
3
+ private startTime;
4
+ private endTime;
5
+ private performanceStart;
6
+ private performanceEnd;
7
+ start(): void;
8
+ stop(): void;
9
+ getMetrics(): TimeUsageType;
10
+ }
@@ -0,0 +1,24 @@
1
+ import dayjs from "dayjs";
2
+ import MetricsBase from "./MetricsBase";
3
+ export default class Time extends MetricsBase {
4
+ startTime = null;
5
+ endTime = null;
6
+ performanceStart = 0;
7
+ performanceEnd = 0;
8
+ start() {
9
+ this.startTime = dayjs().format();
10
+ this.performanceStart = performance.now();
11
+ }
12
+ stop() {
13
+ this.endTime = dayjs().format();
14
+ this.performanceEnd = performance.now();
15
+ }
16
+ getMetrics() {
17
+ return {
18
+ startTime: this.startTime,
19
+ endTime: this.endTime,
20
+ duration: this.performanceEnd - this.performanceStart,
21
+ };
22
+ }
23
+ }
24
+ //# sourceMappingURL=Time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Time.js","sourceRoot":"","sources":["../../src/utils/Time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,WAAmC,MAAM,eAAe,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IACpC,SAAS,GAAkB,IAAI,CAAC;IAChC,OAAO,GAAkB,IAAI,CAAC;IAC9B,gBAAgB,GAAG,CAAC,CAAC;IACrB,cAAc,GAAG,CAAC,CAAC;IAEpB,KAAK;QACX,IAAI,CAAC,SAAS,GAAG,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAC3C,CAAC;IAEM,IAAI;QACV,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACzC,CAAC;IAEM,UAAU;QAChB,OAAO;YACN,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB;SACpC,CAAC;IACpB,CAAC;CACD"}
@@ -0,0 +1,5 @@
1
+ export { default as CpuUsage } from "./CpuUsage";
2
+ export { default as Mapper } from "./Mapper";
3
+ export { default as MemoryUsage } from "./MemoryUsage";
4
+ export { default as Metrics } from "./MetricsBase";
5
+ export { default as Time } from "./Time";
@@ -0,0 +1,6 @@
1
+ export { default as CpuUsage } from "./CpuUsage";
2
+ export { default as Mapper } from "./Mapper";
3
+ export { default as MemoryUsage } from "./MemoryUsage";
4
+ export { default as Metrics } from "./MetricsBase";
5
+ export { default as Time } from "./Time";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@blokjs/shared",
3
+ "version": "0.2.0",
4
+ "description": "Shared class, interfaces and types",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build:dev": "tsc --watch",
10
+ "build": "rm -rf dist && bun run tsc",
11
+ "test": "vitest run",
12
+ "test:dev": "vitest"
13
+ },
14
+ "keywords": [
15
+ "api",
16
+ "blueprint"
17
+ ],
18
+ "author": "Deskree Inc",
19
+ "license": "MIT",
20
+ "devDependencies": {
21
+ "@types/lodash": "^4.14.196",
22
+ "@types/node": "^22.15.21",
23
+ "typescript": "^5.8.3",
24
+ "vitest": "^4.0.18"
25
+ },
26
+ "dependencies": {
27
+ "dayjs": "^1.11.19",
28
+ "lodash": "^4.17.21"
29
+ },
30
+ "private": false,
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }