@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client 0.33.1-next.3 → 0.33.1-next.73

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 ADDED
@@ -0,0 +1,412 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+
24
+ // plugin.schema.json
25
+ var require_plugin_schema = __commonJS({
26
+ "plugin.schema.json"(exports, module2) {
27
+ module2.exports = {
28
+ IVcApiIssuerClient: {
29
+ components: {
30
+ schemas: {
31
+ IIssueCredentialArgs: {
32
+ type: "object",
33
+ properties: {
34
+ credential: {
35
+ $ref: "#/components/schemas/CredentialPayload"
36
+ }
37
+ },
38
+ required: ["credential"],
39
+ additionalProperties: false
40
+ },
41
+ CredentialPayload: {
42
+ type: "object",
43
+ properties: {
44
+ issuer: {
45
+ $ref: "#/components/schemas/IssuerType"
46
+ },
47
+ credentialSubject: {
48
+ $ref: "#/components/schemas/CredentialSubject"
49
+ },
50
+ type: {
51
+ type: "array",
52
+ items: {
53
+ type: "string"
54
+ }
55
+ },
56
+ "@context": {
57
+ type: "array",
58
+ items: {
59
+ type: "string"
60
+ }
61
+ },
62
+ issuanceDate: {
63
+ $ref: "#/components/schemas/DateType"
64
+ },
65
+ expirationDate: {
66
+ $ref: "#/components/schemas/DateType"
67
+ },
68
+ credentialStatus: {
69
+ $ref: "#/components/schemas/CredentialStatusReference"
70
+ },
71
+ id: {
72
+ type: "string"
73
+ }
74
+ },
75
+ required: ["issuer"],
76
+ description: "Used as input when creating Verifiable Credentials"
77
+ },
78
+ IssuerType: {
79
+ anyOf: [
80
+ {
81
+ type: "object",
82
+ properties: {
83
+ id: {
84
+ type: "string"
85
+ }
86
+ },
87
+ required: ["id"]
88
+ },
89
+ {
90
+ type: "string"
91
+ }
92
+ ],
93
+ description: "The issuer of a {@link VerifiableCredential } or the holder of a {@link VerifiablePresentation } .\n\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#issuer | Issuer data model }"
94
+ },
95
+ CredentialSubject: {
96
+ type: "object",
97
+ properties: {
98
+ id: {
99
+ type: "string"
100
+ }
101
+ },
102
+ description: "The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#credential-subject | Credential Subject }"
103
+ },
104
+ DateType: {
105
+ anyOf: [
106
+ {
107
+ type: "string"
108
+ },
109
+ {
110
+ type: "string",
111
+ format: "date-time"
112
+ }
113
+ ],
114
+ description: "Represents an issuance or expiration date for Credentials / Presentations. This is used as input when creating them."
115
+ },
116
+ CredentialStatusReference: {
117
+ type: "object",
118
+ properties: {
119
+ id: {
120
+ type: "string"
121
+ },
122
+ type: {
123
+ type: "string"
124
+ }
125
+ },
126
+ required: ["id", "type"],
127
+ description: "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }"
128
+ },
129
+ VerifiableCredentialSP: {
130
+ type: "object",
131
+ properties: {
132
+ issuer: {
133
+ $ref: "#/components/schemas/IssuerType"
134
+ },
135
+ credentialSubject: {
136
+ anyOf: [
137
+ {
138
+ type: "array",
139
+ items: {
140
+ $ref: "#/components/schemas/CredentialSubject"
141
+ }
142
+ },
143
+ {
144
+ $ref: "#/components/schemas/CredentialSubject"
145
+ }
146
+ ]
147
+ },
148
+ type: {
149
+ anyOf: [
150
+ {
151
+ type: "array",
152
+ items: {
153
+ type: "string"
154
+ }
155
+ },
156
+ {
157
+ type: "string"
158
+ }
159
+ ]
160
+ },
161
+ "@context": {
162
+ anyOf: [
163
+ {
164
+ type: "array",
165
+ items: {
166
+ type: "string"
167
+ }
168
+ },
169
+ {
170
+ type: "string"
171
+ }
172
+ ]
173
+ },
174
+ issuanceDate: {
175
+ type: "string"
176
+ },
177
+ expirationDate: {
178
+ type: "string"
179
+ },
180
+ credentialStatus: {
181
+ $ref: "#/components/schemas/CredentialStatusSP"
182
+ },
183
+ id: {
184
+ type: "string"
185
+ },
186
+ validFrom: {
187
+ type: "string"
188
+ },
189
+ validUntil: {
190
+ type: "string"
191
+ },
192
+ proof: {
193
+ anyOf: [
194
+ {
195
+ $ref: "#/components/schemas/CredentialProofSP"
196
+ },
197
+ {
198
+ type: "array",
199
+ items: {
200
+ $ref: "#/components/schemas/CredentialProofSP"
201
+ }
202
+ },
203
+ {
204
+ $ref: "#/components/schemas/ProofType"
205
+ }
206
+ ]
207
+ }
208
+ },
209
+ required: ["@context", "credentialSubject", "issuanceDate", "issuer", "proof"]
210
+ },
211
+ CredentialStatusSP: {
212
+ type: "object",
213
+ properties: {
214
+ id: {
215
+ type: "string"
216
+ },
217
+ type: {
218
+ type: "string"
219
+ },
220
+ revocationListIndex: {
221
+ type: "string"
222
+ },
223
+ revocationListCredential: {
224
+ type: "string"
225
+ }
226
+ },
227
+ required: ["id", "type"]
228
+ },
229
+ CredentialProofSP: {
230
+ type: "object",
231
+ properties: {
232
+ type: {
233
+ anyOf: [
234
+ {
235
+ type: "string"
236
+ },
237
+ {
238
+ $ref: "#/components/schemas/IProofType"
239
+ }
240
+ ]
241
+ },
242
+ created: {
243
+ type: "string"
244
+ },
245
+ proofPurpose: {
246
+ anyOf: [
247
+ {
248
+ $ref: "#/components/schemas/IProofPurpose"
249
+ },
250
+ {
251
+ type: "string"
252
+ }
253
+ ]
254
+ },
255
+ verificationMethod: {
256
+ type: "string"
257
+ },
258
+ challenge: {
259
+ type: "string"
260
+ },
261
+ domain: {
262
+ type: "string"
263
+ },
264
+ proofValue: {
265
+ type: "string"
266
+ },
267
+ jws: {
268
+ type: "string"
269
+ },
270
+ nonce: {
271
+ type: "string"
272
+ },
273
+ requiredRevealStatements: {
274
+ type: "array",
275
+ items: {
276
+ type: "string"
277
+ }
278
+ }
279
+ },
280
+ required: ["type", "created", "proofPurpose", "verificationMethod"],
281
+ additionalProperties: {
282
+ anyOf: [
283
+ {
284
+ type: "string"
285
+ },
286
+ {
287
+ type: "array",
288
+ items: {
289
+ type: "string"
290
+ }
291
+ },
292
+ {
293
+ not: {}
294
+ }
295
+ ]
296
+ }
297
+ },
298
+ IProofType: {
299
+ type: "string",
300
+ enum: [
301
+ "Ed25519Signature2018",
302
+ "Ed25519Signature2020",
303
+ "EcdsaSecp256k1Signature2019",
304
+ "EcdsaSecp256k1RecoverySignature2020",
305
+ "JsonWebSignature2020",
306
+ "RsaSignature2018",
307
+ "GpgSignature2020",
308
+ "JcsEd25519Signature2020",
309
+ "BbsBlsSignatureProof2020",
310
+ "BbsBlsBoundSignatureProof2020",
311
+ "JwtProof2020",
312
+ "SdJwtProof2024",
313
+ "MsoMdocProof2024"
314
+ ]
315
+ },
316
+ IProofPurpose: {
317
+ type: "string",
318
+ enum: [
319
+ "verificationMethod",
320
+ "assertionMethod",
321
+ "authentication",
322
+ "keyAgreement",
323
+ "contactAgreement",
324
+ "capabilityInvocation",
325
+ "capabilityDelegation"
326
+ ]
327
+ },
328
+ ProofType: {
329
+ type: "object",
330
+ properties: {
331
+ type: {
332
+ type: "string"
333
+ }
334
+ },
335
+ description: "A proof property of a {@link VerifiableCredential } or {@link VerifiablePresentation }"
336
+ }
337
+ },
338
+ methods: {
339
+ vcApiClientIssueCredential: {
340
+ description: "",
341
+ arguments: {
342
+ $ref: "#/components/schemas/IIssueCredentialArgs"
343
+ },
344
+ returnType: {
345
+ $ref: "#/components/schemas/VerifiableCredentialSP"
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ };
352
+ }
353
+ });
354
+
355
+ // src/index.ts
356
+ var index_exports = {};
357
+ __export(index_exports, {
358
+ VcApiIssuerClient: () => VcApiIssuerClient,
359
+ events: () => events,
360
+ schema: () => schema
361
+ });
362
+ module.exports = __toCommonJS(index_exports);
363
+
364
+ // src/types/IVcApiIssuerClient.ts
365
+ var events = /* @__PURE__ */ function(events2) {
366
+ events2["CREDENTIAL_ISSUED"] = "credentialIssued";
367
+ return events2;
368
+ }({});
369
+
370
+ // src/agent/VcApiIssuerClient.ts
371
+ var import_cross_fetch = require("cross-fetch");
372
+ var VcApiIssuerClient = class {
373
+ static {
374
+ __name(this, "VcApiIssuerClient");
375
+ }
376
+ schema = schema.IVcApiIssuer;
377
+ methods = {
378
+ vcApiClientIssueCredential: this.vcApiClientIssueCredential.bind(this)
379
+ };
380
+ issueUrl;
381
+ authorizationToken;
382
+ constructor(options) {
383
+ this.issueUrl = options.issueUrl;
384
+ this.authorizationToken = options.authorizationToken;
385
+ }
386
+ /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
387
+ async vcApiClientIssueCredential(args, context) {
388
+ return await (0, import_cross_fetch.fetch)(this.issueUrl, {
389
+ method: "post",
390
+ headers: {
391
+ Accept: "application/json",
392
+ "Content-Type": "application/json",
393
+ Authorization: `bearer ${this.authorizationToken}`
394
+ },
395
+ body: JSON.stringify({
396
+ credential: args.credential
397
+ })
398
+ }).then(async (response) => {
399
+ if (response.status >= 400) {
400
+ throw new Error(await response.text());
401
+ } else {
402
+ const verifiableCredential = response.json();
403
+ await context.agent.emit(events.CREDENTIAL_ISSUED, verifiableCredential);
404
+ return verifiableCredential;
405
+ }
406
+ });
407
+ }
408
+ };
409
+
410
+ // src/index.ts
411
+ var schema = require_plugin_schema();
412
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../plugin.schema.json","../src/index.ts","../src/types/IVcApiIssuerClient.ts","../src/agent/VcApiIssuerClient.ts"],"sourcesContent":["{\n \"IVcApiIssuerClient\": {\n \"components\": {\n \"schemas\": {\n \"IIssueCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"$ref\": \"#/components/schemas/CredentialPayload\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"CredentialPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuer\": {\n \"$ref\": \"#/components/schemas/IssuerType\"\n },\n \"credentialSubject\": {\n \"$ref\": \"#/components/schemas/CredentialSubject\"\n },\n \"type\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"@context\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"issuanceDate\": {\n \"$ref\": \"#/components/schemas/DateType\"\n },\n \"expirationDate\": {\n \"$ref\": \"#/components/schemas/DateType\"\n },\n \"credentialStatus\": {\n \"$ref\": \"#/components/schemas/CredentialStatusReference\"\n },\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"issuer\"],\n \"description\": \"Used as input when creating Verifiable Credentials\"\n },\n \"IssuerType\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"]\n },\n {\n \"type\": \"string\"\n }\n ],\n \"description\": \"The issuer of a {@link VerifiableCredential } or the holder of a {@link VerifiablePresentation } .\\n\\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\\n\\nSee {@link https://www.w3.org/TR/vc-data-model/#issuer | Issuer data model }\"\n },\n \"CredentialSubject\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"description\": \"The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\\n\\nSee {@link https://www.w3.org/TR/vc-data-model/#credential-subject | Credential Subject }\"\n },\n \"DateType\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n ],\n \"description\": \"Represents an issuance or expiration date for Credentials / Presentations. This is used as input when creating them.\"\n },\n \"CredentialStatusReference\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\", \"type\"],\n \"description\": \"Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\\n\\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }\"\n },\n \"VerifiableCredentialSP\": {\n \"type\": \"object\",\n \"properties\": {\n \"issuer\": {\n \"$ref\": \"#/components/schemas/IssuerType\"\n },\n \"credentialSubject\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/CredentialSubject\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/CredentialSubject\"\n }\n ]\n },\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"@context\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"issuanceDate\": {\n \"type\": \"string\"\n },\n \"expirationDate\": {\n \"type\": \"string\"\n },\n \"credentialStatus\": {\n \"$ref\": \"#/components/schemas/CredentialStatusSP\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"validFrom\": {\n \"type\": \"string\"\n },\n \"validUntil\": {\n \"type\": \"string\"\n },\n \"proof\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/CredentialProofSP\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/CredentialProofSP\"\n }\n },\n {\n \"$ref\": \"#/components/schemas/ProofType\"\n }\n ]\n }\n },\n \"required\": [\"@context\", \"credentialSubject\", \"issuanceDate\", \"issuer\", \"proof\"]\n },\n \"CredentialStatusSP\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"revocationListIndex\": {\n \"type\": \"string\"\n },\n \"revocationListCredential\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\", \"type\"]\n },\n \"CredentialProofSP\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/IProofType\"\n }\n ]\n },\n \"created\": {\n \"type\": \"string\"\n },\n \"proofPurpose\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProofPurpose\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"verificationMethod\": {\n \"type\": \"string\"\n },\n \"challenge\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"proofValue\": {\n \"type\": \"string\"\n },\n \"jws\": {\n \"type\": \"string\"\n },\n \"nonce\": {\n \"type\": \"string\"\n },\n \"requiredRevealStatements\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"type\", \"created\", \"proofPurpose\", \"verificationMethod\"],\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n {\n \"not\": {}\n }\n ]\n }\n },\n \"IProofType\": {\n \"type\": \"string\",\n \"enum\": [\n \"Ed25519Signature2018\",\n \"Ed25519Signature2020\",\n \"EcdsaSecp256k1Signature2019\",\n \"EcdsaSecp256k1RecoverySignature2020\",\n \"JsonWebSignature2020\",\n \"RsaSignature2018\",\n \"GpgSignature2020\",\n \"JcsEd25519Signature2020\",\n \"BbsBlsSignatureProof2020\",\n \"BbsBlsBoundSignatureProof2020\",\n \"JwtProof2020\",\n \"SdJwtProof2024\",\n \"MsoMdocProof2024\"\n ]\n },\n \"IProofPurpose\": {\n \"type\": \"string\",\n \"enum\": [\n \"verificationMethod\",\n \"assertionMethod\",\n \"authentication\",\n \"keyAgreement\",\n \"contactAgreement\",\n \"capabilityInvocation\",\n \"capabilityDelegation\"\n ]\n },\n \"ProofType\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"description\": \"A proof property of a {@link VerifiableCredential } or {@link VerifiablePresentation }\"\n }\n },\n \"methods\": {\n \"vcApiClientIssueCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/IIssueCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerifiableCredentialSP\"\n }\n }\n }\n }\n }\n}\n","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { VcApiIssuerClient } from './agent/VcApiIssuerClient'\nexport * from './types/IVcApiIssuerClient'\n","import { CredentialPayload, IAgentContext, IPluginMethodMap } from '@veramo/core'\nimport { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core'\n\nexport interface IVcApiIssuerClient extends IPluginMethodMap {\n vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP>\n}\n\nexport interface IVcApiIssuerArgs {\n issueUrl: string\n authorizationToken: string\n}\n\nexport interface IIssueCredentialArgs {\n credential: CredentialPayload\n}\n\nexport enum events {\n CREDENTIAL_ISSUED = 'credentialIssued',\n}\n\nexport type IRequiredContext = IAgentContext<Record<string, never>>\n","import { IAgentPlugin } from '@veramo/core'\n\nimport { schema } from '../index'\nimport { events, IIssueCredentialArgs, IRequiredContext, IVcApiIssuerClient, IVcApiIssuerArgs } from '../types/IVcApiIssuerClient'\nimport { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core'\n\nimport { fetch } from 'cross-fetch'\n\n/**\n * {@inheritDoc IVcApiIssuer}\n */\nexport class VcApiIssuerClient implements IAgentPlugin {\n readonly schema = schema.IVcApiIssuer\n readonly methods: IVcApiIssuerClient = {\n vcApiClientIssueCredential: this.vcApiClientIssueCredential.bind(this),\n }\n private readonly issueUrl: string\n private readonly authorizationToken: string\n\n constructor(options: IVcApiIssuerArgs) {\n this.issueUrl = options.issueUrl\n this.authorizationToken = options.authorizationToken\n }\n\n /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */\n private async vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP> {\n return await fetch(this.issueUrl, {\n method: 'post',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n Authorization: `bearer ${this.authorizationToken}`,\n },\n body: JSON.stringify({ credential: args.credential }),\n }).then(async (response) => {\n if (response.status >= 400) {\n throw new Error(await response.text())\n } else {\n const verifiableCredential = response.json()\n await context.agent.emit(events.CREDENTIAL_ISSUED, verifiableCredential)\n return verifiableCredential\n }\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA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er","methods","vcApiClientIssueCredential","bind","issueUrl","authorizationToken","constructor","options","args","context","fetch","method","headers","Accept","Authorization","body","JSON","stringify","credential","then","response","status","Error","text","verifiableCredential","json","agent","emit","events","CREDENTIAL_ISSUED","schema","require"]}
@@ -1,44 +1,37 @@
1
- import { CredentialPayload } from '@veramo/core';
2
- import { IAgentContext } from '@veramo/core';
3
- import { IAgentPlugin } from '@veramo/core';
4
- import { IPluginMethodMap } from '@veramo/core';
5
- import { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core';
6
-
7
- export declare enum events {
8
- CREDENTIAL_ISSUED = "credentialIssued"
9
- }
10
-
11
- export declare interface IIssueCredentialArgs {
12
- credential: CredentialPayload;
13
- }
14
-
15
- export declare type IRequiredContext = IAgentContext<Record<string, never>>;
16
-
17
- export declare interface IVcApiIssuerArgs {
18
- issueUrl: string;
19
- authorizationToken: string;
20
- }
21
-
22
- export declare interface IVcApiIssuerClient extends IPluginMethodMap {
23
- vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP>;
24
- }
25
-
26
- /**
27
- * @public
28
- */
29
- export declare const schema: any;
30
-
31
- /**
32
- * {@inheritDoc IVcApiIssuer}
33
- */
34
- export declare class VcApiIssuerClient implements IAgentPlugin {
35
- readonly schema: any;
36
- readonly methods: IVcApiIssuerClient;
37
- private readonly issueUrl;
38
- private readonly authorizationToken;
39
- constructor(options: IVcApiIssuerArgs);
40
- /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
41
- private vcApiClientIssueCredential;
42
- }
43
-
44
- export { }
1
+ import { IPluginMethodMap, CredentialPayload, IAgentContext, IAgentPlugin } from '@veramo/core';
2
+ import { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core';
3
+
4
+ interface IVcApiIssuerClient extends IPluginMethodMap {
5
+ vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP>;
6
+ }
7
+ interface IVcApiIssuerArgs {
8
+ issueUrl: string;
9
+ authorizationToken: string;
10
+ }
11
+ interface IIssueCredentialArgs {
12
+ credential: CredentialPayload;
13
+ }
14
+ declare enum events {
15
+ CREDENTIAL_ISSUED = "credentialIssued"
16
+ }
17
+ type IRequiredContext = IAgentContext<Record<string, never>>;
18
+
19
+ /**
20
+ * {@inheritDoc IVcApiIssuer}
21
+ */
22
+ declare class VcApiIssuerClient implements IAgentPlugin {
23
+ readonly schema: any;
24
+ readonly methods: IVcApiIssuerClient;
25
+ private readonly issueUrl;
26
+ private readonly authorizationToken;
27
+ constructor(options: IVcApiIssuerArgs);
28
+ /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
29
+ private vcApiClientIssueCredential;
30
+ }
31
+
32
+ /**
33
+ * @public
34
+ */
35
+ declare const schema: any;
36
+
37
+ export { type IIssueCredentialArgs, type IRequiredContext, type IVcApiIssuerArgs, type IVcApiIssuerClient, VcApiIssuerClient, events, schema };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,37 @@
1
+ import { IPluginMethodMap, CredentialPayload, IAgentContext, IAgentPlugin } from '@veramo/core';
2
+ import { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core';
3
+
4
+ interface IVcApiIssuerClient extends IPluginMethodMap {
5
+ vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP>;
6
+ }
7
+ interface IVcApiIssuerArgs {
8
+ issueUrl: string;
9
+ authorizationToken: string;
10
+ }
11
+ interface IIssueCredentialArgs {
12
+ credential: CredentialPayload;
13
+ }
14
+ declare enum events {
15
+ CREDENTIAL_ISSUED = "credentialIssued"
16
+ }
17
+ type IRequiredContext = IAgentContext<Record<string, never>>;
18
+
19
+ /**
20
+ * {@inheritDoc IVcApiIssuer}
21
+ */
22
+ declare class VcApiIssuerClient implements IAgentPlugin {
23
+ readonly schema: any;
24
+ readonly methods: IVcApiIssuerClient;
25
+ private readonly issueUrl;
26
+ private readonly authorizationToken;
27
+ constructor(options: IVcApiIssuerArgs);
28
+ /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
29
+ private vcApiClientIssueCredential;
30
+ }
31
+
1
32
  /**
2
33
  * @public
3
34
  */
4
35
  declare const schema: any;
5
- export { schema };
6
- export { VcApiIssuerClient } from './agent/VcApiIssuerClient';
7
- export * from './types/IVcApiIssuerClient';
8
- //# sourceMappingURL=index.d.ts.map
36
+
37
+ export { type IIssueCredentialArgs, type IRequiredContext, type IVcApiIssuerArgs, type IVcApiIssuerClient, VcApiIssuerClient, events, schema };