@bcts/provenance-mark 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,54 +11,54 @@ let _bcts_envelope = require("@bcts/envelope");
11
11
  /**
12
12
  * Error types for Provenance Mark operations.
13
13
  */
14
- let ProvenanceMarkErrorType = /* @__PURE__ */ function(ProvenanceMarkErrorType$1) {
14
+ let ProvenanceMarkErrorType = /* @__PURE__ */ function(ProvenanceMarkErrorType) {
15
15
  /** Invalid Seed length */
16
- ProvenanceMarkErrorType$1["InvalidSeedLength"] = "InvalidSeedLength";
16
+ ProvenanceMarkErrorType["InvalidSeedLength"] = "InvalidSeedLength";
17
17
  /** Duplicate key */
18
- ProvenanceMarkErrorType$1["DuplicateKey"] = "DuplicateKey";
18
+ ProvenanceMarkErrorType["DuplicateKey"] = "DuplicateKey";
19
19
  /** Missing key */
20
- ProvenanceMarkErrorType$1["MissingKey"] = "MissingKey";
20
+ ProvenanceMarkErrorType["MissingKey"] = "MissingKey";
21
21
  /** Invalid key */
22
- ProvenanceMarkErrorType$1["InvalidKey"] = "InvalidKey";
22
+ ProvenanceMarkErrorType["InvalidKey"] = "InvalidKey";
23
23
  /** Extra keys */
24
- ProvenanceMarkErrorType$1["ExtraKeys"] = "ExtraKeys";
24
+ ProvenanceMarkErrorType["ExtraKeys"] = "ExtraKeys";
25
25
  /** Invalid key length for the given resolution */
26
- ProvenanceMarkErrorType$1["InvalidKeyLength"] = "InvalidKeyLength";
26
+ ProvenanceMarkErrorType["InvalidKeyLength"] = "InvalidKeyLength";
27
27
  /** Invalid next key length for the given resolution */
28
- ProvenanceMarkErrorType$1["InvalidNextKeyLength"] = "InvalidNextKeyLength";
28
+ ProvenanceMarkErrorType["InvalidNextKeyLength"] = "InvalidNextKeyLength";
29
29
  /** Invalid chain ID length for the given resolution */
30
- ProvenanceMarkErrorType$1["InvalidChainIdLength"] = "InvalidChainIdLength";
30
+ ProvenanceMarkErrorType["InvalidChainIdLength"] = "InvalidChainIdLength";
31
31
  /** Invalid message length for the given resolution */
32
- ProvenanceMarkErrorType$1["InvalidMessageLength"] = "InvalidMessageLength";
32
+ ProvenanceMarkErrorType["InvalidMessageLength"] = "InvalidMessageLength";
33
33
  /** Invalid CBOR data in info field */
34
- ProvenanceMarkErrorType$1["InvalidInfoCbor"] = "InvalidInfoCbor";
34
+ ProvenanceMarkErrorType["InvalidInfoCbor"] = "InvalidInfoCbor";
35
35
  /** Date out of range for serialization */
36
- ProvenanceMarkErrorType$1["DateOutOfRange"] = "DateOutOfRange";
36
+ ProvenanceMarkErrorType["DateOutOfRange"] = "DateOutOfRange";
37
37
  /** Invalid date components */
38
- ProvenanceMarkErrorType$1["InvalidDate"] = "InvalidDate";
38
+ ProvenanceMarkErrorType["InvalidDate"] = "InvalidDate";
39
39
  /** Missing required URL parameter */
40
- ProvenanceMarkErrorType$1["MissingUrlParameter"] = "MissingUrlParameter";
40
+ ProvenanceMarkErrorType["MissingUrlParameter"] = "MissingUrlParameter";
41
41
  /** Year out of range for 2-byte serialization */
42
- ProvenanceMarkErrorType$1["YearOutOfRange"] = "YearOutOfRange";
42
+ ProvenanceMarkErrorType["YearOutOfRange"] = "YearOutOfRange";
43
43
  /** Invalid month or day */
44
- ProvenanceMarkErrorType$1["InvalidMonthOrDay"] = "InvalidMonthOrDay";
44
+ ProvenanceMarkErrorType["InvalidMonthOrDay"] = "InvalidMonthOrDay";
45
45
  /** Resolution serialization error */
46
- ProvenanceMarkErrorType$1["ResolutionError"] = "ResolutionError";
46
+ ProvenanceMarkErrorType["ResolutionError"] = "ResolutionError";
47
47
  /** Bytewords encoding/decoding error */
48
- ProvenanceMarkErrorType$1["BytewordsError"] = "BytewordsError";
48
+ ProvenanceMarkErrorType["BytewordsError"] = "BytewordsError";
49
49
  /** CBOR encoding/decoding error */
50
- ProvenanceMarkErrorType$1["CborError"] = "CborError";
50
+ ProvenanceMarkErrorType["CborError"] = "CborError";
51
51
  /** URL parsing error */
52
- ProvenanceMarkErrorType$1["UrlError"] = "UrlError";
52
+ ProvenanceMarkErrorType["UrlError"] = "UrlError";
53
53
  /** Base64 decoding error */
54
- ProvenanceMarkErrorType$1["Base64Error"] = "Base64Error";
54
+ ProvenanceMarkErrorType["Base64Error"] = "Base64Error";
55
55
  /** JSON serialization error */
56
- ProvenanceMarkErrorType$1["JsonError"] = "JsonError";
56
+ ProvenanceMarkErrorType["JsonError"] = "JsonError";
57
57
  /** Integer conversion error */
58
- ProvenanceMarkErrorType$1["IntegerConversionError"] = "IntegerConversionError";
58
+ ProvenanceMarkErrorType["IntegerConversionError"] = "IntegerConversionError";
59
59
  /** Validation error */
60
- ProvenanceMarkErrorType$1["ValidationError"] = "ValidationError";
61
- return ProvenanceMarkErrorType$1;
60
+ ProvenanceMarkErrorType["ValidationError"] = "ValidationError";
61
+ return ProvenanceMarkErrorType;
62
62
  }({});
63
63
  /**
64
64
  * Error class for Provenance Mark operations.
@@ -253,12 +253,12 @@ function dateToDateString(date) {
253
253
  * Resolution levels for provenance marks.
254
254
  * Higher resolution provides more security but larger mark sizes.
255
255
  */
256
- let ProvenanceMarkResolution = /* @__PURE__ */ function(ProvenanceMarkResolution$1) {
257
- ProvenanceMarkResolution$1[ProvenanceMarkResolution$1["Low"] = 0] = "Low";
258
- ProvenanceMarkResolution$1[ProvenanceMarkResolution$1["Medium"] = 1] = "Medium";
259
- ProvenanceMarkResolution$1[ProvenanceMarkResolution$1["Quartile"] = 2] = "Quartile";
260
- ProvenanceMarkResolution$1[ProvenanceMarkResolution$1["High"] = 3] = "High";
261
- return ProvenanceMarkResolution$1;
256
+ let ProvenanceMarkResolution = /* @__PURE__ */ function(ProvenanceMarkResolution) {
257
+ ProvenanceMarkResolution[ProvenanceMarkResolution["Low"] = 0] = "Low";
258
+ ProvenanceMarkResolution[ProvenanceMarkResolution["Medium"] = 1] = "Medium";
259
+ ProvenanceMarkResolution[ProvenanceMarkResolution["Quartile"] = 2] = "Quartile";
260
+ ProvenanceMarkResolution[ProvenanceMarkResolution["High"] = 3] = "High";
261
+ return ProvenanceMarkResolution;
262
262
  }({});
263
263
  /**
264
264
  * Convert a resolution to its numeric value.
@@ -689,9 +689,9 @@ var ProvenanceSeed = class ProvenanceSeed {
689
689
  /**
690
690
  * Create a new seed using custom random data.
691
691
  */
692
- static newUsing(randomData$1) {
693
- if (randomData$1.length < PROVENANCE_SEED_LENGTH) throw new ProvenanceMarkError(ProvenanceMarkErrorType.InvalidSeedLength, void 0, { actual: randomData$1.length });
694
- return ProvenanceSeed.fromBytes(randomData$1.slice(0, PROVENANCE_SEED_LENGTH));
692
+ static newUsing(randomData) {
693
+ if (randomData.length < PROVENANCE_SEED_LENGTH) throw new ProvenanceMarkError(ProvenanceMarkErrorType.InvalidSeedLength, void 0, { actual: randomData.length });
694
+ return ProvenanceSeed.fromBytes(randomData.slice(0, PROVENANCE_SEED_LENGTH));
695
695
  }
696
696
  /**
697
697
  * Create a new seed from a passphrase.
@@ -1264,8 +1264,8 @@ var ProvenanceMarkGenerator = class ProvenanceMarkGenerator {
1264
1264
  /**
1265
1265
  * Create a new generator with custom random data.
1266
1266
  */
1267
- static newUsing(res, randomData$1) {
1268
- const seed = ProvenanceSeed.newUsing(randomData$1);
1267
+ static newUsing(res, randomData) {
1268
+ const seed = ProvenanceSeed.newUsing(randomData);
1269
1269
  return ProvenanceMarkGenerator.newWithSeed(res, seed);
1270
1270
  }
1271
1271
  /**
@@ -1397,14 +1397,14 @@ var ProvenanceMarkGenerator = class ProvenanceMarkGenerator {
1397
1397
  /**
1398
1398
  * Format for validation report output.
1399
1399
  */
1400
- let ValidationReportFormat = /* @__PURE__ */ function(ValidationReportFormat$1) {
1400
+ let ValidationReportFormat = /* @__PURE__ */ function(ValidationReportFormat) {
1401
1401
  /** Human-readable text format */
1402
- ValidationReportFormat$1["Text"] = "text";
1402
+ ValidationReportFormat["Text"] = "text";
1403
1403
  /** Compact JSON format (no whitespace) */
1404
- ValidationReportFormat$1["JsonCompact"] = "json-compact";
1404
+ ValidationReportFormat["JsonCompact"] = "json-compact";
1405
1405
  /** Pretty-printed JSON format (with indentation) */
1406
- ValidationReportFormat$1["JsonPretty"] = "json-pretty";
1407
- return ValidationReportFormat$1;
1406
+ ValidationReportFormat["JsonPretty"] = "json-pretty";
1407
+ return ValidationReportFormat;
1408
1408
  }({});
1409
1409
  /**
1410
1410
  * Format a validation issue as a string.