@bcts/envelope 1.0.0-alpha.20 → 1.0.0-alpha.22

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 (55) hide show
  1. package/LICENSE +2 -1
  2. package/dist/index.cjs +142 -0
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +37 -2
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +37 -2
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.iife.js +142 -0
  9. package/dist/index.iife.js.map +1 -1
  10. package/dist/index.mjs +142 -0
  11. package/dist/index.mjs.map +1 -1
  12. package/package.json +16 -27
  13. package/src/base/assertion.ts +6 -0
  14. package/src/base/assertions.ts +6 -0
  15. package/src/base/cbor.ts +6 -0
  16. package/src/base/digest.ts +4 -0
  17. package/src/base/elide.ts +6 -0
  18. package/src/base/envelope-decodable.ts +6 -0
  19. package/src/base/envelope-encodable.ts +6 -0
  20. package/src/base/envelope.ts +6 -0
  21. package/src/base/error.ts +6 -0
  22. package/src/base/index.ts +6 -0
  23. package/src/base/leaf.ts +6 -0
  24. package/src/base/queries.ts +6 -0
  25. package/src/base/ur.ts +6 -0
  26. package/src/base/walk.ts +6 -0
  27. package/src/base/wrap.ts +6 -0
  28. package/src/extension/attachment.ts +4 -0
  29. package/src/extension/compress.ts +6 -0
  30. package/src/extension/edge.ts +4 -0
  31. package/src/extension/encrypt.ts +6 -0
  32. package/src/extension/event.ts +4 -0
  33. package/src/extension/expression.ts +6 -0
  34. package/src/extension/index.ts +6 -0
  35. package/src/extension/proof.ts +6 -0
  36. package/src/extension/recipient.ts +4 -0
  37. package/src/extension/request.ts +4 -0
  38. package/src/extension/response.ts +4 -0
  39. package/src/extension/salt.ts +6 -0
  40. package/src/extension/secret.ts +6 -0
  41. package/src/extension/signature.ts +4 -0
  42. package/src/extension/sskr.ts +6 -0
  43. package/src/extension/types.ts +6 -0
  44. package/src/format/diagnostic.ts +6 -0
  45. package/src/format/envelope-summary.ts +6 -0
  46. package/src/format/format-context.ts +6 -0
  47. package/src/format/hex.ts +6 -0
  48. package/src/format/index.ts +6 -0
  49. package/src/format/mermaid.ts +6 -0
  50. package/src/format/notation.ts +6 -0
  51. package/src/format/tree.ts +6 -0
  52. package/src/index.ts +6 -0
  53. package/src/seal.ts +6 -0
  54. package/src/utils/index.ts +4 -0
  55. package/src/utils/string.ts +4 -0
