@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client 0.34.1-next.299 → 0.34.1-next.322

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 CHANGED
@@ -45,9 +45,7 @@ var require_plugin_schema = __commonJS({
45
45
  $ref: "#/components/schemas/CredentialPayload"
46
46
  }
47
47
  },
48
- required: [
49
- "credential"
50
- ],
48
+ required: ["credential"],
51
49
  additionalProperties: false
52
50
  },
53
51
  CredentialPayload: {
@@ -84,9 +82,7 @@ var require_plugin_schema = __commonJS({
84
82
  type: "string"
85
83
  }
86
84
  },
87
- required: [
88
- "issuer"
89
- ],
85
+ required: ["issuer"],
90
86
  description: "Used as input when creating Verifiable Credentials"
91
87
  },
92
88
  IssuerType: {
@@ -98,9 +94,7 @@ var require_plugin_schema = __commonJS({
98
94
  type: "string"
99
95
  }
100
96
  },
101
- required: [
102
- "id"
103
- ]
97
+ required: ["id"]
104
98
  },
105
99
  {
106
100
  type: "string"
@@ -139,10 +133,7 @@ var require_plugin_schema = __commonJS({
139
133
  type: "string"
140
134
  }
141
135
  },
142
- required: [
143
- "id",
144
- "type"
145
- ],
136
+ required: ["id", "type"],
146
137
  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 }"
147
138
  },
148
139
  VerifiableCredentialSP: {
@@ -235,14 +226,7 @@ var require_plugin_schema = __commonJS({
235
226
  ]
236
227
  }
237
228
  },
238
- required: [
239
- "@context",
240
- "credentialSubject",
241
- "issuanceDate",
242
- "issuer",
243
- "proof",
244
- "type"
245
- ]
229
+ required: ["@context", "credentialSubject", "issuanceDate", "issuer", "proof", "type"]
246
230
  },
247
231
  CredentialStatusSP: {
248
232
  type: "object",
@@ -260,10 +244,7 @@ var require_plugin_schema = __commonJS({
260
244
  type: "string"
261
245
  }
262
246
  },
263
- required: [
264
- "id",
265
- "type"
266
- ]
247
+ required: ["id", "type"]
267
248
  },
268
249
  CredentialProofSP: {
269
250
  type: "object",
@@ -316,12 +297,7 @@ var require_plugin_schema = __commonJS({
316
297
  }
317
298
  }
318
299
  },
