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

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.
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.VcApiIssuerClient = void 0;
13
- const index_1 = require("../index");
14
- const IVcApiIssuerClient_1 = require("../types/IVcApiIssuerClient");
15
- const cross_fetch_1 = require("cross-fetch");
16
- /**
17
- * {@inheritDoc IVcApiIssuer}
18
- */
19
- class VcApiIssuerClient {
20
- constructor(options) {
21
- this.schema = index_1.schema.IVcApiIssuer;
22
- this.methods = {
23
- vcApiClientIssueCredential: this.vcApiClientIssueCredential.bind(this),
24
- };
25
- this.issueUrl = options.issueUrl;
26
- this.authorizationToken = options.authorizationToken;
27
- }
28
- /** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
29
- vcApiClientIssueCredential(args, context) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return yield (0, cross_fetch_1.fetch)(this.issueUrl, {
32
- method: 'post',
33
- headers: {
34
- Accept: 'application/json',
35
- 'Content-Type': 'application/json',
36
- Authorization: `bearer ${this.authorizationToken}`,
37
- },
38
- body: JSON.stringify({ credential: args.credential }),
39
- }).then((response) => __awaiter(this, void 0, void 0, function* () {
40
- if (response.status >= 400) {
41
- throw new Error(yield response.text());
42
- }
43
- else {
44
- const verifiableCredential = response.json();
45
- yield context.agent.emit(IVcApiIssuerClient_1.events.CREDENTIAL_ISSUED, verifiableCredential);
46
- return verifiableCredential;
47
- }
48
- }));
49
- });
50
- }
51
- }
52
- exports.VcApiIssuerClient = VcApiIssuerClient;
53
- //# sourceMappingURL=VcApiIssuerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VcApiIssuerClient.js","sourceRoot":"","sources":["../../src/agent/VcApiIssuerClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,oCAAiC;AACjC,oEAAkI;AAGlI,6CAAmC;AAEnC;;GAEG;AACH,MAAa,iBAAiB;IAQ5B,YAAY,OAAyB;QAP5B,WAAM,GAAG,cAAM,CAAC,YAAY,CAAA;QAC5B,YAAO,GAAuB;YACrC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;SACvE,CAAA;QAKC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QAChC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;IACtD,CAAC;IAED,4DAA4D;IAC9C,0BAA0B,CAAC,IAA0B,EAAE,OAAyB;;YAC5F,OAAO,MAAM,IAAA,mBAAK,EAAC,IAAI,CAAC,QAAQ,EAAE;gBAChC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU,IAAI,CAAC,kBAAkB,EAAE;iBACnD;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;aACtD,CAAC,CAAC,IAAI,CAAC,CAAO,QAAQ,EAAE,EAAE;gBACzB,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;oBAC3B,MAAM,IAAI,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;gBACxC,CAAC;qBAAM,CAAC;oBACN,MAAM,oBAAoB,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;oBAC5C,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,2BAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAA;oBACxE,OAAO,oBAAoB,CAAA;gBAC7B,CAAC;YACH,CAAC,CAAA,CAAC,CAAA;QACJ,CAAC;KAAA;CACF;AAjCD,8CAiCC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,cAAc,4BAA4B,CAAA"}
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.5"
9
- }
10
- ]
11
- }
@@ -1,17 +0,0 @@
1
- import { CredentialPayload, IAgentContext, IPluginMethodMap } from '@veramo/core';
2
- import { VerifiableCredentialSP } from '@sphereon/ssi-sdk.core';
3
- export interface IVcApiIssuerClient extends IPluginMethodMap {
4
- vcApiClientIssueCredential(args: IIssueCredentialArgs, context: IRequiredContext): Promise<VerifiableCredentialSP>;
5
- }
6
- export interface IVcApiIssuerArgs {
7
- issueUrl: string;
8
- authorizationToken: string;
9
- }
10
- export interface IIssueCredentialArgs {
11
- credential: CredentialPayload;
12
- }
13
- export declare enum events {
14
- CREDENTIAL_ISSUED = "credentialIssued"
15
- }
16
- export type IRequiredContext = IAgentContext<Record<string, never>>;
17
- //# sourceMappingURL=IVcApiIssuerClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IVcApiIssuerClient.d.ts","sourceRoot":"","sources":["../../src/types/IVcApiIssuerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,0BAA0B,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;CACnH;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,iBAAiB,CAAA;CAC9B;AAED,oBAAY,MAAM;IAChB,iBAAiB,qBAAqB;CACvC;AAED,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.events = void 0;
4
- var events;
5
- (function (events) {
6
- events["CREDENTIAL_ISSUED"] = "credentialIssued";
7
- })(events || (exports.events = events = {}));
8
- //# sourceMappingURL=IVcApiIssuerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IVcApiIssuerClient.js","sourceRoot":"","sources":["../../src/types/IVcApiIssuerClient.ts"],"names":[],"mappings":";;;AAgBA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,gDAAsC,CAAA;AACxC,CAAC,EAFW,MAAM,sBAAN,MAAM,QAEjB"}