@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client 0.34.1-fix.226 → 0.34.1-fix.247
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 +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/agent/VcApiIssuerClient.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
9
|
var __commonJS = (cb, mod) => function __require() {
|
|
@@ -19,6 +21,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
21
|
}
|
|
20
22
|
return to;
|
|
21
23
|
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
22
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
33
|
|
|
24
34
|
// plugin.schema.json
|
|
@@ -402,7 +412,7 @@ var events = /* @__PURE__ */ (function(events2) {
|
|
|
402
412
|
})({});
|
|
403
413
|
|
|
404
414
|
// src/agent/VcApiIssuerClient.ts
|
|
405
|
-
var import_cross_fetch = require("cross-fetch");
|
|
415
|
+
var import_cross_fetch = __toESM(require("cross-fetch"), 1);
|
|
406
416
|
var VcApiIssuerClient = class {
|
|
407
417
|
static {
|
|
408
418
|
__name(this, "VcApiIssuerClient");
|
|
@@ -419,7 +429,7 @@ var VcApiIssuerClient = class {
|
|
|
419
429
|
}
|
|
420
430
|
/** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
|
|
421
431
|
async vcApiClientIssueCredential(args, context) {
|
|
422
|
-
return await (0, import_cross_fetch.
|
|
432
|
+
return await (0, import_cross_fetch.default)(this.issueUrl, {
|
|
423
433
|
method: "post",
|
|
424
434
|
headers: {
|
|
425
435
|
Accept: "application/json",
|
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;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;AAAA,gBACV;AAAA,cACF;AAAA,cACA,aAAe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AAQD;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"]}
|
|
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;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,gBAC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,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,UAAMC,mBAAAA,SAAM,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
|
@@ -377,7 +377,7 @@ var events = /* @__PURE__ */ (function(events2) {
|
|
|
377
377
|
})({});
|
|
378
378
|
|
|
379
379
|
// src/agent/VcApiIssuerClient.ts
|
|
380
|
-
import
|
|
380
|
+
import fetch from "cross-fetch";
|
|
381
381
|
var VcApiIssuerClient = class {
|
|
382
382
|
static {
|
|
383
383
|
__name(this, "VcApiIssuerClient");
|
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;AAA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A,gBACV;AAAA,cACF;AAAA,cACA,aAAe;AAAA,YACjB;AAAA,UACF;AAAA,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;;;ACtVO,IAAKA,SAAAA,0BAAAA,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"]}
|
|
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;AA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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-fix.
|
|
3
|
+
"version": "0.34.1-fix.247+6c4b1882",
|
|
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-fix.
|
|
31
|
-
"@sphereon/ssi-sdk.dev": "0.34.1-fix.
|
|
30
|
+
"@sphereon/ssi-sdk.core": "0.34.1-fix.247+6c4b1882",
|
|
31
|
+
"@sphereon/ssi-sdk.dev": "0.34.1-fix.247+6c4b1882",
|
|
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": "
|
|
62
|
+
"gitHead": "6c4b188290980043b16a2aecce8bb0670d6e8ef2"
|
|
63
63
|
}
|
|
@@ -4,7 +4,7 @@ import { schema } from '../index'
|
|
|
4
4
|
import { events, IIssueCredentialArgs, IRequiredContext, IVcApiIssuerClient, IVcApiIssuerArgs } from '../types/IVcApiIssuerClient'
|
|
5
5
|
import { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core'
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import fetch from 'cross-fetch'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* {@inheritDoc IVcApiIssuer}
|