c2-clinical 1.0.117 → 1.0.118

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,7 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // import { randomUUID } from "node:crypto";
4
- const crypto_1 = require("crypto");
6
+ const GenerateUUIDFlowItem_1 = __importDefault(require("./GenerateUUIDFlowItem"));
5
7
  class BuildTreeFlowItem {
6
8
  bank = [];
7
9
  execute(questions) {
@@ -31,7 +33,7 @@ class BuildTreeFlowItem {
31
33
  const lines = parent.children.reduce((acc, item) => {
32
34
  if (!acc.some((a) => a.line === item.line)) {
33
35
  acc.push({
34
- id: (0, crypto_1.randomUUID)(),
36
+ id: GenerateUUIDFlowItem_1.default.execute(),
35
37
  line: item.line,
36
38
  collumns: []
37
39
  });
@@ -60,7 +62,7 @@ class BuildTreeFlowItem {
60
62
  const lines = config.children.reduce((acc, item) => {
61
63
  if (!acc.some((a) => a.line === item.line)) {
62
64
  acc.push({
63
- id: (0, crypto_1.randomUUID)(),
65
+ id: GenerateUUIDFlowItem_1.default.execute(),
64
66
  line: item.line,
65
67
  collumns: []
66
68
  });
@@ -0,0 +1,5 @@
1
+ declare class GenerateUUIDFlowItem {
2
+ execute(): string;
3
+ }
4
+ declare const _default: GenerateUUIDFlowItem;
5
+ export default _default;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class GenerateUUIDFlowItem {
4
+ execute() {
5
+ if (typeof globalThis.crypto?.randomUUID === "function") {
6
+ return globalThis.crypto.randomUUID();
7
+ }
8
+ // fallback se não houver suporte
9
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
10
+ const r = (Math.random() * 16) | 0;
11
+ const v = c === "x" ? r : (r & 0x3) | 0x8;
12
+ return v.toString(16);
13
+ });
14
+ }
15
+ }
16
+ exports.default = new GenerateUUIDFlowItem();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.117",
3
+ "version": "1.0.118",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://github.com/cabralsilva/c2-clinical.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",