@codemation/node-example 0.0.40 → 0.0.42

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @codemation/node-example
2
2
 
3
+ ## 0.0.42
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2fcb715`](https://github.com/MadeRelevant/codemation/commit/2fcb7153d9c732b2f846b8a8d1cc5626b4363fa6)]:
8
+ - @codemation/core@0.13.1
9
+
10
+ ## 0.0.41
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`c1b081f`](https://github.com/MadeRelevant/codemation/commit/c1b081ffc8b66b0c4593c94f1d57a1cdf5c41140), [`be520d2`](https://github.com/MadeRelevant/codemation/commit/be520d2755144a3709ecc109019b84e2c502337e)]:
15
+ - @codemation/core@0.13.0
16
+
3
17
  ## 0.0.40
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.cts CHANGED
@@ -531,6 +531,22 @@ interface ExecutionBinaryService {
531
531
  activationId: NodeActivationId;
532
532
  }): NodeBinaryAttachmentService;
533
533
  openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
534
+ /**
535
+ * Reads all bytes from the attachment into a contiguous `Uint8Array`.
536
+ * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
537
+ * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
538
+ */
539
+ getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
540
+ /**
541
+ * Reads the attachment and decodes the bytes as UTF-8 text.
542
+ * Subject to the same bounded-read safety as `getBytes`.
543
+ */
544
+ getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
545
+ /**
546
+ * Reads the attachment, decodes as UTF-8 text, and parses as JSON.
547
+ * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
548
+ */
549
+ getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
534
550
  }
535
551
  interface ExecutionContext {
536
552
  runId: RunId;
package/dist/index.d.ts CHANGED
@@ -531,6 +531,22 @@ interface ExecutionBinaryService {
531
531
  activationId: NodeActivationId;
532
532
  }): NodeBinaryAttachmentService;
533
533
  openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
534
+ /**
535
+ * Reads all bytes from the attachment into a contiguous `Uint8Array`.
536
+ * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
537
+ * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
538
+ */
539
+ getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
540
+ /**
541
+ * Reads the attachment and decodes the bytes as UTF-8 text.
542
+ * Subject to the same bounded-read safety as `getBytes`.
543
+ */
544
+ getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
545
+ /**
546
+ * Reads the attachment, decodes as UTF-8 text, and parses as JSON.
547
+ * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
548
+ */
549
+ getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
534
550
  }
535
551
  interface ExecutionContext {
536
552
  runId: RunId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemation/node-example",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@codemation/core": "0.12.0"
31
+ "@codemation/core": "0.13.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^25.3.5",