@bcts/xid 1.0.0-alpha.16 → 1.0.0-alpha.17

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/dist/index.cjs CHANGED
@@ -11,37 +11,37 @@ let _bcts_dcbor = require("@bcts/dcbor");
11
11
  * Error types returned when operating on XID Documents.
12
12
  * Ported from bc-xid-rust/src/error.rs
13
13
  */
14
- let XIDErrorCode = /* @__PURE__ */ function(XIDErrorCode$1) {
15
- XIDErrorCode$1["DUPLICATE"] = "DUPLICATE";
16
- XIDErrorCode$1["NOT_FOUND"] = "NOT_FOUND";
17
- XIDErrorCode$1["STILL_REFERENCED"] = "STILL_REFERENCED";
18
- XIDErrorCode$1["EMPTY_VALUE"] = "EMPTY_VALUE";
19
- XIDErrorCode$1["UNKNOWN_PRIVILEGE"] = "UNKNOWN_PRIVILEGE";
20
- XIDErrorCode$1["INVALID_XID"] = "INVALID_XID";
21
- XIDErrorCode$1["MISSING_INCEPTION_KEY"] = "MISSING_INCEPTION_KEY";
22
- XIDErrorCode$1["INVALID_RESOLUTION_METHOD"] = "INVALID_RESOLUTION_METHOD";
23
- XIDErrorCode$1["MULTIPLE_PROVENANCE_MARKS"] = "MULTIPLE_PROVENANCE_MARKS";
24
- XIDErrorCode$1["UNEXPECTED_PREDICATE"] = "UNEXPECTED_PREDICATE";
25
- XIDErrorCode$1["UNEXPECTED_NESTED_ASSERTIONS"] = "UNEXPECTED_NESTED_ASSERTIONS";
26
- XIDErrorCode$1["NO_PERMISSIONS"] = "NO_PERMISSIONS";
27
- XIDErrorCode$1["NO_REFERENCES"] = "NO_REFERENCES";
28
- XIDErrorCode$1["UNKNOWN_KEY_REFERENCE"] = "UNKNOWN_KEY_REFERENCE";
29
- XIDErrorCode$1["UNKNOWN_DELEGATE_REFERENCE"] = "UNKNOWN_DELEGATE_REFERENCE";
30
- XIDErrorCode$1["KEY_NOT_FOUND_IN_DOCUMENT"] = "KEY_NOT_FOUND_IN_DOCUMENT";
31
- XIDErrorCode$1["DELEGATE_NOT_FOUND_IN_DOCUMENT"] = "DELEGATE_NOT_FOUND_IN_DOCUMENT";
32
- XIDErrorCode$1["INVALID_PASSWORD"] = "INVALID_PASSWORD";
33
- XIDErrorCode$1["ENVELOPE_NOT_SIGNED"] = "ENVELOPE_NOT_SIGNED";
34
- XIDErrorCode$1["SIGNATURE_VERIFICATION_FAILED"] = "SIGNATURE_VERIFICATION_FAILED";
35
- XIDErrorCode$1["NO_PROVENANCE_MARK"] = "NO_PROVENANCE_MARK";
36
- XIDErrorCode$1["GENERATOR_CONFLICT"] = "GENERATOR_CONFLICT";
37
- XIDErrorCode$1["NO_GENERATOR"] = "NO_GENERATOR";
38
- XIDErrorCode$1["CHAIN_ID_MISMATCH"] = "CHAIN_ID_MISMATCH";
39
- XIDErrorCode$1["SEQUENCE_MISMATCH"] = "SEQUENCE_MISMATCH";
40
- XIDErrorCode$1["ENVELOPE_PARSING"] = "ENVELOPE_PARSING";
41
- XIDErrorCode$1["COMPONENT"] = "COMPONENT";
42
- XIDErrorCode$1["CBOR"] = "CBOR";
43
- XIDErrorCode$1["PROVENANCE_MARK"] = "PROVENANCE_MARK";
44
- return XIDErrorCode$1;
14
+ let XIDErrorCode = /* @__PURE__ */ function(XIDErrorCode) {
15
+ XIDErrorCode["DUPLICATE"] = "DUPLICATE";
16
+ XIDErrorCode["NOT_FOUND"] = "NOT_FOUND";
17
+ XIDErrorCode["STILL_REFERENCED"] = "STILL_REFERENCED";
18
+ XIDErrorCode["EMPTY_VALUE"] = "EMPTY_VALUE";
19
+ XIDErrorCode["UNKNOWN_PRIVILEGE"] = "UNKNOWN_PRIVILEGE";
20
+ XIDErrorCode["INVALID_XID"] = "INVALID_XID";
21
+ XIDErrorCode["MISSING_INCEPTION_KEY"] = "MISSING_INCEPTION_KEY";
22
+ XIDErrorCode["INVALID_RESOLUTION_METHOD"] = "INVALID_RESOLUTION_METHOD";
23
+ XIDErrorCode["MULTIPLE_PROVENANCE_MARKS"] = "MULTIPLE_PROVENANCE_MARKS";
24
+ XIDErrorCode["UNEXPECTED_PREDICATE"] = "UNEXPECTED_PREDICATE";
25
+ XIDErrorCode["UNEXPECTED_NESTED_ASSERTIONS"] = "UNEXPECTED_NESTED_ASSERTIONS";
26
+ XIDErrorCode["NO_PERMISSIONS"] = "NO_PERMISSIONS";
27
+ XIDErrorCode["NO_REFERENCES"] = "NO_REFERENCES";
28
+ XIDErrorCode["UNKNOWN_KEY_REFERENCE"] = "UNKNOWN_KEY_REFERENCE";
29
+ XIDErrorCode["UNKNOWN_DELEGATE_REFERENCE"] = "UNKNOWN_DELEGATE_REFERENCE";
30
+ XIDErrorCode["KEY_NOT_FOUND_IN_DOCUMENT"] = "KEY_NOT_FOUND_IN_DOCUMENT";
31
+ XIDErrorCode["DELEGATE_NOT_FOUND_IN_DOCUMENT"] = "DELEGATE_NOT_FOUND_IN_DOCUMENT";
32
+ XIDErrorCode["INVALID_PASSWORD"] = "INVALID_PASSWORD";
33
+ XIDErrorCode["ENVELOPE_NOT_SIGNED"] = "ENVELOPE_NOT_SIGNED";
34
+ XIDErrorCode["SIGNATURE_VERIFICATION_FAILED"] = "SIGNATURE_VERIFICATION_FAILED";
35
+ XIDErrorCode["NO_PROVENANCE_MARK"] = "NO_PROVENANCE_MARK";
36
+ XIDErrorCode["GENERATOR_CONFLICT"] = "GENERATOR_CONFLICT";
37
+ XIDErrorCode["NO_GENERATOR"] = "NO_GENERATOR";
38
+ XIDErrorCode["CHAIN_ID_MISMATCH"] = "CHAIN_ID_MISMATCH";
39
+ XIDErrorCode["SEQUENCE_MISMATCH"] = "SEQUENCE_MISMATCH";
40
+ XIDErrorCode["ENVELOPE_PARSING"] = "ENVELOPE_PARSING";
41
+ XIDErrorCode["COMPONENT"] = "COMPONENT";
42
+ XIDErrorCode["CBOR"] = "CBOR";
43
+ XIDErrorCode["PROVENANCE_MARK"] = "PROVENANCE_MARK";
44
+ return XIDErrorCode;
45
45
  }({});
46
46
  var XIDError = class XIDError extends Error {
47
47
  code;
@@ -243,36 +243,36 @@ var XIDError = class XIDError extends Error {
243
243
  /**
244
244
  * Enum representing XID privileges.
245
245
  */
246
- let Privilege = /* @__PURE__ */ function(Privilege$1) {
246
+ let Privilege = /* @__PURE__ */ function(Privilege) {
247
247
  /** Allow all applicable XID operations */
248
- Privilege$1["All"] = "All";
248
+ Privilege["All"] = "All";
249
249
  /** Authenticate as the subject (e.g., log into services) */
250
- Privilege$1["Auth"] = "Auth";
250
+ Privilege["Auth"] = "Auth";
251
251
  /** Sign digital communications as the subject */
252
- Privilege$1["Sign"] = "Sign";
252
+ Privilege["Sign"] = "Sign";
253
253
  /** Encrypt messages from the subject */
254
- Privilege$1["Encrypt"] = "Encrypt";
254
+ Privilege["Encrypt"] = "Encrypt";
255
255
  /** Elide data under the subject's control */
256
- Privilege$1["Elide"] = "Elide";
256
+ Privilege["Elide"] = "Elide";
257
257
  /** Issue or revoke verifiable credentials on the subject's authority */
258
- Privilege$1["Issue"] = "Issue";
258
+ Privilege["Issue"] = "Issue";
259
259
  /** Access resources under the subject's control */
260
- Privilege$1["Access"] = "Access";
260
+ Privilege["Access"] = "Access";
261
261
  /** Delegate privileges to third parties */
262
- Privilege$1["Delegate"] = "Delegate";
262
+ Privilege["Delegate"] = "Delegate";
263
263
  /** Verify (update) the XID document */
264
- Privilege$1["Verify"] = "Verify";
264
+ Privilege["Verify"] = "Verify";
265
265
  /** Update service endpoints */
266
- Privilege$1["Update"] = "Update";
266
+ Privilege["Update"] = "Update";
267
267
  /** Remove the inception key from the XID document */
268
- Privilege$1["Transfer"] = "Transfer";
268
+ Privilege["Transfer"] = "Transfer";
269
269
  /** Add or remove other verifiers (rotate keys) */
270
- Privilege$1["Elect"] = "Elect";
270
+ Privilege["Elect"] = "Elect";
271
271
  /** Transition to a new provenance mark chain */
272
- Privilege$1["Burn"] = "Burn";
272
+ Privilege["Burn"] = "Burn";
273
273
  /** Revoke the XID entirely */
274
- Privilege$1["Revoke"] = "Revoke";
275
- return Privilege$1;
274
+ Privilege["Revoke"] = "Revoke";
275
+ return Privilege;
276
276
  }({});
277
277
  /**
278
278
  * Convert a Privilege to its corresponding KnownValue.
@@ -562,16 +562,16 @@ const kv$3 = (v) => v;
562
562
  /**
563
563
  * Options for handling private keys in envelopes.
564
564
  */
565
- let XIDPrivateKeyOptions = /* @__PURE__ */ function(XIDPrivateKeyOptions$1) {
565
+ let XIDPrivateKeyOptions = /* @__PURE__ */ function(XIDPrivateKeyOptions) {
566
566
  /** Omit the private key from the envelope (default). */
567
- XIDPrivateKeyOptions$1["Omit"] = "Omit";
567
+ XIDPrivateKeyOptions["Omit"] = "Omit";
568
568
  /** Include the private key in plaintext (with salt for decorrelation). */
569
- XIDPrivateKeyOptions$1["Include"] = "Include";
569
+ XIDPrivateKeyOptions["Include"] = "Include";
570
570
  /** Include the private key assertion but elide it (maintains digest tree). */
571
- XIDPrivateKeyOptions$1["Elide"] = "Elide";
571
+ XIDPrivateKeyOptions["Elide"] = "Elide";
572
572
  /** Include the private key encrypted with a password. */
573
- XIDPrivateKeyOptions$1["Encrypt"] = "Encrypt";
574
- return XIDPrivateKeyOptions$1;
573
+ XIDPrivateKeyOptions["Encrypt"] = "Encrypt";
574
+ return XIDPrivateKeyOptions;
575
575
  }({});
576
576
  /**
577
577
  * Represents a key in an XID document.
@@ -1174,16 +1174,16 @@ const kv$1 = (v) => v;
1174
1174
  /**
1175
1175
  * Options for handling generators in envelopes.
1176
1176
  */
1177
- let XIDGeneratorOptions = /* @__PURE__ */ function(XIDGeneratorOptions$1) {
1177
+ let XIDGeneratorOptions = /* @__PURE__ */ function(XIDGeneratorOptions) {
1178
1178
  /** Omit the generator from the envelope (default). */
1179
- XIDGeneratorOptions$1["Omit"] = "Omit";
1179
+ XIDGeneratorOptions["Omit"] = "Omit";
1180
1180
  /** Include the generator in plaintext (with salt for decorrelation). */
1181
- XIDGeneratorOptions$1["Include"] = "Include";
1181
+ XIDGeneratorOptions["Include"] = "Include";
1182
1182
  /** Include the generator assertion but elide it (maintains digest tree). */
1183
- XIDGeneratorOptions$1["Elide"] = "Elide";
1183
+ XIDGeneratorOptions["Elide"] = "Elide";
1184
1184
  /** Include the generator encrypted with a password. */
1185
- XIDGeneratorOptions$1["Encrypt"] = "Encrypt";
1186
- return XIDGeneratorOptions$1;
1185
+ XIDGeneratorOptions["Encrypt"] = "Encrypt";
1186
+ return XIDGeneratorOptions;
1187
1187
  }({});
1188
1188
  /**
1189
1189
  * Represents provenance information in an XID document.
@@ -1445,12 +1445,12 @@ const DEREFERENCE_VIA_RAW = _bcts_known_values.DEREFERENCE_VIA.value();
1445
1445
  /**
1446
1446
  * Options for verifying the signature on an envelope when loading.
1447
1447
  */
1448
- let XIDVerifySignature = /* @__PURE__ */ function(XIDVerifySignature$1) {
1448
+ let XIDVerifySignature = /* @__PURE__ */ function(XIDVerifySignature) {
1449
1449
  /** Do not verify the signature (default). */
1450
- XIDVerifySignature$1["None"] = "None";
1450
+ XIDVerifySignature["None"] = "None";
1451
1451
  /** Verify that the envelope is signed with the inception key. */
1452
- XIDVerifySignature$1["Inception"] = "Inception";
1453
- return XIDVerifySignature$1;
1452
+ XIDVerifySignature["Inception"] = "Inception";
1453
+ return XIDVerifySignature;
1454
1454
  }({});
1455
1455
  /**
1456
1456
  * Represents an XID document.
@@ -1822,7 +1822,6 @@ var XIDDocument = class XIDDocument {
1822
1822
  case "privateKeys":
1823
1823
  envelope = envelope.sign(signingOptions.privateKeys);
1824
1824
  break;
1825
- case "none":
1826
1825
  default: break;
1827
1826
  }
1828
1827
  return envelope;