@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client 0.34.1-feature.SSISDK.17.bitstring.sl.2 → 0.34.1-next.3
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 +20 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -54
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/plugin.schema.json +21 -55
package/dist/index.cjs
CHANGED
|
@@ -35,9 +35,7 @@ var require_plugin_schema = __commonJS({
|
|
|
35
35
|
$ref: "#/components/schemas/CredentialPayload"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
required: [
|
|
39
|
-
"credential"
|
|
40
|
-
],
|
|
38
|
+
required: ["credential"],
|
|
41
39
|
additionalProperties: false
|
|
42
40
|
},
|
|
43
41
|
CredentialPayload: {
|
|
@@ -74,9 +72,7 @@ var require_plugin_schema = __commonJS({
|
|
|
74
72
|
type: "string"
|
|
75
73
|
}
|
|
76
74
|
},
|
|
77
|
-
required: [
|
|
78
|
-
"issuer"
|
|
79
|
-
],
|
|
75
|
+
required: ["issuer"],
|
|
80
76
|
description: "Used as input when creating Verifiable Credentials"
|
|
81
77
|
},
|
|
82
78
|
IssuerType: {
|
|
@@ -88,9 +84,7 @@ var require_plugin_schema = __commonJS({
|
|
|
88
84
|
type: "string"
|
|
89
85
|
}
|
|
90
86
|
},
|
|
91
|
-
required: [
|
|
92
|
-
"id"
|
|
93
|
-
]
|
|
87
|
+
required: ["id"]
|
|
94
88
|
},
|
|
95
89
|
{
|
|
96
90
|
type: "string"
|
|
@@ -129,10 +123,7 @@ var require_plugin_schema = __commonJS({
|
|
|
129
123
|
type: "string"
|
|
130
124
|
}
|
|
131
125
|
},
|
|
132
|
-
required: [
|
|
133
|
-
"id",
|
|
134
|
-
"type"
|
|
135
|
-
],
|
|
126
|
+
required: ["id", "type"],
|
|
136
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 }"
|
|
137
128
|
},
|
|
138
129
|
VerifiableCredentialSP: {
|
|
@@ -167,41 +158,31 @@ var require_plugin_schema = __commonJS({
|
|
|
167
158
|
}
|
|
168
159
|
]
|
|
169
160
|
},
|
|
170
|
-
issuanceDate: {
|
|
171
|
-
type: "string"
|
|
172
|
-
},
|
|
173
|
-
expirationDate: {
|
|
174
|
-
type: "string"
|
|
175
|
-
},
|
|
176
|
-
credentialStatus: {
|
|
177
|
-
$ref: "#/components/schemas/CredentialStatusSP"
|
|
178
|
-
},
|
|
179
|
-
id: {
|
|
180
|
-
type: "string"
|
|
181
|
-
},
|
|
182
161
|
"@context": {
|
|
183
162
|
anyOf: [
|
|
184
163
|
{
|
|
185
164
|
type: "array",
|
|
186
165
|
items: {
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
type: "string"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: "object"
|
|
193
|
-
}
|
|
194
|
-
]
|
|
166
|
+
type: "string"
|
|
195
167
|
}
|
|
196
168
|
},
|
|
197
169
|
{
|
|
198
170
|
type: "string"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
type: "object"
|
|
202
171
|
}
|
|
203
172
|
]
|
|
204
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
|
+
},
|
|
205
186
|
validFrom: {
|
|
206
187
|
type: "string"
|
|
207
188
|
},
|
|
@@ -225,14 +206,7 @@ var require_plugin_schema = __commonJS({
|
|
|
225
206
|
]
|
|
226
207
|
}
|
|
227
208
|
},
|
|
228
|
-
required: [
|
|
229
|
-
"@context",
|
|
230
|
-
"credentialSubject",
|
|
231
|
-
"issuanceDate",
|
|
232
|
-
"issuer",
|
|
233
|
-
"proof",
|
|
234
|
-
"type"
|
|
235
|
-
]
|
|
209
|
+
required: ["@context", "credentialSubject", "issuanceDate", "issuer", "proof"]
|
|
236
210
|
},
|
|
237
211
|
CredentialStatusSP: {
|
|
238
212
|
type: "object",
|
|
@@ -250,10 +224,7 @@ var require_plugin_schema = __commonJS({
|
|
|
250
224
|
type: "string"
|
|
251
225
|
}
|
|
252
226
|
},
|
|
253
|
-
required: [
|
|
254
|
-
"id",
|
|
255
|
-
"type"
|
|
256
|
-
]
|
|
227
|
+
required: ["id", "type"]
|
|
257
228
|
},
|
|
258
229
|
CredentialProofSP: {
|
|
259
230
|
type: "object",
|
|
@@ -306,12 +277,7 @@ var require_plugin_schema = __commonJS({
|
|
|
306
277
|
}
|
|
307
278
|
}
|
|
308
279
|
},
|
|
309
|
-
required: [
|
|
310
|
-
"type",
|
|
311
|
-
"created",
|
|
312
|
-
"proofPurpose",
|
|
313
|
-
"verificationMethod"
|
|
314
|
-
],
|
|
280
|
+
required: ["type", "created", "proofPurpose", "verificationMethod"],
|
|
315
281
|
additionalProperties: {
|
|
316
282
|
anyOf: [
|
|
317
283
|
{
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +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\": [\n \"credential\"\n ],\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\": [\n \"issuer\"\n ],\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\": [\n \"id\"\n ]\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\": [\n \"id\",\n \"type\"\n ],\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 \"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 \"@context\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\"\n }\n ]\n }\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\"\n }\n ]\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\": [\n \"@context\",\n \"credentialSubject\",\n \"issuanceDate\",\n \"issuer\",\n \"proof\",\n \"type\"\n ]\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\": [\n \"id\",\n \"type\"\n ]\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\": [\n \"type\",\n \"created\",\n \"proofPurpose\",\n \"verificationMethod\"\n ],\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 * @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;AAAA,gCAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,oBAAsB;AAAA,QACpB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,sBAAwB;AAAA,cACtB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,YAAc;AAAA,kBACZ,MAAQ;AAAA,gBACV;AAAA,cACF;AAAA,cACA,UAAY;AAAA,gBACV;AAAA,cACF;AAAA,cACA,sBAAwB;AAAA,YAC1B;AAAA,YACA,mBAAqB;AAAA,cACnB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,QAAU;AAAA,kBACR,MAAQ;AAAA,gBACV;AAAA,gBACA,mBAAqB;AAAA,kBACnB,MAAQ;AAAA,gBACV;AAAA,gBACA,MAAQ;AAAA,kBACN,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA,YAAY;AAAA,kBACV,MAAQ;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QACF;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;ACtWA;;;;;;;;;ACgBO,IAAKC,SAAAA,yBAAAA,SAAAA;;SAAAA;;;;ACVZ,yBAAsB;AAKf,IAAMC,oBAAN,MAAMA;EATb,OASaA;;;EACFC,SAASA,OAAOC;EAChBC,UAA8B;IACrCC,4BAA4B,KAAKA,2BAA2BC,KAAK,IAAI;EACvE;EACiBC;EACAC;EAEjBC,YAAYC,SAA2B;AACrC,SAAKH,WAAWG,QAAQH;AACxB,SAAKC,qBAAqBE,QAAQF;EACpC;;EAGA,MAAcH,2BAA2BM,MAA4BC,SAA4D;AAC/H,WAAO,UAAMC,0BAAM,KAAKN,UAAU;MAChCO,QAAQ;MACRC,SAAS;QACPC,QAAQ;QACR,gBAAgB;QAChBC,eAAe,UAAU,KAAKT,kBAAkB;MAClD;MACAU,MAAMC,KAAKC,UAAU;QAAEC,YAAYV,KAAKU;MAAW,CAAA;IACrD,CAAA,EAAGC,KAAK,OAAOC,aAAAA;AACb,UAAIA,SAASC,UAAU,KAAK;AAC1B,cAAM,IAAIC,MAAM,MAAMF,SAASG,KAAI,CAAA;MACrC,OAAO;AACL,cAAMC,uBAAuBJ,SAASK,KAAI;AAC1C,cAAMhB,QAAQiB,MAAMC,KAAKC,OAAOC,mBAAmBL,oBAAAA;AACnD,eAAOA;MACT;IACF,CAAA;EACF;AACF;;;AFzCA,IAAMM,SAASC;","names":["module","events","VcApiIssuerClient","schema","IVcApiIssuer","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
|
+
{"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;AAAA,gCAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,oBAAsB;AAAA,QACpB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,sBAAwB;AAAA,cACtB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,YAAc;AAAA,kBACZ,MAAQ;AAAA,gBACV;AAAA,cACF;AAAA,cACA,UAAY,CAAC,YAAY;AAAA,cACzB,sBAAwB;AAAA,YAC1B;AAAA,YACA,mBAAqB;AAAA,cACnB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,QAAU;AAAA,kBACR,MAAQ;AAAA,gBACV;AAAA,gBACA,mBAAqB;AAAA,kBACnB,MAAQ;AAAA,gBACV;AAAA,gBACA,MAAQ;AAAA,kBACN,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA,YAAY;AAAA,kBACV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vE;EACiBC;EACAC;EAEjB,YAAYC,SAA2B;AACrC,SAAKF,WAAWE,QAAQF;AACxB,SAAKC,qBAAqBC,QAAQD;EACpC;;EAGA,MAAcH,2BAA2BK,MAA4BC,SAA4D;AAC/H,WAAO,UAAMC,0BAAM,KAAKL,UAAU;MAChCM,QAAQ;MACRC,SAAS;QACPC,QAAQ;QACR,gBAAgB;QAChBC,eAAe,UAAU,KAAKR,kBAAkB;MAClD;MACAS,MAAMC,KAAKC,UAAU;QAAEC,YAAYV,KAAKU;MAAW,CAAA;IACrD,CAAA,EAAGC,KAAK,OAAOC,aAAAA;AACb,UAAIA,SAASC,UAAU,KAAK;AAC1B,cAAM,IAAIC,MAAM,MAAMF,SAASG,KAAI,CAAA;MACrC,OAAO;AACL,cAAMC,uBAAuBJ,SAASK,KAAI;AAC1C,cAAMhB,QAAQiB,MAAMC,KAAKC,OAAOC,mBAAmBL,oBAAAA;AACnD,eAAOA;MACT;IACF,CAAA;EACF;AACF;;;AFzCA,IAAMM,SAASC;","names":["module","events","VcApiIssuerClient","schema","IVcApiIssuer","methods","vcApiClientIssueCredential","bind","issueUrl","authorizationToken","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"]}
|
package/dist/index.js
CHANGED
|
@@ -19,9 +19,7 @@ var require_plugin_schema = __commonJS({
|
|
|
19
19
|
$ref: "#/components/schemas/CredentialPayload"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
required: [
|
|
23
|
-
"credential"
|
|
24
|
-
],
|
|
22
|
+
required: ["credential"],
|
|
25
23
|
additionalProperties: false
|
|
26
24
|
},
|
|
27
25
|
CredentialPayload: {
|
|
@@ -58,9 +56,7 @@ var require_plugin_schema = __commonJS({
|
|
|
58
56
|
type: "string"
|
|
59
57
|
}
|
|
60
58
|
},
|
|
61
|
-
required: [
|
|
62
|
-
"issuer"
|
|
63
|
-
],
|
|
59
|
+
required: ["issuer"],
|
|
64
60
|
description: "Used as input when creating Verifiable Credentials"
|
|
65
61
|
},
|
|
66
62
|
IssuerType: {
|
|
@@ -72,9 +68,7 @@ var require_plugin_schema = __commonJS({
|
|
|
72
68
|
type: "string"
|
|
73
69
|
}
|
|
74
70
|
},
|
|
75
|
-
required: [
|
|
76
|
-
"id"
|
|
77
|
-
]
|
|
71
|
+
required: ["id"]
|
|
78
72
|
},
|
|
79
73
|
{
|
|
80
74
|
type: "string"
|
|
@@ -113,10 +107,7 @@ var require_plugin_schema = __commonJS({
|
|
|
113
107
|
type: "string"
|
|
114
108
|
}
|
|
115
109
|
},
|
|
116
|
-
required: [
|
|
117
|
-
"id",
|
|
118
|
-
"type"
|
|
119
|
-
],
|
|
110
|
+
required: ["id", "type"],
|
|
120
111
|
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 }"
|
|
121
112
|
},
|
|
122
113
|
VerifiableCredentialSP: {
|
|
@@ -151,41 +142,31 @@ var require_plugin_schema = __commonJS({
|
|
|
151
142
|
}
|
|
152
143
|
]
|
|
153
144
|
},
|
|
154
|
-
issuanceDate: {
|
|
155
|
-
type: "string"
|
|
156
|
-
},
|
|
157
|
-
expirationDate: {
|
|
158
|
-
type: "string"
|
|
159
|
-
},
|
|
160
|
-
credentialStatus: {
|
|
161
|
-
$ref: "#/components/schemas/CredentialStatusSP"
|
|
162
|
-
},
|
|
163
|
-
id: {
|
|
164
|
-
type: "string"
|
|
165
|
-
},
|
|
166
145
|
"@context": {
|
|
167
146
|
anyOf: [
|
|
168
147
|
{
|
|
169
148
|
type: "array",
|
|
170
149
|
items: {
|
|
171
|
-
|
|
172
|
-
{
|
|
173
|
-
type: "string"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
type: "object"
|
|
177
|
-
}
|
|
178
|
-
]
|
|
150
|
+
type: "string"
|
|
179
151
|
}
|
|
180
152
|
},
|
|
181
153
|
{
|
|
182
154
|
type: "string"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: "object"
|
|
186
155
|
}
|
|
187
156
|
]
|
|
188
157
|
},
|
|
158
|
+
issuanceDate: {
|
|
159
|
+
type: "string"
|
|
160
|
+
},
|
|
161
|
+
expirationDate: {
|
|
162
|
+
type: "string"
|
|
163
|
+
},
|
|
164
|
+
credentialStatus: {
|
|
165
|
+
$ref: "#/components/schemas/CredentialStatusSP"
|
|
166
|
+
},
|
|
167
|
+
id: {
|
|
168
|
+
type: "string"
|
|
169
|
+
},
|
|
189
170
|
validFrom: {
|
|
190
171
|
type: "string"
|
|
191
172
|
},
|
|
@@ -209,14 +190,7 @@ var require_plugin_schema = __commonJS({
|
|
|
209
190
|
]
|
|
210
191
|
}
|
|
211
192
|
},
|
|
212
|
-
required: [
|
|
213
|
-
"@context",
|
|
214
|
-
"credentialSubject",
|
|
215
|
-
"issuanceDate",
|
|
216
|
-
"issuer",
|
|
217
|
-
"proof",
|
|
218
|
-
"type"
|
|
219
|
-
]
|
|
193
|
+
required: ["@context", "credentialSubject", "issuanceDate", "issuer", "proof"]
|
|
220
194
|
},
|
|
221
195
|
CredentialStatusSP: {
|
|
222
196
|
type: "object",
|
|
@@ -234,10 +208,7 @@ var require_plugin_schema = __commonJS({
|
|
|
234
208
|
type: "string"
|
|
235
209
|
}
|
|
236
210
|
},
|
|
237
|
-
required: [
|
|
238
|
-
"id",
|
|
239
|
-
"type"
|
|
240
|
-
]
|
|
211
|
+
required: ["id", "type"]
|
|
241
212
|
},
|
|
242
213
|
CredentialProofSP: {
|
|
243
214
|
type: "object",
|
|
@@ -290,12 +261,7 @@ var require_plugin_schema = __commonJS({
|
|
|
290
261
|
}
|
|
291
262
|
}
|
|
292
263
|
},
|
|
293
|
-
required: [
|
|
294
|
-
"type",
|
|
295
|
-
"created",
|
|
296
|
-
"proofPurpose",
|
|
297
|
-
"verificationMethod"
|
|
298
|
-
],
|
|
264
|
+
required: ["type", "created", "proofPurpose", "verificationMethod"],
|
|
299
265
|
additionalProperties: {
|
|
300
266
|
anyOf: [
|
|
301
267
|
{
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../plugin.schema.json","../src/types/IVcApiIssuerClient.ts","../src/agent/VcApiIssuerClient.ts","../src/index.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\": [\n \"credential\"\n ],\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\": [\n \"issuer\"\n ],\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\": [\n \"id\"\n ]\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\": [\n \"id\",\n \"type\"\n ],\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 \"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 \"@context\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\"\n }\n ]\n }\n },\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"object\"\n }\n ]\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\": [\n \"@context\",\n \"credentialSubject\",\n \"issuanceDate\",\n \"issuer\",\n \"proof\",\n \"type\"\n ]\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\": [\n \"id\",\n \"type\"\n ]\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\": [\n \"type\",\n \"created\",\n \"proofPurpose\",\n \"verificationMethod\"\n ],\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}","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","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { VcApiIssuerClient } from './agent/VcApiIssuerClient'\nexport * from './types/IVcApiIssuerClient'\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,oBAAsB;AAAA,QACpB,YAAc;AAAA,UACZ,SAAW;AAAA,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QAAQiB,MAAMC,KAAKC,OAAOC,mBAAmBL,oBAAAA;AACnD,eAAOA;MACT;IACF,CAAA;EACF;AACF;;;ACzCA,IAAMM,SAASC;","names":["events","fetch","VcApiIssuerClient","schema","IVcApiIssuer","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
|
+
{"version":3,"sources":["../plugin.schema.json","../src/types/IVcApiIssuerClient.ts","../src/agent/VcApiIssuerClient.ts","../src/index.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","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","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { VcApiIssuerClient } from './agent/VcApiIssuerClient'\nexport * from './types/IVcApiIssuerClient'\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,oBAAsB;AAAA,QACpB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,sBAAwB;AAAA,cACtB,MAAQ;AAAA,cAC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AAA,UACA,SAAW;AAAA,YACT,4BAA8B;AAAA,cAC5B,aAAe;AAAA,cACf,WAAa;AAAA,gBACX,MAAQ;AAAA,cACV;AAAA,cACA,YAAc;AAAA,gBACZ,MAAQ;AAAA,cACV;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA;AAAA;;;ACpTO,IAAKA,SAAAA,yBAAAA,SAAAA;;SAAAA;;;;ACVZ,SAASC,aAAa;AAKf,IAAMC,oBAAN,MAAMA;EATb,OASaA;;;EACFC,SAASA,OAAOC;EAChBC,UAA8B;IACrCC,4BAA4B,KAAKA,2BAA2BC,KAAK,IAAI;EACvE;EACiBC;EACAC;EAEjB,YAAYC,SAA2B;AACrC,SAAKF,WAAWE,QAAQF;AACxB,SAAKC,qBAAqBC,QAAQD;EACpC;;EAGA,MAAcH,2BAA2BK,MAA4BC,SAA4D;AAC/H,WAAO,MAAMC,MAAM,KAAKL,UAAU;MAChCM,QAAQ;MACRC,SAAS;QACPC,QAAQ;QACR,gBAAgB;QAChBC,eAAe,UAAU,KAAKR,kBAAkB;MAClD;MACAS,MAAMC,KAAKC,UAAU;QAAEC,YAAYV,KAAKU;MAAW,CAAA;IACrD,CAAA,EAAGC,KAAK,OAAOC,aAAAA;AACb,UAAIA,SAASC,UAAU,KAAK;AAC1B,cAAM,IAAIC,MAAM,MAAMF,SAASG,KAAI,CAAA;MACrC,OAAO;AACL,cAAMC,uBAAuBJ,SAASK,KAAI;AAC1C,cAAMhB,QAAQiB,MAAMC,KAAKC,OAAOC,mBAAmBL,oBAAAA;AACnD,eAAOA;MACT;IACF,CAAA;EACF;AACF;;;ACzCA,IAAMM,SAASC;","names":["events","fetch","VcApiIssuerClient","schema","IVcApiIssuer","methods","vcApiClientIssueCredential","bind","issueUrl","authorizationToken","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client",
|
|
3
|
-
"version": "0.34.1-
|
|
3
|
+
"version": "0.34.1-next.3+6c49ea2f",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@sphereon/ssi-sdk.core": "0.34.1-
|
|
31
|
-
"@sphereon/ssi-sdk.dev": "0.34.1-
|
|
30
|
+
"@sphereon/ssi-sdk.core": "0.34.1-next.3+6c49ea2f",
|
|
31
|
+
"@sphereon/ssi-sdk.dev": "0.34.1-next.3+6c49ea2f",
|
|
32
32
|
"@veramo/core": "4.2.0",
|
|
33
33
|
"cross-fetch": "^3.1.8"
|
|
34
34
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"API",
|
|
60
60
|
"Issuer"
|
|
61
61
|
],
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6c49ea2f9c1bc61641ca2c98e3aa0a5b48018d91"
|
|
63
63
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
"$ref": "#/components/schemas/CredentialPayload"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"required": [
|
|
13
|
-
"credential"
|
|
14
|
-
],
|
|
12
|
+
"required": ["credential"],
|
|
15
13
|
"additionalProperties": false
|
|
16
14
|
},
|
|
17
15
|
"CredentialPayload": {
|
|
@@ -48,9 +46,7 @@
|
|
|
48
46
|
"type": "string"
|
|
49
47
|
}
|
|
50
48
|
},
|
|
51
|
-
"required": [
|
|
52
|
-
"issuer"
|
|
53
|
-
],
|
|
49
|
+
"required": ["issuer"],
|
|
54
50
|
"description": "Used as input when creating Verifiable Credentials"
|
|
55
51
|
},
|
|
56
52
|
"IssuerType": {
|
|
@@ -62,9 +58,7 @@
|
|
|
62
58
|
"type": "string"
|
|
63
59
|
}
|
|
64
60
|
},
|
|
65
|
-
"required": [
|
|
66
|
-
"id"
|
|
67
|
-
]
|
|
61
|
+
"required": ["id"]
|
|
68
62
|
},
|
|
69
63
|
{
|
|
70
64
|
"type": "string"
|
|
@@ -103,10 +97,7 @@
|
|
|
103
97
|
"type": "string"
|
|
104
98
|
}
|
|
105
99
|
},
|
|
106
|
-
"required": [
|
|
107
|
-
"id",
|
|
108
|
-
"type"
|
|
109
|
-
],
|
|
100
|
+
"required": ["id", "type"],
|
|
110
101
|
"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 }"
|
|
111
102
|
},
|
|
112
103
|
"VerifiableCredentialSP": {
|
|
@@ -141,41 +132,31 @@
|
|
|
141
132
|
}
|
|
142
133
|
]
|
|
143
134
|
},
|
|
144
|
-
"issuanceDate": {
|
|
145
|
-
"type": "string"
|
|
146
|
-
},
|
|
147
|
-
"expirationDate": {
|
|
148
|
-
"type": "string"
|
|
149
|
-
},
|
|
150
|
-
"credentialStatus": {
|
|
151
|
-
"$ref": "#/components/schemas/CredentialStatusSP"
|
|
152
|
-
},
|
|
153
|
-
"id": {
|
|
154
|
-
"type": "string"
|
|
155
|
-
},
|
|
156
135
|
"@context": {
|
|
157
136
|
"anyOf": [
|
|
158
137
|
{
|
|
159
138
|
"type": "array",
|
|
160
139
|
"items": {
|
|
161
|
-
"
|
|
162
|
-
{
|
|
163
|
-
"type": "string"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"type": "object"
|
|
167
|
-
}
|
|
168
|
-
]
|
|
140
|
+
"type": "string"
|
|
169
141
|
}
|
|
170
142
|
},
|
|
171
143
|
{
|
|
172
144
|
"type": "string"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"type": "object"
|
|
176
145
|
}
|
|
177
146
|
]
|
|
178
147
|
},
|
|
148
|
+
"issuanceDate": {
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"expirationDate": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"credentialStatus": {
|
|
155
|
+
"$ref": "#/components/schemas/CredentialStatusSP"
|
|
156
|
+
},
|
|
157
|
+
"id": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
179
160
|
"validFrom": {
|
|
180
161
|
"type": "string"
|
|
181
162
|
},
|
|
@@ -199,14 +180,7 @@
|
|
|
199
180
|
]
|
|
200
181
|
}
|
|
201
182
|
},
|
|
202
|
-
"required": [
|
|
203
|
-
"@context",
|
|
204
|
-
"credentialSubject",
|
|
205
|
-
"issuanceDate",
|
|
206
|
-
"issuer",
|
|
207
|
-
"proof",
|
|
208
|
-
"type"
|
|
209
|
-
]
|
|
183
|
+
"required": ["@context", "credentialSubject", "issuanceDate", "issuer", "proof"]
|
|
210
184
|
},
|
|
211
185
|
"CredentialStatusSP": {
|
|
212
186
|
"type": "object",
|
|
@@ -224,10 +198,7 @@
|
|
|
224
198
|
"type": "string"
|
|
225
199
|
}
|
|
226
200
|
},
|
|
227
|
-
"required": [
|
|
228
|
-
"id",
|
|
229
|
-
"type"
|
|
230
|
-
]
|
|
201
|
+
"required": ["id", "type"]
|
|
231
202
|
},
|
|
232
203
|
"CredentialProofSP": {
|
|
233
204
|
"type": "object",
|
|
@@ -280,12 +251,7 @@
|
|
|
280
251
|
}
|
|
281
252
|
}
|
|
282
253
|
},
|
|
283
|
-
"required": [
|
|
284
|
-
"type",
|
|
285
|
-
"created",
|
|
286
|
-
"proofPurpose",
|
|
287
|
-
"verificationMethod"
|
|
288
|
-
],
|
|
254
|
+
"required": ["type", "created", "proofPurpose", "verificationMethod"],
|
|
289
255
|
"additionalProperties": {
|
|
290
256
|
"anyOf": [
|
|
291
257
|
{
|
|
@@ -356,4 +322,4 @@
|
|
|
356
322
|
}
|
|
357
323
|
}
|
|
358
324
|
}
|
|
359
|
-
}
|
|
325
|
+
}
|