@did-btcr2/common 5.0.0 → 7.0.0
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/cjs/canonicalization.js +95 -230
- package/dist/cjs/canonicalization.js.map +1 -1
- package/dist/cjs/errors.js +3 -8
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/json-patch.js +1 -1
- package/dist/cjs/json-patch.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/date.js +3 -4
- package/dist/cjs/utils/date.js.map +1 -1
- package/dist/cjs/utils/json.js +2 -9
- package/dist/cjs/utils/json.js.map +1 -1
- package/dist/esm/canonicalization.js +95 -230
- package/dist/esm/canonicalization.js.map +1 -1
- package/dist/esm/errors.js +3 -8
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/json-patch.js +1 -1
- package/dist/esm/json-patch.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/date.js +3 -4
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/json.js +2 -9
- package/dist/esm/utils/json.js.map +1 -1
- package/dist/types/canonicalization.d.ts +46 -137
- package/dist/types/canonicalization.d.ts.map +1 -1
- package/dist/types/errors.d.ts +5 -6
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/json-patch.d.ts +2 -1
- package/dist/types/json-patch.d.ts.map +1 -1
- package/dist/types/types.d.ts +8 -28
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/date.d.ts +4 -4
- package/dist/types/utils/date.d.ts.map +1 -1
- package/dist/types/utils/json.d.ts +2 -16
- package/dist/types/utils/json.d.ts.map +1 -1
- package/dist/types/utils/string.d.ts +1 -0
- package/package.json +11 -5
- package/src/canonicalization.ts +100 -254
- package/src/errors.ts +3 -15
- package/src/index.ts +0 -3
- package/src/json-patch.ts +2 -2
- package/src/types.ts +7 -30
- package/src/utils/date.ts +3 -4
- package/src/utils/json.ts +3 -10
- package/dist/cjs/constants.js +0 -119
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/logger.js +0 -155
- package/dist/cjs/logger.js.map +0 -1
- package/dist/cjs/utils/set.js +0 -23
- package/dist/cjs/utils/set.js.map +0 -1
- package/dist/esm/constants.js +0 -119
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/logger.js +0 -155
- package/dist/esm/logger.js.map +0 -1
- package/dist/esm/utils/set.js +0 -23
- package/dist/esm/utils/set.js.map +0 -1
- package/dist/types/constants.d.ts +0 -97
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/logger.d.ts +0 -64
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/utils/set.d.ts +0 -14
- package/dist/types/utils/set.d.ts.map +0 -1
- package/src/constants.ts +0 -127
- package/src/logger.ts +0 -173
- package/src/utils/set.ts +0 -23
|
@@ -1,143 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HashBytes } from './types.js';
|
|
2
|
+
export type CanonicalizationAlgorithm = 'jcs' | 'rdfc';
|
|
3
|
+
export type CanonicalizationEncoding = 'hex' | 'base58' | 'base64url';
|
|
2
4
|
export interface CanonicalizationOptions {
|
|
3
5
|
algorithm?: CanonicalizationAlgorithm;
|
|
4
6
|
encoding?: CanonicalizationEncoding;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
9
|
+
* Canonicalizes a JSON object using the specified algorithm.
|
|
10
|
+
*
|
|
11
|
+
* @param {Record<any, any>} object - The object to canonicalize.
|
|
12
|
+
* @param {CanonicalizationAlgorithm} [algorithm='jcs'] - The algorithm to use.
|
|
13
|
+
* @returns {string} The canonicalized string.
|
|
14
|
+
* @throws {CanonicalizationError} If the algorithm is not supported.
|
|
12
15
|
*/
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
static canonicalize(object: Record<any, any>, algorithm?: CanonicalizationAlgorithm): string;
|
|
51
|
-
/**
|
|
52
|
-
* Step 1: Canonicalizes an object using JCS (JSON Canonicalization Scheme).
|
|
53
|
-
* @param {Record<any, any>} object The object to canonicalize.
|
|
54
|
-
* @returns {string} The canonicalized object.
|
|
55
|
-
*/
|
|
56
|
-
static jcs(object: Record<any, any>): string;
|
|
57
|
-
/**
|
|
58
|
-
* Step 2: SHA-256 hashes a canonicalized object.
|
|
59
|
-
* @param {string} canonicalized The canonicalized object.
|
|
60
|
-
* @returns {HashBytes} The SHA-256 HashBytes (Uint8Array).
|
|
61
|
-
*/
|
|
62
|
-
static toHash(canonicalized: string): HashBytes;
|
|
63
|
-
/**
|
|
64
|
-
* Step 3: Encodes SHA-256 hashed, canonicalized object as a hex or base58btc string.
|
|
65
|
-
* @param {string} canonicalizedhash The canonicalized object to encode.
|
|
66
|
-
* @param {CanonicalizationEncoding} encoding The encoding format ('hex' or 'base58btc').
|
|
67
|
-
* @throws {CanonicalizationError} If the encoding format is not supported.
|
|
68
|
-
* @returns {string} The encoded string.
|
|
69
|
-
*/
|
|
70
|
-
static encode(canonicalizedhash: HashBytes, encoding?: CanonicalizationEncoding): string;
|
|
71
|
-
/**
|
|
72
|
-
* Decodes SHA-256 hashed, canonicalized object as a hex or base58btc string.
|
|
73
|
-
* @param {string} canonicalizedhash The canonicalized object to encode.
|
|
74
|
-
* @param {CanonicalizationEncoding} encoding The encoding format ('hex' or 'base58btc').
|
|
75
|
-
* @throws {CanonicalizationError} If the encoding format is not supported.
|
|
76
|
-
* @returns {string} The encoded string.
|
|
77
|
-
*/
|
|
78
|
-
static decode(canonicalizedhash: string, encoding?: CanonicalizationEncoding): HashBytes;
|
|
79
|
-
/**
|
|
80
|
-
* Step 3.1: Encodes HashBytes (Uint8Array) to a hex string.
|
|
81
|
-
* @param {HashBytes} hashBytes The hash as a Uint8Array.
|
|
82
|
-
* @returns {string} The hash as a hex string.
|
|
83
|
-
*/
|
|
84
|
-
static toHex(hashBytes: HashBytes): string;
|
|
85
|
-
/**
|
|
86
|
-
* Decodes a hex string to HashBytes (Uint8Array).
|
|
87
|
-
* @param {HexString} hexString The hash as a hex string.
|
|
88
|
-
* @returns {HashBytes} The hash bytes.
|
|
89
|
-
*/
|
|
90
|
-
static fromHex(hexString: HexString): HashBytes;
|
|
91
|
-
/**
|
|
92
|
-
* Step 3.2: Encodes HashBytes (Uint8Array) to a base58btc string.
|
|
93
|
-
* @param {HashBytes} hashBytes The hash as a Uint8Array.
|
|
94
|
-
* @returns {string} The hash as a hex string.
|
|
95
|
-
*/
|
|
96
|
-
static toBase58(hashBytes: HashBytes): string;
|
|
97
|
-
/**
|
|
98
|
-
* Decodes a base58btc string to HashBytes (Uint8Array).
|
|
99
|
-
* @param {string} b58str The hash as a base58btc string.
|
|
100
|
-
* @returns {HashBytes} The hash bytes.
|
|
101
|
-
*/
|
|
102
|
-
static fromBase58(b58str: string): HashBytes;
|
|
103
|
-
/**
|
|
104
|
-
* Step 3.2: Encodes HashBytes (Uint8Array) to a base64url string.
|
|
105
|
-
* @param {HashBytes} hashBytes The hash as a Uint8Array.
|
|
106
|
-
* @returns {string} The hash as a base64url string.
|
|
107
|
-
*/
|
|
108
|
-
static toBase64Url(hashBytes: HashBytes): string;
|
|
109
|
-
/**
|
|
110
|
-
* Decodes a base64url string to HashBytes (Uint8Array).
|
|
111
|
-
* @param {string} b64urlstr The hash as a base64url string.
|
|
112
|
-
* @returns {HashBytes} The hash bytes.
|
|
113
|
-
*/
|
|
114
|
-
static fromBase64Url(b64urlstr: string): HashBytes;
|
|
115
|
-
/**
|
|
116
|
-
* Canonicalizes an object, hashes it and returns it as hash bytes.
|
|
117
|
-
* Step 1-2: Canonicalize → Hash.
|
|
118
|
-
* @param {Record<any, any>} object The object to process.
|
|
119
|
-
* @returns {Promise<HashBytes>} The final SHA-256 hash bytes.
|
|
120
|
-
*/
|
|
121
|
-
static andHash(object: Record<any, any>, algorithm?: CanonicalizationAlgorithm): HashBytes;
|
|
122
|
-
/**
|
|
123
|
-
* Computes the SHA-256 hash of a canonicalized object and encodes it as a hex string.
|
|
124
|
-
* Step 2-3: Hash → Encode(Hex).
|
|
125
|
-
* @param {string} canonicalized The canonicalized object to hash.
|
|
126
|
-
* @returns {string} The SHA-256 hash as a hex string.
|
|
127
|
-
*/
|
|
128
|
-
static andHashToHex(canonicalized: string): string;
|
|
129
|
-
/**
|
|
130
|
-
* Computes the SHA-256 hashes of canonicalized object and encodes it as a base58btc string.
|
|
131
|
-
* Step 2-3: Hash → Encode(base58btc).
|
|
132
|
-
* @param {string} canonicalized The canonicalized object to hash.
|
|
133
|
-
* @returns {string} The SHA-256 hash as a base58btc string.
|
|
134
|
-
*/
|
|
135
|
-
static andHashToBase58(canonicalized: string): string;
|
|
136
|
-
/**
|
|
137
|
-
* Computes the SHA-256 hashes of canonicalized object and encodes it as a base64url string.
|
|
138
|
-
* Step 2-3: Hash → Encode(base64url).
|
|
139
|
-
* @param {string} canonicalized The canonicalized object to hash.
|
|
140
|
-
* @returns {string} The SHA-256 hash as a base64url string.
|
|
141
|
-
*/
|
|
142
|
-
static andHashToBase64Url(canonicalized: string): string;
|
|
143
|
-
}
|
|
16
|
+
export declare function canonicalize(object: Record<any, any>, algorithm?: CanonicalizationAlgorithm): string;
|
|
17
|
+
/**
|
|
18
|
+
* SHA-256 hashes a canonicalized string.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} canonicalized - The canonicalized string to hash.
|
|
21
|
+
* @returns {HashBytes} The SHA-256 hash bytes (Uint8Array).
|
|
22
|
+
*/
|
|
23
|
+
export declare function hash(canonicalized: string): HashBytes;
|
|
24
|
+
/**
|
|
25
|
+
* Encodes hash bytes using the specified encoding.
|
|
26
|
+
*
|
|
27
|
+
* @param {HashBytes} hashBytes - The hash bytes to encode.
|
|
28
|
+
* @param {CanonicalizationEncoding} [encoding='hex'] - The encoding format.
|
|
29
|
+
* @returns {string} The encoded string.
|
|
30
|
+
* @throws {CanonicalizationError} If the encoding is not supported.
|
|
31
|
+
*/
|
|
32
|
+
export declare function encodeHash(hashBytes: HashBytes, encoding?: CanonicalizationEncoding): string;
|
|
33
|
+
/**
|
|
34
|
+
* Decodes an encoded hash string back to bytes.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} encoded - The encoded hash string.
|
|
37
|
+
* @param {CanonicalizationEncoding} [encoding='hex'] - The encoding format.
|
|
38
|
+
* @returns {HashBytes} The decoded hash bytes.
|
|
39
|
+
* @throws {CanonicalizationError} If the encoding is not supported.
|
|
40
|
+
*/
|
|
41
|
+
export declare function decodeHash(encoded: string, encoding?: CanonicalizationEncoding): HashBytes;
|
|
42
|
+
/**
|
|
43
|
+
* Implements {@link http://dcdpr.github.io/did-btcr2/#json-canonicalization-and-hash | 9.2 JSON Canonicalization and Hash}.
|
|
44
|
+
*
|
|
45
|
+
* Full pipeline: Canonicalize (JCS) -> Hash (SHA-256) -> Encode.
|
|
46
|
+
*
|
|
47
|
+
* @param {Record<any, any>} object - The object to process.
|
|
48
|
+
* @param {CanonicalizationOptions} [options] - Options for algorithm and encoding.
|
|
49
|
+
* @returns {string} The encoded hash string.
|
|
50
|
+
*/
|
|
51
|
+
export declare function canonicalHash(object: Record<any, any>, options?: CanonicalizationOptions): string;
|
|
52
|
+
//# sourceMappingURL=canonicalization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalization.d.ts","sourceRoot":"","sources":["../../src/canonicalization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canonicalization.d.ts","sourceRoot":"","sources":["../../src/canonicalization.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,MAAM,CAAC;AACvD,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEtE,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACrC;AAiCD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,GAAE,yBAAiC,GAAG,MAAM,CAY3G;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAErD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAE,wBAAgC,GAAG,MAAM,CAOnG;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,wBAAgC,GAAG,SAAS,CAOjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAIjG"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ export declare enum MethodErrorCode {
|
|
|
61
61
|
/** Options required for resolution are missing. */
|
|
62
62
|
MISSING_RESOLUTION_OPTIONS = "MISSING_RESOLUTION_OPTIONS"
|
|
63
63
|
}
|
|
64
|
-
export declare const INVALID_DID: MethodErrorCode, METHOD_NOT_SUPPORTED: MethodErrorCode, INTERNAL_ERROR: MethodErrorCode, INVALID_DID_DOCUMENT: MethodErrorCode, INVALID_DID_UPDATE: MethodErrorCode,
|
|
65
|
-
|
|
64
|
+
export declare const INVALID_DID: MethodErrorCode, METHOD_NOT_SUPPORTED: MethodErrorCode, INTERNAL_ERROR: MethodErrorCode, INVALID_DID_DOCUMENT: MethodErrorCode, INVALID_DID_UPDATE: MethodErrorCode, INVALID_DID_URL: MethodErrorCode, INVALID_PREVIOUS_DID_PROOF: MethodErrorCode, INVALID_PUBLIC_KEY: MethodErrorCode, INVALID_PUBLIC_KEY_MULTIBASE: MethodErrorCode, INVALID_PUBLIC_KEY_LENGTH: MethodErrorCode, INVALID_PUBLIC_KEY_TYPE: MethodErrorCode, INVALID_SIGNATURE: MethodErrorCode, PROOF_VERIFICATION_ERROR: MethodErrorCode, PROOF_GENERATION_ERROR: MethodErrorCode, PROOF_SERIALIZATION_ERROR: MethodErrorCode, PROOF_PARSING_ERROR: MethodErrorCode, VERIFICATION_METHOD_ERROR: MethodErrorCode, LATE_PUBLISHING_ERROR: MethodErrorCode, INVALID_SIDECAR_DATA: MethodErrorCode, MISSING_UPDATE_DATA: MethodErrorCode, MISSING_RESOLUTION_OPTIONS: MethodErrorCode;
|
|
65
|
+
type ErrorOptions = {
|
|
66
66
|
type?: string;
|
|
67
67
|
name?: string;
|
|
68
68
|
data?: any;
|
|
@@ -79,7 +79,7 @@ export declare class DidMethodError extends Error {
|
|
|
79
79
|
constructor(message: string, options?: ErrorOptions);
|
|
80
80
|
}
|
|
81
81
|
export declare class MethodError extends DidMethodError {
|
|
82
|
-
constructor(message: string, type
|
|
82
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
83
83
|
}
|
|
84
84
|
export declare class IdentifierError extends DidMethodError {
|
|
85
85
|
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
@@ -123,9 +123,8 @@ export declare class SingletonBeaconError extends DidMethodError {
|
|
|
123
123
|
export declare class CIDAggregateBeaconError extends DidMethodError {
|
|
124
124
|
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
125
125
|
}
|
|
126
|
-
export declare class SMTAggregateBeaconError extends DidMethodError {
|
|
127
|
-
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
128
|
-
}
|
|
129
126
|
export declare class CanonicalizationError extends DidMethodError {
|
|
130
127
|
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
131
128
|
}
|
|
129
|
+
export {};
|
|
130
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACzB,yDAAyD;IACzD,WAAW,gBAAgB;IAE3B,sGAAsG;IACtG,oBAAoB,yBAAyB;IAE7C,uEAAuE;IACvE,cAAc,mBAAmB;IAEjC,kEAAkE;IAClE,oBAAoB,yBAAyB;IAE7C,gEAAgE;IAChE,kBAAkB,uBAAuB;IAEzC,2EAA2E;IAC3E,2BAA2B,gCAAgC;IAE3D,2FAA2F;IAC3F,eAAe,oBAAoB;IAEnC,mDAAmD;IACnD,0BAA0B,+BAA+B;IAEzD,gEAAgE;IAChE,kBAAkB,uBAAuB;IAEzC,wFAAwF;IACxF,4BAA4B,iCAAiC;IAE7D,yEAAyE;IACzE,yBAAyB,8BAA8B;IAEvD,sEAAsE;IACtE,uBAAuB,4BAA4B;IAEnD,iEAAiE;IACjE,iBAAiB,sBAAsB;IAEvC,qDAAqD;IACrD,mHAAmH;IACnH,SAAS,cAAc;IAEvB;;;OAGG;IACH,4BAA4B,iCAAiC;IAE7D,sGAAsG;IACtG,2BAA2B,gCAAgC;I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AG,CAAC;CAGhG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from './canonicalization.js';
|
|
2
|
-
export * from './constants.js';
|
|
3
2
|
export * from './errors.js';
|
|
4
3
|
export * from './json-patch.js';
|
|
5
|
-
export * from './logger.js';
|
|
6
4
|
export * from './types.js';
|
|
7
5
|
export * from './utils/date.js';
|
|
8
6
|
export * from './utils/json.js';
|
|
9
|
-
export * from './utils/set.js';
|
|
10
7
|
export * from './utils/string.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONObject } from './types.js';
|
|
2
|
-
export type PatchOpCode = 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test'
|
|
2
|
+
export type PatchOpCode = 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
|
|
3
3
|
/**
|
|
4
4
|
* A JSON Patch operation, as defined in {@link https://datatracker.ietf.org/doc/html/rfc6902 | RFC 6902}.
|
|
5
5
|
*/
|
|
@@ -54,3 +54,4 @@ export declare class JSONPatch {
|
|
|
54
54
|
*/
|
|
55
55
|
static validateOperations(operations: PatchOperation[]): Error | null;
|
|
56
56
|
}
|
|
57
|
+
//# sourceMappingURL=json-patch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-patch.d.ts","sourceRoot":"","sources":["../../src/json-patch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"json-patch.d.ts","sourceRoot":"","sources":["../../src/json-patch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAClF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACpB;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACV,cAAc,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAChC,UAAU,EAAE,cAAc,EAAE,EAC5B,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;KAAO,GAC9D,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;IAmBnB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,GAAE,MAAW,GAAG,cAAc,EAAE;IAWxG;;;;;KAKC;IACD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAM1D;;;;KAIC;IACD,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAOjD;;;;KAIC;IACD,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,GAAG,IAAI;CAYtE"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { HDKey } from '@scure/bip32';
|
|
1
|
+
import type { HDKey } from '@scure/bip32';
|
|
2
2
|
export type Bytes = Uint8Array;
|
|
3
3
|
export type Hex = Bytes | string;
|
|
4
4
|
export type HexString = string;
|
|
5
|
-
export type SignatureHex = Hex;
|
|
6
|
-
export type HashHex = Hex;
|
|
7
5
|
export type DocumentBytes = Bytes;
|
|
8
6
|
export type SignatureBytes = Bytes;
|
|
9
7
|
export type ProofBytes = Bytes;
|
|
10
8
|
export type HashBytes = Bytes;
|
|
11
9
|
export type MessageBytes = Bytes;
|
|
12
10
|
export type Entropy = Bytes | bigint;
|
|
13
|
-
export type CompressedPublicKeyParityByte = 0x02 | 0x03;
|
|
14
|
-
export type Bip340Encoding = string;
|
|
15
|
-
export type Base58BtcPrefix = 'z';
|
|
16
11
|
export type KeyBytes = Bytes;
|
|
17
12
|
export type Point = {
|
|
18
13
|
x: Array<number>;
|
|
@@ -64,33 +59,18 @@ export declare enum BitcoinNetworkNames {
|
|
|
64
59
|
}
|
|
65
60
|
export type DecentralizedIdentifier = string;
|
|
66
61
|
export type Did = DecentralizedIdentifier;
|
|
67
|
-
export type BeaconUri = string;
|
|
68
62
|
export type CanonicalizedProofConfig = string;
|
|
69
63
|
export type CryptosuiteName = 'bip340-jcs-2025' | 'bip340-rdfc-2025';
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
65
|
+
type JsonArray = JsonValue[];
|
|
66
|
+
type JsonValue = JsonPrimitive | JsonArray | JsonObject;
|
|
67
|
+
type JsonObject = {
|
|
74
68
|
[key: string]: JsonValue;
|
|
75
69
|
};
|
|
76
70
|
export type JSONObject = JsonObject;
|
|
77
71
|
export type Prototyped = JSONObject;
|
|
78
72
|
export type Unprototyped = JSONObject;
|
|
79
|
-
export type
|
|
80
|
-
export type Context = string | string[] | ContextObject | ContextObject[];
|
|
81
|
-
export type Maybe<T> = T | unknown;
|
|
82
|
-
export type TwoDigits = `${number}${number}`;
|
|
83
|
-
export type ThreeDigits = `${number}${number}${number}`;
|
|
84
|
-
export type Year = `${1 | 2}${ThreeDigits}`;
|
|
85
|
-
export type Month = TwoDigits;
|
|
86
|
-
export type Day = TwoDigits;
|
|
87
|
-
export type Hours = TwoDigits;
|
|
88
|
-
export type Minutes = TwoDigits;
|
|
89
|
-
export type Seconds = TwoDigits;
|
|
90
|
-
export type UtcTimestamp = `${Year}-${Month}-${Day}T${Hours}:${Minutes}:${Seconds}`;
|
|
91
|
-
export type TzOffset = `${Hours}:${Minutes}`;
|
|
92
|
-
export type DateTimestamp = `${UtcTimestamp}Z` | `${UtcTimestamp}-${TzOffset}`;
|
|
93
|
-
export type CanonicalizableObject = Record<string, any>;
|
|
94
|
-
export type CanonicalizationAlgorithm = 'jcs' | 'rdfc';
|
|
95
|
-
export type CanonicalizationEncoding = 'hex' | 'base58btc' | 'base64url';
|
|
73
|
+
export type Maybe<T> = T | undefined;
|
|
96
74
|
export type UnixTimestamp = number;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC;AAC/B,MAAM,MAAM,GAAG,GAAG,KAA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QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAA;CACf,CAAC;AACF,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,QAAQ,aAAa;CACxB;AACD,oBAAY,aAAa;IACrB,CAAC,MAAM;IACP,CAAC,MAAM;CACV;AACD,oBAAY,mBAAmB;IAC3B,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,SAAS,IAAI;CAChB;AACD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,GAAG,GAAG,uBAAuB,CAAC;AAC1C,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AACrE,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACtD,KAAK,SAAS,GAAG,SAAS,EAAE,CAAC;AAC7B,KAAK,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AACxD,KAAK,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC;AACpC,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAGtC,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AACrC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC"}
|
|
@@ -17,10 +17,9 @@ export declare class DateUtils {
|
|
|
17
17
|
*/
|
|
18
18
|
static toUnixSeconds(date?: Date): number;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param {string} dateString - The date string to
|
|
22
|
-
* @returns {
|
|
23
|
-
* @throws {Error} If the date string is invalid.
|
|
20
|
+
* Parse a date string into a Date object.
|
|
21
|
+
* @param {string} dateString - The date string to parse.
|
|
22
|
+
* @returns {Date} The parsed Date, or Date(0) (Unix epoch) if the string is invalid.
|
|
24
23
|
*/
|
|
25
24
|
static dateStringToTimestamp(dateString: string): Date;
|
|
26
25
|
/**
|
|
@@ -37,3 +36,4 @@ export declare class DateUtils {
|
|
|
37
36
|
*/
|
|
38
37
|
static isValidXsdDateTime(value?: string): boolean;
|
|
39
38
|
}
|
|
39
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM;IAQhE;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM;IAQrD
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM;IAQhE;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM;IAQrD;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAQtD;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIpD;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;CAoEnD"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { JSONObject, Prototyped, Unprototyped } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Options for cloning JSON values.
|
|
4
|
-
*/
|
|
5
|
-
type CloneOptions = {
|
|
6
|
-
stripPrototypes?: boolean;
|
|
7
|
-
transform?: (value: any) => any;
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* Utilities for working with JSON data.
|
|
11
4
|
* @name JSONUtils
|
|
@@ -77,13 +70,6 @@ export declare class JSONUtils {
|
|
|
77
70
|
* @returns {T} The sanitized JSON value.
|
|
78
71
|
*/
|
|
79
72
|
static sanitize<T>(value: T): T;
|
|
80
|
-
|
|
81
|
-
* Internal function to clone JSON values with options.
|
|
82
|
-
* @param {T} value - The value to clone.
|
|
83
|
-
* @param {CloneOptions} options - The cloning options.
|
|
84
|
-
* @param {WeakMap<object, any>} seen - A WeakMap to track seen objects for circular reference detection.
|
|
85
|
-
* @returns {any} The cloned value.
|
|
86
|
-
*/
|
|
87
|
-
static cloneInternal<T>(value: T, options?: CloneOptions, seen?: WeakMap<object, any>, depth?: number): any;
|
|
73
|
+
private static cloneInternal;
|
|
88
74
|
}
|
|
89
|
-
|
|
75
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/utils/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/utils/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUnE;;;;GAIG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU;IAOpD;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM;IAUlD;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY;IAK5D;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU;IAIzE;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAI9C;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAO5B;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;IAQzE;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CACd,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,IAAI,GAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAiC,EAC7D,KAAK,GAAE,MAAU,GAChB,OAAO;IAoFV;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC;IAuBxE;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAuB/B,OAAO,CAAC,MAAM,CAAC,aAAa;CAwD7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Common utilities, types, interfaces, etc. shared across the did-btcr2-js monorepo packages.",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -45,11 +45,17 @@
|
|
|
45
45
|
"keywords": [],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@noble/hashes": "^1.7.1",
|
|
48
|
-
"@scure/
|
|
49
|
-
"chalk": "^5.4.1",
|
|
48
|
+
"@scure/base": "^1.2.6",
|
|
50
49
|
"fast-json-patch": "^3.1.1",
|
|
51
|
-
"json-canonicalize": "^1.0.6"
|
|
52
|
-
|
|
50
|
+
"json-canonicalize": "^1.0.6"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@scure/bip32": "^1.5.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"@scure/bip32": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
53
59
|
},
|
|
54
60
|
"devDependencies": {
|
|
55
61
|
"@eslint/js": "^9.21.0",
|