@twin.org/immutable-proof-service 0.0.1-next.3 → 0.0.1-next.30
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/index.cjs +201 -233
- package/dist/esm/index.mjs +205 -237
- package/dist/types/entities/immutableProof.d.ts +2 -2
- package/dist/types/immutableProofService.d.ts +12 -24
- package/dist/types/index.d.ts +2 -1
- package/dist/types/models/IImmutableProofServiceConfig.d.ts +3 -8
- package/dist/types/models/IImmutableProofServiceConstructorOptions.d.ts +34 -0
- package/docs/changelog.md +1 -1
- package/docs/open-api/spec.json +705 -732
- package/docs/reference/classes/ImmutableProof.md +3 -3
- package/docs/reference/classes/ImmutableProofService.md +35 -43
- package/docs/reference/functions/generateRestRoutesImmutableProof.md +8 -4
- package/docs/reference/functions/immutableProofCreate.md +9 -3
- package/docs/reference/functions/immutableProofGet.md +9 -3
- package/docs/reference/functions/immutableProofVerify.md +9 -3
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IImmutableProofServiceConfig.md +4 -18
- package/docs/reference/interfaces/IImmutableProofServiceConstructorOptions.md +75 -0
- package/locales/en.json +1 -1
- package/package.json +10 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
2
|
+
import { type IImmutableProof, type IImmutableProofComponent, type IImmutableProofVerification } from "@twin.org/immutable-proof-models";
|
|
3
|
+
import type { IImmutableProofServiceConstructorOptions } from "./models/IImmutableProofServiceConstructorOptions";
|
|
4
4
|
/**
|
|
5
5
|
* Class for performing immutable proof operations.
|
|
6
6
|
*/
|
|
@@ -16,48 +16,36 @@ export declare class ImmutableProofService implements IImmutableProofComponent {
|
|
|
16
16
|
/**
|
|
17
17
|
* Create a new instance of ImmutableProofService.
|
|
18
18
|
* @param options The dependencies for the immutable proof connector.
|
|
19
|
-
* @param options.config The configuration for the connector.
|
|
20
|
-
* @param options.vaultConnectorType The vault connector type, defaults to "vault".
|
|
21
|
-
* @param options.immutableProofEntityStorageType The entity storage for proofs, defaults to "immutable-proof".
|
|
22
|
-
* @param options.immutableStorageType The immutable storage, defaults to "immutable-storage".
|
|
23
|
-
* @param options.identityConnectorType The identity connector type, defaults to "identity".
|
|
24
19
|
*/
|
|
25
|
-
constructor(options?:
|
|
26
|
-
vaultConnectorType?: string;
|
|
27
|
-
immutableProofEntityStorageType?: string;
|
|
28
|
-
immutableStorageType?: string;
|
|
29
|
-
config?: IImmutableProofServiceConfig;
|
|
30
|
-
identityConnectorType?: string;
|
|
31
|
-
});
|
|
20
|
+
constructor(options?: IImmutableProofServiceConstructorOptions);
|
|
32
21
|
/**
|
|
33
|
-
* Create a new
|
|
34
|
-
* @param
|
|
22
|
+
* Create a new proof.
|
|
23
|
+
* @param document The document to create the proof for.
|
|
35
24
|
* @param userIdentity The identity to create the immutable proof operation with.
|
|
36
25
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
37
|
-
* @returns The id of the new
|
|
26
|
+
* @returns The id of the new proof.
|
|
38
27
|
*/
|
|
39
|
-
create(
|
|
28
|
+
create(document: IJsonLdNodeObject, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
40
29
|
/**
|
|
41
|
-
* Get
|
|
30
|
+
* Get a proof.
|
|
42
31
|
* @param id The id of the proof to get.
|
|
43
32
|
* @returns The proof.
|
|
44
33
|
* @throws NotFoundError if the proof is not found.
|
|
45
34
|
*/
|
|
46
35
|
get(id: string): Promise<IImmutableProof>;
|
|
47
36
|
/**
|
|
48
|
-
* Verify
|
|
37
|
+
* Verify a proof.
|
|
49
38
|
* @param id The id of the proof to verify.
|
|
50
|
-
* @param proofObject The object to verify as JSON-LD.
|
|
51
39
|
* @returns The result of the verification and any failures.
|
|
52
40
|
* @throws NotFoundError if the proof is not found.
|
|
53
41
|
*/
|
|
54
|
-
verify(id: string
|
|
42
|
+
verify(id: string): Promise<IImmutableProofVerification>;
|
|
55
43
|
/**
|
|
56
|
-
* Remove the
|
|
44
|
+
* Remove the verifiable storage for the proof.
|
|
57
45
|
* @param id The id of the proof to remove the storage from.
|
|
58
46
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
59
47
|
* @returns Nothing.
|
|
60
48
|
* @throws NotFoundError if the proof is not found.
|
|
61
49
|
*/
|
|
62
|
-
|
|
50
|
+
removeVerifiable(id: string, nodeIdentity?: string): Promise<void>;
|
|
63
51
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
export * from "./entities/immutableProof";
|
|
1
2
|
export * from "./immutableProofRoutes";
|
|
2
3
|
export * from "./immutableProofService";
|
|
3
|
-
export * from "./entities/immutableProof";
|
|
4
4
|
export * from "./models/IImmutableProofServiceConfig";
|
|
5
|
+
export * from "./models/IImmutableProofServiceConstructorOptions";
|
|
5
6
|
export * from "./restEntryPoints";
|
|
6
7
|
export * from "./schema";
|
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface IImmutableProofServiceConfig {
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
7
|
-
* @default immutable-proof
|
|
6
|
+
* The verification method id to use for the proof.
|
|
7
|
+
* @default immutable-proof-assertion
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The key to use in the proof config.
|
|
12
|
-
* @default immutable-proof
|
|
13
|
-
*/
|
|
14
|
-
proofConfigKeyId?: string;
|
|
9
|
+
verificationMethodId?: string;
|
|
15
10
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IImmutableProofServiceConfig } from "./IImmutableProofServiceConfig";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the immutable proof service constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IImmutableProofServiceConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The entity storage for proofs.
|
|
8
|
+
* @default immutable-proof
|
|
9
|
+
*/
|
|
10
|
+
immutableProofEntityStorageType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The verifiable storage.
|
|
13
|
+
* @default verifiable-storage
|
|
14
|
+
*/
|
|
15
|
+
verifiableStorageType?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The identity connector type.
|
|
18
|
+
* @default identity
|
|
19
|
+
*/
|
|
20
|
+
identityConnectorType?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The background task connector type.
|
|
23
|
+
* @default background-task
|
|
24
|
+
*/
|
|
25
|
+
backgroundTaskConnectorType?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The event bus component type, defaults to no event bus.
|
|
28
|
+
*/
|
|
29
|
+
eventBusComponentType?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The configuration for the connector.
|
|
32
|
+
*/
|
|
33
|
+
config?: IImmutableProofServiceConfig;
|
|
34
|
+
}
|
package/docs/changelog.md
CHANGED