319
- required: [
320
- "type",
321
- "created",
322
- "proofPurpose",
323
- "verificationMethod"
324
- ],
300
+ required: ["type", "created", "proofPurpose", "verificationMethod"],
325
301
  additionalProperties: {
326
302
  anyOf: [
327
303
  {
@@ -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.CREDENTI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C,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"]}
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 \"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\": [\"@context\", \"credentialSubject\", \"issuanceDate\", \"issuer\", \"proof\", \"type\"]\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,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA,cAAgB;AAAA,kBACd,MAAQ;AAAA,gBACV;AAAA,gBACA,gBAAkB;AAAA,kBAChB,MAAQ;AAAA,gBACV;AAAA,gBACA,kBAAoB;AAAA,kBAClB,MAAQ;AAAA,gBACV;AAAA,gBACA,IAAM;AAAA,kBACJ,MAAQ;AAAA,gBACV;AAAA,cACF;AAAA,cACA,UAAY,CAAC,QAAQ;AAAA,cACrB,aAAe;AAAA,YACjB;AAAA,YACA,YAAc;AAAA,cACZ,OAAS;AAAA,gBACP;AAAA,kBACE,MAAQ;AAAA,kBACR,YAAc;AAAA,oBACZ,IAAM;AAAA,sBACJ,MAA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YV,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: {
@@ -209,14 +200,7 @@ var require_plugin_schema = __commonJS({
209
200
  ]
210
201
  }
211
202
  },
212
- required: [
213
- "@context",
214
- "credentialSubject",
215
- "issuanceDate",
216
- "issuer",
217
- "proof",
218
- "type"
219
- ]
203
+ required: ["@context", "credentialSubject", "issuanceDate", "issuer", "proof", "type"]
220
204
  },
221
205
  CredentialStatusSP: {
222
206
  type: "object",
@@ -234,10 +218,7 @@ var require_plugin_schema = __commonJS({
234
218
  type: "string"
235
219
  }
236
220
  },
237
- required: [
238
- "id",
239
- "type"
240
- ]
221
+ required: ["id", "type"]
241
222
  },
242
223
  CredentialProofSP: {
243
224
  type: "object",
@@ -290,12 +271,7 @@ var require_plugin_schema = __commonJS({
290
271
  }
291
272
  }
292
273
  },
293
- required: [
294
- "type",
295
- "created",
296
- "proofPurpose",
297
- "verificationMethod"
298
- ],
274
+ required: ["type", "created", "proofPurpose", "verificationMethod"],
299
275
  additionalProperties: {
300
276
  anyOf: [
301
277
  {
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,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;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA,cAAgB;AAAA,kBACd,MAAQ;AAAA,gBACV;AAAA,gBACA,gBAAkB;AAAA,kBAChB,MAAQ;AAAA,gBACV;AAAA,gBACA,kBAAoB;AAAA,kBAClB,MAAQ;AAAA,gBACV;AAAA,gBACA,IAAM;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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"]}
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 \"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\": [\"@context\", \"credentialSubject\", \"issuanceDate\", \"issuer\", \"proof\", \"type\"]\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,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,MAAQ;AAAA,kBACR,OAAS;AAAA,oBACP,MAAQ;AAAA,kBACV;AAAA,gBACF;AAAA,gBACA,cAAgB;AAAA,kBACd,MAAQ;AAAA,gBACV;AAAA,gBACA,gBAAkB;AAAA,kBAChB,MAAQ;AAAA,gBACV;AAAA,gBACA,kBAAoB;AAAA,kBAClB,MAAQ;AAAA,gBACV;AAAA,gB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C;;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-next.299+9e9f5a50",
3
+ "version": "0.34.1-next.322+78f8dd31",
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": "tsx ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
28
28
  },
29
29
  "dependencies": {
30
- "@sphereon/ssi-sdk.core": "0.34.1-next.299+9e9f5a50",
31
- "@sphereon/ssi-sdk.dev": "0.34.1-next.299+9e9f5a50",
30
+ "@sphereon/ssi-sdk.core": "0.34.1-next.322+78f8dd31",
31
+ "@sphereon/ssi-sdk.dev": "0.34.1-next.322+78f8dd31",
32
32
  "@veramo/core": "4.2.0",
33
33
  "cross-fetch": "^4.1.0"
34
34
  },
@@ -59,5 +59,5 @@
59
59
  "API",
60
60
  "Issuer"
61
61
  ],
62
- "gitHead": "9e9f5a50ead9373a078cb5291cbc4fb1e7865dc2"
62
+ "gitHead": "78f8dd3157066ae8cf11d2ae50c8c3d8f43b8ed0"
63
63
  }
@@ -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": {
@@ -199,14 +190,7 @@
199
190
  ]
200
191
  }
201
192
  },
202
- "required": [
203
- "@context",
204
- "credentialSubject",
205
- "issuanceDate",
206
- "issuer",
207
- "proof",
208
- "type"
209
- ]
193
+ "required": ["@context", "credentialSubject", "issuanceDate", "issuer", "proof", "type"]
210
194
  },
211
195
  "CredentialStatusSP": {
212
196
  "type": "object",
@@ -224,10 +208,7 @@
224
208
  "type": "string"
225
209
  }
226
210
  },
227
- "required": [
228
- "id",
229
- "type"
230
- ]
211
+ "required": ["id", "type"]
231
212
  },
232
213
  "CredentialProofSP": {
233
214
  "type": "object",
@@ -280,12 +261,7 @@
280
261
  }
281
262
  }
282
263
  },
283
- "required": [
284
- "type",
285
- "created",
286
- "proofPurpose",
287
- "verificationMethod"
288
- ],
264
+ "required": ["type", "created", "proofPurpose", "verificationMethod"],
289
265
  "additionalProperties": {
290
266
  "anyOf": [
291
267
  {
@@ -356,4 +332,4 @@
356
332
  }
357
333
  }
358
334
  }
359
- }
335
+ }