@verana-labs/vs-agent-client 2.0.0-dev.1 → 2.0.0-dev.100
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/README.md +58 -111
- package/build/ApiClient.d.ts +12 -39
- package/build/ApiClient.js +13 -40
- package/build/ApiClient.js.map +1 -1
- package/build/api/AgentApi.d.ts +9 -0
- package/build/api/AgentApi.js +19 -0
- package/build/api/AgentApi.js.map +1 -0
- package/build/api/AnoncredsApi.d.ts +15 -0
- package/build/api/AnoncredsApi.js +37 -0
- package/build/api/AnoncredsApi.js.map +1 -0
- package/build/api/AuthApi.d.ts +8 -0
- package/build/api/AuthApi.js +16 -0
- package/build/api/AuthApi.js.map +1 -0
- package/build/api/DidcommApi.d.ts +44 -0
- package/build/api/DidcommApi.js +124 -0
- package/build/api/DidcommApi.js.map +1 -0
- package/build/api/VtApi.d.ts +17 -0
- package/build/api/VtApi.js +51 -0
- package/build/api/VtApi.js.map +1 -0
- package/build/events.d.ts +7 -0
- package/build/events.js +52 -0
- package/build/events.js.map +1 -0
- package/build/http.d.ts +19 -0
- package/build/http.js +61 -0
- package/build/http.js.map +1 -0
- package/build/index.d.ts +7 -3
- package/build/index.js +7 -3
- package/build/index.js.map +1 -1
- package/build/types/agent.d.ts +10 -0
- package/build/types/agent.js +3 -0
- package/build/types/agent.js.map +1 -0
- package/build/types/anoncreds.d.ts +48 -0
- package/build/types/anoncreds.js +3 -0
- package/build/types/anoncreds.js.map +1 -0
- package/build/types/auth.d.ts +18 -0
- package/build/types/auth.js +3 -0
- package/build/types/auth.js.map +1 -0
- package/build/types/common.d.ts +34 -0
- package/build/types/common.js +3 -0
- package/build/types/common.js.map +1 -0
- package/build/types/didcomm.d.ts +312 -0
- package/build/types/didcomm.js +3 -0
- package/build/types/didcomm.js.map +1 -0
- package/build/types/events.d.ts +193 -0
- package/build/types/events.js +3 -0
- package/build/types/events.js.map +1 -0
- package/build/types/index.d.ts +7 -1
- package/build/types/index.js +7 -1
- package/build/types/index.js.map +1 -1
- package/build/types/vt.d.ts +116 -0
- package/build/types/vt.js +3 -0
- package/build/types/vt.js.map +1 -0
- package/package.json +3 -15
- package/build/handlers/ExpressEventHandler.d.ts +0 -71
- package/build/handlers/ExpressEventHandler.js +0 -102
- package/build/handlers/ExpressEventHandler.js.map +0 -1
- package/build/handlers/index.d.ts +0 -1
- package/build/handlers/index.js +0 -18
- package/build/handlers/index.js.map +0 -1
- package/build/services/CredentialTypeService.d.ts +0 -19
- package/build/services/CredentialTypeService.js +0 -66
- package/build/services/CredentialTypeService.js.map +0 -1
- package/build/services/InvitationService.d.ts +0 -16
- package/build/services/InvitationService.js +0 -56
- package/build/services/InvitationService.js.map +0 -1
- package/build/services/MessageService.d.ts +0 -18
- package/build/services/MessageService.js +0 -57
- package/build/services/MessageService.js.map +0 -1
- package/build/services/RevocationRegistryService.d.ts +0 -18
- package/build/services/RevocationRegistryService.js +0 -58
- package/build/services/RevocationRegistryService.js.map +0 -1
- package/build/services/TrustCredentialService.d.ts +0 -33
- package/build/services/TrustCredentialService.js +0 -75
- package/build/services/TrustCredentialService.js.map +0 -1
- package/build/services/index.d.ts +0 -5
- package/build/services/index.js +0 -22
- package/build/services/index.js.map +0 -1
- package/build/types/enums.d.ts +0 -3
- package/build/types/enums.js +0 -9
- package/build/types/enums.js.map +0 -1
- package/build/utils/HttpUtils.d.ts +0 -4
- package/build/utils/HttpUtils.js +0 -18
- package/build/utils/HttpUtils.js.map +0 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.js +0 -18
- package/build/utils/index.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
import { AddServiceEndpointBody, EditClaimsBody, ListFlowsQuery, Page, PaginationQuery, RejectFlowBody, SendOobLinkBody, ServiceEndpoint, StartValidationBody, UpdateServiceEndpointBody, ValidateFlowBody, VtFlowRecord } from '../types';
|
|
3
|
+
export declare class VtApi {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
listFlows(query?: ListFlowsQuery): Promise<Page<VtFlowRecord>>;
|
|
7
|
+
getFlow(participantSessionId: string): Promise<VtFlowRecord>;
|
|
8
|
+
editCredentialClaims(participantSessionId: string, body: EditClaimsBody): Promise<Record<string, unknown>>;
|
|
9
|
+
sendOobLink(participantSessionId: string, body: SendOobLinkBody): Promise<VtFlowRecord>;
|
|
10
|
+
startValidation(participantSessionId: string, body?: StartValidationBody): Promise<VtFlowRecord>;
|
|
11
|
+
validateFlow(participantSessionId: string, body?: ValidateFlowBody): Promise<VtFlowRecord>;
|
|
12
|
+
rejectFlow(participantSessionId: string, body: RejectFlowBody): Promise<VtFlowRecord>;
|
|
13
|
+
listServiceEndpoints(query?: PaginationQuery): Promise<Page<ServiceEndpoint>>;
|
|
14
|
+
addServiceEndpoint(body: AddServiceEndpointBody): Promise<ServiceEndpoint>;
|
|
15
|
+
updateServiceEndpoint(serviceEndpointId: string, body: UpdateServiceEndpointBody): Promise<ServiceEndpoint>;
|
|
16
|
+
deleteServiceEndpoint(serviceEndpointId: string): Promise<ServiceEndpoint>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VtApi = void 0;
|
|
4
|
+
class VtApi {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
listFlows(query) {
|
|
9
|
+
return this.http.request('GET', '/vt/flows', { query });
|
|
10
|
+
}
|
|
11
|
+
getFlow(participantSessionId) {
|
|
12
|
+
return this.http.request('GET', `/vt/flows/${encodeURIComponent(participantSessionId)}`);
|
|
13
|
+
}
|
|
14
|
+
editCredentialClaims(participantSessionId, body) {
|
|
15
|
+
return this.http.request('PUT', `/vt/flows/${encodeURIComponent(participantSessionId)}/claims`, { body });
|
|
16
|
+
}
|
|
17
|
+
sendOobLink(participantSessionId, body) {
|
|
18
|
+
return this.http.request('POST', `/vt/flows/${encodeURIComponent(participantSessionId)}/oob-link`, {
|
|
19
|
+
body,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
startValidation(participantSessionId, body) {
|
|
23
|
+
return this.http.request('POST', `/vt/flows/${encodeURIComponent(participantSessionId)}/start-validation`, { body });
|
|
24
|
+
}
|
|
25
|
+
validateFlow(participantSessionId, body) {
|
|
26
|
+
return this.http.request('POST', `/vt/flows/${encodeURIComponent(participantSessionId)}/validate`, {
|
|
27
|
+
body,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
rejectFlow(participantSessionId, body) {
|
|
31
|
+
return this.http.request('POST', `/vt/flows/${encodeURIComponent(participantSessionId)}/reject`, {
|
|
32
|
+
body,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
listServiceEndpoints(query) {
|
|
36
|
+
return this.http.request('GET', '/vt/service-endpoints', { query });
|
|
37
|
+
}
|
|
38
|
+
addServiceEndpoint(body) {
|
|
39
|
+
return this.http.request('POST', '/vt/service-endpoints', { body });
|
|
40
|
+
}
|
|
41
|
+
updateServiceEndpoint(serviceEndpointId, body) {
|
|
42
|
+
return this.http.request('PATCH', `/vt/service-endpoints/${encodeURIComponent(serviceEndpointId)}`, {
|
|
43
|
+
body,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
deleteServiceEndpoint(serviceEndpointId) {
|
|
47
|
+
return this.http.request('DELETE', `/vt/service-endpoints/${encodeURIComponent(serviceEndpointId)}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.VtApi = VtApi;
|
|
51
|
+
//# sourceMappingURL=VtApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VtApi.js","sourceRoot":"","sources":["../../src/api/VtApi.ts"],"names":[],"mappings":";;;AAgBA,MAAa,KAAK;IAChB,YAAoC,IAAgB;QAAhB,SAAI,GAAJ,IAA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;SACL,CAAC,CAAA;IACJ,CAAC;IAEM,oBAAoB,CAAC,KAAuB;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,uBAAuB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IACrE,CAAC;IAEM,kBAAkB,CAAC,IAA4B;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IACrE,CAAC;IAEM,qBAAqB,CAC1B,iBAAyB,EACzB,IAA+B;QAE/B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,yBAAyB,kBAAkB,CAAC,iBAAiB,CAAC,EAAE,EAAE;YAClG,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAEM,qBAAqB,CAAC,iBAAyB;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,yBAAyB,kBAAkB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IACtG,CAAC;CACF;AAhED,sBAgEC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EventEnvelope, EventHandlerFn, EventType, UnknownEventEnvelope } from './types';
|
|
2
|
+
export declare function isEventEnvelope(envelope: EventEnvelope | UnknownEventEnvelope): envelope is EventEnvelope;
|
|
3
|
+
export declare class EventDispatcher {
|
|
4
|
+
private readonly handlers;
|
|
5
|
+
on<T extends EventType>(type: T, handler: EventHandlerFn<T>): this;
|
|
6
|
+
dispatch(envelope: EventEnvelope | UnknownEventEnvelope): Promise<void>;
|
|
7
|
+
}
|
package/build/events.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventDispatcher = void 0;
|
|
4
|
+
exports.isEventEnvelope = isEventEnvelope;
|
|
5
|
+
const EVENT_TYPES = {
|
|
6
|
+
'didcomm.connections.state-updated': true,
|
|
7
|
+
'didcomm.invitations.state-updated': true,
|
|
8
|
+
'didcomm.basic-messages.message-received': true,
|
|
9
|
+
'didcomm.receipts.message-receipts-received': true,
|
|
10
|
+
'didcomm.reactions.message-reactions-received': true,
|
|
11
|
+
'didcomm.user-profile.profile-received': true,
|
|
12
|
+
'didcomm.user-profile.request-profile-received': true,
|
|
13
|
+
'didcomm.media-sharing.share-media-received': true,
|
|
14
|
+
'didcomm.media-sharing.request-media-received': true,
|
|
15
|
+
'didcomm.calls.call-offer-received': true,
|
|
16
|
+
'didcomm.calls.call-accept-received': true,
|
|
17
|
+
'didcomm.calls.call-reject-received': true,
|
|
18
|
+
'didcomm.calls.call-end-received': true,
|
|
19
|
+
'didcomm.action-menu.menu-request-received': true,
|
|
20
|
+
'didcomm.action-menu.perform-received': true,
|
|
21
|
+
'didcomm.question-answer.answer-received': true,
|
|
22
|
+
'didcomm.mrtd.mrz-data-received': true,
|
|
23
|
+
'didcomm.mrtd.emrtd-data-received': true,
|
|
24
|
+
'didcomm.mrtd.problem-report-received': true,
|
|
25
|
+
'didcomm.presentations.state-updated': true,
|
|
26
|
+
'didcomm.credential-exchanges.state-updated': true,
|
|
27
|
+
'vt.flows.state-updated': true,
|
|
28
|
+
'vpr.notification': true,
|
|
29
|
+
};
|
|
30
|
+
function isEventEnvelope(envelope) {
|
|
31
|
+
return envelope.type in EVENT_TYPES;
|
|
32
|
+
}
|
|
33
|
+
class EventDispatcher {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.handlers = new Map();
|
|
36
|
+
}
|
|
37
|
+
on(type, handler) {
|
|
38
|
+
var _a;
|
|
39
|
+
const list = (_a = this.handlers.get(type)) !== null && _a !== void 0 ? _a : [];
|
|
40
|
+
list.push(handler);
|
|
41
|
+
this.handlers.set(type, list);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
async dispatch(envelope) {
|
|
45
|
+
var _a;
|
|
46
|
+
for (const handler of (_a = this.handlers.get(envelope.type)) !== null && _a !== void 0 ? _a : []) {
|
|
47
|
+
await handler(envelope.data, envelope);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.EventDispatcher = EventDispatcher;
|
|
52
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AA8BA,0CAEC;AA5BD,MAAM,WAAW,GAA4B;IAC3C,mCAAmC,EAAE,IAAI;IACzC,mCAAmC,EAAE,IAAI;IACzC,yCAAyC,EAAE,IAAI;IAC/C,4CAA4C,EAAE,IAAI;IAClD,8CAA8C,EAAE,IAAI;IACpD,uCAAuC,EAAE,IAAI;IAC7C,+CAA+C,EAAE,IAAI;IACrD,4CAA4C,EAAE,IAAI;IAClD,8CAA8C,EAAE,IAAI;IACpD,mCAAmC,EAAE,IAAI;IACzC,oCAAoC,EAAE,IAAI;IAC1C,oCAAoC,EAAE,IAAI;IAC1C,iCAAiC,EAAE,IAAI;IACvC,2CAA2C,EAAE,IAAI;IACjD,sCAAsC,EAAE,IAAI;IAC5C,yCAAyC,EAAE,IAAI;IAC/C,gCAAgC,EAAE,IAAI;IACtC,kCAAkC,EAAE,IAAI;IACxC,sCAAsC,EAAE,IAAI;IAC5C,qCAAqC,EAAE,IAAI;IAC3C,4CAA4C,EAAE,IAAI;IAClD,wBAAwB,EAAE,IAAI;IAC9B,kBAAkB,EAAE,IAAI;CACzB,CAAA;AAED,SAAgB,eAAe,CAAC,QAA8C;IAC5E,OAAO,QAAQ,CAAC,IAAI,IAAI,WAAW,CAAA;AACrC,CAAC;AAED,MAAa,eAAe;IAA5B;QACmB,aAAQ,GAAG,IAAI,GAAG,EAAwB,CAAA;IAc7D,CAAC;IAZQ,EAAE,CAAsB,IAAO,EAAE,OAA0B;;QAChE,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAA;QAC1C,IAAI,CAAC,IAAI,CAAC,OAAqB,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC7B,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,QAA8C;;QAClE,KAAK,MAAM,OAAO,IAAI,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,mCAAI,EAAE,EAAE,CAAC;YAC7D,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACxC,CAAC;IACH,CAAC;CACF;AAfD,0CAeC"}
|
package/build/http.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ApiClientOptions {
|
|
2
|
+
token?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class ApiError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly status: number;
|
|
7
|
+
constructor(code: string, status: number, message: string);
|
|
8
|
+
}
|
|
9
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
10
|
+
export interface RequestOptions {
|
|
11
|
+
query?: object;
|
|
12
|
+
body?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare class HttpClient {
|
|
15
|
+
private readonly baseUrl;
|
|
16
|
+
private readonly token?;
|
|
17
|
+
constructor(baseUrl: string, options: ApiClientOptions);
|
|
18
|
+
request<T>(method: HttpMethod, path: string, options?: RequestOptions): Promise<T>;
|
|
19
|
+
}
|
package/build/http.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpClient = exports.ApiError = void 0;
|
|
4
|
+
class ApiError extends Error {
|
|
5
|
+
constructor(code, status, message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.status = status;
|
|
9
|
+
this.name = 'ApiError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.ApiError = ApiError;
|
|
13
|
+
class HttpClient {
|
|
14
|
+
constructor(baseUrl, options) {
|
|
15
|
+
this.baseUrl = `${baseUrl.replace(/\/+$/, '')}/v2`;
|
|
16
|
+
this.token = options.token;
|
|
17
|
+
}
|
|
18
|
+
async request(method, path, options = {}) {
|
|
19
|
+
const headers = { Accept: 'application/json' };
|
|
20
|
+
if (options.body !== undefined)
|
|
21
|
+
headers['Content-Type'] = 'application/json';
|
|
22
|
+
if (this.token)
|
|
23
|
+
headers.Authorization = `Bearer ${this.token}`;
|
|
24
|
+
const response = await fetch(`${this.baseUrl}${path}${toQueryString(options.query)}`, {
|
|
25
|
+
method,
|
|
26
|
+
headers,
|
|
27
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
28
|
+
});
|
|
29
|
+
const text = await response.text();
|
|
30
|
+
if (response.ok)
|
|
31
|
+
return (text === '' ? undefined : JSON.parse(text));
|
|
32
|
+
const error = parseErrorEnvelope(text);
|
|
33
|
+
throw error
|
|
34
|
+
? new ApiError(error.code, response.status, error.message)
|
|
35
|
+
: new ApiError('HTTP_ERROR', response.status, response.statusText);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.HttpClient = HttpClient;
|
|
39
|
+
function toQueryString(query) {
|
|
40
|
+
if (!query)
|
|
41
|
+
return '';
|
|
42
|
+
const params = new URLSearchParams();
|
|
43
|
+
for (const [key, value] of Object.entries(query)) {
|
|
44
|
+
if (value !== undefined)
|
|
45
|
+
params.set(key, String(value));
|
|
46
|
+
}
|
|
47
|
+
const encoded = params.toString();
|
|
48
|
+
return encoded === '' ? '' : `?${encoded}`;
|
|
49
|
+
}
|
|
50
|
+
function parseErrorEnvelope(text) {
|
|
51
|
+
try {
|
|
52
|
+
const { error } = JSON.parse(text);
|
|
53
|
+
return typeof (error === null || error === void 0 ? void 0 : error.code) === 'string' && typeof error.message === 'string'
|
|
54
|
+
? { code: error.code, message: error.message }
|
|
55
|
+
: undefined;
|
|
56
|
+
}
|
|
57
|
+
catch (_a) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";;;AAIA,MAAa,QAAS,SAAQ,KAAK;IACjC,YACkB,IAAY,EACZ,MAAc,EAC9B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAA;QAJE,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QAI9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAA;IACxB,CAAC;CACF;AATD,4BASC;AASD,MAAa,UAAU;IAIrB,YAAmB,OAAe,EAAE,OAAyB;QAC3D,IAAI,CAAC,OAAO,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAA;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IAC5B,CAAC;IAEM,KAAK,CAAC,OAAO,CAAI,MAAkB,EAAE,IAAY,EAAE,UAA0B,EAAE;QACpF,MAAM,OAAO,GAA2B,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAA;QACtE,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAA;QAC5E,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,aAAa,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAA;QAE9D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE;YAC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AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAsD,CAAA;QACvF,OAAO,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;YACzE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;YAC9C,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './ApiClient';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './api/AgentApi';
|
|
3
|
+
export * from './api/AnoncredsApi';
|
|
4
|
+
export * from './api/AuthApi';
|
|
5
|
+
export * from './api/DidcommApi';
|
|
6
|
+
export * from './api/VtApi';
|
|
7
|
+
export * from './events';
|
|
8
|
+
export * from './http';
|
|
4
9
|
export * from './types';
|
|
5
|
-
export * from './utils';
|
package/build/index.js
CHANGED
|
@@ -15,8 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ApiClient"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./api/AgentApi"), exports);
|
|
19
|
+
__exportStar(require("./api/AnoncredsApi"), exports);
|
|
20
|
+
__exportStar(require("./api/AuthApi"), exports);
|
|
21
|
+
__exportStar(require("./api/DidcommApi"), exports);
|
|
22
|
+
__exportStar(require("./api/VtApi"), exports);
|
|
23
|
+
__exportStar(require("./events"), exports);
|
|
24
|
+
__exportStar(require("./http"), exports);
|
|
20
25
|
__exportStar(require("./types"), exports);
|
|
21
|
-
__exportStar(require("./utils"), exports);
|
|
22
26
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,iDAA8B;AAC9B,qDAAkC;AAClC,gDAA6B;AAC7B,mDAAgC;AAChC,8CAA2B;AAC3B,2CAAwB;AACxB,yCAAsB;AACtB,0CAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PaginationQuery } from './common';
|
|
2
|
+
export interface CredentialDefinition {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
attributes: string[];
|
|
7
|
+
supportRevocation: boolean;
|
|
8
|
+
relatedJsonSchemaCredentialId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateCredentialDefinitionBody {
|
|
11
|
+
relatedJsonSchemaCredentialId: string;
|
|
12
|
+
supportRevocation?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CredentialDefinitionPackageData {
|
|
15
|
+
name?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
relatedJsonSchemaCredentialId?: string;
|
|
18
|
+
credentialDefinition?: unknown;
|
|
19
|
+
credentialDefinitionPrivate?: Record<string, unknown>;
|
|
20
|
+
keyCorrectnessProof?: Record<string, unknown>;
|
|
21
|
+
schema?: unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface CredentialDefinitionPackage {
|
|
24
|
+
id: string;
|
|
25
|
+
data: CredentialDefinitionPackageData;
|
|
26
|
+
}
|
|
27
|
+
export interface DeleteCredentialDefinitionQuery {
|
|
28
|
+
deleteAssociatedRevocationRegistries?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ListRevocationRegistriesQuery extends PaginationQuery {
|
|
31
|
+
credentialDefinitionId?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CreateRevocationRegistryBody {
|
|
34
|
+
credentialDefinitionId: string;
|
|
35
|
+
maximumCredentialNumber?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateRevocationRegistryResponse {
|
|
38
|
+
revocationRegistryDefinitionId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RevokeCredentialBody {
|
|
41
|
+
revocationRegistryDefinitionId: string;
|
|
42
|
+
revocationRegistryIndex: number;
|
|
43
|
+
}
|
|
44
|
+
export interface RevokeCredentialResponse {
|
|
45
|
+
revocationRegistryDefinitionId: string;
|
|
46
|
+
revocationRegistryIndex: number;
|
|
47
|
+
revokedAt: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anoncreds.js","sourceRoot":"","sources":["../../src/types/anoncreds.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ChallengeRequest {
|
|
2
|
+
account: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ChallengeResponse {
|
|
5
|
+
nonce: string;
|
|
6
|
+
expiresAt: string;
|
|
7
|
+
audience: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TokenRequest {
|
|
10
|
+
account: string;
|
|
11
|
+
pubKey: string;
|
|
12
|
+
signature: string;
|
|
13
|
+
nonce: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TokenResponse {
|
|
16
|
+
token: string;
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface PaginationQuery {
|
|
2
|
+
limit?: number;
|
|
3
|
+
cursor?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Page<T> {
|
|
6
|
+
items: T[];
|
|
7
|
+
nextCursor: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface SentMessage {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Claim {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
mimeType?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RequestedCredential {
|
|
18
|
+
credentialDefinitionId?: string;
|
|
19
|
+
jsonSchemaCredentialId?: string;
|
|
20
|
+
attributes?: string[];
|
|
21
|
+
}
|
|
22
|
+
export type DidExchangeState = 'start' | 'invitation-sent' | 'invitation-received' | 'request-sent' | 'request-received' | 'response-sent' | 'response-received' | 'abandoned' | 'completed';
|
|
23
|
+
export type DidExchangeRole = 'requester' | 'responder';
|
|
24
|
+
export type BasicMessageRole = 'sender' | 'receiver';
|
|
25
|
+
export type ProofState = 'proposal-sent' | 'proposal-received' | 'request-sent' | 'request-received' | 'presentation-sent' | 'presentation-received' | 'declined' | 'abandoned' | 'done';
|
|
26
|
+
export type ProofRole = 'verifier' | 'prover';
|
|
27
|
+
export type CredentialState = 'proposal-sent' | 'proposal-received' | 'offer-sent' | 'offer-received' | 'declined' | 'request-sent' | 'request-received' | 'credential-issued' | 'credential-received' | 'done' | 'abandoned';
|
|
28
|
+
export type CredentialRole = 'issuer' | 'holder';
|
|
29
|
+
export type DidCommVersion = 'v1' | 'v2';
|
|
30
|
+
export type InvitationState = 'created' | 'accepted';
|
|
31
|
+
export type VtFlowRole = 'applicant' | 'validator';
|
|
32
|
+
export type VtFlowVariant = 'onboarding-process' | 'direct-issuance';
|
|
33
|
+
export type VtFlowState = 'AWAITING_OP' | 'OR_SENT' | 'AWAITING_OR' | 'IR_SENT' | 'AWAITING_IR' | 'OOB_PENDING' | 'VALIDATING' | 'AWAITING_VALIDATION_TX' | 'VALIDATION_TX_SUBMITTED' | 'VALIDATION_TX_FAILED' | 'VALIDATED' | 'VALIDATED_PENDING_CLAIMS' | 'CRED_OFFERED' | 'COMPLETED' | 'CRED_REVOKED' | 'TERMINATED_BY_VALIDATOR' | 'TERMINATED_BY_APPLICANT' | 'ERROR' | 'PARTICIPANT_REVOKED' | 'PARTICIPANT_SLASHED';
|
|
34
|
+
export type VtConnectionState = 'NOT_CONNECTED' | 'ESTABLISHED' | 'TERMINATED';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":""}
|