package/package.json CHANGED
@@ -1,29 +1,18 @@
1
1
  {
2
2
  "name": "@bcts/envelope",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.22",
4
4
  "type": "module",
5
5
  "description": "Gordian Envelope for TypeScript",
6
6
  "license": "BSD-2-Clause-Patent",
7
- "contributors": [
8
- {
9
- "name": "Leonardo Custodio",
10
- "email": "leonardo.custodio@parity.io",
11
- "url": "https://github.com/leonardocustodio"
12
- },
13
- {
14
- "name": "Karim Jedda",
15
- "email": "karim@parity.io",
16
- "url": "https://github.com/KarimJedda"
17
- }
18
- ],
7
+ "author": "Parity Technologies <admin@parity.io> (https://parity.io)",
19
8
  "homepage": "https://bcts.dev",
20
9
  "repository": {
21
10
  "type": "git",
22
- "url": "https://github.com/leonardocustodio/bcts",
11
+ "url": "https://github.com/paritytech/bcts",
23
12
  "directory": "packages/envelope"
24
13
  },
25
14
  "bugs": {
26
- "url": "https://github.com/leonardocustodio/bcts/issues"
15
+ "url": "https://github.com/paritytech/bcts/issues"
27
16
  },
28
17
  "main": "dist/index.cjs",
29
18
  "module": "dist/index.mjs",
@@ -71,26 +60,26 @@
71
60
  "devDependencies": {
72
61
  "@bcts/eslint": "^0.1.0",
73
62
  "@bcts/tsconfig": "^0.1.0",
74
- "@eslint/js": "^9.39.2",
75
- "@types/node": "^25.2.1",
63
+ "@eslint/js": "^10.0.1",
64
+ "@types/node": "^25.3.2",
76
65
  "@types/pako": "^2.0.3",
77
- "eslint": "^9.39.2",
66
+ "eslint": "^10.0.2",
78
67
  "prettier": "^3.8.1",
79
68
  "ts-node": "^10.9.2",
80
69
  "tsdown": "^0.20.3",
81
- "typedoc": "^0.28.16",
70
+ "typedoc": "^0.28.17",
82
71
  "typescript": "^5.9.3",
83
72
  "vitest": "^4.0.18"
84
73
  },
85
74
  "dependencies": {
86
- "@bcts/components": "^1.0.0-alpha.20",
87
- "@bcts/crypto": "^1.0.0-alpha.20",
88
- "@bcts/dcbor": "^1.0.0-alpha.20",
89
- "@bcts/known-values": "^1.0.0-alpha.20",
90
- "@bcts/rand": "^1.0.0-alpha.20",
91
- "@bcts/sskr": "^1.0.0-alpha.20",
92
- "@bcts/tags": "^1.0.0-alpha.20",
93
- "@bcts/uniform-resources": "^1.0.0-alpha.20",
75
+ "@bcts/components": "^1.0.0-alpha.22",
76
+ "@bcts/crypto": "^1.0.0-alpha.22",
77
+ "@bcts/dcbor": "^1.0.0-alpha.22",
78
+ "@bcts/known-values": "^1.0.0-alpha.22",
79
+ "@bcts/rand": "^1.0.0-alpha.22",
80
+ "@bcts/sskr": "^1.0.0-alpha.22",
81
+ "@bcts/tags": "^1.0.0-alpha.22",
82
+ "@bcts/uniform-resources": "^1.0.0-alpha.22",
94
83
  "pako": "^2.1.0"
95
84
  }
96
85
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Digest, type DigestProvider } from "./digest";
2
8
  import { Envelope } from "./envelope";
3
9
  import { type EnvelopeEncodable } from "./envelope-encodable";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "./envelope";
2
8
  import type { EnvelopeEncodableValue } from "./envelope-encodable";
3
9
  import { EnvelopeError } from "./error";
package/src/base/cbor.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import type { Cbor } from "@bcts/dcbor";
2
8
  import {
3
9
  type CborTagged,
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Re-export Digest from @bcts/components for type compatibility.
3
7
  *
4
8
  * The @bcts/components Digest class is the canonical implementation with:
package/src/base/elide.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { type Digest, type DigestProvider } from "./digest";
2
8
  import { Envelope } from "./envelope";
3
9
  import { Assertion } from "./assertion";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import type { Cbor } from "@bcts/dcbor";
2
8
  import { tryIntoText, tryIntoBool, tryIntoByteString, isNull, decodeCbor } from "@bcts/dcbor";
3
9
  import { Envelope } from "./envelope";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import type { CborTaggedEncodable } from "@bcts/dcbor";
2
8
  import type { KnownValue } from "@bcts/known-values";
3
9
  import type { Envelope } from "./envelope";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Digest, type DigestProvider } from "./digest";
2
8
  import { Assertion } from "./assertion";
3
9
  import { EnvelopeError } from "./error";
package/src/base/error.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Error types returned when operating on Gordian Envelopes.
2
8
  ///
3
9
  /// These errors capture various conditions that can occur when working with
package/src/base/index.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Base module exports for Gordian Envelope.
2
8
  ///
3
9
  /// This module provides the core functionality for working with Gordian
package/src/base/leaf.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import type { Cbor } from "@bcts/dcbor";
2
8
  import { isNumber, isNaN, asArray, asMap, asText } from "@bcts/dcbor";
3
9
  import type { KnownValue } from "@bcts/known-values";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  // Cbor type available if needed later
2
8
  import { Envelope } from "./envelope";
3
9
  import type { EnvelopeEncodableValue } from "./envelope-encodable";
package/src/base/ur.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// UR (Uniform Resource) support for Gordian Envelope.
2
8
  ///
