@verana-labs/credo-ts-didcomm-vt-flow 2.0.0-dev.8 → 2.0.0-dev.81
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/build/VtFlowApi.d.ts +20 -3
- package/build/VtFlowApi.js +123 -14
- package/build/VtFlowApi.js.map +1 -1
- package/build/VtFlowModule.js +27 -18
- package/build/VtFlowModule.js.map +1 -1
- package/build/VtFlowModuleConfig.d.ts +45 -3
- package/build/VtFlowModuleConfig.js +16 -1
- package/build/VtFlowModuleConfig.js.map +1 -1
- package/build/errors/VtFlowErrorCode.d.ts +13 -3
- package/build/errors/VtFlowErrorCode.js +62 -18
- package/build/errors/VtFlowErrorCode.js.map +1 -1
- package/build/errors/buildVtFlowProblemReport.d.ts +5 -2
- package/build/errors/buildVtFlowProblemReport.js +8 -3
- package/build/errors/buildVtFlowProblemReport.js.map +1 -1
- package/build/errors/index.d.ts +3 -3
- package/build/errors/index.js +4 -1
- package/build/errors/index.js.map +1 -1
- package/build/handlers/IssuanceRequestHandler.d.ts +2 -1
- package/build/handlers/IssuanceRequestHandler.js +11 -2
- package/build/handlers/IssuanceRequestHandler.js.map +1 -1
- package/build/handlers/OnboardingRequestHandler.d.ts +2 -1
- package/build/handlers/OnboardingRequestHandler.js +11 -2
- package/build/handlers/OnboardingRequestHandler.js.map +1 -1
- package/build/handlers/ProblemReportHandler.d.ts +10 -0
- package/build/handlers/ProblemReportHandler.js +17 -0
- package/build/handlers/ProblemReportHandler.js.map +1 -0
- package/build/handlers/index.d.ts +1 -0
- package/build/handlers/index.js +3 -1
- package/build/handlers/index.js.map +1 -1
- package/build/index.d.ts +5 -4
- package/build/index.js +12 -1
- package/build/index.js.map +1 -1
- package/build/messages/ValidatingMessage.d.ts +1 -1
- package/build/messages/ValidatingMessage.js +1 -1
- package/build/messages/ValidatingMessage.js.map +1 -1
- package/build/messages/VtFlowProblemReportMessage.d.ts +13 -0
- package/build/messages/VtFlowProblemReportMessage.js +53 -0
- package/build/messages/VtFlowProblemReportMessage.js.map +1 -0
- package/build/messages/VtFlowProtocol.d.ts +3 -1
- package/build/messages/VtFlowProtocol.js +4 -2
- package/build/messages/VtFlowProtocol.js.map +1 -1
- package/build/messages/index.d.ts +2 -1
- package/build/messages/index.js +4 -1
- package/build/messages/index.js.map +1 -1
- package/build/repository/VtFlowRecord.d.ts +25 -7
- package/build/repository/VtFlowRecord.js +10 -3
- package/build/repository/VtFlowRecord.js.map +1 -1
- package/build/services/VtFlowService.d.ts +65 -17
- package/build/services/VtFlowService.js +431 -87
- package/build/services/VtFlowService.js.map +1 -1
- package/build/types.d.ts +100 -5
- package/build/types.js +66 -2
- package/build/types.js.map +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +6 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/peerAnchorDid.d.ts +2 -0
- package/build/utils/peerAnchorDid.js +8 -0
- package/build/utils/peerAnchorDid.js.map +1 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidatingMessage.js","sourceRoot":"","sources":["../../src/messages/ValidatingMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwF;AACxF,qDAAsD;AAEtD,qDAA0D;AAQ1D,
|
|
1
|
+
{"version":3,"file":"ValidatingMessage.js","sourceRoot":"","sources":["../../src/messages/ValidatingMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwF;AACxF,qDAAsD;AAEtD,qDAA0D;AAQ1D,kIAAkI;AAClI,MAAa,iBAAkB,SAAQ,wBAAc;IACnD,YAAmB,OAAiC;;QAClD,KAAK,EAAE,CAAA;QAaO,SAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAA;QAX1D,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,EAAE,GAAG,MAAA,OAAO,CAAC,EAAE,mCAAI,IAAI,CAAC,UAAU,EAAE,CAAA;YACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;YAE9B,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;;AAVH,8CAoBC;AARwB,sBAAI,GAAG,IAAA,0BAAgB,EAAC,wCAAuB,CAAC,AAA5C,CAA4C;AAGvD;IADf,IAAA,4BAAkB,EAAC,iBAAiB,CAAC,IAAI,CAAC;;+CACiB;AAIrD;IAFN,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACY"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DidCommProblemReportMessage, ImpactStatus, WhereStatus, WhoRetriesStatus } from '@credo-ts/didcomm';
|
|
2
|
+
/**
|
|
3
|
+
* Spec `problem-report (adopted)`. Credo's base class is typed
|
|
4
|
+
* `notification/1.0/problem-report`, which is not the `report-problem/1.0` URI the vt-flow
|
|
5
|
+
* Message Type URIs table requires, and a handler keys on the message class.
|
|
6
|
+
*/
|
|
7
|
+
export declare class VtFlowProblemReportMessage extends DidCommProblemReportMessage {
|
|
8
|
+
static readonly type: import("@credo-ts/didcomm").ParsedMessageType;
|
|
9
|
+
readonly type: string;
|
|
10
|
+
whoRetries?: WhoRetriesStatus;
|
|
11
|
+
impact?: ImpactStatus;
|
|
12
|
+
where?: WhereStatus;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.VtFlowProblemReportMessage = void 0;
|
|
13
|
+
const didcomm_1 = require("@credo-ts/didcomm");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const VtFlowProtocol_1 = require("./VtFlowProtocol");
|
|
17
|
+
// RFC 0035 values are lower case on the wire, while Credo's enums and their IsEnum checks are upper case.
|
|
18
|
+
function rfc0035Case({ value, type }) {
|
|
19
|
+
if (typeof value !== 'string')
|
|
20
|
+
return value;
|
|
21
|
+
return type === class_transformer_1.TransformationType.CLASS_TO_PLAIN ? value.toLowerCase() : value.toUpperCase();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Spec `problem-report (adopted)`. Credo's base class is typed
|
|
25
|
+
* `notification/1.0/problem-report`, which is not the `report-problem/1.0` URI the vt-flow
|
|
26
|
+
* Message Type URIs table requires, and a handler keys on the message class.
|
|
27
|
+
*/
|
|
28
|
+
class VtFlowProblemReportMessage extends didcomm_1.DidCommProblemReportMessage {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.type = VtFlowProblemReportMessage.type.messageTypeUri;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.VtFlowProblemReportMessage = VtFlowProblemReportMessage;
|
|
35
|
+
VtFlowProblemReportMessage.type = (0, didcomm_1.parseMessageType)(VtFlowProtocol_1.VT_FLOW_PROBLEM_REPORT_TYPE);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, didcomm_1.IsValidMessageType)(VtFlowProblemReportMessage.type),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], VtFlowProblemReportMessage.prototype, "type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Transform)(rfc0035Case),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], VtFlowProblemReportMessage.prototype, "whoRetries", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Transform)(rfc0035Case),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], VtFlowProblemReportMessage.prototype, "impact", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsString)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], VtFlowProblemReportMessage.prototype, "where", void 0);
|
|
53
|
+
//# sourceMappingURL=VtFlowProblemReportMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VtFlowProblemReportMessage.js","sourceRoot":"","sources":["../../src/messages/VtFlowProblemReportMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAO0B;AAC1B,yDAAiE;AACjE,qDAAsD;AAEtD,qDAA8D;AAE9D,0GAA0G;AAC1G,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAgD;IAChF,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,OAAO,IAAI,KAAK,sCAAkB,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;AAC/F,CAAC;AAED;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,qCAA2B;IAA3E;;QAIkB,SAAI,GAAG,0BAA0B,CAAC,IAAI,CAAC,cAAc,CAAA;IAYvE,CAAC;;AAhBD,gEAgBC;AAfwB,+BAAI,GAAG,IAAA,0BAAgB,EAAC,4CAA2B,CAAC,AAAhD,CAAgD;AAG3D;IADf,IAAA,4BAAkB,EAAC,0BAA0B,CAAC,IAAI,CAAC;;wDACiB;AAG9D;IADN,IAAA,6BAAS,EAAC,WAAW,CAAC;;8DACa;AAG7B;IADN,IAAA,6BAAS,EAAC,WAAW,CAAC;;0DACK;AAKrB;IAFN,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yDACe"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/** Canonical URIs for the five vt-flow superprotocol messages. */
|
|
1
|
+
/** Canonical URIs for the five vt-flow superprotocol messages and the adopted problem-report. */
|
|
2
2
|
export declare const VT_FLOW_PROTOCOL_URI: "https://didcomm.org/vt-flow/1.0";
|
|
3
3
|
export declare const VT_FLOW_ONBOARDING_REQUEST_TYPE: "https://didcomm.org/vt-flow/1.0/onboarding-request";
|
|
4
4
|
export declare const VT_FLOW_ISSUANCE_REQUEST_TYPE: "https://didcomm.org/vt-flow/1.0/issuance-request";
|
|
5
5
|
export declare const VT_FLOW_OOB_LINK_TYPE: "https://didcomm.org/vt-flow/1.0/oob-link";
|
|
6
6
|
export declare const VT_FLOW_VALIDATING_TYPE: "https://didcomm.org/vt-flow/1.0/validating";
|
|
7
7
|
export declare const VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE: "https://didcomm.org/vt-flow/1.0/credential-state-change";
|
|
8
|
+
/** The adopted problem-report of the spec, which is not under the vt-flow protocol URI. */
|
|
9
|
+
export declare const VT_FLOW_PROBLEM_REPORT_TYPE: "https://didcomm.org/report-problem/1.0/problem-report";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE = exports.VT_FLOW_VALIDATING_TYPE = exports.VT_FLOW_OOB_LINK_TYPE = exports.VT_FLOW_ISSUANCE_REQUEST_TYPE = exports.VT_FLOW_ONBOARDING_REQUEST_TYPE = exports.VT_FLOW_PROTOCOL_URI = void 0;
|
|
4
|
-
/** Canonical URIs for the five vt-flow superprotocol messages. */
|
|
3
|
+
exports.VT_FLOW_PROBLEM_REPORT_TYPE = exports.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE = exports.VT_FLOW_VALIDATING_TYPE = exports.VT_FLOW_OOB_LINK_TYPE = exports.VT_FLOW_ISSUANCE_REQUEST_TYPE = exports.VT_FLOW_ONBOARDING_REQUEST_TYPE = exports.VT_FLOW_PROTOCOL_URI = void 0;
|
|
4
|
+
/** Canonical URIs for the five vt-flow superprotocol messages and the adopted problem-report. */
|
|
5
5
|
exports.VT_FLOW_PROTOCOL_URI = 'https://didcomm.org/vt-flow/1.0';
|
|
6
6
|
exports.VT_FLOW_ONBOARDING_REQUEST_TYPE = `${exports.VT_FLOW_PROTOCOL_URI}/onboarding-request`;
|
|
7
7
|
exports.VT_FLOW_ISSUANCE_REQUEST_TYPE = `${exports.VT_FLOW_PROTOCOL_URI}/issuance-request`;
|
|
8
8
|
exports.VT_FLOW_OOB_LINK_TYPE = `${exports.VT_FLOW_PROTOCOL_URI}/oob-link`;
|
|
9
9
|
exports.VT_FLOW_VALIDATING_TYPE = `${exports.VT_FLOW_PROTOCOL_URI}/validating`;
|
|
10
10
|
exports.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE = `${exports.VT_FLOW_PROTOCOL_URI}/credential-state-change`;
|
|
11
|
+
/** The adopted problem-report of the spec, which is not under the vt-flow protocol URI. */
|
|
12
|
+
exports.VT_FLOW_PROBLEM_REPORT_TYPE = 'https://didcomm.org/report-problem/1.0/problem-report';
|
|
11
13
|
//# sourceMappingURL=VtFlowProtocol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VtFlowProtocol.js","sourceRoot":"","sources":["../../src/messages/VtFlowProtocol.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"VtFlowProtocol.js","sourceRoot":"","sources":["../../src/messages/VtFlowProtocol.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACpF,QAAA,oBAAoB,GAAG,iCAA0C,CAAA;AAEjE,QAAA,+BAA+B,GAAG,GAAG,4BAAoB,qBAA8B,CAAA;AACvF,QAAA,6BAA6B,GAAG,GAAG,4BAAoB,mBAA4B,CAAA;AACnF,QAAA,qBAAqB,GAAG,GAAG,4BAAoB,WAAoB,CAAA;AACnE,QAAA,uBAAuB,GAAG,GAAG,4BAAoB,aAAsB,CAAA;AACvE,QAAA,oCAAoC,GAAG,GAAG,4BAAoB,0BAAmC,CAAA;AAE9G,2FAA2F;AAC9E,QAAA,2BAA2B,GAAG,uDAAgE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { VT_FLOW_PROTOCOL_URI, VT_FLOW_ONBOARDING_REQUEST_TYPE, VT_FLOW_ISSUANCE_REQUEST_TYPE, VT_FLOW_OOB_LINK_TYPE, VT_FLOW_VALIDATING_TYPE, VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE, } from './VtFlowProtocol';
|
|
1
|
+
export { VT_FLOW_PROTOCOL_URI, VT_FLOW_ONBOARDING_REQUEST_TYPE, VT_FLOW_ISSUANCE_REQUEST_TYPE, VT_FLOW_OOB_LINK_TYPE, VT_FLOW_VALIDATING_TYPE, VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE, VT_FLOW_PROBLEM_REPORT_TYPE, } from './VtFlowProtocol';
|
|
2
2
|
export { OnboardingRequestMessage } from './OnboardingRequestMessage';
|
|
3
3
|
export type { OnboardingRequestMessageOptions } from './OnboardingRequestMessage';
|
|
4
4
|
export { IssuanceRequestMessage } from './IssuanceRequestMessage';
|
|
@@ -9,3 +9,4 @@ export { ValidatingMessage } from './ValidatingMessage';
|
|
|
9
9
|
export type { ValidatingMessageOptions } from './ValidatingMessage';
|
|
10
10
|
export { CredentialStateChangeMessage, VtCredentialState } from './CredentialStateChangeMessage';
|
|
11
11
|
export type { CredentialStateChangeMessageOptions } from './CredentialStateChangeMessage';
|
|
12
|
+
export { VtFlowProblemReportMessage } from './VtFlowProblemReportMessage';
|
package/build/messages/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VtCredentialState = exports.CredentialStateChangeMessage = exports.ValidatingMessage = exports.OobLinkMessage = exports.IssuanceRequestMessage = exports.OnboardingRequestMessage = exports.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE = exports.VT_FLOW_VALIDATING_TYPE = exports.VT_FLOW_OOB_LINK_TYPE = exports.VT_FLOW_ISSUANCE_REQUEST_TYPE = exports.VT_FLOW_ONBOARDING_REQUEST_TYPE = exports.VT_FLOW_PROTOCOL_URI = void 0;
|
|
3
|
+
exports.VtFlowProblemReportMessage = exports.VtCredentialState = exports.CredentialStateChangeMessage = exports.ValidatingMessage = exports.OobLinkMessage = exports.IssuanceRequestMessage = exports.OnboardingRequestMessage = exports.VT_FLOW_PROBLEM_REPORT_TYPE = exports.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE = exports.VT_FLOW_VALIDATING_TYPE = exports.VT_FLOW_OOB_LINK_TYPE = exports.VT_FLOW_ISSUANCE_REQUEST_TYPE = exports.VT_FLOW_ONBOARDING_REQUEST_TYPE = exports.VT_FLOW_PROTOCOL_URI = void 0;
|
|
4
4
|
var VtFlowProtocol_1 = require("./VtFlowProtocol");
|
|
5
5
|
Object.defineProperty(exports, "VT_FLOW_PROTOCOL_URI", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_PROTOCOL_URI; } });
|
|
6
6
|
Object.defineProperty(exports, "VT_FLOW_ONBOARDING_REQUEST_TYPE", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_ONBOARDING_REQUEST_TYPE; } });
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "VT_FLOW_ISSUANCE_REQUEST_TYPE", { enumerable: tr
|
|
|
8
8
|
Object.defineProperty(exports, "VT_FLOW_OOB_LINK_TYPE", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_OOB_LINK_TYPE; } });
|
|
9
9
|
Object.defineProperty(exports, "VT_FLOW_VALIDATING_TYPE", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_VALIDATING_TYPE; } });
|
|
10
10
|
Object.defineProperty(exports, "VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_CREDENTIAL_STATE_CHANGE_TYPE; } });
|
|
11
|
+
Object.defineProperty(exports, "VT_FLOW_PROBLEM_REPORT_TYPE", { enumerable: true, get: function () { return VtFlowProtocol_1.VT_FLOW_PROBLEM_REPORT_TYPE; } });
|
|
11
12
|
var OnboardingRequestMessage_1 = require("./OnboardingRequestMessage");
|
|
12
13
|
Object.defineProperty(exports, "OnboardingRequestMessage", { enumerable: true, get: function () { return OnboardingRequestMessage_1.OnboardingRequestMessage; } });
|
|
13
14
|
var IssuanceRequestMessage_1 = require("./IssuanceRequestMessage");
|
|
@@ -19,4 +20,6 @@ Object.defineProperty(exports, "ValidatingMessage", { enumerable: true, get: fun
|
|
|
19
20
|
var CredentialStateChangeMessage_1 = require("./CredentialStateChangeMessage");
|
|
20
21
|
Object.defineProperty(exports, "CredentialStateChangeMessage", { enumerable: true, get: function () { return CredentialStateChangeMessage_1.CredentialStateChangeMessage; } });
|
|
21
22
|
Object.defineProperty(exports, "VtCredentialState", { enumerable: true, get: function () { return CredentialStateChangeMessage_1.VtCredentialState; } });
|
|
23
|
+
var VtFlowProblemReportMessage_1 = require("./VtFlowProblemReportMessage");
|
|
24
|
+
Object.defineProperty(exports, "VtFlowProblemReportMessage", { enumerable: true, get: function () { return VtFlowProblemReportMessage_1.VtFlowProblemReportMessage; } });
|
|
22
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":";;;AAAA,mDAQyB;AAPvB,sHAAA,oBAAoB,OAAA;AACpB,iIAAA,+BAA+B,OAAA;AAC/B,+HAAA,6BAA6B,OAAA;AAC7B,uHAAA,qBAAqB,OAAA;AACrB,yHAAA,uBAAuB,OAAA;AACvB,sIAAA,oCAAoC,OAAA;AACpC,6HAAA,2BAA2B,OAAA;AAG7B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AAGjC,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAG/B,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AAGvB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAG1B,+EAAgG;AAAvF,4IAAA,4BAA4B,OAAA;AAAE,iIAAA,iBAAiB,OAAA;AAGxD,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RecordTags, TagsBase } from '@credo-ts/core';
|
|
2
2
|
import type { DidCommAttachment } from '@credo-ts/didcomm';
|
|
3
3
|
import { BaseRecord } from '@credo-ts/core';
|
|
4
|
-
import { VtFlowRole, VtFlowState, VtFlowVariant } from '../types';
|
|
5
|
-
/** Indexed storage tags queryable through `VtFlowRepository`;
|
|
4
|
+
import { VtFlowIssuance, VtFlowMessage, VtFlowOobLink, VtFlowRole, VtFlowState, VtFlowValidation, VtFlowVariant } from '../types';
|
|
5
|
+
/** Indexed storage tags queryable through `VtFlowRepository`; the participant ids are OnboardingProcess-only. */
|
|
6
6
|
export type DefaultVtFlowTags = {
|
|
7
7
|
threadId: string;
|
|
8
8
|
participantSessionId: string;
|
|
@@ -10,7 +10,8 @@ export type DefaultVtFlowTags = {
|
|
|
10
10
|
role: VtFlowRole;
|
|
11
11
|
flowState: VtFlowState;
|
|
12
12
|
flowVariant: VtFlowVariant;
|
|
13
|
-
|
|
13
|
+
applicantParticipantId?: string;
|
|
14
|
+
validatorParticipantId?: string;
|
|
14
15
|
schemaId?: string;
|
|
15
16
|
credentialExchangeRecordId?: string;
|
|
16
17
|
subprotocolThid?: string;
|
|
@@ -29,13 +30,20 @@ export interface VtFlowStorageProps {
|
|
|
29
30
|
agentParticipantId: string;
|
|
30
31
|
walletAgentParticipantId: string;
|
|
31
32
|
issuerParticipantId?: number;
|
|
32
|
-
|
|
33
|
+
applicantParticipantId?: string;
|
|
34
|
+
applicantParticipantRole?: number;
|
|
35
|
+
validatorParticipantId?: string;
|
|
33
36
|
schemaId?: string;
|
|
34
37
|
claims?: Record<string, unknown>;
|
|
35
38
|
credentialExchangeRecordId?: string;
|
|
36
39
|
subprotocolThid?: string;
|
|
37
|
-
|
|
40
|
+
ecsSchemaKey?: string;
|
|
41
|
+
oobLink?: VtFlowOobLink;
|
|
42
|
+
messages?: VtFlowMessage[];
|
|
43
|
+
validation?: VtFlowValidation;
|
|
44
|
+
issuance?: VtFlowIssuance;
|
|
38
45
|
proofsAttach?: DidCommAttachment[];
|
|
46
|
+
credentialId?: string;
|
|
39
47
|
credentialDigest?: string;
|
|
40
48
|
errorMessage?: string;
|
|
41
49
|
tags?: CustomVtFlowTags;
|
|
@@ -53,15 +61,25 @@ export declare class VtFlowRecord extends BaseRecord<DefaultVtFlowTags, CustomVt
|
|
|
53
61
|
agentParticipantId: string;
|
|
54
62
|
walletAgentParticipantId: string;
|
|
55
63
|
issuerParticipantId?: number;
|
|
56
|
-
|
|
64
|
+
applicantParticipantId?: string;
|
|
65
|
+
applicantParticipantRole?: number;
|
|
66
|
+
validatorParticipantId?: string;
|
|
57
67
|
schemaId?: string;
|
|
58
68
|
claims?: Record<string, unknown>;
|
|
59
69
|
credentialExchangeRecordId?: string;
|
|
60
70
|
subprotocolThid?: string;
|
|
61
|
-
|
|
71
|
+
/** ECS key of the credential schema, resolved while verifying the offer so publication needs no indexer */
|
|
72
|
+
ecsSchemaKey?: string;
|
|
73
|
+
oobLink?: VtFlowOobLink;
|
|
74
|
+
messages?: VtFlowMessage[];
|
|
75
|
+
validation?: VtFlowValidation;
|
|
76
|
+
issuance?: VtFlowIssuance;
|
|
62
77
|
proofsAttach?: DidCommAttachment[];
|
|
78
|
+
credentialId?: string;
|
|
63
79
|
credentialDigest?: string;
|
|
64
80
|
errorMessage?: string;
|
|
81
|
+
/** Outlives TERMINATED_BY_VALIDATOR when a validation in flight lands, until the applicant re-attaches ([VSA-ADM-VT-FL-REJECT-2]) */
|
|
82
|
+
connectionTerminated?: boolean;
|
|
65
83
|
constructor(props: VtFlowStorageProps);
|
|
66
84
|
getTags(): DefaultVtFlowTags & CustomVtFlowTags;
|
|
67
85
|
assertRole(expectedRole: VtFlowRole): void;
|
|
@@ -21,19 +21,26 @@ class VtFlowRecord extends core_1.BaseRecord {
|
|
|
21
21
|
this.agentParticipantId = props.agentParticipantId;
|
|
22
22
|
this.walletAgentParticipantId = props.walletAgentParticipantId;
|
|
23
23
|
this.issuerParticipantId = props.issuerParticipantId;
|
|
24
|
-
this.
|
|
24
|
+
this.applicantParticipantId = props.applicantParticipantId;
|
|
25
|
+
this.applicantParticipantRole = props.applicantParticipantRole;
|
|
26
|
+
this.validatorParticipantId = props.validatorParticipantId;
|
|
25
27
|
this.schemaId = props.schemaId;
|
|
26
28
|
this.claims = props.claims;
|
|
27
29
|
this.credentialExchangeRecordId = props.credentialExchangeRecordId;
|
|
28
30
|
this.subprotocolThid = props.subprotocolThid;
|
|
29
|
-
this.
|
|
31
|
+
this.ecsSchemaKey = props.ecsSchemaKey;
|
|
32
|
+
this.oobLink = props.oobLink;
|
|
33
|
+
this.messages = props.messages;
|
|
34
|
+
this.validation = props.validation;
|
|
35
|
+
this.issuance = props.issuance;
|
|
30
36
|
this.proofsAttach = props.proofsAttach;
|
|
37
|
+
this.credentialId = props.credentialId;
|
|
31
38
|
this.credentialDigest = props.credentialDigest;
|
|
32
39
|
this.errorMessage = props.errorMessage;
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
getTags() {
|
|
36
|
-
return Object.assign(Object.assign({}, this._tags), { threadId: this.threadId, participantSessionId: this.participantSessionId, connectionId: this.connectionId, role: this.role, flowState: this.state, flowVariant: this.variant,
|
|
43
|
+
return Object.assign(Object.assign({}, this._tags), { threadId: this.threadId, participantSessionId: this.participantSessionId, connectionId: this.connectionId, role: this.role, flowState: this.state, flowVariant: this.variant, applicantParticipantId: this.applicantParticipantId, validatorParticipantId: this.validatorParticipantId, schemaId: this.schemaId, credentialExchangeRecordId: this.credentialExchangeRecordId, subprotocolThid: this.subprotocolThid });
|
|
37
44
|
}
|
|
38
45
|
assertRole(expectedRole) {
|
|
39
46
|
if (this.role !== expectedRole) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VtFlowRecord.js","sourceRoot":"","sources":["../../src/repository/VtFlowRecord.ts"],"names":[],"mappings":";;;AAGA,yCAA8D;
|
|
1
|
+
{"version":3,"file":"VtFlowRecord.js","sourceRoot":"","sources":["../../src/repository/VtFlowRecord.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { AgentContext, Logger, Query, QueryOptions } from '@credo-ts/core';
|
|
2
2
|
import type { DidCommConnectionRecord, DidCommCredentialExchangeRecord, DidCommInboundMessageContext } from '@credo-ts/didcomm';
|
|
3
3
|
import { EventEmitter } from '@credo-ts/core';
|
|
4
|
-
import { VtFlowModuleConfig } from '../VtFlowModuleConfig';
|
|
4
|
+
import { VtFlowModuleConfig, type VtFlowRequestPurpose } from '../VtFlowModuleConfig';
|
|
5
5
|
import { type BuildVtFlowProblemReportOptions, VtFlowErrorCode, buildVtFlowProblemReport } from '../errors';
|
|
6
|
-
import { CredentialStateChangeMessage, type CredentialStateChangeMessageOptions, IssuanceRequestMessage, OnboardingRequestMessage, OobLinkMessage, type OobLinkMessageOptions, ValidatingMessage, type ValidatingMessageOptions } from '../messages';
|
|
6
|
+
import { CredentialStateChangeMessage, type CredentialStateChangeMessageOptions, IssuanceRequestMessage, OnboardingRequestMessage, OobLinkMessage, type OobLinkMessageOptions, VtFlowProblemReportMessage, ValidatingMessage, type ValidatingMessageOptions } from '../messages';
|
|
7
7
|
import { VtFlowRecord, VtFlowRepository } from '../repository';
|
|
8
|
-
import { VtFlowState } from '../types';
|
|
8
|
+
import { type VtFlowIssuance, type VtFlowMessage, type VtFlowValidation, VtFlowState } from '../types';
|
|
9
9
|
export interface CreateOnboardingRequestParams {
|
|
10
10
|
connectionId: string;
|
|
11
11
|
participantSessionId: string;
|
|
12
|
-
|
|
12
|
+
applicantParticipantId: string;
|
|
13
|
+
applicantParticipantRole?: number;
|
|
14
|
+
validatorParticipantId?: string;
|
|
15
|
+
schemaId?: string;
|
|
13
16
|
agentParticipantId: string;
|
|
14
17
|
walletAgentParticipantId: string;
|
|
15
18
|
claims?: Record<string, unknown>;
|
|
@@ -50,21 +53,35 @@ export declare class VtFlowService {
|
|
|
50
53
|
message: IssuanceRequestMessage;
|
|
51
54
|
record: VtFlowRecord;
|
|
52
55
|
}>;
|
|
56
|
+
reattachOnboardingProcessRecord(agentContext: AgentContext, params: {
|
|
57
|
+
vtFlowRecordId: string;
|
|
58
|
+
connectionId: string;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
message: OnboardingRequestMessage;
|
|
61
|
+
record: VtFlowRecord;
|
|
62
|
+
}>;
|
|
63
|
+
private releaseCredentialExchange;
|
|
53
64
|
/** Validator-side OnboardingProcess: create or re-attach (by `participant_session_id`) a record in `AWAITING_OR` from an inbound `onboarding-request`. */
|
|
54
65
|
processReceiveOnboardingRequest(messageContext: DidCommInboundMessageContext<OnboardingRequestMessage>): Promise<VtFlowRecord>;
|
|
55
66
|
/** Validator-side DirectIssuance counterpart of `processReceiveOnboardingRequest`, landing the record in `AWAITING_IR`. */
|
|
56
67
|
processReceiveIssuanceRequest(messageContext: DidCommInboundMessageContext<IssuanceRequestMessage>): Promise<VtFlowRecord>;
|
|
57
|
-
/** Applicant-side inbound `oob-link`;
|
|
68
|
+
/** Applicant-side inbound `oob-link`; `OR_SENT`, `IR_SENT`, `VALIDATING` or `OOB_PENDING` => `OOB_PENDING`. */
|
|
58
69
|
processReceiveOobLink(messageContext: DidCommInboundMessageContext<OobLinkMessage>): Promise<VtFlowRecord>;
|
|
59
|
-
/** Applicant-side inbound `validating`;
|
|
70
|
+
/** Applicant-side inbound `validating`; `OR_SENT`, `IR_SENT` or `OOB_PENDING` => `VALIDATING`. */
|
|
60
71
|
processReceiveValidating(messageContext: DidCommInboundMessageContext<ValidatingMessage>): Promise<VtFlowRecord>;
|
|
61
72
|
/** Applicant-side inbound `credential-state-change`; v1.0 handles `REVOKED` only. */
|
|
62
73
|
processReceiveCredentialStateChange(messageContext: DidCommInboundMessageContext<CredentialStateChangeMessage>): Promise<VtFlowRecord | null>;
|
|
63
|
-
/** `AWAITING_OR => VALIDATING
|
|
64
|
-
acceptOnboardingRequest(agentContext: AgentContext, recordId: string): Promise<
|
|
74
|
+
/** `AWAITING_OR => VALIDATING` once the `checkParticipantId` hook accepts the `participant_id`, with no transition and no message once it reports the request settled by a `VALIDATED` entry; caller is expected to have verified agent/wallet IDs on-chain. */
|
|
75
|
+
acceptOnboardingRequest(agentContext: AgentContext, recordId: string): Promise<{
|
|
76
|
+
record: VtFlowRecord;
|
|
77
|
+
message?: ValidatingMessage;
|
|
78
|
+
}>;
|
|
65
79
|
/** DirectIssuance: `AWAITING_IR => VALIDATING`; transient before `CRED_OFFERED`. */
|
|
66
|
-
acceptIssuanceRequest(agentContext: AgentContext, recordId: string): Promise<
|
|
67
|
-
|
|
80
|
+
acceptIssuanceRequest(agentContext: AgentContext, recordId: string): Promise<{
|
|
81
|
+
record: VtFlowRecord;
|
|
82
|
+
message: ValidatingMessage;
|
|
83
|
+
}>;
|
|
84
|
+
/** Reject with a problem-report; a fatal code moves the sender to the Error Codes state, a retryable one returns a validator to `AWAITING_OR` or `AWAITING_IR`. */
|
|
68
85
|
rejectRequest(agentContext: AgentContext, recordId: string, params: RejectRequestParams): Promise<{
|
|
69
86
|
record: VtFlowRecord;
|
|
70
87
|
problemReport: ReturnType<typeof buildVtFlowProblemReport>;
|
|
@@ -88,20 +105,37 @@ export declare class VtFlowService {
|
|
|
88
105
|
record: VtFlowRecord;
|
|
89
106
|
problemReport: ReturnType<typeof buildVtFlowProblemReport>;
|
|
90
107
|
}>;
|
|
91
|
-
/** Build an `oob-link`;
|
|
108
|
+
/** Build an `oob-link` from `VALIDATING` or `OOB_PENDING`; the flow moves to or stays in `OOB_PENDING`. */
|
|
92
109
|
sendOobLinkForSession(agentContext: AgentContext, recordId: string, params: SendOobLinkParams): Promise<{
|
|
93
110
|
record: VtFlowRecord;
|
|
94
111
|
message: OobLinkMessage;
|
|
95
112
|
}>;
|
|
96
|
-
/**
|
|
113
|
+
/** `OOB_PENDING` => `VALIDATING`, with the `validating` that tells the applicant its out-of-band step is done. */
|
|
97
114
|
sendValidatingForSession(agentContext: AgentContext, recordId: string, params?: SendValidatingParams): Promise<{
|
|
98
115
|
record: VtFlowRecord;
|
|
99
116
|
message: ValidatingMessage;
|
|
100
117
|
}>;
|
|
101
|
-
/**
|
|
118
|
+
/** Record the validation decision or its transaction outcome, moving the flow when `state` is given. */
|
|
119
|
+
recordValidation(agentContext: AgentContext, recordId: string, validation: VtFlowValidation, state?: VtFlowState): Promise<VtFlowRecord>;
|
|
120
|
+
/** Record the outcome of the `CreateOrUpdateParticipantSession` transaction that anchors the issued credential. */
|
|
121
|
+
recordIssuance(agentContext: AgentContext, recordId: string, issuance: VtFlowIssuance): Promise<VtFlowRecord>;
|
|
122
|
+
/** `VALIDATED` => `VALIDATED_PENDING_CLAIMS`, when the claims fail the schema at offer time ([VSA-VTI-FLOW-OP-ISSUE-4]). */
|
|
123
|
+
markPendingClaims(agentContext: AgentContext, recordId: string): Promise<VtFlowRecord>;
|
|
124
|
+
/** Validator-side states preceding `VALIDATED` => `VALIDATED`; call after `SetParticipantOPtoValidated` lands on-chain. */
|
|
102
125
|
markValidated(agentContext: AgentContext, recordId: string): Promise<VtFlowRecord>;
|
|
126
|
+
/**
|
|
127
|
+
* Close an onboarding process that carries no credential exchange. Only a HOLDER receives a
|
|
128
|
+
* credential; for every other role the chain records the outcome with
|
|
129
|
+
* SetParticipantOPToValidated, and nothing else follows. Both sides use this, so it asserts no
|
|
130
|
+
* role: the validator calls it after it validates, and the applicant reaches it from the chain
|
|
131
|
+
* event.
|
|
132
|
+
*/
|
|
133
|
+
markCompleted(agentContext: AgentContext, recordId: string): Promise<VtFlowRecord>;
|
|
134
|
+
/** Validator states that an `offer-credential` moves to `CRED_OFFERED`; from `COMPLETED` it starts a new subprotocol run. */
|
|
135
|
+
assertCanOfferCredential(record: VtFlowRecord): void;
|
|
103
136
|
/** Link a Credo exchange record to the session and transition to `CRED_OFFERED`. */
|
|
104
|
-
attachCredentialExchangeRecord(agentContext: AgentContext, recordId: string, credentialExchangeRecord: DidCommCredentialExchangeRecord, credentialDigest?: string, issuerParticipantId?: number): Promise<VtFlowRecord>;
|
|
137
|
+
attachCredentialExchangeRecord(agentContext: AgentContext, recordId: string, credentialExchangeRecord: DidCommCredentialExchangeRecord, credentialDigest?: string, issuerParticipantId?: number, credentialId?: string): Promise<VtFlowRecord>;
|
|
138
|
+
setEcsSchemaKey(agentContext: AgentContext, recordId: string, ecsSchemaKey: string): Promise<VtFlowRecord>;
|
|
105
139
|
setCredentialDigest(agentContext: AgentContext, recordId: string, credentialDigest: string): Promise<VtFlowRecord>;
|
|
106
140
|
/** Validator-side `credential-state-change`; `COMPLETED => CRED_REVOKED`, re-notify allowed from `CRED_REVOKED`. */
|
|
107
141
|
notifyCredentialStateChange(agentContext: AgentContext, recordId: string, params: NotifyCredentialStateChangeParams): Promise<{
|
|
@@ -119,14 +153,28 @@ export declare class VtFlowService {
|
|
|
119
153
|
findAllByQuery(agentContext: AgentContext, query: Query<VtFlowRecord>, queryOptions?: QueryOptions): Promise<VtFlowRecord[]>;
|
|
120
154
|
/** Transition the record, persist it, and emit `VtFlowStateChanged`. */
|
|
121
155
|
updateState(agentContext: AgentContext, record: VtFlowRecord, newState: VtFlowState): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Inbound adopted `problem-report`. The Error Codes table gives the state the receiving party
|
|
158
|
+
* moves to, so both sides run this same mapping. A retryable code records the message and leaves
|
|
159
|
+
* the flow where it is.
|
|
160
|
+
*/
|
|
161
|
+
processReceiveProblemReport(messageContext: DidCommInboundMessageContext<VtFlowProblemReportMessage>): Promise<VtFlowRecord | undefined>;
|
|
162
|
+
/** `terminated-by-sender` is the peer's termination, so the receiver lands in the state named after the sender. */
|
|
163
|
+
private resolveErrorFlowState;
|
|
164
|
+
/** Append to `messages[]`, which a validator fills with what it sent and an applicant with what it received. */
|
|
165
|
+
appendMessage(record: VtFlowRecord, message: VtFlowMessage): void;
|
|
122
166
|
/** Persist record changes without state-transition semantics (no event emitted). */
|
|
123
167
|
updateRecord(agentContext: AgentContext, record: VtFlowRecord): Promise<void>;
|
|
124
168
|
/** participant_session_ids are public on-chain, so only the original peer may re-attach a flow with one. */
|
|
169
|
+
private isSamePeer;
|
|
125
170
|
private assertSamePeer;
|
|
171
|
+
/** VS-CONN-VS failure is fatal, so it ends the flow of the request in ERROR unless that flow has ended or belongs to another peer. */
|
|
172
|
+
private checkRequestFromVerifiableService;
|
|
126
173
|
private emitStateChanged;
|
|
127
174
|
getModuleConfig(): VtFlowModuleConfig;
|
|
128
175
|
getLogger(): Logger;
|
|
129
|
-
buildProblemReport(options: BuildVtFlowProblemReportOptions):
|
|
130
|
-
/** Spec Verifiable Service Identity Check: invokes the caller-provided VS-CONN-VS hook. Throws `vt-flow.not-a-verifiable-service` when the peer fails the check. When no hook is configured, logs a warning and permits. */
|
|
131
|
-
checkIsVerifiableService(agentContext: AgentContext, connection: DidCommConnectionRecord): Promise<void>;
|
|
176
|
+
buildProblemReport(options: BuildVtFlowProblemReportOptions): VtFlowProblemReportMessage;
|
|
177
|
+
/** Spec Verifiable Service Identity Check: invokes the caller-provided VS-CONN-VS hook. Throws `vt-flow.not-a-verifiable-service` when the peer fails the check. When no hook is configured, logs a warning and permits. A `purpose` is passed on the Validator side only, and lets a rejected peer through the ECS issuance exemption. */
|
|
178
|
+
checkIsVerifiableService(agentContext: AgentContext, connection: DidCommConnectionRecord, purpose?: VtFlowRequestPurpose): Promise<void>;
|
|
179
|
+
private isExemptFromVsConnVs;
|
|
132
180
|
}
|