11import ServiceBase from "./ServiceBase" ;
2- import {
3- CheckStatusRequest ,
4- CheckStatusResponse ,
5- CreateProofRequest ,
6- CreateProofResponse ,
7- IssueFromTemplateRequest ,
8- IssueFromTemplateResponse ,
9- IssueRequest ,
10- IssueResponse ,
11- SendRequest ,
12- SendResponse ,
13- ServiceOptions ,
14- UpdateStatusRequest ,
15- UpdateStatusResponse ,
16- VerifiableCredentialDefinition ,
17- VerifyProofRequest ,
18- VerifyProofResponse ,
19- } from "./proto" ;
2+ import { ServiceOptions , VerifiableCredentialDefinition } from "./proto" ;
3+ import * as proto from "./proto" ;
204
215import type { Client as BrowserClient } from "nice-grpc-web" ;
226
@@ -28,62 +12,81 @@ export class CredentialService extends ServiceBase {
2812
2913 this . client = this . createClient ( VerifiableCredentialDefinition ) ;
3014 }
31- // BEGIN Code generated by protoc-gen-trinsic. DO NOT EDIT.
32- // target: /home/runner/ work/ sdk/sdk/ web/ src/ CredentialService.ts
15+ // BEGIN Code generated by protoc-gen-trinsic. DO NOT EDIT.
16+ // target: C:\ work\ sdk\ web\ src\ CredentialService.ts
3317
34- /** Sign and issue a verifiable credential from a submitted document.
35- * The document must be a valid JSON-LD document. */
36- public async issue ( request : IssueRequest ) : Promise < IssueResponse > {
37-
38- return this . client . issue ( request , {
39- metadata : await this . buildMetadata ( IssueRequest . encode ( request ) . finish ( ) )
40- } ) ;
41- }
42- /** Sign and issue a verifiable credential from a pre-defined template.
43- * This process will also add schema validation and
44- * revocation registry values to the credential. */
45- public async issueFromTemplate ( request : IssueFromTemplateRequest ) : Promise < IssueFromTemplateResponse > {
46-
47- return this . client . issueFromTemplate ( request , {
48- metadata : await this . buildMetadata ( IssueFromTemplateRequest . encode ( request ) . finish ( ) )
49- } ) ;
50- }
51- /** Check credential status in the revocation registry */
52- public async checkStatus ( request : CheckStatusRequest ) : Promise < CheckStatusResponse > {
53-
54- return this . client . checkStatus ( request , {
55- metadata : await this . buildMetadata ( CheckStatusRequest . encode ( request ) . finish ( ) )
56- } ) ;
57- }
58- /** Update credential status by setting the revocation value */
59- public async updateStatus ( request : UpdateStatusRequest ) : Promise < UpdateStatusResponse > {
60-
61- return this . client . updateStatus ( request , {
62- metadata : await this . buildMetadata ( UpdateStatusRequest . encode ( request ) . finish ( ) )
63- } ) ;
64- }
65- /** Create a proof from a signed document that is a valid
66- * verifiable credential and contains a signature from which a proof can be derived. */
67- public async createProof ( request : CreateProofRequest ) : Promise < CreateProofResponse > {
68-
69- return this . client . createProof ( request , {
70- metadata : await this . buildMetadata ( CreateProofRequest . encode ( request ) . finish ( ) )
71- } ) ;
72- }
73- /** Verifies a proof by checking the signature value, and if possible schema validation,
74- * revocation status, and issuer status against a trust registry */
75- public async verifyProof ( request : VerifyProofRequest ) : Promise < VerifyProofResponse > {
76-
77- return this . client . verifyProof ( request , {
78- metadata : await this . buildMetadata ( VerifyProofRequest . encode ( request ) . finish ( ) )
79- } ) ;
80- }
81- /** Sends a document directly to a user's email within the given ecosystem */
82- public async send ( request : SendRequest ) : Promise < SendResponse > {
83-
84- return this . client . send ( request , {
85- metadata : await this . buildMetadata ( SendRequest . encode ( request ) . finish ( ) )
86- } ) ;
87- }
88- // END Code generated by protoc-gen-trinsic. DO NOT EDIT.
18+ /** Sign and issue a verifiable credential from a submitted document.
19+ * The document must be a valid JSON-LD document. */
20+ public async issue (
21+ request : proto . IssueRequest
22+ ) : Promise < proto . IssueResponse > {
23+ return this . client . issue ( request , {
24+ metadata : await this . buildMetadata (
25+ proto . IssueRequest . encode ( request ) . finish ( )
26+ ) ,
27+ } ) ;
28+ }
29+ /** Sign and issue a verifiable credential from a pre-defined template.
30+ * This process will also add schema validation and
31+ * revocation registry values to the credential. */
32+ public async issueFromTemplate (
33+ request : proto . IssueFromTemplateRequest
34+ ) : Promise < proto . IssueFromTemplateResponse > {
35+ return this . client . issueFromTemplate ( request , {
36+ metadata : await this . buildMetadata (
37+ proto . IssueFromTemplateRequest . encode ( request ) . finish ( )
38+ ) ,
39+ } ) ;
40+ }
41+ /** Check credential status in the revocation registry */
42+ public async checkStatus (
43+ request : proto . CheckStatusRequest
44+ ) : Promise < proto . CheckStatusResponse > {
45+ return this . client . checkStatus ( request , {
46+ metadata : await this . buildMetadata (
47+ proto . CheckStatusRequest . encode ( request ) . finish ( )
48+ ) ,
49+ } ) ;
50+ }
51+ /** Update credential status by setting the revocation value */
52+ public async updateStatus (
53+ request : proto . UpdateStatusRequest
54+ ) : Promise < proto . UpdateStatusResponse > {
55+ return this . client . updateStatus ( request , {
56+ metadata : await this . buildMetadata (
57+ proto . UpdateStatusRequest . encode ( request ) . finish ( )
58+ ) ,
59+ } ) ;
60+ }
61+ /** Create a proof from a signed document that is a valid
62+ * verifiable credential and contains a signature from which a proof can be derived. */
63+ public async createProof (
64+ request : proto . CreateProofRequest
65+ ) : Promise < proto . CreateProofResponse > {
66+ return this . client . createProof ( request , {
67+ metadata : await this . buildMetadata (
68+ proto . CreateProofRequest . encode ( request ) . finish ( )
69+ ) ,
70+ } ) ;
71+ }
72+ /** Verifies a proof by checking the signature value, and if possible schema validation,
73+ * revocation status, and issuer status against a trust registry */
74+ public async verifyProof (
75+ request : proto . VerifyProofRequest
76+ ) : Promise < proto . VerifyProofResponse > {
77+ return this . client . verifyProof ( request , {
78+ metadata : await this . buildMetadata (
79+ proto . VerifyProofRequest . encode ( request ) . finish ( )
80+ ) ,
81+ } ) ;
82+ }
83+ /** Sends a document directly to a user's email within the given ecosystem */
84+ public async send ( request : proto . SendRequest ) : Promise < proto . SendResponse > {
85+ return this . client . send ( request , {
86+ metadata : await this . buildMetadata (
87+ proto . SendRequest . encode ( request ) . finish ( )
88+ ) ,
89+ } ) ;
90+ }
91+ // END Code generated by protoc-gen-trinsic. DO NOT EDIT.
8992}
0 commit comments