@sphereon/ssi-sdk.ms-request-api 0.11.1-unstable.150 → 0.11.1-unstable.152
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/IssuerUtil.d.ts +4 -8
- package/dist/IssuerUtil.js +35 -58
- package/dist/agent/MsRequestApi.d.ts +6 -6
- package/dist/agent/MsRequestApi.js +61 -85
- package/dist/index.d.ts +6 -6
- package/dist/index.js +24 -40
- package/dist/ssi-sdk.ms-request-api.d.ts +42 -46
- package/dist/types/IMsRequestApi.d.ts +41 -41
- package/dist/types/IMsRequestApi.js +3 -3
- package/package.json +4 -4
package/dist/IssuerUtil.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { IIssueRequest, IIssueRequestResponse } from './types/IMsRequestApi'
|
|
2
|
-
export declare function fetchIssuanceRequestMs(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
msIdentityHostName: string
|
|
6
|
-
): Promise<IIssueRequestResponse>
|
|
7
|
-
export declare function generatePin(digits: number): string
|
|
8
|
-
//# sourceMappingURL=IssuerUtil.d.ts.map
|
|
1
|
+
import { IIssueRequest, IIssueRequestResponse } from './types/IMsRequestApi';
|
|
2
|
+
export declare function fetchIssuanceRequestMs(issuanceInfo: IIssueRequest, accessToken: string, msIdentityHostName: string): Promise<IIssueRequestResponse>;
|
|
3
|
+
export declare function generatePin(digits: number): string;
|
|
4
|
+
//# sourceMappingURL=IssuerUtil.d.ts.map
|
package/dist/IssuerUtil.js
CHANGED
|
@@ -1,63 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) {
|
|
6
|
-
return value instanceof P
|
|
7
|
-
? value
|
|
8
|
-
: new P(function (resolve) {
|
|
9
|
-
resolve(value)
|
|
10
|
-
})
|
|
11
|
-
}
|
|
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); }); }
|
|
12
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
step(generator['throw'](value))
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function step(result) {
|
|
28
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
|
|
29
|
-
}
|
|
30
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next())
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
34
|
-
exports.generatePin = exports.fetchIssuanceRequestMs = void 0
|
|
35
|
-
const cross_fetch_1 = require('cross-fetch')
|
|
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.generatePin = exports.fetchIssuanceRequestMs = void 0;
|
|
13
|
+
const cross_fetch_1 = require("cross-fetch");
|
|
36
14
|
function fetchIssuanceRequestMs(issuanceInfo, accessToken, msIdentityHostName) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
var client_api_request_endpoint = `${msIdentityHostName}${issuanceInfo.authenticationInfo.azTenantId}/verifiablecredentials/request`;
|
|
17
|
+
var payload = JSON.stringify(issuanceInfo.issuanceConfig);
|
|
18
|
+
const fetchOptions = {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
body: payload,
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
'Content-Length': payload.length.toString(),
|
|
24
|
+
Authorization: `Bearer ${accessToken}`,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const response = yield (0, cross_fetch_1.fetch)(client_api_request_endpoint, fetchOptions);
|
|
28
|
+
return yield response.json();
|
|
29
|
+
});
|
|
52
30
|
}
|
|
53
|
-
exports.fetchIssuanceRequestMs = fetchIssuanceRequestMs
|
|
31
|
+
exports.fetchIssuanceRequestMs = fetchIssuanceRequestMs;
|
|
54
32
|
function generatePin(digits) {
|
|
55
|
-
|
|
56
|
-
max =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return ('' + number).substring(add)
|
|
33
|
+
var add = 1, max = 12 - add;
|
|
34
|
+
max = Math.pow(10, digits + add);
|
|
35
|
+
var min = max / 10; // Math.pow(10, n) basically
|
|
36
|
+
var number = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
37
|
+
return ('' + number).substring(add);
|
|
61
38
|
}
|
|
62
|
-
exports.generatePin = generatePin
|
|
63
|
-
//# sourceMappingURL=IssuerUtil.js.map
|
|
39
|
+
exports.generatePin = generatePin;
|
|
40
|
+
//# sourceMappingURL=IssuerUtil.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IAgentPlugin } from '@veramo/core'
|
|
2
|
-
import { IMsRequestApi } from '../types/IMsRequestApi'
|
|
1
|
+
import { IAgentPlugin } from '@veramo/core';
|
|
2
|
+
import { IMsRequestApi } from '../types/IMsRequestApi';
|
|
3
3
|
/**
|
|
4
4
|
* {@inheritDoc IMsRequestApi}
|
|
5
5
|
*/
|
|
6
6
|
export declare class MsRequestApi implements IAgentPlugin {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
readonly methods: IMsRequestApi;
|
|
8
|
+
/** {@inheritDoc IMsRequestApi.issuanceRequestMsVc} */
|
|
9
|
+
private issuanceRequestMsVc;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=MsRequestApi.d.ts.map
|
|
11
|
+
//# sourceMappingURL=MsRequestApi.d.ts.map
|
|
@@ -1,92 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) {
|
|
6
|
-
return value instanceof P
|
|
7
|
-
? value
|
|
8
|
-
: new P(function (resolve) {
|
|
9
|
-
resolve(value)
|
|
10
|
-
})
|
|
11
|
-
}
|
|
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); }); }
|
|
12
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function step(result) {
|
|
28
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
|
|
29
|
-
}
|
|
30
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next())
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
34
|
-
exports.MsRequestApi = void 0
|
|
35
|
-
const ssi_sdk_ms_authenticator_1 = require('@sphereon/ssi-sdk.ms-authenticator')
|
|
36
|
-
const IssuerUtil_1 = require('../IssuerUtil')
|
|
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.MsRequestApi = void 0;
|
|
13
|
+
const ssi_sdk_ms_authenticator_1 = require("@sphereon/ssi-sdk.ms-authenticator");
|
|
14
|
+
const IssuerUtil_1 = require("../IssuerUtil");
|
|
37
15
|
/**
|
|
38
16
|
* {@inheritDoc IMsRequestApi}
|
|
39
17
|
*/
|
|
40
18
|
class MsRequestApi {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
constructor() {
|
|
20
|
+
this.methods = {
|
|
21
|
+
issuanceRequestMsVc: this.issuanceRequestMsVc.bind(this),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** {@inheritDoc IMsRequestApi.issuanceRequestMsVc} */
|
|
25
|
+
issuanceRequestMsVc(clientIssueRequest, context) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
var accessToken = yield (0, ssi_sdk_ms_authenticator_1.ClientCredentialAuthenticator)(clientIssueRequest.authenticationInfo);
|
|
28
|
+
var msIdentityHostName = yield (0, ssi_sdk_ms_authenticator_1.checkMsIdentityHostname)(clientIssueRequest.authenticationInfo);
|
|
29
|
+
// Config Request and App Config File should be a parameter to this function
|
|
30
|
+
if (!clientIssueRequest.authenticationInfo.azTenantId) {
|
|
31
|
+
throw new Error('azTenantId is missing.');
|
|
32
|
+
}
|
|
33
|
+
// check if pin is required, if found make sure we set a new random pin
|
|
34
|
+
// pincode is only used when the payload contains claim value pairs which results in an IDTokenhint
|
|
35
|
+
if (clientIssueRequest.clientIssuanceConfig.issuance.pin) {
|
|
36
|
+
clientIssueRequest.clientIssuanceConfig.issuance.pin.value = (0, IssuerUtil_1.generatePin)(clientIssueRequest.clientIssuanceConfig.issuance.pin.length);
|
|
37
|
+
}
|
|
38
|
+
var issuance = {
|
|
39
|
+
type: clientIssueRequest.clientIssuanceConfig.issuance.type,
|
|
40
|
+
manifest: clientIssueRequest.clientIssuanceConfig.issuance.manifest,
|
|
41
|
+
pin: clientIssueRequest.clientIssuanceConfig.issuance.pin,
|
|
42
|
+
claims: clientIssueRequest.claims,
|
|
43
|
+
};
|
|
44
|
+
var issuanceConfig = {
|
|
45
|
+
authority: clientIssueRequest.clientIssuanceConfig.authority,
|
|
46
|
+
includeQRCode: clientIssueRequest.clientIssuanceConfig.includeQRCode,
|
|
47
|
+
registration: clientIssueRequest.clientIssuanceConfig.registration,
|
|
48
|
+
callback: clientIssueRequest.clientIssuanceConfig.callback,
|
|
49
|
+
issuance: issuance,
|
|
50
|
+
};
|
|
51
|
+
var issueRequest = {
|
|
52
|
+
authenticationInfo: clientIssueRequest.authenticationInfo,
|
|
53
|
+
issuanceConfig: issuanceConfig,
|
|
54
|
+
};
|
|
55
|
+
var resp = yield (0, IssuerUtil_1.fetchIssuanceRequestMs)(issueRequest, accessToken, msIdentityHostName);
|
|
56
|
+
// the response from the VC Request API call is returned to the caller (the UI). It contains the URI to the request which Authenticator can download after
|
|
57
|
+
// it has scanned the QR code. If the payload requested the VC Request service to create the QR code that is returned as well
|
|
58
|
+
// the javascript in the UI will use that QR code to display it on the screen to the user.
|
|
59
|
+
resp.id = issueRequest.issuanceConfig.callback.state; // add session id so browser can pull status
|
|
60
|
+
if (issueRequest.issuanceConfig.issuance.pin) {
|
|
61
|
+
resp.pin = issueRequest.issuanceConfig.issuance.pin.value; // add pin code so browser can display it
|
|
62
|
+
}
|
|
63
|
+
return resp;
|
|
64
|
+
});
|
|
44
65
|
}
|
|
45
|
-
}
|
|
46
|
-
/** {@inheritDoc IMsRequestApi.issuanceRequestMsVc} */
|
|
47
|
-
issuanceRequestMsVc(clientIssueRequest, context) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
var accessToken = yield (0, ssi_sdk_ms_authenticator_1.ClientCredentialAuthenticator)(clientIssueRequest.authenticationInfo)
|
|
50
|
-
var msIdentityHostName = yield (0, ssi_sdk_ms_authenticator_1.checkMsIdentityHostname)(clientIssueRequest.authenticationInfo)
|
|
51
|
-
// Config Request and App Config File should be a parameter to this function
|
|
52
|
-
if (!clientIssueRequest.authenticationInfo.azTenantId) {
|
|
53
|
-
throw new Error('azTenantId is missing.')
|
|
54
|
-
}
|
|
55
|
-
// check if pin is required, if found make sure we set a new random pin
|
|
56
|
-
// pincode is only used when the payload contains claim value pairs which results in an IDTokenhint
|
|
57
|
-
if (clientIssueRequest.clientIssuanceConfig.issuance.pin) {
|
|
58
|
-
clientIssueRequest.clientIssuanceConfig.issuance.pin.value = (0, IssuerUtil_1.generatePin)(
|
|
59
|
-
clientIssueRequest.clientIssuanceConfig.issuance.pin.length
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
var issuance = {
|
|
63
|
-
type: clientIssueRequest.clientIssuanceConfig.issuance.type,
|
|
64
|
-
manifest: clientIssueRequest.clientIssuanceConfig.issuance.manifest,
|
|
65
|
-
pin: clientIssueRequest.clientIssuanceConfig.issuance.pin,
|
|
66
|
-
claims: clientIssueRequest.claims,
|
|
67
|
-
}
|
|
68
|
-
var issuanceConfig = {
|
|
69
|
-
authority: clientIssueRequest.clientIssuanceConfig.authority,
|
|
70
|
-
includeQRCode: clientIssueRequest.clientIssuanceConfig.includeQRCode,
|
|
71
|
-
registration: clientIssueRequest.clientIssuanceConfig.registration,
|
|
72
|
-
callback: clientIssueRequest.clientIssuanceConfig.callback,
|
|
73
|
-
issuance: issuance,
|
|
74
|
-
}
|
|
75
|
-
var issueRequest = {
|
|
76
|
-
authenticationInfo: clientIssueRequest.authenticationInfo,
|
|
77
|
-
issuanceConfig: issuanceConfig,
|
|
78
|
-
}
|
|
79
|
-
var resp = yield (0, IssuerUtil_1.fetchIssuanceRequestMs)(issueRequest, accessToken, msIdentityHostName)
|
|
80
|
-
// the response from the VC Request API call is returned to the caller (the UI). It contains the URI to the request which Authenticator can download after
|
|
81
|
-
// it has scanned the QR code. If the payload requested the VC Request service to create the QR code that is returned as well
|
|
82
|
-
// the javascript in the UI will use that QR code to display it on the screen to the user.
|
|
83
|
-
resp.id = issueRequest.issuanceConfig.callback.state // add session id so browser can pull status
|
|
84
|
-
if (issueRequest.issuanceConfig.issuance.pin) {
|
|
85
|
-
resp.pin = issueRequest.issuanceConfig.issuance.pin.value // add pin code so browser can display it
|
|
86
|
-
}
|
|
87
|
-
return resp
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
66
|
}
|
|
91
|
-
exports.MsRequestApi = MsRequestApi
|
|
92
|
-
//# sourceMappingURL=MsRequestApi.js.map
|
|
67
|
+
exports.MsRequestApi = MsRequestApi;
|
|
68
|
+
//# sourceMappingURL=MsRequestApi.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @public
|
|
3
3
|
*/
|
|
4
|
-
declare const schema: any
|
|
5
|
-
export { schema }
|
|
6
|
-
export { MsRequestApi } from './agent/MsRequestApi'
|
|
7
|
-
export * from './types/IMsRequestApi'
|
|
8
|
-
export * from './IssuerUtil'
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
4
|
+
declare const schema: any;
|
|
5
|
+
export { schema };
|
|
6
|
+
export { MsRequestApi } from './agent/MsRequestApi';
|
|
7
|
+
export * from './types/IMsRequestApi';
|
|
8
|
+
export * from './IssuerUtil';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
: function (o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k
|
|
20
|
-
o[k2] = m[k]
|
|
21
|
-
})
|
|
22
|
-
var __exportStar =
|
|
23
|
-
(this && this.__exportStar) ||
|
|
24
|
-
function (m, exports) {
|
|
25
|
-
for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
|
|
26
|
-
}
|
|
27
|
-
Object.defineProperty(exports, '__esModule', { value: true })
|
|
28
|
-
exports.MsRequestApi = exports.schema = void 0
|
|
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.MsRequestApi = exports.schema = void 0;
|
|
29
18
|
/**
|
|
30
19
|
* @public
|
|
31
20
|
*/
|
|
32
|
-
const schema = require('../plugin.schema.json')
|
|
33
|
-
exports.schema = schema
|
|
34
|
-
var MsRequestApi_1 = require(
|
|
35
|
-
Object.defineProperty(exports,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
})
|
|
41
|
-
__exportStar(require('./types/IMsRequestApi'), exports)
|
|
42
|
-
__exportStar(require('./IssuerUtil'), exports)
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
21
|
+
const schema = require('../plugin.schema.json');
|
|
22
|
+
exports.schema = schema;
|
|
23
|
+
var MsRequestApi_1 = require("./agent/MsRequestApi");
|
|
24
|
+
Object.defineProperty(exports, "MsRequestApi", { enumerable: true, get: function () { return MsRequestApi_1.MsRequestApi; } });
|
|
25
|
+
__exportStar(require("./types/IMsRequestApi"), exports);
|
|
26
|
+
__exportStar(require("./IssuerUtil"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -4,98 +4,94 @@ import { IMsAuthenticationClientCredentialArgs } from '@sphereon/ssi-sdk.ms-auth
|
|
|
4
4
|
import { IPluginMethodMap } from '@veramo/core';
|
|
5
5
|
|
|
6
6
|
export declare interface Callback {
|
|
7
|
-
url: string
|
|
8
|
-
state: string
|
|
9
|
-
headers: Headers_2
|
|
7
|
+
url: string;
|
|
8
|
+
state: string;
|
|
9
|
+
headers: Headers_2;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export declare type CredentialSubject = {
|
|
13
|
-
[x: string]: any
|
|
14
|
-
}
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
};
|
|
15
15
|
|
|
16
|
-
export declare function fetchIssuanceRequestMs(
|
|
17
|
-
issuanceInfo: IIssueRequest,
|
|
18
|
-
accessToken: string,
|
|
19
|
-
msIdentityHostName: string
|
|
20
|
-
): Promise<IIssueRequestResponse>
|
|
16
|
+
export declare function fetchIssuanceRequestMs(issuanceInfo: IIssueRequest, accessToken: string, msIdentityHostName: string): Promise<IIssueRequestResponse>;
|
|
21
17
|
|
|
22
|
-
export declare function generatePin(digits: number): string
|
|
18
|
+
export declare function generatePin(digits: number): string;
|
|
23
19
|
|
|
24
20
|
declare interface Headers_2 {
|
|
25
|
-
apiKey: string
|
|
21
|
+
apiKey: string;
|
|
26
22
|
}
|
|
27
23
|
export { Headers_2 as Headers }
|
|
28
24
|
|
|
29
25
|
export declare interface IClientIssuance {
|
|
30
|
-
type: string
|
|
31
|
-
manifest: string
|
|
32
|
-
pin: Pin
|
|
26
|
+
type: string;
|
|
27
|
+
manifest: string;
|
|
28
|
+
pin: Pin;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
export declare interface IClientIssuanceConfig {
|
|
36
|
-
authority: string
|
|
37
|
-
includeQRCode: boolean
|
|
38
|
-
registration: Registration
|
|
39
|
-
callback: Callback
|
|
40
|
-
issuance: IClientIssuance
|
|
32
|
+
authority: string;
|
|
33
|
+
includeQRCode: boolean;
|
|
34
|
+
registration: Registration;
|
|
35
|
+
callback: Callback;
|
|
36
|
+
issuance: IClientIssuance;
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
export declare interface IClientIssueRequest {
|
|
44
|
-
authenticationInfo: IMsAuthenticationClientCredentialArgs
|
|
45
|
-
clientIssuanceConfig: IClientIssuanceConfig
|
|
46
|
-
claims: CredentialSubject
|
|
40
|
+
authenticationInfo: IMsAuthenticationClientCredentialArgs;
|
|
41
|
+
clientIssuanceConfig: IClientIssuanceConfig;
|
|
42
|
+
claims: CredentialSubject;
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
export declare interface IIssueRequest {
|
|
50
|
-
authenticationInfo: IMsAuthenticationClientCredentialArgs
|
|
51
|
-
issuanceConfig: IssuanceConfig
|
|
46
|
+
authenticationInfo: IMsAuthenticationClientCredentialArgs;
|
|
47
|
+
issuanceConfig: IssuanceConfig;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
export declare interface IIssueRequestResponse {
|
|
55
|
-
id: string
|
|
56
|
-
requestId: string
|
|
57
|
-
url: string
|
|
58
|
-
expiry: Date
|
|
59
|
-
pin: string
|
|
51
|
+
id: string;
|
|
52
|
+
requestId: string;
|
|
53
|
+
url: string;
|
|
54
|
+
expiry: Date;
|
|
55
|
+
pin: string;
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
export declare interface IMsRequestApi extends IPluginMethodMap {
|
|
63
|
-
issuanceRequestMsVc(clientIssueRequest: IClientIssueRequest, context: IRequiredContext): Promise<IIssueRequestResponse
|
|
59
|
+
issuanceRequestMsVc(clientIssueRequest: IClientIssueRequest, context: IRequiredContext): Promise<IIssueRequestResponse>;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
export declare type IRequiredContext = IAgentContext<Record<string, never
|
|
62
|
+
export declare type IRequiredContext = IAgentContext<Record<string, never>>;
|
|
67
63
|
|
|
68
64
|
export declare interface Issuance {
|
|
69
|
-
type: string
|
|
70
|
-
manifest: string
|
|
71
|
-
pin: Pin
|
|
72
|
-
claims: CredentialSubject
|
|
65
|
+
type: string;
|
|
66
|
+
manifest: string;
|
|
67
|
+
pin: Pin;
|
|
68
|
+
claims: CredentialSubject;
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
export declare interface IssuanceConfig {
|
|
76
|
-
authority: string
|
|
77
|
-
includeQRCode: boolean
|
|
78
|
-
registration: Registration
|
|
79
|
-
callback: Callback
|
|
80
|
-
issuance: Issuance
|
|
72
|
+
authority: string;
|
|
73
|
+
includeQRCode: boolean;
|
|
74
|
+
registration: Registration;
|
|
75
|
+
callback: Callback;
|
|
76
|
+
issuance: Issuance;
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
/**
|
|
84
80
|
* {@inheritDoc IMsRequestApi}
|
|
85
81
|
*/
|
|
86
82
|
export declare class MsRequestApi implements IAgentPlugin {
|
|
87
|
-
readonly methods: IMsRequestApi
|
|
83
|
+
readonly methods: IMsRequestApi;
|
|
88
84
|
/** {@inheritDoc IMsRequestApi.issuanceRequestMsVc} */
|
|
89
|
-
private issuanceRequestMsVc
|
|
85
|
+
private issuanceRequestMsVc;
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
export declare interface Pin {
|
|
93
|
-
value: string
|
|
94
|
-
length: number
|
|
89
|
+
value: string;
|
|
90
|
+
length: number;
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
export declare interface Registration {
|
|
98
|
-
clientName: string
|
|
94
|
+
clientName: string;
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
/**
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { IAgentContext, IPluginMethodMap } from '@veramo/core'
|
|
2
|
-
import { IMsAuthenticationClientCredentialArgs } from '@sphereon/ssi-sdk.ms-authenticator'
|
|
1
|
+
import { IAgentContext, IPluginMethodMap } from '@veramo/core';
|
|
2
|
+
import { IMsAuthenticationClientCredentialArgs } from '@sphereon/ssi-sdk.ms-authenticator';
|
|
3
3
|
export interface IMsRequestApi extends IPluginMethodMap {
|
|
4
|
-
|
|
4
|
+
issuanceRequestMsVc(clientIssueRequest: IClientIssueRequest, context: IRequiredContext): Promise<IIssueRequestResponse>;
|
|
5
5
|
}
|
|
6
6
|
export interface IClientIssueRequest {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
authenticationInfo: IMsAuthenticationClientCredentialArgs;
|
|
8
|
+
clientIssuanceConfig: IClientIssuanceConfig;
|
|
9
|
+
claims: CredentialSubject;
|
|
10
10
|
}
|
|
11
11
|
export interface IClientIssuanceConfig {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
authority: string;
|
|
13
|
+
includeQRCode: boolean;
|
|
14
|
+
registration: Registration;
|
|
15
|
+
callback: Callback;
|
|
16
|
+
issuance: IClientIssuance;
|
|
17
17
|
}
|
|
18
18
|
export interface IClientIssuance {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
type: string;
|
|
20
|
+
manifest: string;
|
|
21
|
+
pin: Pin;
|
|
22
22
|
}
|
|
23
23
|
export interface IIssueRequest {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
authenticationInfo: IMsAuthenticationClientCredentialArgs;
|
|
25
|
+
issuanceConfig: IssuanceConfig;
|
|
26
26
|
}
|
|
27
27
|
export interface IIssueRequestResponse {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
id: string;
|
|
29
|
+
requestId: string;
|
|
30
|
+
url: string;
|
|
31
|
+
expiry: Date;
|
|
32
|
+
pin: string;
|
|
33
33
|
}
|
|
34
34
|
export interface Registration {
|
|
35
|
-
|
|
35
|
+
clientName: string;
|
|
36
36
|
}
|
|
37
37
|
export interface Headers {
|
|
38
|
-
|
|
38
|
+
apiKey: string;
|
|
39
39
|
}
|
|
40
40
|
export interface Callback {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
url: string;
|
|
42
|
+
state: string;
|
|
43
|
+
headers: Headers;
|
|
44
44
|
}
|
|
45
45
|
export interface Pin {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
value: string;
|
|
47
|
+
length: number;
|
|
48
48
|
}
|
|
49
49
|
export type CredentialSubject = {
|
|
50
|
-
|
|
51
|
-
}
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
};
|
|
52
52
|
export interface Issuance {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
type: string;
|
|
54
|
+
manifest: string;
|
|
55
|
+
pin: Pin;
|
|
56
|
+
claims: CredentialSubject;
|
|
57
57
|
}
|
|
58
58
|
export interface IssuanceConfig {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
authority: string;
|
|
60
|
+
includeQRCode: boolean;
|
|
61
|
+
registration: Registration;
|
|
62
|
+
callback: Callback;
|
|
63
|
+
issuance: Issuance;
|
|
64
64
|
}
|
|
65
|
-
export type IRequiredContext = IAgentContext<Record<string, never
|
|
66
|
-
//# sourceMappingURL=IMsRequestApi.d.ts.map
|
|
65
|
+
export type IRequiredContext = IAgentContext<Record<string, never>>;
|
|
66
|
+
//# sourceMappingURL=IMsRequestApi.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=IMsRequestApi.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=IMsRequestApi.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.ms-request-api",
|
|
3
|
-
"version": "0.11.1-unstable.
|
|
3
|
+
"version": "0.11.1-unstable.152+e1924a1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
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.ms-authenticator": "0.11.1-unstable.
|
|
18
|
+
"@sphereon/ssi-sdk.ms-authenticator": "0.11.1-unstable.152+e1924a1",
|
|
19
19
|
"@veramo/remote-client": "4.2.0",
|
|
20
20
|
"@veramo/remote-server": "4.2.0",
|
|
21
21
|
"cross-fetch": "^3.1.5",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"typeorm": "^0.3.12"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@sphereon/ssi-sdk.agent-config": "0.11.1-unstable.
|
|
27
|
+
"@sphereon/ssi-sdk.agent-config": "0.11.1-unstable.152+e1924a1",
|
|
28
28
|
"@types/express": "^4.17.17",
|
|
29
29
|
"@types/express-session": "^1.17.4",
|
|
30
30
|
"@types/jest": "^27.5.2",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"API",
|
|
66
66
|
"Issuer"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "e1924a1e5c4b336718ed0e6ddd5dbe8fcc767507"
|
|
69
69
|
}
|