@c7-digital/ledger 0.0.3 → 0.0.5
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/BUILD.md +1 -1
- package/README.md +1 -3
- package/lib/src/PackageIdEmitterMap.d.ts +42 -0
- package/lib/src/PackageIdEmitterMap.js +60 -0
- package/lib/src/generated/asyncapi-schema.js +1 -1
- package/lib/src/generated/openapi-schema.js +1 -1
- package/lib/src/ledger.d.ts +15 -5
- package/lib/src/ledger.js +132 -24
- package/lib/src/multistream.d.ts +34 -7
- package/lib/src/multistream.js +69 -25
- package/lib/src/token.d.ts +13 -0
- package/lib/src/token.js +64 -0
- package/lib/src/types.d.ts +62 -2
- package/lib/src/websocket.d.ts +9 -0
- package/lib/src/websocket.js +16 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-lite/src/PackageIdEmitterMap.d.ts +42 -0
- package/lib-lite/src/PackageIdEmitterMap.js +60 -0
- package/lib-lite/src/ledger.d.ts +15 -5
- package/lib-lite/src/ledger.js +132 -24
- package/lib-lite/src/multistream.d.ts +34 -7
- package/lib-lite/src/multistream.js +69 -25
- package/lib-lite/src/token.d.ts +13 -0
- package/lib-lite/src/token.js +64 -0
- package/lib-lite/src/types.d.ts +62 -2
- package/lib-lite/src/websocket.d.ts +9 -0
- package/lib-lite/src/websocket.js +16 -0
- package/lib-lite/tsconfig.temp.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/src/TemplateEmitterMap.d.ts +0 -40
- package/lib/src/TemplateEmitterMap.js +0 -57
- package/lib-lite/src/TemplateEmitterMap.d.ts +0 -40
- package/lib-lite/src/TemplateEmitterMap.js +0 -57
package/package.json
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "eventemitter3";
|
|
2
|
-
import { PackageIdString } from "./valueTypes.js";
|
|
3
|
-
/**
|
|
4
|
-
* A specialized Map wrapper for template emitters that uses partiallyQualified
|
|
5
|
-
* template IDs for comparison to ensure consistent lookup regardless of package ID.
|
|
6
|
-
*/
|
|
7
|
-
export declare class TemplateEmitterMap {
|
|
8
|
-
private emitters;
|
|
9
|
-
/**
|
|
10
|
-
* Set an EventEmitter for a specific template ID
|
|
11
|
-
* @param templateId The full template ID
|
|
12
|
-
* @param emitter The EventEmitter instance
|
|
13
|
-
*/
|
|
14
|
-
set(templateId: PackageIdString, emitter: EventEmitter): void;
|
|
15
|
-
/**
|
|
16
|
-
* Get the EventEmitter for a specific template ID
|
|
17
|
-
* @param templateId The template ID (full or partial)
|
|
18
|
-
* @returns The EventEmitter or undefined if not found
|
|
19
|
-
*/
|
|
20
|
-
get(templateId: PackageIdString): EventEmitter | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Check if an emitter exists for a specific template ID
|
|
23
|
-
* @param templateId The template ID (full or partial)
|
|
24
|
-
* @returns True if an emitter exists, false otherwise
|
|
25
|
-
*/
|
|
26
|
-
has(templateId: PackageIdString): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Get all emitters in the map
|
|
29
|
-
* @returns An iterator of all EventEmitter instances
|
|
30
|
-
*/
|
|
31
|
-
values(): IterableIterator<EventEmitter>;
|
|
32
|
-
/**
|
|
33
|
-
* Clear all emitters from the map
|
|
34
|
-
*/
|
|
35
|
-
clear(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Get the number of emitters in the map
|
|
38
|
-
*/
|
|
39
|
-
get size(): number;
|
|
40
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { partiallyQualified } from "./util.js";
|
|
2
|
-
/**
|
|
3
|
-
* A specialized Map wrapper for template emitters that uses partiallyQualified
|
|
4
|
-
* template IDs for comparison to ensure consistent lookup regardless of package ID.
|
|
5
|
-
*/
|
|
6
|
-
export class TemplateEmitterMap {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.emitters = new Map();
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Set an EventEmitter for a specific template ID
|
|
12
|
-
* @param templateId The full template ID
|
|
13
|
-
* @param emitter The EventEmitter instance
|
|
14
|
-
*/
|
|
15
|
-
set(templateId, emitter) {
|
|
16
|
-
const partialId = partiallyQualified(templateId);
|
|
17
|
-
this.emitters.set(partialId, { fullId: templateId, emitter });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the EventEmitter for a specific template ID
|
|
21
|
-
* @param templateId The template ID (full or partial)
|
|
22
|
-
* @returns The EventEmitter or undefined if not found
|
|
23
|
-
*/
|
|
24
|
-
get(templateId) {
|
|
25
|
-
const partialId = partiallyQualified(templateId);
|
|
26
|
-
return this.emitters.get(partialId)?.emitter;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Check if an emitter exists for a specific template ID
|
|
30
|
-
* @param templateId The template ID (full or partial)
|
|
31
|
-
* @returns True if an emitter exists, false otherwise
|
|
32
|
-
*/
|
|
33
|
-
has(templateId) {
|
|
34
|
-
const partialId = partiallyQualified(templateId);
|
|
35
|
-
return this.emitters.has(partialId);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get all emitters in the map
|
|
39
|
-
* @returns An iterator of all EventEmitter instances
|
|
40
|
-
*/
|
|
41
|
-
values() {
|
|
42
|
-
return Array.from(this.emitters.values())
|
|
43
|
-
.map(entry => entry.emitter)[Symbol.iterator]();
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Clear all emitters from the map
|
|
47
|
-
*/
|
|
48
|
-
clear() {
|
|
49
|
-
this.emitters.clear();
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get the number of emitters in the map
|
|
53
|
-
*/
|
|
54
|
-
get size() {
|
|
55
|
-
return this.emitters.size;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "eventemitter3";
|
|
2
|
-
import { PackageIdString } from "./valueTypes.js";
|
|
3
|
-
/**
|
|
4
|
-
* A specialized Map wrapper for template emitters that uses partiallyQualified
|
|
5
|
-
* template IDs for comparison to ensure consistent lookup regardless of package ID.
|
|
6
|
-
*/
|
|
7
|
-
export declare class TemplateEmitterMap {
|
|
8
|
-
private emitters;
|
|
9
|
-
/**
|
|
10
|
-
* Set an EventEmitter for a specific template ID
|
|
11
|
-
* @param templateId The full template ID
|
|
12
|
-
* @param emitter The EventEmitter instance
|
|
13
|
-
*/
|
|
14
|
-
set(templateId: PackageIdString, emitter: EventEmitter): void;
|
|
15
|
-
/**
|
|
16
|
-
* Get the EventEmitter for a specific template ID
|
|
17
|
-
* @param templateId The template ID (full or partial)
|
|
18
|
-
* @returns The EventEmitter or undefined if not found
|
|
19
|
-
*/
|
|
20
|
-
get(templateId: PackageIdString): EventEmitter | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Check if an emitter exists for a specific template ID
|
|
23
|
-
* @param templateId The template ID (full or partial)
|
|
24
|
-
* @returns True if an emitter exists, false otherwise
|
|
25
|
-
*/
|
|
26
|
-
has(templateId: PackageIdString): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Get all emitters in the map
|
|
29
|
-
* @returns An iterator of all EventEmitter instances
|
|
30
|
-
*/
|
|
31
|
-
values(): IterableIterator<EventEmitter>;
|
|
32
|
-
/**
|
|
33
|
-
* Clear all emitters from the map
|
|
34
|
-
*/
|
|
35
|
-
clear(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Get the number of emitters in the map
|
|
38
|
-
*/
|
|
39
|
-
get size(): number;
|
|
40
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { partiallyQualified } from "./util.js";
|
|
2
|
-
/**
|
|
3
|
-
* A specialized Map wrapper for template emitters that uses partiallyQualified
|
|
4
|
-
* template IDs for comparison to ensure consistent lookup regardless of package ID.
|
|
5
|
-
*/
|
|
6
|
-
export class TemplateEmitterMap {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.emitters = new Map();
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Set an EventEmitter for a specific template ID
|
|
12
|
-
* @param templateId The full template ID
|
|
13
|
-
* @param emitter The EventEmitter instance
|
|
14
|
-
*/
|
|
15
|
-
set(templateId, emitter) {
|
|
16
|
-
const partialId = partiallyQualified(templateId);
|
|
17
|
-
this.emitters.set(partialId, { fullId: templateId, emitter });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the EventEmitter for a specific template ID
|
|
21
|
-
* @param templateId The template ID (full or partial)
|
|
22
|
-
* @returns The EventEmitter or undefined if not found
|
|
23
|
-
*/
|
|
24
|
-
get(templateId) {
|
|
25
|
-
const partialId = partiallyQualified(templateId);
|
|
26
|
-
return this.emitters.get(partialId)?.emitter;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Check if an emitter exists for a specific template ID
|
|
30
|
-
* @param templateId The template ID (full or partial)
|
|
31
|
-
* @returns True if an emitter exists, false otherwise
|
|
32
|
-
*/
|
|
33
|
-
has(templateId) {
|
|
34
|
-
const partialId = partiallyQualified(templateId);
|
|
35
|
-
return this.emitters.has(partialId);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get all emitters in the map
|
|
39
|
-
* @returns An iterator of all EventEmitter instances
|
|
40
|
-
*/
|
|
41
|
-
values() {
|
|
42
|
-
return Array.from(this.emitters.values())
|
|
43
|
-
.map(entry => entry.emitter)[Symbol.iterator]();
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Clear all emitters from the map
|
|
47
|
-
*/
|
|
48
|
-
clear() {
|
|
49
|
-
this.emitters.clear();
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get the number of emitters in the map
|
|
53
|
-
*/
|
|
54
|
-
get size() {
|
|
55
|
-
return this.emitters.size;
|
|
56
|
-
}
|
|
57
|
-
}
|