3
9
  /// This module adds urString() and fromUrString() methods to the Envelope class,
package/src/base/walk.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "./envelope";
2
8
  import type { Digest } from "./digest";
3
9
  import type { EnvelopeEncodableValue } from "./envelope-encodable";
package/src/base/wrap.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "./envelope";
2
8
  import { EnvelopeError } from "./error";
3
9
 
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Attachment Extension for Gordian Envelope
3
7
  *
4
8
  * Provides functionality for attaching vendor-specific metadata to envelopes.
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { EnvelopeError } from "../base/error";
3
9
  import { type Digest } from "../base/digest";
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Edge Extension for Gordian Envelope (BCR-2026-003)
3
7
  *
4
8
  * Provides functionality for creating and managing edge envelopes that
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { EnvelopeError } from "../base/error";
3
9
  import { type Digest } from "../base/digest";
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Event type for notifications and messages.
3
7
  *
4
8
  * Ported from bc-envelope-rust/src/extension/expressions/event.rs
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { type EnvelopeEncodable, type EnvelopeEncodableValue } from "../base/envelope-encodable";
3
9
  import { EnvelopeError } from "../base/error";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Extension module exports for Gordian Envelope.
2
8
  ///
3
9
  /// This module provides extended functionality for working with Gordian
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { type Digest } from "../base/digest";
3
9
 
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Public key encryption extension for Gordian Envelope.
3
7
  *
4
8
  * This module implements public key encryption for Gordian Envelope, allowing
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Request type for distributed function calls.
3
7
  *
4
8
  * Ported from bc-envelope-rust/src/extension/expressions/request.rs
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Response type for distributed function calls.
3
7
  *
4
8
  * Ported from bc-envelope-rust/src/extension/expressions/response.rs
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { EnvelopeError } from "../base/error";
3
9
  import type { EnvelopeEncodableValue } from "../base/envelope-encodable";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Secret-based envelope locking and unlocking.
2
8
  ///
3
9
  /// This module provides functionality for encrypting envelope subjects using
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Signature Extension for Gordian Envelope
3
7
  *
4
8
  * Provides functionality for digitally signing Envelopes and verifying signatures,
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// SSKR-based envelope splitting and joining.
2
8
  ///
3
9
  /// This module provides functionality for splitting encrypted envelopes
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { type EnvelopeEncodableValue } from "../base/envelope-encodable";
3
9
  import { EnvelopeError } from "../base/error";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
 
3
9
  // Type for CBOR values that can appear in diagnostic notation
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Envelope summary functionality for generating short text representations.
2
8
  ///
3
9
  /// This module provides the EnvelopeSummary interface and implementations
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Format context for Gordian Envelopes with annotations.
2
8
  ///
3
9
  /// The FormatContext provides information about CBOR tags, known values,
package/src/format/hex.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { cborData } from "@bcts/dcbor";
3
9
 
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Format module exports for Gordian Envelope.
2
8
  ///
3
9
  /// This module provides various formatting options for displaying and
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Mermaid diagram formatting for Gordian Envelopes.
2
8
  ///
3
9
  /// This module provides functionality for creating Mermaid flowchart diagrams
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Envelope notation formatting.
2
8
  ///
3
9
  /// This module provides functionality for formatting envelopes in human-readable
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  import { Envelope } from "../base/envelope";
2
8
  import { type EdgeType, edgeLabel } from "../base/walk";
3
9
 
package/src/index.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Gordian Envelope TypeScript Library
2
8
  ///
3
9
  /// A TypeScript implementation of Blockchain Commons' Gordian Envelope
package/src/seal.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ */
6
+
1
7
  /// Envelope Sealing and Unsealing
2
8
  ///
3
9
  /// This module provides convenience functions for combining signing and
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * Utility functions for the envelope library.
3
7
  */
4
8
 
@@ -1,4 +1,8 @@
1
1
  /**
2
+ * Copyright © 2023-2026 Blockchain Commons, LLC
3
+ * Copyright © 2025-2026 Parity Technologies
4
+ *
5
+ *
2
6
  * String utility functions used throughout the envelope library.
3
7
  *
4
8
  * Provides helper methods for string formatting and manipulation.