@verana-labs/vs-agent-model 1.6.0
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/LICENSE +201 -0
- package/README.md +93 -0
- package/build/events/ConnectionStateUpdated.d.ts +33 -0
- package/build/events/ConnectionStateUpdated.js +56 -0
- package/build/events/ConnectionStateUpdated.js.map +1 -0
- package/build/events/Event.d.ts +6 -0
- package/build/events/Event.js +32 -0
- package/build/events/Event.js.map +1 -0
- package/build/events/EventType.d.ts +6 -0
- package/build/events/EventType.js +11 -0
- package/build/events/EventType.js.map +1 -0
- package/build/events/MessageReceived.d.ts +13 -0
- package/build/events/MessageReceived.js +34 -0
- package/build/events/MessageReceived.js.map +1 -0
- package/build/events/MessageStateUpdated.d.ts +17 -0
- package/build/events/MessageStateUpdated.js +48 -0
- package/build/events/MessageStateUpdated.js.map +1 -0
- package/build/events/VCAuthnEvent.d.ts +18 -0
- package/build/events/VCAuthnEvent.js +52 -0
- package/build/events/VCAuthnEvent.js.map +1 -0
- package/build/events/index.d.ts +6 -0
- package/build/events/index.js +23 -0
- package/build/events/index.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +21 -0
- package/build/index.js.map +1 -0
- package/build/messages/BaseMessage.d.ts +24 -0
- package/build/messages/BaseMessage.js +56 -0
- package/build/messages/BaseMessage.js.map +1 -0
- package/build/messages/ContextualMenuRequest.d.ts +9 -0
- package/build/messages/ContextualMenuRequest.js +21 -0
- package/build/messages/ContextualMenuRequest.js.map +1 -0
- package/build/messages/ContextualMenuSelect.d.ts +11 -0
- package/build/messages/ContextualMenuSelect.js +39 -0
- package/build/messages/ContextualMenuSelect.js.map +1 -0
- package/build/messages/ContextualMenuUpdate.d.ts +26 -0
- package/build/messages/ContextualMenuUpdate.js +79 -0
- package/build/messages/ContextualMenuUpdate.js.map +1 -0
- package/build/messages/CredentialIssuanceMessage.d.ts +31 -0
- package/build/messages/CredentialIssuanceMessage.js +92 -0
- package/build/messages/CredentialIssuanceMessage.js.map +1 -0
- package/build/messages/CredentialReceptionMessage.d.ts +12 -0
- package/build/messages/CredentialReceptionMessage.js +39 -0
- package/build/messages/CredentialReceptionMessage.js.map +1 -0
- package/build/messages/CredentialRequestMessage.d.ts +14 -0
- package/build/messages/CredentialRequestMessage.js +49 -0
- package/build/messages/CredentialRequestMessage.js.map +1 -0
- package/build/messages/CredentialRevocationMessage.d.ts +9 -0
- package/build/messages/CredentialRevocationMessage.js +21 -0
- package/build/messages/CredentialRevocationMessage.js.map +1 -0
- package/build/messages/IdentityProofRequestMessage.d.ts +20 -0
- package/build/messages/IdentityProofRequestMessage.js +60 -0
- package/build/messages/IdentityProofRequestMessage.js.map +1 -0
- package/build/messages/IdentityProofResultMessage.d.ts +20 -0
- package/build/messages/IdentityProofResultMessage.js +60 -0
- package/build/messages/IdentityProofResultMessage.js.map +1 -0
- package/build/messages/IdentityProofSubmitMessage.d.ts +20 -0
- package/build/messages/IdentityProofSubmitMessage.js +60 -0
- package/build/messages/IdentityProofSubmitMessage.js.map +1 -0
- package/build/messages/InvitationMessage.d.ts +15 -0
- package/build/messages/InvitationMessage.js +49 -0
- package/build/messages/InvitationMessage.js.map +1 -0
- package/build/messages/MediaMessage.d.ts +56 -0
- package/build/messages/MediaMessage.js +138 -0
- package/build/messages/MediaMessage.js.map +1 -0
- package/build/messages/MenuDisplayMessage.d.ts +26 -0
- package/build/messages/MenuDisplayMessage.js +72 -0
- package/build/messages/MenuDisplayMessage.js.map +1 -0
- package/build/messages/MenuSelectMessage.d.ts +19 -0
- package/build/messages/MenuSelectMessage.js +51 -0
- package/build/messages/MenuSelectMessage.js.map +1 -0
- package/build/messages/MessageType.d.ts +28 -0
- package/build/messages/MessageType.js +33 -0
- package/build/messages/MessageType.js.map +1 -0
- package/build/messages/ProfileMessage.d.ts +21 -0
- package/build/messages/ProfileMessage.js +24 -0
- package/build/messages/ProfileMessage.js.map +1 -0
- package/build/messages/ReceiptsMessage.d.ts +28 -0
- package/build/messages/ReceiptsMessage.js +76 -0
- package/build/messages/ReceiptsMessage.js.map +1 -0
- package/build/messages/TerminateConnectionMessage.d.ts +9 -0
- package/build/messages/TerminateConnectionMessage.js +21 -0
- package/build/messages/TerminateConnectionMessage.js.map +1 -0
- package/build/messages/TextMessage.d.ts +15 -0
- package/build/messages/TextMessage.js +38 -0
- package/build/messages/TextMessage.js.map +1 -0
- package/build/messages/calls/CallAcceptRequestMessage.d.ts +11 -0
- package/build/messages/calls/CallAcceptRequestMessage.js +36 -0
- package/build/messages/calls/CallAcceptRequestMessage.js.map +1 -0
- package/build/messages/calls/CallEndRequestMessage.d.ts +9 -0
- package/build/messages/calls/CallEndRequestMessage.js +21 -0
- package/build/messages/calls/CallEndRequestMessage.js.map +1 -0
- package/build/messages/calls/CallOfferRequestMessage.d.ts +17 -0
- package/build/messages/calls/CallOfferRequestMessage.js +57 -0
- package/build/messages/calls/CallOfferRequestMessage.js.map +1 -0
- package/build/messages/calls/CallRejectRequestMessage.d.ts +9 -0
- package/build/messages/calls/CallRejectRequestMessage.js +21 -0
- package/build/messages/calls/CallRejectRequestMessage.js.map +1 -0
- package/build/messages/index.d.ts +32 -0
- package/build/messages/index.js +49 -0
- package/build/messages/index.js.map +1 -0
- package/build/messages/mrtd/EMrtdDataRequestMessage.d.ts +7 -0
- package/build/messages/mrtd/EMrtdDataRequestMessage.js +21 -0
- package/build/messages/mrtd/EMrtdDataRequestMessage.js.map +1 -0
- package/build/messages/mrtd/EMrtdDataSubmitMessage.d.ts +44 -0
- package/build/messages/mrtd/EMrtdDataSubmitMessage.js +121 -0
- package/build/messages/mrtd/EMrtdDataSubmitMessage.js.map +1 -0
- package/build/messages/mrtd/MrtdSubmitState.d.ts +6 -0
- package/build/messages/mrtd/MrtdSubmitState.js +11 -0
- package/build/messages/mrtd/MrtdSubmitState.js.map +1 -0
- package/build/messages/mrtd/MrzDataRequestMessage.d.ts +7 -0
- package/build/messages/mrtd/MrzDataRequestMessage.js +21 -0
- package/build/messages/mrtd/MrzDataRequestMessage.js.map +1 -0
- package/build/messages/mrtd/MrzDataSubmitMessage.d.ts +15 -0
- package/build/messages/mrtd/MrzDataSubmitMessage.js +23 -0
- package/build/messages/mrtd/MrzDataSubmitMessage.js.map +1 -0
- package/build/messages/proofs/vc/VerifiableCredentialProofItemResult.d.ts +17 -0
- package/build/messages/proofs/vc/VerifiableCredentialProofItemResult.js +23 -0
- package/build/messages/proofs/vc/VerifiableCredentialProofItemResult.js.map +1 -0
- package/build/messages/proofs/vc/VerifiableCredentialRequestedProofItem.d.ts +15 -0
- package/build/messages/proofs/vc/VerifiableCredentialRequestedProofItem.js +21 -0
- package/build/messages/proofs/vc/VerifiableCredentialRequestedProofItem.js.map +1 -0
- package/build/messages/proofs/vc/VerifiableCredentialSubmittedProofItem.d.ts +18 -0
- package/build/messages/proofs/vc/VerifiableCredentialSubmittedProofItem.js +22 -0
- package/build/messages/proofs/vc/VerifiableCredentialSubmittedProofItem.js.map +1 -0
- package/build/types.d.ts +127 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/build/utils/dateUtils.d.ts +20 -0
- package/build/utils/dateUtils.js +53 -0
- package/build/utils/dateUtils.js.map +1 -0
- package/build/utils/index.d.ts +2 -0
- package/build/utils/index.js +19 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/stats.d.ts +16 -0
- package/build/utils/stats.js +83 -0
- package/build/utils/stats.js.map +1 -0
- package/package.json +39 -0
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { HandshakeProtocol, ReceiveOutOfBandInvitationConfig, OutOfBandDidCommService, ProofState, JsonObject } from '@credo-ts/core';
|
|
2
|
+
import { Claim, ClaimOptions } from './messages/CredentialIssuanceMessage';
|
|
3
|
+
export interface VsAgentInfo {
|
|
4
|
+
label: string;
|
|
5
|
+
endpoints: string[];
|
|
6
|
+
isInitialized: boolean;
|
|
7
|
+
publicDid?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AgentMessageType {
|
|
10
|
+
'@id': string;
|
|
11
|
+
'@type': string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateCredentialTypeOptions {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
attributes: string[];
|
|
18
|
+
schemaId?: string;
|
|
19
|
+
supportRevocation?: boolean;
|
|
20
|
+
relatedJsonSchemaCredentialId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CredentialIssuanceRequest {
|
|
23
|
+
format: 'jsonld' | 'anoncreds';
|
|
24
|
+
jsonSchemaCredentialId: string;
|
|
25
|
+
claims: JsonObject;
|
|
26
|
+
did?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CredentialIssuanceResponse {
|
|
29
|
+
status: number;
|
|
30
|
+
didcommInvitationUrl?: string;
|
|
31
|
+
jsonSchemaCredentialId?: string;
|
|
32
|
+
credential?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface ImportCredentialTypeOptions {
|
|
35
|
+
id: string;
|
|
36
|
+
data: {
|
|
37
|
+
name: string;
|
|
38
|
+
version: string;
|
|
39
|
+
credentialDefinition: JsonObject;
|
|
40
|
+
credentialDefinitionPrivate: JsonObject;
|
|
41
|
+
keyCorrectnessProof: JsonObject;
|
|
42
|
+
schema?: JsonObject;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface CredentialTypeInfo extends CreateCredentialTypeOptions {
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CredentialTypeResult extends Omit<CredentialTypeInfo, 'supportRevocation'> {
|
|
49
|
+
revocationSupported: boolean;
|
|
50
|
+
relatedJsonSchemaCredentialId?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RevocationRegistryInfo {
|
|
53
|
+
credentialDefinitionId: string;
|
|
54
|
+
maximumCredentialNumber: number;
|
|
55
|
+
}
|
|
56
|
+
export interface CreatePresentationRequestOptions {
|
|
57
|
+
ref?: string;
|
|
58
|
+
callbackUrl?: string;
|
|
59
|
+
requestedCredentials: RequestedCredential[];
|
|
60
|
+
}
|
|
61
|
+
export type RequestedCredential = {
|
|
62
|
+
credentialDefinitionId: string;
|
|
63
|
+
attributes?: string[];
|
|
64
|
+
};
|
|
65
|
+
export interface CreatePresentationRequestResult {
|
|
66
|
+
proofExchangeId: string;
|
|
67
|
+
url: string;
|
|
68
|
+
shortUrl: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CreateInvitationResult {
|
|
71
|
+
url: string;
|
|
72
|
+
}
|
|
73
|
+
export interface PresentationData {
|
|
74
|
+
requestedCredentials: RequestedCredential[];
|
|
75
|
+
claims: Claim[];
|
|
76
|
+
verified: boolean;
|
|
77
|
+
state: ProofState;
|
|
78
|
+
proofExchangeId: string;
|
|
79
|
+
threadId: string;
|
|
80
|
+
updatedAt: Date | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface CreateCredentialOfferOptions {
|
|
83
|
+
credentialDefinitionId: string;
|
|
84
|
+
claims: ClaimOptions[];
|
|
85
|
+
}
|
|
86
|
+
export interface CreateCredentialOfferResult {
|
|
87
|
+
credentialExchangeId: string;
|
|
88
|
+
url: string;
|
|
89
|
+
shortUrl: string;
|
|
90
|
+
}
|
|
91
|
+
type ReceiveOutOfBandInvitationProps = Omit<ReceiveOutOfBandInvitationConfig, 'routing'>;
|
|
92
|
+
export interface ReceiveInvitationProps extends ReceiveOutOfBandInvitationProps {
|
|
93
|
+
invitation: Omit<OutOfBandInvitationSchema, 'appendedAttachments'>;
|
|
94
|
+
}
|
|
95
|
+
export interface ReceiveInvitationByUrlProps extends ReceiveOutOfBandInvitationProps {
|
|
96
|
+
invitationUrl: string;
|
|
97
|
+
}
|
|
98
|
+
export interface AcceptInvitationConfig {
|
|
99
|
+
autoAcceptConnection?: boolean;
|
|
100
|
+
reuseConnection?: boolean;
|
|
101
|
+
label?: string;
|
|
102
|
+
alias?: string;
|
|
103
|
+
imageUrl?: string;
|
|
104
|
+
mediatorId?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface OutOfBandInvitationSchema {
|
|
107
|
+
'@id'?: string;
|
|
108
|
+
'@type': string;
|
|
109
|
+
label: string;
|
|
110
|
+
goalCode?: string;
|
|
111
|
+
goal?: string;
|
|
112
|
+
accept?: string[];
|
|
113
|
+
handshake_protocols?: HandshakeProtocol[];
|
|
114
|
+
services: Array<OutOfBandDidCommService | string>;
|
|
115
|
+
imageUrl?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ConnectionInvitationSchema {
|
|
118
|
+
id?: string;
|
|
119
|
+
'@type': string;
|
|
120
|
+
label: string;
|
|
121
|
+
did?: string;
|
|
122
|
+
recipientKeys?: string[];
|
|
123
|
+
serviceEndpoint?: string;
|
|
124
|
+
routingKeys?: string[];
|
|
125
|
+
imageUrl?: string;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Machine Readable Travel Document (MRTD) date in the format `YYMMDD` to a complete
|
|
3
|
+
* `YYYYMMDD` date format, taking into account the current century.
|
|
4
|
+
*
|
|
5
|
+
* **Note:** This method is limited to interpreting dates based on the current year.
|
|
6
|
+
* It may not handle dates correctly for years beyond the range determined by the
|
|
7
|
+
* current century (e.g., for dates after 2050 when the current year is in the 21st century).
|
|
8
|
+
*
|
|
9
|
+
* @param {string} date - The MRTD date string in the format `YYMMDD`.
|
|
10
|
+
* @param {boolean} isExpirationDate - A boolean flag indicating whether the date is an expiration date.
|
|
11
|
+
* @returns {string} - The converted date in the format `YYYYMMDD`, or the original input
|
|
12
|
+
* if the input is not a valid `YYMMDD` date.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Current year: 2024
|
|
16
|
+
* convertMRTDDate("240101"); // Returns "20240101"
|
|
17
|
+
* convertMRTDDate("991231"); // Returns "19991231"
|
|
18
|
+
* convertMRTDDate("abcd12"); // Returns "abcd12" (invalid input)
|
|
19
|
+
*/
|
|
20
|
+
export declare function convertShortDate(date: string | null | undefined, isExpirationDate: boolean): string | undefined;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertShortDate = convertShortDate;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a Machine Readable Travel Document (MRTD) date in the format `YYMMDD` to a complete
|
|
6
|
+
* `YYYYMMDD` date format, taking into account the current century.
|
|
7
|
+
*
|
|
8
|
+
* **Note:** This method is limited to interpreting dates based on the current year.
|
|
9
|
+
* It may not handle dates correctly for years beyond the range determined by the
|
|
10
|
+
* current century (e.g., for dates after 2050 when the current year is in the 21st century).
|
|
11
|
+
*
|
|
12
|
+
* @param {string} date - The MRTD date string in the format `YYMMDD`.
|
|
13
|
+
* @param {boolean} isExpirationDate - A boolean flag indicating whether the date is an expiration date.
|
|
14
|
+
* @returns {string} - The converted date in the format `YYYYMMDD`, or the original input
|
|
15
|
+
* if the input is not a valid `YYMMDD` date.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Current year: 2024
|
|
19
|
+
* convertMRTDDate("240101"); // Returns "20240101"
|
|
20
|
+
* convertMRTDDate("991231"); // Returns "19991231"
|
|
21
|
+
* convertMRTDDate("abcd12"); // Returns "abcd12" (invalid input)
|
|
22
|
+
*/
|
|
23
|
+
function convertShortDate(date, isExpirationDate) {
|
|
24
|
+
if (!date || !/^\d{6}$/.test(date))
|
|
25
|
+
return date !== null && date !== void 0 ? date : undefined;
|
|
26
|
+
const currentYear = new Date().getFullYear();
|
|
27
|
+
const currentCentury = Math.floor(currentYear / 100);
|
|
28
|
+
const year = parseInt(date.slice(0, 2), 10);
|
|
29
|
+
const month = date.slice(2, 4);
|
|
30
|
+
const day = date.slice(4, 6);
|
|
31
|
+
let fullYear;
|
|
32
|
+
if (isExpirationDate) {
|
|
33
|
+
if (year <= currentYear % 100) {
|
|
34
|
+
fullYear = currentCentury * 100 + year;
|
|
35
|
+
if (fullYear < currentYear) {
|
|
36
|
+
fullYear += 100;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
fullYear = currentCentury * 100 + year;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (year <= currentYear % 100) {
|
|
45
|
+
fullYear = currentCentury * 100 + year;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
fullYear = (currentCentury - 1) * 100 + year;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return `${fullYear}${month}${day}`;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=dateUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.js","sourceRoot":"","sources":["../../src/utils/dateUtils.ts"],"names":[],"mappings":";;AAmBA,4CA4BC;AA/CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,gBAAgB,CAAC,IAA+B,EAAE,gBAAyB;IACzF,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS,CAAA;IAE5D,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAC5C,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC,CAAA;IACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE5B,IAAI,QAAgB,CAAA;IAEpB,IAAI,gBAAgB,EAAE,CAAC;QACrB,IAAI,IAAI,IAAI,WAAW,GAAG,GAAG,EAAE,CAAC;YAC9B,QAAQ,GAAG,cAAc,GAAG,GAAG,GAAG,IAAI,CAAA;YACtC,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;gBAC3B,QAAQ,IAAI,GAAG,CAAA;YACjB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,cAAc,GAAG,GAAG,GAAG,IAAI,CAAA;QACxC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,IAAI,IAAI,WAAW,GAAG,GAAG,EAAE,CAAC;YAC9B,QAAQ,GAAG,cAAc,GAAG,GAAG,GAAG,IAAI,CAAA;QACxC,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,CAAC,cAAc,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAA;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,GAAG,EAAE,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
__exportStar(require("./stats"), exports);
|
|
18
|
+
__exportStar(require("./dateUtils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,8CAA2B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class StatEnum {
|
|
2
|
+
index: number;
|
|
3
|
+
value?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
constructor(index: number, value: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class StatEvent {
|
|
9
|
+
statClass: string;
|
|
10
|
+
entityId: string;
|
|
11
|
+
enums: StatEnum[];
|
|
12
|
+
ts: Date;
|
|
13
|
+
increment: number;
|
|
14
|
+
constructor(entityId: string, enums: StatEnum[], increment: number, ts: Date | undefined, statClass: string);
|
|
15
|
+
toJSON(): Record<string, any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StatEvent = exports.StatEnum = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class StatEnum {
|
|
15
|
+
constructor(index, value) {
|
|
16
|
+
this.index = index;
|
|
17
|
+
this.value = value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.StatEnum = StatEnum;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsNumber)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], StatEnum.prototype, "index", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], StatEnum.prototype, "value", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsString)(),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], StatEnum.prototype, "description", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], StatEnum.prototype, "label", void 0);
|
|
40
|
+
class StatEvent {
|
|
41
|
+
constructor(entityId, enums, increment, ts = new Date(), statClass) {
|
|
42
|
+
this.increment = 1;
|
|
43
|
+
this.entityId = entityId;
|
|
44
|
+
this.enums = enums;
|
|
45
|
+
this.increment = increment;
|
|
46
|
+
this.ts = ts;
|
|
47
|
+
this.statClass = statClass;
|
|
48
|
+
}
|
|
49
|
+
toJSON() {
|
|
50
|
+
return {
|
|
51
|
+
statClass: this.statClass,
|
|
52
|
+
entityId: this.entityId,
|
|
53
|
+
enums: this.enums.map(statEnum => ({
|
|
54
|
+
index: statEnum.index,
|
|
55
|
+
description: statEnum.value,
|
|
56
|
+
})),
|
|
57
|
+
ts: this.ts.toISOString(),
|
|
58
|
+
increment: this.increment,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.StatEvent = StatEvent;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsString)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], StatEvent.prototype, "statClass", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsString)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], StatEvent.prototype, "entityId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsArray)(),
|
|
73
|
+
__metadata("design:type", Array)
|
|
74
|
+
], StatEvent.prototype, "enums", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsDate)(),
|
|
77
|
+
__metadata("design:type", Date)
|
|
78
|
+
], StatEvent.prototype, "ts", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, class_validator_1.IsNumber)(),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], StatEvent.prototype, "increment", void 0);
|
|
83
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/utils/stats.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiF;AAEjF,MAAa,QAAQ;IAgBnB,YAAY,KAAa,EAAE,KAAa;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AApBD,4BAoBC;AAlBC;IADC,IAAA,0BAAQ,GAAE;;uCACE;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uCACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6CACO;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uCACC;AAQhB,MAAa,SAAS;IAgBpB,YACE,QAAgB,EAChB,KAAiB,EACjB,SAAiB,EACjB,KAAW,IAAI,IAAI,EAAE,EACrB,SAAiB;QAPnB,cAAS,GAAW,CAAC,CAAA;QASnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACjC,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,WAAW,EAAE,QAAQ,CAAC,KAAK;aAC5B,CAAC,CAAC;YACH,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;CACF;AA1CD,8BA0CC;AAxCC;IADC,IAAA,0BAAQ,GAAE;;4CACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;2CACK;AAGhB;IADC,IAAA,yBAAO,GAAE;;wCACO;AAGjB;IADC,IAAA,wBAAM,GAAE;8BACL,IAAI;qCAAA;AAGR;IADC,IAAA,0BAAQ,GAAE;;4CACU"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@verana-labs/vs-agent-model",
|
|
3
|
+
"main": "build/index",
|
|
4
|
+
"types": "build/index",
|
|
5
|
+
"version": "1.6.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/2060-io/vs-agent"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"build"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@2060.io/credo-ts-didcomm-mrtd": "0.0.17",
|
|
19
|
+
"@2060.io/credo-ts-didcomm-receipts": "0.0.7",
|
|
20
|
+
"@credo-ts/core": "0.5.18-alpha-20250930143725",
|
|
21
|
+
"class-transformer": "0.5.1",
|
|
22
|
+
"class-validator": "0.14.1",
|
|
23
|
+
"mrz": "^4.2.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node-tlv": "^1.5.4",
|
|
27
|
+
"ts-node-dev": "^2.0.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@credo-ts/core": "0.5.18-alpha-20250930143725"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "pnpm run clean && pnpm run compile",
|
|
34
|
+
"clean": "rimraf -rf ./build",
|
|
35
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
36
|
+
"version": "pnpm version",
|
|
37
|
+
"test": "vitest"
|
|
38
|
+
}
|
|
39
|
+
}
|