@sphereon/ssi-sdk.w3c-vc-api-issuer-rest-client 0.33.0 → 0.33.1-feature.vcdm2.4
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 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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");
|
|
1
|
+
import { schema } from '../index';
|
|
2
|
+
import { events } from '../types/IVcApiIssuerClient';
|
|
3
|
+
import { fetch } from 'cross-fetch';
|
|
16
4
|
/**
|
|
17
5
|
* {@inheritDoc IVcApiIssuer}
|
|
18
6
|
*/
|
|
19
|
-
class VcApiIssuerClient {
|
|
7
|
+
export class VcApiIssuerClient {
|
|
8
|
+
schema = schema.IVcApiIssuer;
|
|
9
|
+
methods = {
|
|
10
|
+
vcApiClientIssueCredential: this.vcApiClientIssueCredential.bind(this),
|
|
11
|
+
};
|
|
12
|
+
issueUrl;
|
|
13
|
+
authorizationToken;
|
|
20
14
|
constructor(options) {
|
|
21
|
-
this.schema = index_1.schema.IVcApiIssuer;
|
|
22
|
-
this.methods = {
|
|
23
|
-
vcApiClientIssueCredential: this.vcApiClientIssueCredential.bind(this),
|
|
24
|
-
};
|
|
25
15
|
this.issueUrl = options.issueUrl;
|
|
26
16
|
this.authorizationToken = options.authorizationToken;
|
|
27
17
|
}
|
|
28
18
|
/** {@inheritDoc IVcApiIssuer.vcApiClientIssueCredential} */
|
|
29
|
-
vcApiClientIssueCredential(args, context) {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
19
|
+
async vcApiClientIssueCredential(args, context) {
|
|
20
|
+
return await fetch(this.issueUrl, {
|
|
21
|
+
method: 'post',
|
|
22
|
+
headers: {
|
|
23
|
+
Accept: 'application/json',
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
Authorization: `bearer ${this.authorizationToken}`,
|
|
26
|
+
},
|
|
27
|
+
body: JSON.stringify({ credential: args.credential }),
|
|
28
|
+
}).then(async (response) => {
|
|
29
|
+
if (response.status >= 400) {
|
|
30
|
+
throw new Error(await response.text());
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const verifiableCredential = response.json();
|
|
34
|
+
await context.agent.emit(events.CREDENTIAL_ISSUED, verifiableCredential);
|
|
35
|
+
return verifiableCredential;
|
|
36
|
+
}
|
|
49
37
|
});
|
|
50
38
|
}
|
|
51
39
|
}
|
|
52
|
-
exports.VcApiIssuerClient = VcApiIssuerClient;
|
|
53
40
|
//# sourceMappingURL=VcApiIssuerClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VcApiIssuerClient.js","sourceRoot":"","sources":["../../src/agent/VcApiIssuerClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VcApiIssuerClient.js","sourceRoot":"","sources":["../../src/agent/VcApiIssuerClient.ts"],"names":[],"mappings":"AAEA,OA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E,oBAAoB,CAAC,CAAA;gBACxE,OAAO,oBAAoB,CAAA;YAC7B,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.VcApiIssuerClient = exports.schema = void 0;
|
|
18
1
|
/**
|
|
19
2
|
* @public
|
|
20
3
|
*/
|
|
21
4
|
const schema = require('../plugin.schema.json');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
__exportStar(require("./types/IVcApiIssuerClient"), exports);
|
|
5
|
+
export { schema };
|
|
6
|
+
export { VcApiIssuerClient } from './agent/VcApiIssuerClient';
|
|
7
|
+
export * from './types/IVcApiIssuerClient';
|
|
26
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,cAAc,4BAA4B,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.events = void 0;
|
|
4
|
-
var events;
|
|
1
|
+
export var events;
|
|
5
2
|
(function (events) {
|
|
6
3
|
events["CREDENTIAL_ISSUED"] = "credentialIssued";
|
|
7
|
-
})(events || (
|
|
4
|
+
})(events || (events = {}));
|
|
8
5
|
//# sourceMappingURL=IVcApiIssuerClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IVcApiIssuerClient.js","sourceRoot":"","sources":["../../src/types/IVcApiIssuerClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IVcApiIssuerClient.js","sourceRoot":"","sources":["../../src/types/IVcApiIssuerClient.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,gDAAsC,CAAA;AACxC,CAAC,EAFW,MAAM,KAAN,MAAM,QAEjB"}
|
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.33.
|
|
3
|
+
"version": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sphereon/ssi-sdk.core": "0.33.
|
|
19
|
-
"@sphereon/ssi-sdk.dev": "0.33.
|
|
18
|
+
"@sphereon/ssi-sdk.core": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
19
|
+
"@sphereon/ssi-sdk.dev": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
20
20
|
"@veramo/core": "4.2.0",
|
|
21
21
|
"cross-fetch": "^3.1.8"
|
|
22
22
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"Issuer"
|
|
49
49
|
],
|
|
50
50
|
"nx": {},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "9f634bdb714061141e277508c124b08d626f6036"
|
|
52
52
|
}
|