hazo_images 1.2.0 → 1.2.1

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/README.md CHANGED
@@ -16,7 +16,7 @@ npm install hazo_core
16
16
  npm install sharp
17
17
 
18
18
  # Optional — only needed if using uploadProcessedImage
19
- npm install hazo_files@^2.1.1
19
+ npm install hazo_files
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -1,5 +1,64 @@
1
1
  // src/runware/client.ts
2
- import { fetchWithRequestId, generateRequestId } from "hazo_core";
2
+ import { fetchWithRequestId } from "hazo_core";
3
+
4
+ // ../node_modules/uuid/dist/esm-node/rng.js
5
+ import crypto from "crypto";
6
+ var rnds8Pool = new Uint8Array(256);
7
+ var poolPtr = rnds8Pool.length;
8
+ function rng() {
9
+ if (poolPtr > rnds8Pool.length - 16) {
10
+ crypto.randomFillSync(rnds8Pool);
11
+ poolPtr = 0;
12
+ }
13
+ return rnds8Pool.slice(poolPtr, poolPtr += 16);
14
+ }
15
+
16
+ // ../node_modules/uuid/dist/esm-node/regex.js
17
+ var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
18
+
19
+ // ../node_modules/uuid/dist/esm-node/validate.js
20
+ function validate(uuid) {
21
+ return typeof uuid === "string" && regex_default.test(uuid);
22
+ }
23
+ var validate_default = validate;
24
+
25
+ // ../node_modules/uuid/dist/esm-node/stringify.js
26
+ var byteToHex = [];
27
+ for (let i = 0; i < 256; ++i) {
28
+ byteToHex.push((i + 256).toString(16).substr(1));
29
+ }
30
+ function stringify(arr, offset = 0) {
31
+ const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
32
+ if (!validate_default(uuid)) {
33
+ throw TypeError("Stringified UUID is invalid");
34
+ }
35
+ return uuid;
36
+ }
37
+ var stringify_default = stringify;
38
+
39
+ // ../node_modules/uuid/dist/esm-node/v4.js
40
+ function v4(options, buf, offset) {
41
+ options = options || {};
42
+ const rnds = options.random || (options.rng || rng)();
43
+ rnds[6] = rnds[6] & 15 | 64;
44
+ rnds[8] = rnds[8] & 63 | 128;
45
+ if (buf) {
46
+ offset = offset || 0;
47
+ for (let i = 0; i < 16; ++i) {
48
+ buf[offset + i] = rnds[i];
49
+ }
50
+ return buf;
51
+ }
52
+ return stringify_default(rnds);
53
+ }
54
+ var v4_default = v4;
55
+
56
+ // src/utils/uuid.ts
57
+ import { generateRequestId } from "hazo_core";
58
+ var uuidv4 = v4_default;
59
+ function generateTaskUUID() {
60
+ return uuidv4();
61
+ }
3
62
 
4
63
  // src/utils/logger.ts
5
64
  import { createLogger } from "hazo_core";
@@ -114,7 +173,7 @@ function createRunwareClient(opts = {}) {
114
173
  });
115
174
  throw err;
116
175
  }
117
- const taskUUID = generateRequestId();
176
+ const taskUUID = generateTaskUUID();
118
177
  cfg.logger.info("runware.generate_image.started", { model, taskUUID });
119
178
  const task = {
120
179
  taskType: "imageInference",
@@ -266,7 +325,7 @@ function createRunwareClient(opts = {}) {
266
325
  async getBalance() {
267
326
  const start = Date.now();
268
327
  const apiKey = resolveApiKey(cfg.optsApiKey);
269
- const taskUUID = generateRequestId();
328
+ const taskUUID = generateTaskUUID();
270
329
  const controller = new AbortController();
271
330
  const timer = setTimeout(() => controller.abort(), cfg.timeoutMs);
272
331
  let res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_images",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Image processing pipeline for the hazo ecosystem — Sharp wrapper, thumbnail generation, EXIF handling, and hazo_files integration helper",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -73,7 +73,7 @@
73
73
  "@types/jest": "^30.0.0",
74
74
  "@types/node": "^22.10.0",
75
75
  "@types/react": "^19.0.0",
76
- "hazo_core": "^1.0.0",
76
+ "hazo_core": "^1.0.1",
77
77
  "jest": "^30.2.0",
78
78
  "jest-environment-node": "^30.2.0",
79
79
  "ts-jest": "^29.4.5",