@credo-ts/question-answer 0.7.2-pr-2704-20260918194459 → 0.7.2
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/QuestionAnswerApi.d.mts +1 -3
- package/build/QuestionAnswerApi.d.mts.map +1 -1
- package/build/QuestionAnswerApi.mjs +7 -9
- package/build/QuestionAnswerApi.mjs.map +1 -1
- package/build/QuestionAnswerEvents.d.mts +2 -4
- package/build/QuestionAnswerEvents.d.mts.map +1 -1
- package/build/QuestionAnswerEvents.mjs +1 -1
- package/build/QuestionAnswerEvents.mjs.map +1 -1
- package/build/QuestionAnswerModule.d.mts +1 -3
- package/build/QuestionAnswerModule.d.mts.map +1 -1
- package/build/QuestionAnswerModule.mjs +3 -4
- package/build/QuestionAnswerModule.mjs.map +1 -1
- package/build/QuestionAnswerRole.d.mts +1 -2
- package/build/QuestionAnswerRole.d.mts.map +1 -1
- package/build/QuestionAnswerRole.mjs +1 -1
- package/build/QuestionAnswerRole.mjs.map +1 -1
- package/build/_virtual/{_@oxc-project_runtime@0.112.0/helpers → _@oxc-project_runtime@0.151.0/helpers/esm}/decorate.mjs +2 -3
- package/build/_virtual/{_@oxc-project_runtime@0.112.0/helpers → _@oxc-project_runtime@0.151.0/helpers/esm}/decorateMetadata.mjs +2 -3
- package/build/_virtual/{_@oxc-project_runtime@0.112.0/helpers → _@oxc-project_runtime@0.151.0/helpers/esm}/decorateParam.mjs +2 -3
- package/build/handlers/AnswerMessageHandler.mjs +1 -2
- package/build/handlers/AnswerMessageHandler.mjs.map +1 -1
- package/build/handlers/QuestionMessageHandler.mjs +1 -2
- package/build/handlers/QuestionMessageHandler.mjs.map +1 -1
- package/build/handlers/index.mjs +1 -0
- package/build/index.mjs +1 -2
- package/build/messages/AnswerMessage.d.mts +2 -5
- package/build/messages/AnswerMessage.d.mts.map +1 -1
- package/build/messages/AnswerMessage.mjs +3 -4
- package/build/messages/AnswerMessage.mjs.map +1 -1
- package/build/messages/QuestionMessage.d.mts +2 -5
- package/build/messages/QuestionMessage.d.mts.map +1 -1
- package/build/messages/QuestionMessage.mjs +3 -4
- package/build/messages/QuestionMessage.mjs.map +1 -1
- package/build/messages/index.d.mts +2 -1
- package/build/messages/index.mjs +1 -0
- package/build/models/QuestionAnswerState.d.mts +1 -2
- package/build/models/QuestionAnswerState.d.mts.map +1 -1
- package/build/models/QuestionAnswerState.mjs +1 -1
- package/build/models/QuestionAnswerState.mjs.map +1 -1
- package/build/models/ValidResponse.d.mts +1 -2
- package/build/models/ValidResponse.d.mts.map +1 -1
- package/build/models/ValidResponse.mjs +1 -1
- package/build/models/ValidResponse.mjs.map +1 -1
- package/build/repository/QuestionAnswerRecord.d.mts +5 -7
- package/build/repository/QuestionAnswerRecord.d.mts.map +1 -1
- package/build/repository/QuestionAnswerRecord.mjs +1 -2
- package/build/repository/QuestionAnswerRecord.mjs.map +1 -1
- package/build/repository/QuestionAnswerRepository.d.mts +1 -3
- package/build/repository/QuestionAnswerRepository.d.mts.map +1 -1
- package/build/repository/QuestionAnswerRepository.mjs +5 -7
- package/build/repository/QuestionAnswerRepository.mjs.map +1 -1
- package/build/repository/index.d.mts +2 -1
- package/build/repository/index.mjs +1 -0
- package/build/services/QuestionAnswerService.d.mts +1 -3
- package/build/services/QuestionAnswerService.d.mts.map +1 -1
- package/build/services/QuestionAnswerService.mjs +21 -23
- package/build/services/QuestionAnswerService.mjs.map +1 -1
- package/build/services/index.d.mts +2 -1
- package/build/services/index.mjs +1 -0
- package/package.json +4 -4
|
@@ -5,9 +5,8 @@ import { QuestionAnswerService } from "./services/QuestionAnswerService.mjs";
|
|
|
5
5
|
import "./services/index.mjs";
|
|
6
6
|
import { DidCommConnectionService, DidCommMessageSender } from "@credo-ts/didcomm";
|
|
7
7
|
import { AgentContext, Query, QueryOptions } from "@credo-ts/core";
|
|
8
|
-
|
|
9
8
|
//#region src/QuestionAnswerApi.d.ts
|
|
10
|
-
declare class QuestionAnswerApi {
|
|
9
|
+
export declare class QuestionAnswerApi {
|
|
11
10
|
private questionAnswerService;
|
|
12
11
|
private messageSender;
|
|
13
12
|
private connectionService;
|
|
@@ -56,5 +55,4 @@ declare class QuestionAnswerApi {
|
|
|
56
55
|
findById(questionAnswerId: string): Promise<QuestionAnswerRecord | null>;
|
|
57
56
|
}
|
|
58
57
|
//#endregion
|
|
59
|
-
export { QuestionAnswerApi };
|
|
60
58
|
//# sourceMappingURL=QuestionAnswerApi.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerApi.d.mts","names":[],"sources":["../src/QuestionAnswerApi.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerApi.d.mts","names":[],"sources":["../src/QuestionAnswerApi.ts"],"mappings":";;;;;;;;qBAQa;UACH;UACA;UACA;UACA;EAGN,YAAA,uBAAuB,uBACvB,eAAe,sBACf,mBAAmB,0BACnB,cAAc;;;;;;;;;EAgBH,aACX,sBACA;IACE;IACA,gBAAgB;IAChB;MACD,QAAA;;;;;;;;EAgCU,WAAW,0BAA0B,mBAAgB,QAAA;;;;;;EA2B3D,UAAM,QAAA;;;;;;EASN,eAAe,OAAO,MAAM,uBAAuB,eAAe,eAAY,QAAA;;;;;;;;EAW9E,SAAS,2BAAwB,QAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import __decorateMetadata from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "./_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { ValidResponse } from "./models/ValidResponse.mjs";
|
|
4
4
|
import { QuestionAnswerService } from "./services/QuestionAnswerService.mjs";
|
|
5
5
|
import "./services/index.mjs";
|
|
6
6
|
import { DidCommConnectionService, DidCommMessageSender, getOutboundDidCommMessageContext } from "@credo-ts/didcomm";
|
|
7
7
|
import { AgentContext, injectable } from "@credo-ts/core";
|
|
8
|
-
|
|
9
8
|
//#region src/QuestionAnswerApi.ts
|
|
10
|
-
var _ref, _ref2, _ref3, _ref4;
|
|
11
9
|
let QuestionAnswerApi = class QuestionAnswerApi {
|
|
12
10
|
constructor(questionAnswerService, messageSender, connectionService, agentContext) {
|
|
13
11
|
this.questionAnswerService = questionAnswerService;
|
|
@@ -86,12 +84,12 @@ let QuestionAnswerApi = class QuestionAnswerApi {
|
|
|
86
84
|
}
|
|
87
85
|
};
|
|
88
86
|
QuestionAnswerApi = __decorate([injectable(), __decorateMetadata("design:paramtypes", [
|
|
89
|
-
typeof
|
|
90
|
-
typeof
|
|
91
|
-
typeof
|
|
92
|
-
typeof
|
|
87
|
+
typeof QuestionAnswerService === "undefined" ? Object : QuestionAnswerService,
|
|
88
|
+
typeof DidCommMessageSender === "undefined" ? Object : DidCommMessageSender,
|
|
89
|
+
typeof DidCommConnectionService === "undefined" ? Object : DidCommConnectionService,
|
|
90
|
+
typeof AgentContext === "undefined" ? Object : AgentContext
|
|
93
91
|
])], QuestionAnswerApi);
|
|
94
|
-
|
|
95
92
|
//#endregion
|
|
96
93
|
export { QuestionAnswerApi };
|
|
94
|
+
|
|
97
95
|
//# sourceMappingURL=QuestionAnswerApi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerApi.mjs","names":[],"sources":["../src/QuestionAnswerApi.ts"],"sourcesContent":["import type { Query, QueryOptions } from '@credo-ts/core'\nimport { AgentContext, injectable } from '@credo-ts/core'\nimport { DidCommConnectionService, DidCommMessageSender, getOutboundDidCommMessageContext } from '@credo-ts/didcomm'\nimport { ValidResponse } from './models'\nimport type { QuestionAnswerRecord } from './repository'\nimport { QuestionAnswerService } from './services'\n\n@injectable()\nexport class QuestionAnswerApi {\n private questionAnswerService: QuestionAnswerService\n private messageSender: DidCommMessageSender\n private connectionService: DidCommConnectionService\n private agentContext: AgentContext\n\n public constructor(\n questionAnswerService: QuestionAnswerService,\n messageSender: DidCommMessageSender,\n connectionService: DidCommConnectionService,\n agentContext: AgentContext\n ) {\n this.questionAnswerService = questionAnswerService\n this.messageSender = messageSender\n this.connectionService = connectionService\n this.agentContext = agentContext\n }\n\n /**\n * Create a question message with possible valid responses, then send message to the\n * holder\n *\n * @param connectionId connection to send the question message to\n * @param config config for creating question message\n * @returns QuestionAnswer record\n */\n public async sendQuestion(\n connectionId: string,\n config: {\n question: string\n validResponses: ValidResponse[]\n detail?: string\n }\n ) {\n const connection = await this.connectionService.getById(this.agentContext, connectionId)\n connection.assertReady()\n\n const { questionMessage, questionAnswerRecord } = await this.questionAnswerService.createQuestion(\n this.agentContext,\n connectionId,\n {\n question: config.question,\n validResponses: config.validResponses.map((item) => new ValidResponse(item)),\n detail: config?.detail,\n }\n )\n const outboundMessageContext = await getOutboundDidCommMessageContext(this.agentContext, {\n message: questionMessage,\n associatedRecord: questionAnswerRecord,\n connectionRecord: connection,\n })\n\n await this.messageSender.sendMessage(outboundMessageContext)\n\n return questionAnswerRecord\n }\n\n /**\n * Create an answer message as the holder and send it in response to a question message\n *\n * @param questionRecordId the id of the questionAnswer record\n * @param response response included in the answer message\n * @returns QuestionAnswer record\n */\n public async sendAnswer(questionRecordId: string, response: string) {\n const questionRecord = await this.questionAnswerService.getById(this.agentContext, questionRecordId)\n\n const { answerMessage, questionAnswerRecord } = await this.questionAnswerService.createAnswer(\n this.agentContext,\n questionRecord,\n response\n )\n\n const connection = await this.connectionService.getById(this.agentContext, questionRecord.connectionId)\n\n const outboundMessageContext = await getOutboundDidCommMessageContext(this.agentContext, {\n message: answerMessage,\n associatedRecord: questionAnswerRecord,\n connectionRecord: connection,\n })\n\n await this.messageSender.sendMessage(outboundMessageContext)\n\n return questionAnswerRecord\n }\n\n /**\n * Get all QuestionAnswer records\n *\n * @returns list containing all QuestionAnswer records\n */\n public getAll() {\n return this.questionAnswerService.getAll(this.agentContext)\n }\n\n /**\n * Get all QuestionAnswer records by specified query params\n *\n * @returns list containing all QuestionAnswer records matching specified query params\n */\n public findAllByQuery(query: Query<QuestionAnswerRecord>, queryOptions?: QueryOptions) {\n return this.questionAnswerService.findAllByQuery(this.agentContext, query, queryOptions)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public findById(questionAnswerId: string) {\n return this.questionAnswerService.findById(this.agentContext, questionAnswerId)\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerApi.mjs","names":[],"sources":["../src/QuestionAnswerApi.ts"],"sourcesContent":["import type { Query, QueryOptions } from '@credo-ts/core'\nimport { AgentContext, injectable } from '@credo-ts/core'\nimport { DidCommConnectionService, DidCommMessageSender, getOutboundDidCommMessageContext } from '@credo-ts/didcomm'\nimport { ValidResponse } from './models'\nimport type { QuestionAnswerRecord } from './repository'\nimport { QuestionAnswerService } from './services'\n\n@injectable()\nexport class QuestionAnswerApi {\n private questionAnswerService: QuestionAnswerService\n private messageSender: DidCommMessageSender\n private connectionService: DidCommConnectionService\n private agentContext: AgentContext\n\n public constructor(\n questionAnswerService: QuestionAnswerService,\n messageSender: DidCommMessageSender,\n connectionService: DidCommConnectionService,\n agentContext: AgentContext\n ) {\n this.questionAnswerService = questionAnswerService\n this.messageSender = messageSender\n this.connectionService = connectionService\n this.agentContext = agentContext\n }\n\n /**\n * Create a question message with possible valid responses, then send message to the\n * holder\n *\n * @param connectionId connection to send the question message to\n * @param config config for creating question message\n * @returns QuestionAnswer record\n */\n public async sendQuestion(\n connectionId: string,\n config: {\n question: string\n validResponses: ValidResponse[]\n detail?: string\n }\n ) {\n const connection = await this.connectionService.getById(this.agentContext, connectionId)\n connection.assertReady()\n\n const { questionMessage, questionAnswerRecord } = await this.questionAnswerService.createQuestion(\n this.agentContext,\n connectionId,\n {\n question: config.question,\n validResponses: config.validResponses.map((item) => new ValidResponse(item)),\n detail: config?.detail,\n }\n )\n const outboundMessageContext = await getOutboundDidCommMessageContext(this.agentContext, {\n message: questionMessage,\n associatedRecord: questionAnswerRecord,\n connectionRecord: connection,\n })\n\n await this.messageSender.sendMessage(outboundMessageContext)\n\n return questionAnswerRecord\n }\n\n /**\n * Create an answer message as the holder and send it in response to a question message\n *\n * @param questionRecordId the id of the questionAnswer record\n * @param response response included in the answer message\n * @returns QuestionAnswer record\n */\n public async sendAnswer(questionRecordId: string, response: string) {\n const questionRecord = await this.questionAnswerService.getById(this.agentContext, questionRecordId)\n\n const { answerMessage, questionAnswerRecord } = await this.questionAnswerService.createAnswer(\n this.agentContext,\n questionRecord,\n response\n )\n\n const connection = await this.connectionService.getById(this.agentContext, questionRecord.connectionId)\n\n const outboundMessageContext = await getOutboundDidCommMessageContext(this.agentContext, {\n message: answerMessage,\n associatedRecord: questionAnswerRecord,\n connectionRecord: connection,\n })\n\n await this.messageSender.sendMessage(outboundMessageContext)\n\n return questionAnswerRecord\n }\n\n /**\n * Get all QuestionAnswer records\n *\n * @returns list containing all QuestionAnswer records\n */\n public getAll() {\n return this.questionAnswerService.getAll(this.agentContext)\n }\n\n /**\n * Get all QuestionAnswer records by specified query params\n *\n * @returns list containing all QuestionAnswer records matching specified query params\n */\n public findAllByQuery(query: Query<QuestionAnswerRecord>, queryOptions?: QueryOptions) {\n return this.questionAnswerService.findAllByQuery(this.agentContext, query, queryOptions)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public findById(questionAnswerId: string) {\n return this.questionAnswerService.findById(this.agentContext, questionAnswerId)\n }\n}\n"],"mappings":";;;;;;;;AAQO,IAAM,oBAAN,MAAM,kBAAkB;CAM7B,YACE,uBACA,eACA,mBACA,cACA;EACA,KAAK,wBAAwB;EAC7B,KAAK,gBAAgB;EACrB,KAAK,oBAAoB;EACzB,KAAK,eAAe;CACtB;;;;;;;;;CAUA,MAAa,aACX,cACA,QAKA;EACA,MAAM,aAAa,MAAM,KAAK,kBAAkB,QAAQ,KAAK,cAAc,YAAY;EACvF,WAAW,YAAY;EAEvB,MAAM,EAAE,iBAAiB,yBAAyB,MAAM,KAAK,sBAAsB,eACjF,KAAK,cACL,cACA;GACE,UAAU,OAAO;GACjB,gBAAgB,OAAO,eAAe,KAAK,SAAS,IAAI,cAAc,IAAI,CAAC;GAC3E,QAAQ,QAAQ;EAClB,CACF;EACA,MAAM,yBAAyB,MAAM,iCAAiC,KAAK,cAAc;GACvF,SAAS;GACT,kBAAkB;GAClB,kBAAkB;EACpB,CAAC;EAED,MAAM,KAAK,cAAc,YAAY,sBAAsB;EAE3D,OAAO;CACT;;;;;;;;CASA,MAAa,WAAW,kBAA0B,UAAkB;EAClE,MAAM,iBAAiB,MAAM,KAAK,sBAAsB,QAAQ,KAAK,cAAc,gBAAgB;EAEnG,MAAM,EAAE,eAAe,yBAAyB,MAAM,KAAK,sBAAsB,aAC/E,KAAK,cACL,gBACA,QACF;EAEA,MAAM,aAAa,MAAM,KAAK,kBAAkB,QAAQ,KAAK,cAAc,eAAe,YAAY;EAEtG,MAAM,yBAAyB,MAAM,iCAAiC,KAAK,cAAc;GACvF,SAAS;GACT,kBAAkB;GAClB,kBAAkB;EACpB,CAAC;EAED,MAAM,KAAK,cAAc,YAAY,sBAAsB;EAE3D,OAAO;CACT;;;;;;CAOA,SAAgB;EACd,OAAO,KAAK,sBAAsB,OAAO,KAAK,YAAY;CAC5D;;;;;;CAOA,eAAsB,OAAoC,cAA6B;EACrF,OAAO,KAAK,sBAAsB,eAAe,KAAK,cAAc,OAAO,YAAY;CACzF;;;;;;;;CASA,SAAgB,kBAA0B;EACxC,OAAO,KAAK,sBAAsB,SAAS,KAAK,cAAc,gBAAgB;CAChF;AACF;AAnHC,oBAAA,WAAA,CAAA,WAAW,GAAA,mBAAA,qBAAA"}
|
|
@@ -2,12 +2,11 @@ import { QuestionAnswerState } from "./models/QuestionAnswerState.mjs";
|
|
|
2
2
|
import { QuestionAnswerRecord } from "./repository/QuestionAnswerRecord.mjs";
|
|
3
3
|
import "./repository/index.mjs";
|
|
4
4
|
import { BaseEvent } from "@credo-ts/core";
|
|
5
|
-
|
|
6
5
|
//#region src/QuestionAnswerEvents.d.ts
|
|
7
|
-
declare enum QuestionAnswerEventTypes {
|
|
6
|
+
export declare enum QuestionAnswerEventTypes {
|
|
8
7
|
QuestionAnswerStateChanged = "QuestionAnswerStateChanged"
|
|
9
8
|
}
|
|
10
|
-
interface QuestionAnswerStateChangedEvent extends BaseEvent {
|
|
9
|
+
export interface QuestionAnswerStateChangedEvent extends BaseEvent {
|
|
11
10
|
type: typeof QuestionAnswerEventTypes.QuestionAnswerStateChanged;
|
|
12
11
|
payload: {
|
|
13
12
|
previousState: QuestionAnswerState | null;
|
|
@@ -15,5 +14,4 @@ interface QuestionAnswerStateChangedEvent extends BaseEvent {
|
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
//#endregion
|
|
18
|
-
export { QuestionAnswerEventTypes, QuestionAnswerStateChangedEvent };
|
|
19
17
|
//# sourceMappingURL=QuestionAnswerEvents.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerEvents.d.mts","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerEvents.d.mts","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"mappings":";;;;;oBAIY;EACV;;iBAEe,wCAAwC;EACvD,aAAa,yBAAyB;EACtC;IACE,eAAe;IACf,sBAAsB"}
|
|
@@ -3,7 +3,7 @@ let QuestionAnswerEventTypes = /* @__PURE__ */ function(QuestionAnswerEventTypes
|
|
|
3
3
|
QuestionAnswerEventTypes["QuestionAnswerStateChanged"] = "QuestionAnswerStateChanged";
|
|
4
4
|
return QuestionAnswerEventTypes;
|
|
5
5
|
}({});
|
|
6
|
-
|
|
7
6
|
//#endregion
|
|
8
7
|
export { QuestionAnswerEventTypes };
|
|
8
|
+
|
|
9
9
|
//# sourceMappingURL=QuestionAnswerEvents.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerEvents.mjs","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"sourcesContent":["import type { BaseEvent } from '@credo-ts/core'\nimport type { QuestionAnswerState } from './models'\nimport type { QuestionAnswerRecord } from './repository'\n\nexport enum QuestionAnswerEventTypes {\n QuestionAnswerStateChanged = 'QuestionAnswerStateChanged',\n}\nexport interface QuestionAnswerStateChangedEvent extends BaseEvent {\n type: typeof QuestionAnswerEventTypes.QuestionAnswerStateChanged\n payload: {\n previousState: QuestionAnswerState | null\n questionAnswerRecord: QuestionAnswerRecord\n }\n}\n"],"mappings":";AAIA,IAAY,
|
|
1
|
+
{"version":3,"file":"QuestionAnswerEvents.mjs","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"sourcesContent":["import type { BaseEvent } from '@credo-ts/core'\nimport type { QuestionAnswerState } from './models'\nimport type { QuestionAnswerRecord } from './repository'\n\nexport enum QuestionAnswerEventTypes {\n QuestionAnswerStateChanged = 'QuestionAnswerStateChanged',\n}\nexport interface QuestionAnswerStateChangedEvent extends BaseEvent {\n type: typeof QuestionAnswerEventTypes.QuestionAnswerStateChanged\n payload: {\n previousState: QuestionAnswerState | null\n questionAnswerRecord: QuestionAnswerRecord\n }\n}\n"],"mappings":";AAIA,IAAY,2BAAL,yBAAA,0BAAA;CACL,yBAAA,gCAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { QuestionAnswerApi } from "./QuestionAnswerApi.mjs";
|
|
2
2
|
import { AgentContext, DependencyManager, Module } from "@credo-ts/core";
|
|
3
|
-
|
|
4
3
|
//#region src/QuestionAnswerModule.d.ts
|
|
5
|
-
declare class QuestionAnswerModule implements Module {
|
|
4
|
+
export declare class QuestionAnswerModule implements Module {
|
|
6
5
|
readonly api: typeof QuestionAnswerApi;
|
|
7
6
|
/**
|
|
8
7
|
* Registers the dependencies of the question answer module on the dependency manager.
|
|
@@ -11,5 +10,4 @@ declare class QuestionAnswerModule implements Module {
|
|
|
11
10
|
initialize(agentContext: AgentContext): Promise<void>;
|
|
12
11
|
}
|
|
13
12
|
//#endregion
|
|
14
|
-
export { QuestionAnswerModule };
|
|
15
13
|
//# sourceMappingURL=QuestionAnswerModule.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerModule.d.mts","names":[],"sources":["../src/QuestionAnswerModule.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerModule.d.mts","names":[],"sources":["../src/QuestionAnswerModule.ts"],"mappings":";;;qBASa,gCAAgC;WAC3B,YAAG;;;;EAKZ,SAAS,mBAAmB;EAQtB,WAAW,cAAc,eAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./QuestionAnswerRole.mjs";
|
|
2
2
|
import { QuestionAnswerRepository } from "./repository/QuestionAnswerRepository.mjs";
|
|
3
3
|
import "./repository/index.mjs";
|
|
4
4
|
import { QuestionAnswerService } from "./services/QuestionAnswerService.mjs";
|
|
@@ -8,7 +8,6 @@ import { AnswerMessageHandler } from "./handlers/AnswerMessageHandler.mjs";
|
|
|
8
8
|
import { QuestionMessageHandler } from "./handlers/QuestionMessageHandler.mjs";
|
|
9
9
|
import "./handlers/index.mjs";
|
|
10
10
|
import { DidCommFeatureRegistry, DidCommMessageHandlerRegistry, DidCommProtocol } from "@credo-ts/didcomm";
|
|
11
|
-
|
|
12
11
|
//#region src/QuestionAnswerModule.ts
|
|
13
12
|
var QuestionAnswerModule = class {
|
|
14
13
|
constructor() {
|
|
@@ -28,11 +27,11 @@ var QuestionAnswerModule = class {
|
|
|
28
27
|
messageHandlerRegistry.registerMessageHandlers([new QuestionMessageHandler(questionAnswerService), new AnswerMessageHandler(questionAnswerService)]);
|
|
29
28
|
featureRegistry.register(new DidCommProtocol({
|
|
30
29
|
id: "https://didcomm.org/questionanswer/1.0",
|
|
31
|
-
roles: [
|
|
30
|
+
roles: ["questioner", "responder"]
|
|
32
31
|
}));
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
35
|
export { QuestionAnswerModule };
|
|
36
|
+
|
|
38
37
|
//# sourceMappingURL=QuestionAnswerModule.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerModule.mjs","names":[],"sources":["../src/QuestionAnswerModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager, Module } from '@credo-ts/core'\n\nimport { DidCommFeatureRegistry, DidCommMessageHandlerRegistry, DidCommProtocol } from '@credo-ts/didcomm'\nimport { AnswerMessageHandler, QuestionMessageHandler } from './handlers'\nimport { QuestionAnswerApi } from './QuestionAnswerApi'\nimport { QuestionAnswerRole } from './QuestionAnswerRole'\nimport { QuestionAnswerRepository } from './repository'\nimport { QuestionAnswerService } from './services'\n\nexport class QuestionAnswerModule implements Module {\n public readonly api = QuestionAnswerApi\n\n /**\n * Registers the dependencies of the question answer module on the dependency manager.\n */\n public register(dependencyManager: DependencyManager) {\n // Services\n dependencyManager.registerSingleton(QuestionAnswerService)\n\n // Repositories\n dependencyManager.registerSingleton(QuestionAnswerRepository)\n }\n\n public async initialize(agentContext: AgentContext) {\n // Feature Registry\n const featureRegistry = agentContext.dependencyManager.resolve(DidCommFeatureRegistry)\n const messageHandlerRegistry = agentContext.resolve(DidCommMessageHandlerRegistry)\n const questionAnswerService = agentContext.resolve(QuestionAnswerService)\n\n messageHandlerRegistry.registerMessageHandlers([\n new QuestionMessageHandler(questionAnswerService),\n new AnswerMessageHandler(questionAnswerService),\n ])\n\n featureRegistry.register(\n new DidCommProtocol({\n id: 'https://didcomm.org/questionanswer/1.0',\n roles: [QuestionAnswerRole.Questioner, QuestionAnswerRole.Responder],\n })\n )\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerModule.mjs","names":[],"sources":["../src/QuestionAnswerModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager, Module } from '@credo-ts/core'\n\nimport { DidCommFeatureRegistry, DidCommMessageHandlerRegistry, DidCommProtocol } from '@credo-ts/didcomm'\nimport { AnswerMessageHandler, QuestionMessageHandler } from './handlers'\nimport { QuestionAnswerApi } from './QuestionAnswerApi'\nimport { QuestionAnswerRole } from './QuestionAnswerRole'\nimport { QuestionAnswerRepository } from './repository'\nimport { QuestionAnswerService } from './services'\n\nexport class QuestionAnswerModule implements Module {\n public readonly api = QuestionAnswerApi\n\n /**\n * Registers the dependencies of the question answer module on the dependency manager.\n */\n public register(dependencyManager: DependencyManager) {\n // Services\n dependencyManager.registerSingleton(QuestionAnswerService)\n\n // Repositories\n dependencyManager.registerSingleton(QuestionAnswerRepository)\n }\n\n public async initialize(agentContext: AgentContext) {\n // Feature Registry\n const featureRegistry = agentContext.dependencyManager.resolve(DidCommFeatureRegistry)\n const messageHandlerRegistry = agentContext.resolve(DidCommMessageHandlerRegistry)\n const questionAnswerService = agentContext.resolve(QuestionAnswerService)\n\n messageHandlerRegistry.registerMessageHandlers([\n new QuestionMessageHandler(questionAnswerService),\n new AnswerMessageHandler(questionAnswerService),\n ])\n\n featureRegistry.register(\n new DidCommProtocol({\n id: 'https://didcomm.org/questionanswer/1.0',\n roles: [QuestionAnswerRole.Questioner, QuestionAnswerRole.Responder],\n })\n )\n }\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAa,uBAAb,MAAoD;;EAClD,KAAgB,MAAM;;;;;CAKtB,SAAgB,mBAAsC;EAEpD,kBAAkB,kBAAkB,qBAAqB;EAGzD,kBAAkB,kBAAkB,wBAAwB;CAC9D;CAEA,MAAa,WAAW,cAA4B;EAElD,MAAM,kBAAkB,aAAa,kBAAkB,QAAQ,sBAAsB;EACrF,MAAM,yBAAyB,aAAa,QAAQ,6BAA6B;EACjF,MAAM,wBAAwB,aAAa,QAAQ,qBAAqB;EAExE,uBAAuB,wBAAwB,CAC7C,IAAI,uBAAuB,qBAAqB,GAChD,IAAI,qBAAqB,qBAAqB,CAChD,CAAC;EAED,gBAAgB,SACd,IAAI,gBAAgB;GAClB,IAAI;GACJ,OAAO,CAAA,cAAA,WAA4D;EACrE,CAAC,CACH;CACF;AACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
//#region src/QuestionAnswerRole.d.ts
|
|
2
|
-
declare enum QuestionAnswerRole {
|
|
2
|
+
export declare enum QuestionAnswerRole {
|
|
3
3
|
Questioner = "questioner",
|
|
4
4
|
Responder = "responder"
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
export { QuestionAnswerRole };
|
|
8
7
|
//# sourceMappingURL=QuestionAnswerRole.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRole.d.mts","names":[],"sources":["../src/QuestionAnswerRole.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRole.d.mts","names":[],"sources":["../src/QuestionAnswerRole.ts"],"mappings":";oBAAY;EACV;EACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRole.mjs","names":[],"sources":["../src/QuestionAnswerRole.ts"],"sourcesContent":["export enum QuestionAnswerRole {\n Questioner = 'questioner',\n Responder = 'responder',\n}\n"],"mappings":";AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRole.mjs","names":[],"sources":["../src/QuestionAnswerRole.ts"],"sourcesContent":["export enum QuestionAnswerRole {\n Questioner = 'questioner',\n Responder = 'responder',\n}\n"],"mappings":";AAAA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,gBAAA;CACA,mBAAA,eAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
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
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
//#endregion
|
|
10
|
-
export { __decorate };
|
|
9
|
+
export { __decorate as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
2
2
|
function __decorateMetadata(k, v) {
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
5
|
//#endregion
|
|
7
|
-
export { __decorateMetadata };
|
|
6
|
+
export { __decorateMetadata as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateParam.js
|
|
2
2
|
function __decorateParam(paramIndex, decorator) {
|
|
3
3
|
return function(target, key) {
|
|
4
4
|
decorator(target, key, paramIndex);
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
//#endregion
|
|
9
|
-
export { __decorateParam };
|
|
8
|
+
export { __decorateParam as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AnswerMessage } from "../messages/AnswerMessage.mjs";
|
|
2
2
|
import "../messages/index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/handlers/AnswerMessageHandler.ts
|
|
5
4
|
var AnswerMessageHandler = class {
|
|
6
5
|
constructor(questionAnswerService) {
|
|
@@ -11,7 +10,7 @@ var AnswerMessageHandler = class {
|
|
|
11
10
|
await this.questionAnswerService.receiveAnswer(messageContext);
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
export { AnswerMessageHandler };
|
|
15
|
+
|
|
17
16
|
//# sourceMappingURL=AnswerMessageHandler.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswerMessageHandler.mjs","names":[],"sources":["../../src/handlers/AnswerMessageHandler.ts"],"sourcesContent":["import type { DidCommMessageHandler, DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport { AnswerMessage } from '../messages'\nimport type { QuestionAnswerService } from '../services'\n\nexport class AnswerMessageHandler implements DidCommMessageHandler {\n private questionAnswerService: QuestionAnswerService\n public supportedMessages = [AnswerMessage]\n\n public constructor(questionAnswerService: QuestionAnswerService) {\n this.questionAnswerService = questionAnswerService\n }\n\n public async handle(messageContext: DidCommMessageHandlerInboundMessage<AnswerMessageHandler>) {\n await this.questionAnswerService.receiveAnswer(messageContext)\n\n return undefined\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnswerMessageHandler.mjs","names":[],"sources":["../../src/handlers/AnswerMessageHandler.ts"],"sourcesContent":["import type { DidCommMessageHandler, DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport { AnswerMessage } from '../messages'\nimport type { QuestionAnswerService } from '../services'\n\nexport class AnswerMessageHandler implements DidCommMessageHandler {\n private questionAnswerService: QuestionAnswerService\n public supportedMessages = [AnswerMessage]\n\n public constructor(questionAnswerService: QuestionAnswerService) {\n this.questionAnswerService = questionAnswerService\n }\n\n public async handle(messageContext: DidCommMessageHandlerInboundMessage<AnswerMessageHandler>) {\n await this.questionAnswerService.receiveAnswer(messageContext)\n\n return undefined\n }\n}\n"],"mappings":";;;AAIA,IAAa,uBAAb,MAAmE;CAIjE,YAAmB,uBAA8C;EAFjE,KAAO,oBAAoB,CAAC,aAAa;EAGvC,KAAK,wBAAwB;CAC/B;CAEA,MAAa,OAAO,gBAA2E;EAC7F,MAAM,KAAK,sBAAsB,cAAc,cAAc;CAG/D;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { QuestionMessage } from "../messages/QuestionMessage.mjs";
|
|
2
2
|
import "../messages/index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/handlers/QuestionMessageHandler.ts
|
|
5
4
|
var QuestionMessageHandler = class {
|
|
6
5
|
constructor(questionAnswerService) {
|
|
@@ -11,7 +10,7 @@ var QuestionMessageHandler = class {
|
|
|
11
10
|
await this.questionAnswerService.processReceiveQuestion(messageContext);
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
//#endregion
|
|
16
14
|
export { QuestionMessageHandler };
|
|
15
|
+
|
|
17
16
|
//# sourceMappingURL=QuestionMessageHandler.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionMessageHandler.mjs","names":[],"sources":["../../src/handlers/QuestionMessageHandler.ts"],"sourcesContent":["import type { DidCommMessageHandler, DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport { QuestionMessage } from '../messages'\nimport type { QuestionAnswerService } from '../services'\n\nexport class QuestionMessageHandler implements DidCommMessageHandler {\n private questionAnswerService: QuestionAnswerService\n public supportedMessages = [QuestionMessage]\n\n public constructor(questionAnswerService: QuestionAnswerService) {\n this.questionAnswerService = questionAnswerService\n }\n\n public async handle(messageContext: DidCommMessageHandlerInboundMessage<QuestionMessageHandler>) {\n await this.questionAnswerService.processReceiveQuestion(messageContext)\n\n return undefined\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionMessageHandler.mjs","names":[],"sources":["../../src/handlers/QuestionMessageHandler.ts"],"sourcesContent":["import type { DidCommMessageHandler, DidCommMessageHandlerInboundMessage } from '@credo-ts/didcomm'\nimport { QuestionMessage } from '../messages'\nimport type { QuestionAnswerService } from '../services'\n\nexport class QuestionMessageHandler implements DidCommMessageHandler {\n private questionAnswerService: QuestionAnswerService\n public supportedMessages = [QuestionMessage]\n\n public constructor(questionAnswerService: QuestionAnswerService) {\n this.questionAnswerService = questionAnswerService\n }\n\n public async handle(messageContext: DidCommMessageHandlerInboundMessage<QuestionMessageHandler>) {\n await this.questionAnswerService.processReceiveQuestion(messageContext)\n\n return undefined\n }\n}\n"],"mappings":";;;AAIA,IAAa,yBAAb,MAAqE;CAInE,YAAmB,uBAA8C;EAFjE,KAAO,oBAAoB,CAAC,eAAe;EAGzC,KAAK,wBAAwB;CAC/B;CAEA,MAAa,OAAO,gBAA6E;EAC/F,MAAM,KAAK,sBAAsB,uBAAuB,cAAc;CAGxE;AACF"}
|
package/build/handlers/index.mjs
CHANGED
package/build/index.mjs
CHANGED
|
@@ -12,5 +12,4 @@ import { QuestionAnswerService } from "./services/QuestionAnswerService.mjs";
|
|
|
12
12
|
import "./services/index.mjs";
|
|
13
13
|
import { QuestionAnswerApi } from "./QuestionAnswerApi.mjs";
|
|
14
14
|
import { QuestionAnswerModule } from "./QuestionAnswerModule.mjs";
|
|
15
|
-
|
|
16
|
-
export { AnswerMessage, QuestionAnswerApi, QuestionAnswerEventTypes, QuestionAnswerModule, QuestionAnswerRecord, QuestionAnswerRepository, QuestionAnswerRole, QuestionAnswerService, QuestionAnswerState, QuestionMessage, ValidResponse };
|
|
15
|
+
export { AnswerMessage, QuestionAnswerApi, QuestionAnswerEventTypes, QuestionAnswerModule, QuestionAnswerRecord, QuestionAnswerRepository, QuestionAnswerRole, QuestionAnswerService, QuestionAnswerState, QuestionMessage, ValidResponse };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
|
|
2
1
|
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
3
|
-
|
|
4
2
|
//#region src/messages/AnswerMessage.d.ts
|
|
5
|
-
declare class AnswerMessage extends DidCommMessage {
|
|
3
|
+
export declare class AnswerMessage extends DidCommMessage {
|
|
6
4
|
/**
|
|
7
5
|
* Create new AnswerMessage instance.
|
|
8
6
|
* @param options
|
|
@@ -13,9 +11,8 @@ declare class AnswerMessage extends DidCommMessage {
|
|
|
13
11
|
threadId: string;
|
|
14
12
|
});
|
|
15
13
|
readonly type: string;
|
|
16
|
-
static readonly type:
|
|
14
|
+
static readonly type: import("@credo-ts/didcomm").ParsedMessageType;
|
|
17
15
|
response: string;
|
|
18
16
|
}
|
|
19
17
|
//#endregion
|
|
20
|
-
export { AnswerMessage };
|
|
21
18
|
//# sourceMappingURL=AnswerMessage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswerMessage.d.mts","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnswerMessage.d.mts","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"mappings":";;qBAIa,sBAAsB;;;;;EAKd,YAAA;IAAW;IAAa;IAAkB;;WAW7C;kBACO,kCAAI;EAIpB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
4
4
|
import { Expose } from "class-transformer";
|
|
5
5
|
import { IsString } from "class-validator";
|
|
6
|
-
|
|
7
6
|
//#region src/messages/AnswerMessage.ts
|
|
8
7
|
var AnswerMessage = class AnswerMessage extends DidCommMessage {
|
|
9
8
|
/**
|
|
@@ -27,7 +26,7 @@ __decorate([
|
|
|
27
26
|
IsString(),
|
|
28
27
|
__decorateMetadata("design:type", String)
|
|
29
28
|
], AnswerMessage.prototype, "response", void 0);
|
|
30
|
-
|
|
31
29
|
//#endregion
|
|
32
30
|
export { AnswerMessage };
|
|
31
|
+
|
|
33
32
|
//# sourceMappingURL=AnswerMessage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnswerMessage.mjs","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { Expose } from 'class-transformer'\nimport { IsString } from 'class-validator'\n\nexport class AnswerMessage extends DidCommMessage {\n /**\n * Create new AnswerMessage instance.\n * @param options\n */\n public constructor(options: { id?: string; response: string; threadId: string }) {\n super()\n\n if (options) {\n this.id = options.id || this.generateId()\n this.setThread({ threadId: options.threadId })\n this.response = options.response\n }\n }\n\n @IsValidMessageType(AnswerMessage.type)\n public readonly type = AnswerMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/questionanswer/1.0/answer')\n\n @Expose({ name: 'response' })\n @IsString()\n public response!: string\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnswerMessage.mjs","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { Expose } from 'class-transformer'\nimport { IsString } from 'class-validator'\n\nexport class AnswerMessage extends DidCommMessage {\n /**\n * Create new AnswerMessage instance.\n * @param options\n */\n public constructor(options: { id?: string; response: string; threadId: string }) {\n super()\n\n if (options) {\n this.id = options.id || this.generateId()\n this.setThread({ threadId: options.threadId })\n this.response = options.response\n }\n }\n\n @IsValidMessageType(AnswerMessage.type)\n public readonly type = AnswerMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/questionanswer/1.0/answer')\n\n @Expose({ name: 'response' })\n @IsString()\n public response!: string\n}\n"],"mappings":";;;;;;AAIA,IAAa,gBAAb,MAAa,sBAAsB,eAAe;;;;;CAKhD,YAAmB,SAA8D;EAC/E,MAAM;EASR,KACgB,OAAO,cAAc,KAAK;EARxC,IAAI,SAAS;GACX,KAAK,KAAK,QAAQ,MAAM,KAAK,WAAW;GACxC,KAAK,UAAU,EAAE,UAAU,QAAQ,SAAS,CAAC;GAC7C,KAAK,WAAW,QAAQ;EAC1B;CACF;AASF;AALE,cAAuB,OAAO,iBAAiB,+CAA+C;AAF7F,WAAA,CAAA,mBAAmB,cAAc,IAAI,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,cAAA,WAAA,QAAA,KAAA,CAAA;;CAIrC,OAAO,EAAE,MAAM,WAAW,CAAC;CAC3B,SAAS"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ValidResponse } from "../models/ValidResponse.mjs";
|
|
2
|
-
import * as _credo_ts_didcomm0 from "@credo-ts/didcomm";
|
|
3
2
|
import { DidCommMessage } from "@credo-ts/didcomm";
|
|
4
|
-
|
|
5
3
|
//#region src/messages/QuestionMessage.d.ts
|
|
6
|
-
declare class QuestionMessage extends DidCommMessage {
|
|
4
|
+
export declare class QuestionMessage extends DidCommMessage {
|
|
7
5
|
/**
|
|
8
6
|
* Create new QuestionMessage instance.
|
|
9
7
|
* @param options
|
|
@@ -17,7 +15,7 @@ declare class QuestionMessage extends DidCommMessage {
|
|
|
17
15
|
nonce?: string;
|
|
18
16
|
});
|
|
19
17
|
readonly type: string;
|
|
20
|
-
static readonly type:
|
|
18
|
+
static readonly type: import("@credo-ts/didcomm").ParsedMessageType;
|
|
21
19
|
nonce?: string;
|
|
22
20
|
signatureRequired?: boolean;
|
|
23
21
|
validResponses: ValidResponse[];
|
|
@@ -25,5 +23,4 @@ declare class QuestionMessage extends DidCommMessage {
|
|
|
25
23
|
questionDetail?: string;
|
|
26
24
|
}
|
|
27
25
|
//#endregion
|
|
28
|
-
export { QuestionMessage };
|
|
29
26
|
//# sourceMappingURL=QuestionMessage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionMessage.d.mts","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionMessage.d.mts","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"mappings":";;;qBAMa,wBAAwB;;;;;EAKhB,YAAA;IACjB;IACA;IACA,gBAAgB;IAChB;IACA;IACA;;WAec;kBACO,kCAAI;EAIpB;EAKA;EAMA,gBAAiB;EAIjB;EAKA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { ValidResponse } from "../models/ValidResponse.mjs";
|
|
4
4
|
import { DidCommMessage, IsValidMessageType, parseMessageType } from "@credo-ts/didcomm";
|
|
5
5
|
import { Expose, Type } from "class-transformer";
|
|
6
6
|
import { IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
7
|
-
|
|
8
7
|
//#region src/messages/QuestionMessage.ts
|
|
9
8
|
var QuestionMessage = class QuestionMessage extends DidCommMessage {
|
|
10
9
|
/**
|
|
@@ -55,7 +54,7 @@ __decorate([
|
|
|
55
54
|
IsString(),
|
|
56
55
|
__decorateMetadata("design:type", String)
|
|
57
56
|
], QuestionMessage.prototype, "questionDetail", void 0);
|
|
58
|
-
|
|
59
57
|
//#endregion
|
|
60
58
|
export { QuestionMessage };
|
|
59
|
+
|
|
61
60
|
//# sourceMappingURL=QuestionMessage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionMessage.mjs","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { Expose, Type } from 'class-transformer'\nimport { IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator'\n\nimport { ValidResponse } from '../models'\n\nexport class QuestionMessage extends DidCommMessage {\n /**\n * Create new QuestionMessage instance.\n * @param options\n */\n public constructor(options: {\n questionText: string\n questionDetail?: string\n validResponses: ValidResponse[]\n signatureRequired?: boolean\n id?: string\n nonce?: string\n }) {\n super()\n\n if (options) {\n this.id = options.id || this.generateId()\n this.nonce = options.nonce\n this.questionText = options.questionText\n this.questionDetail = options.questionDetail\n this.signatureRequired = options.signatureRequired\n this.validResponses = options.validResponses\n }\n }\n\n @IsValidMessageType(QuestionMessage.type)\n public readonly type = QuestionMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/questionanswer/1.0/question')\n\n @IsOptional()\n @IsString()\n public nonce?: string\n\n @IsOptional()\n @IsBoolean()\n @Expose({ name: 'signature_required' })\n public signatureRequired?: boolean\n\n @Expose({ name: 'valid_responses' })\n @Type(() => ValidResponse)\n @ValidateNested({ each: true })\n @IsInstance(ValidResponse, { each: true })\n public validResponses!: ValidResponse[]\n\n @Expose({ name: 'question_text' })\n @IsString()\n public questionText!: string\n\n @IsOptional()\n @Expose({ name: 'question_detail' })\n @IsString()\n public questionDetail?: string\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionMessage.mjs","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"sourcesContent":["import { DidCommMessage, IsValidMessageType, parseMessageType } from '@credo-ts/didcomm'\nimport { Expose, Type } from 'class-transformer'\nimport { IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from 'class-validator'\n\nimport { ValidResponse } from '../models'\n\nexport class QuestionMessage extends DidCommMessage {\n /**\n * Create new QuestionMessage instance.\n * @param options\n */\n public constructor(options: {\n questionText: string\n questionDetail?: string\n validResponses: ValidResponse[]\n signatureRequired?: boolean\n id?: string\n nonce?: string\n }) {\n super()\n\n if (options) {\n this.id = options.id || this.generateId()\n this.nonce = options.nonce\n this.questionText = options.questionText\n this.questionDetail = options.questionDetail\n this.signatureRequired = options.signatureRequired\n this.validResponses = options.validResponses\n }\n }\n\n @IsValidMessageType(QuestionMessage.type)\n public readonly type = QuestionMessage.type.messageTypeUri\n public static readonly type = parseMessageType('https://didcomm.org/questionanswer/1.0/question')\n\n @IsOptional()\n @IsString()\n public nonce?: string\n\n @IsOptional()\n @IsBoolean()\n @Expose({ name: 'signature_required' })\n public signatureRequired?: boolean\n\n @Expose({ name: 'valid_responses' })\n @Type(() => ValidResponse)\n @ValidateNested({ each: true })\n @IsInstance(ValidResponse, { each: true })\n public validResponses!: ValidResponse[]\n\n @Expose({ name: 'question_text' })\n @IsString()\n public questionText!: string\n\n @IsOptional()\n @Expose({ name: 'question_detail' })\n @IsString()\n public questionDetail?: string\n}\n"],"mappings":";;;;;;;AAMA,IAAa,kBAAb,MAAa,wBAAwB,eAAe;;;;;CAKlD,YAAmB,SAOhB;EACD,MAAM;EAYR,KACgB,OAAO,gBAAgB,KAAK;EAX1C,IAAI,SAAS;GACX,KAAK,KAAK,QAAQ,MAAM,KAAK,WAAW;GACxC,KAAK,QAAQ,QAAQ;GACrB,KAAK,eAAe,QAAQ;GAC5B,KAAK,iBAAiB,QAAQ;GAC9B,KAAK,oBAAoB,QAAQ;GACjC,KAAK,iBAAiB,QAAQ;EAChC;CACF;AA6BF;AAzBE,gBAAuB,OAAO,iBAAiB,iDAAiD;AAF/F,WAAA,CAAA,mBAAmB,gBAAgB,IAAI,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,gBAAA,WAAA,QAAA,KAAA,CAAA;;CAIvC,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,UAAU;CACV,OAAO,EAAE,MAAM,qBAAqB,CAAC;;;;CAGrC,OAAO,EAAE,MAAM,kBAAkB,CAAC;CAClC,WAAW,aAAa;CACxB,eAAe,EAAE,MAAM,KAAK,CAAC;CAC7B,WAAW,eAAe,EAAE,MAAM,KAAK,CAAC;;;;CAGxC,OAAO,EAAE,MAAM,gBAAgB,CAAC;CAChC,SAAS;;;;CAGT,WAAW;CACX,OAAO,EAAE,MAAM,kBAAkB,CAAC;CAClC,SAAS"}
|
package/build/messages/index.mjs
CHANGED
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md
|
|
6
6
|
*/
|
|
7
|
-
declare enum QuestionAnswerState {
|
|
7
|
+
export declare enum QuestionAnswerState {
|
|
8
8
|
QuestionSent = "question-sent",
|
|
9
9
|
QuestionReceived = "question-received",
|
|
10
10
|
AnswerReceived = "answer-received",
|
|
11
11
|
AnswerSent = "answer-sent"
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { QuestionAnswerState };
|
|
15
14
|
//# sourceMappingURL=QuestionAnswerState.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerState.d.mts","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerState.d.mts","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"mappings":";;;;;;oBAKY;EACV;EACA;EACA;EACA"}
|
|
@@ -11,7 +11,7 @@ let QuestionAnswerState = /* @__PURE__ */ function(QuestionAnswerState) {
|
|
|
11
11
|
QuestionAnswerState["AnswerSent"] = "answer-sent";
|
|
12
12
|
return QuestionAnswerState;
|
|
13
13
|
}({});
|
|
14
|
-
|
|
15
14
|
//#endregion
|
|
16
15
|
export { QuestionAnswerState };
|
|
16
|
+
|
|
17
17
|
//# sourceMappingURL=QuestionAnswerState.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerState.mjs","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"sourcesContent":["/**\n * QuestionAnswer states inferred from RFC 0113.\n *\n * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md\n */\nexport enum QuestionAnswerState {\n QuestionSent = 'question-sent',\n QuestionReceived = 'question-received',\n AnswerReceived = 'answer-received',\n AnswerSent = 'answer-sent',\n}\n"],"mappings":";;;;;;AAKA,IAAY,
|
|
1
|
+
{"version":3,"file":"QuestionAnswerState.mjs","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"sourcesContent":["/**\n * QuestionAnswer states inferred from RFC 0113.\n *\n * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md\n */\nexport enum QuestionAnswerState {\n QuestionSent = 'question-sent',\n QuestionReceived = 'question-received',\n AnswerReceived = 'answer-received',\n AnswerSent = 'answer-sent',\n}\n"],"mappings":";;;;;;AAKA,IAAY,sBAAL,yBAAA,qBAAA;CACL,oBAAA,kBAAA;CACA,oBAAA,sBAAA;CACA,oBAAA,oBAAA;CACA,oBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidResponse.d.mts","names":[],"sources":["../../src/models/ValidResponse.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"ValidResponse.d.mts","names":[],"sources":["../../src/models/ValidResponse.ts"],"mappings":";qBAAa;EACQ,YAAA,SAAS;EAMrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidResponse.mjs","names":[],"sources":["../../src/models/ValidResponse.ts"],"sourcesContent":["export class ValidResponse {\n public constructor(options: ValidResponse) {\n if (options) {\n this.text = options.text\n }\n }\n\n public text!: string\n}\n"],"mappings":";AAAA,IAAa,gBAAb,MAA2B;CACzB,
|
|
1
|
+
{"version":3,"file":"ValidResponse.mjs","names":[],"sources":["../../src/models/ValidResponse.ts"],"sourcesContent":["export class ValidResponse {\n public constructor(options: ValidResponse) {\n if (options) {\n this.text = options.text\n }\n }\n\n public text!: string\n}\n"],"mappings":";AAAA,IAAa,gBAAb,MAA2B;CACzB,YAAmB,SAAwB;EACzC,IAAI,SACF,KAAK,OAAO,QAAQ;CAExB;AAGF"}
|
|
@@ -2,17 +2,16 @@ import { QuestionAnswerState } from "../models/QuestionAnswerState.mjs";
|
|
|
2
2
|
import { ValidResponse } from "../models/ValidResponse.mjs";
|
|
3
3
|
import { QuestionAnswerRole } from "../QuestionAnswerRole.mjs";
|
|
4
4
|
import { BaseRecord, RecordTags, TagsBase } from "@credo-ts/core";
|
|
5
|
-
|
|
6
5
|
//#region src/repository/QuestionAnswerRecord.d.ts
|
|
7
|
-
type CustomQuestionAnswerTags = TagsBase;
|
|
8
|
-
type DefaultQuestionAnswerTags = {
|
|
6
|
+
export type CustomQuestionAnswerTags = TagsBase;
|
|
7
|
+
export type DefaultQuestionAnswerTags = {
|
|
9
8
|
connectionId: string;
|
|
10
9
|
role: QuestionAnswerRole;
|
|
11
10
|
state: QuestionAnswerState;
|
|
12
11
|
threadId: string;
|
|
13
12
|
};
|
|
14
|
-
type QuestionAnswerTags = RecordTags<QuestionAnswerRecord>;
|
|
15
|
-
interface QuestionAnswerStorageProps {
|
|
13
|
+
export type QuestionAnswerTags = RecordTags<QuestionAnswerRecord>;
|
|
14
|
+
export interface QuestionAnswerStorageProps {
|
|
16
15
|
id?: string;
|
|
17
16
|
createdAt?: Date;
|
|
18
17
|
connectionId: string;
|
|
@@ -26,7 +25,7 @@ interface QuestionAnswerStorageProps {
|
|
|
26
25
|
validResponses: ValidResponse[];
|
|
27
26
|
response?: string;
|
|
28
27
|
}
|
|
29
|
-
declare class QuestionAnswerRecord extends BaseRecord<DefaultQuestionAnswerTags, CustomQuestionAnswerTags> {
|
|
28
|
+
export declare class QuestionAnswerRecord extends BaseRecord<DefaultQuestionAnswerTags, CustomQuestionAnswerTags> {
|
|
30
29
|
questionText: string;
|
|
31
30
|
questionDetail?: string;
|
|
32
31
|
validResponses: ValidResponse[];
|
|
@@ -49,5 +48,4 @@ declare class QuestionAnswerRecord extends BaseRecord<DefaultQuestionAnswerTags,
|
|
|
49
48
|
assertState(expectedStates: QuestionAnswerState | QuestionAnswerState[]): void;
|
|
50
49
|
}
|
|
51
50
|
//#endregion
|
|
52
|
-
export { CustomQuestionAnswerTags, DefaultQuestionAnswerTags, QuestionAnswerRecord, QuestionAnswerStorageProps, QuestionAnswerTags };
|
|
53
51
|
//# sourceMappingURL=QuestionAnswerRecord.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRecord.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRecord.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRecord.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRecord.ts"],"mappings":";;;;;YAKY,2BAA2B;YAC3B;EACV;EACA,MAAM;EACN,OAAO;EACP;;YAGU,qBAAqB,WAAW;iBAE3B;EACf;EACA,YAAY;EACZ;EACA,MAAM;EACN;EACA,OAAO;EACP,OAAO;EACP;EAEA;EACA;EACA,gBAAgB;EAEhB;;qBAGW,6BAA6B,WAAW,2BAA2B;EACvE;EACA;EACA,gBAAiB;EACjB;EACA,MAAO;EACP;EACA,OAAQ;EACR;EACA;kBAEgB;WACP;EAEG,YAAA,OAAO;EAmBnB;;;;;;EAUA,WAAW,cAAc;EAMzB,YAAY,gBAAgB,sBAAsB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseRecord, CredoError, utils } from "@credo-ts/core";
|
|
2
|
-
|
|
3
2
|
//#region src/repository/QuestionAnswerRecord.ts
|
|
4
3
|
var QuestionAnswerRecord = class QuestionAnswerRecord extends BaseRecord {
|
|
5
4
|
constructor(props) {
|
|
@@ -38,7 +37,7 @@ var QuestionAnswerRecord = class QuestionAnswerRecord extends BaseRecord {
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
QuestionAnswerRecord.type = "QuestionAnswerRecord";
|
|
41
|
-
|
|
42
40
|
//#endregion
|
|
43
41
|
export { QuestionAnswerRecord };
|
|
42
|
+
|
|
44
43
|
//# sourceMappingURL=QuestionAnswerRecord.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRecord.mjs","names":[],"sources":["../../src/repository/QuestionAnswerRecord.ts"],"sourcesContent":["import type { RecordTags, TagsBase } from '@credo-ts/core'\nimport { BaseRecord, CredoError, utils } from '@credo-ts/core'\nimport type { QuestionAnswerState, ValidResponse } from '../models'\nimport type { QuestionAnswerRole } from '../QuestionAnswerRole'\n\nexport type CustomQuestionAnswerTags = TagsBase\nexport type DefaultQuestionAnswerTags = {\n connectionId: string\n role: QuestionAnswerRole\n state: QuestionAnswerState\n threadId: string\n}\n\nexport type QuestionAnswerTags = RecordTags<QuestionAnswerRecord>\n\nexport interface QuestionAnswerStorageProps {\n id?: string\n createdAt?: Date\n connectionId: string\n role: QuestionAnswerRole\n signatureRequired: boolean\n state: QuestionAnswerState\n tags?: CustomQuestionAnswerTags\n threadId: string\n\n questionText: string\n questionDetail?: string\n validResponses: ValidResponse[]\n\n response?: string\n}\n\nexport class QuestionAnswerRecord extends BaseRecord<DefaultQuestionAnswerTags, CustomQuestionAnswerTags> {\n public questionText!: string\n public questionDetail?: string\n public validResponses!: ValidResponse[]\n public connectionId!: string\n public role!: QuestionAnswerRole\n public signatureRequired!: boolean\n public state!: QuestionAnswerState\n public threadId!: string\n public response?: string\n\n public static readonly type = 'QuestionAnswerRecord'\n public readonly type = QuestionAnswerRecord.type\n\n public constructor(props: QuestionAnswerStorageProps) {\n super()\n\n if (props) {\n this.id = props.id ?? utils.uuid()\n this.createdAt = props.createdAt ?? new Date()\n this.questionText = props.questionText\n this.questionDetail = props.questionDetail\n this.validResponses = props.validResponses\n this.connectionId = props.connectionId\n this._tags = props.tags ?? {}\n this.role = props.role\n this.signatureRequired = props.signatureRequired\n this.state = props.state\n this.threadId = props.threadId\n this.response = props.response\n }\n }\n\n public getTags() {\n return {\n ...this._tags,\n connectionId: this.connectionId,\n role: this.role,\n state: this.state,\n threadId: this.threadId,\n }\n }\n\n public assertRole(expectedRole: QuestionAnswerRole) {\n if (this.role !== expectedRole) {\n throw new CredoError(`Invalid question answer record role ${this.role}, expected is ${expectedRole}.`)\n }\n }\n\n public assertState(expectedStates: QuestionAnswerState | QuestionAnswerState[]) {\n if (!Array.isArray(expectedStates)) {\n expectedStates = [expectedStates]\n }\n\n if (!expectedStates.includes(this.state)) {\n throw new CredoError(\n `Question answer record is in invalid state ${this.state}. Valid states are: ${expectedStates.join(', ')}.`\n )\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRecord.mjs","names":[],"sources":["../../src/repository/QuestionAnswerRecord.ts"],"sourcesContent":["import type { RecordTags, TagsBase } from '@credo-ts/core'\nimport { BaseRecord, CredoError, utils } from '@credo-ts/core'\nimport type { QuestionAnswerState, ValidResponse } from '../models'\nimport type { QuestionAnswerRole } from '../QuestionAnswerRole'\n\nexport type CustomQuestionAnswerTags = TagsBase\nexport type DefaultQuestionAnswerTags = {\n connectionId: string\n role: QuestionAnswerRole\n state: QuestionAnswerState\n threadId: string\n}\n\nexport type QuestionAnswerTags = RecordTags<QuestionAnswerRecord>\n\nexport interface QuestionAnswerStorageProps {\n id?: string\n createdAt?: Date\n connectionId: string\n role: QuestionAnswerRole\n signatureRequired: boolean\n state: QuestionAnswerState\n tags?: CustomQuestionAnswerTags\n threadId: string\n\n questionText: string\n questionDetail?: string\n validResponses: ValidResponse[]\n\n response?: string\n}\n\nexport class QuestionAnswerRecord extends BaseRecord<DefaultQuestionAnswerTags, CustomQuestionAnswerTags> {\n public questionText!: string\n public questionDetail?: string\n public validResponses!: ValidResponse[]\n public connectionId!: string\n public role!: QuestionAnswerRole\n public signatureRequired!: boolean\n public state!: QuestionAnswerState\n public threadId!: string\n public response?: string\n\n public static readonly type = 'QuestionAnswerRecord'\n public readonly type = QuestionAnswerRecord.type\n\n public constructor(props: QuestionAnswerStorageProps) {\n super()\n\n if (props) {\n this.id = props.id ?? utils.uuid()\n this.createdAt = props.createdAt ?? new Date()\n this.questionText = props.questionText\n this.questionDetail = props.questionDetail\n this.validResponses = props.validResponses\n this.connectionId = props.connectionId\n this._tags = props.tags ?? {}\n this.role = props.role\n this.signatureRequired = props.signatureRequired\n this.state = props.state\n this.threadId = props.threadId\n this.response = props.response\n }\n }\n\n public getTags() {\n return {\n ...this._tags,\n connectionId: this.connectionId,\n role: this.role,\n state: this.state,\n threadId: this.threadId,\n }\n }\n\n public assertRole(expectedRole: QuestionAnswerRole) {\n if (this.role !== expectedRole) {\n throw new CredoError(`Invalid question answer record role ${this.role}, expected is ${expectedRole}.`)\n }\n }\n\n public assertState(expectedStates: QuestionAnswerState | QuestionAnswerState[]) {\n if (!Array.isArray(expectedStates)) {\n expectedStates = [expectedStates]\n }\n\n if (!expectedStates.includes(this.state)) {\n throw new CredoError(\n `Question answer record is in invalid state ${this.state}. Valid states are: ${expectedStates.join(', ')}.`\n )\n }\n }\n}\n"],"mappings":";;AAgCA,IAAa,uBAAb,MAAa,6BAA6B,WAAgE;CAcxG,YAAmB,OAAmC;EACpD,MAAM;EAHR,KAAgB,OAAO,qBAAqB;EAK1C,IAAI,OAAO;GACT,KAAK,KAAK,MAAM,MAAM,MAAM,KAAK;GACjC,KAAK,YAAY,MAAM,6BAAa,IAAI,KAAK;GAC7C,KAAK,eAAe,MAAM;GAC1B,KAAK,iBAAiB,MAAM;GAC5B,KAAK,iBAAiB,MAAM;GAC5B,KAAK,eAAe,MAAM;GAC1B,KAAK,QAAQ,MAAM,QAAQ,CAAC;GAC5B,KAAK,OAAO,MAAM;GAClB,KAAK,oBAAoB,MAAM;GAC/B,KAAK,QAAQ,MAAM;GACnB,KAAK,WAAW,MAAM;GACtB,KAAK,WAAW,MAAM;EACxB;CACF;CAEA,UAAiB;EACf,OAAO;GACL,GAAG,KAAK;GACR,cAAc,KAAK;GACnB,MAAM,KAAK;GACX,OAAO,KAAK;GACZ,UAAU,KAAK;EACjB;CACF;CAEA,WAAkB,cAAkC;EAClD,IAAI,KAAK,SAAS,cAChB,MAAM,IAAI,WAAW,uCAAuC,KAAK,KAAK,gBAAgB,aAAa,EAAE;CAEzG;CAEA,YAAmB,gBAA6D;EAC9E,IAAI,CAAC,MAAM,QAAQ,cAAc,GAC/B,iBAAiB,CAAC,cAAc;EAGlC,IAAI,CAAC,eAAe,SAAS,KAAK,KAAK,GACrC,MAAM,IAAI,WACR,8CAA8C,KAAK,MAAM,sBAAsB,eAAe,KAAK,IAAI,EAAE,EAC3G;CAEJ;AACF;AAjDE,qBAAuB,OAAO"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { QuestionAnswerRecord } from "./QuestionAnswerRecord.mjs";
|
|
2
2
|
import { EventEmitter, Repository, StorageService } from "@credo-ts/core";
|
|
3
|
-
|
|
4
3
|
//#region src/repository/QuestionAnswerRepository.d.ts
|
|
5
|
-
declare class QuestionAnswerRepository extends Repository<QuestionAnswerRecord> {
|
|
4
|
+
export declare class QuestionAnswerRepository extends Repository<QuestionAnswerRecord> {
|
|
6
5
|
constructor(storageService: StorageService<QuestionAnswerRecord>, eventEmitter: EventEmitter);
|
|
7
6
|
}
|
|
8
7
|
//#endregion
|
|
9
|
-
export { QuestionAnswerRepository };
|
|
10
8
|
//# sourceMappingURL=QuestionAnswerRepository.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRepository.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRepository.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"mappings":";;;qBAKa,iCAAiC,WAAW;EAEZ,YAAA,gBAAgB,eAAe,uBACxE,cAAc"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { QuestionAnswerRecord } from "./QuestionAnswerRecord.mjs";
|
|
4
|
-
import
|
|
4
|
+
import __decorateParam from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.mjs";
|
|
5
5
|
import { EventEmitter, InjectionSymbols, Repository, inject, injectable } from "@credo-ts/core";
|
|
6
|
-
|
|
7
6
|
//#region src/repository/QuestionAnswerRepository.ts
|
|
8
|
-
var _ref;
|
|
9
7
|
let QuestionAnswerRepository = class QuestionAnswerRepository extends Repository {
|
|
10
8
|
constructor(storageService, eventEmitter) {
|
|
11
9
|
super(QuestionAnswerRecord, storageService, eventEmitter);
|
|
@@ -14,9 +12,9 @@ let QuestionAnswerRepository = class QuestionAnswerRepository extends Repository
|
|
|
14
12
|
QuestionAnswerRepository = __decorate([
|
|
15
13
|
injectable(),
|
|
16
14
|
__decorateParam(0, inject(InjectionSymbols.StorageService)),
|
|
17
|
-
__decorateMetadata("design:paramtypes", [Object, typeof
|
|
15
|
+
__decorateMetadata("design:paramtypes", [Object, typeof EventEmitter === "undefined" ? Object : EventEmitter])
|
|
18
16
|
], QuestionAnswerRepository);
|
|
19
|
-
|
|
20
17
|
//#endregion
|
|
21
18
|
export { QuestionAnswerRepository };
|
|
19
|
+
|
|
22
20
|
//# sourceMappingURL=QuestionAnswerRepository.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerRepository.mjs","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"sourcesContent":["import { EventEmitter, InjectionSymbols, inject, injectable, Repository, type StorageService } from '@credo-ts/core'\n\nimport { QuestionAnswerRecord } from './QuestionAnswerRecord'\n\n@injectable()\nexport class QuestionAnswerRepository extends Repository<QuestionAnswerRecord> {\n public constructor(\n @inject(InjectionSymbols.StorageService) storageService: StorageService<QuestionAnswerRecord>,\n eventEmitter: EventEmitter\n ) {\n super(QuestionAnswerRecord, storageService, eventEmitter)\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerRepository.mjs","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"sourcesContent":["import { EventEmitter, InjectionSymbols, inject, injectable, Repository, type StorageService } from '@credo-ts/core'\n\nimport { QuestionAnswerRecord } from './QuestionAnswerRecord'\n\n@injectable()\nexport class QuestionAnswerRepository extends Repository<QuestionAnswerRecord> {\n public constructor(\n @inject(InjectionSymbols.StorageService) storageService: StorageService<QuestionAnswerRecord>,\n eventEmitter: EventEmitter\n ) {\n super(QuestionAnswerRecord, storageService, eventEmitter)\n }\n}\n"],"mappings":";;;;;;AAKO,IAAM,2BAAN,MAAM,iCAAiC,WAAiC;CAC7E,YACE,gBACA,cACA;EACA,MAAM,sBAAsB,gBAAgB,YAAY;CAC1D;AACF;;CARC,WAAW;CAGP,gBAAA,GAAA,OAAO,iBAAiB,cAAc,CAAA"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { CustomQuestionAnswerTags, DefaultQuestionAnswerTags, QuestionAnswerRecord, QuestionAnswerStorageProps, QuestionAnswerTags } from "./QuestionAnswerRecord.mjs";
|
|
2
|
-
import { QuestionAnswerRepository } from "./QuestionAnswerRepository.mjs";
|
|
2
|
+
import { QuestionAnswerRepository } from "./QuestionAnswerRepository.mjs";
|
|
3
|
+
export { CustomQuestionAnswerTags, DefaultQuestionAnswerTags, QuestionAnswerRecord, QuestionAnswerRepository, QuestionAnswerStorageProps, QuestionAnswerTags };
|
|
@@ -7,9 +7,8 @@ import { QuestionAnswerRepository } from "../repository/QuestionAnswerRepository
|
|
|
7
7
|
import "../repository/index.mjs";
|
|
8
8
|
import { DidCommInboundMessageContext } from "@credo-ts/didcomm";
|
|
9
9
|
import { AgentContext, EventEmitter, Logger, Query, QueryOptions } from "@credo-ts/core";
|
|
10
|
-
|
|
11
10
|
//#region src/services/QuestionAnswerService.d.ts
|
|
12
|
-
declare class QuestionAnswerService {
|
|
11
|
+
export declare class QuestionAnswerService {
|
|
13
12
|
private questionAnswerRepository;
|
|
14
13
|
private eventEmitter;
|
|
15
14
|
private logger;
|
|
@@ -112,5 +111,4 @@ declare class QuestionAnswerService {
|
|
|
112
111
|
findAllByQuery(agentContext: AgentContext, query: Query<QuestionAnswerRecord>, queryOptions?: QueryOptions): Promise<QuestionAnswerRecord[]>;
|
|
113
112
|
}
|
|
114
113
|
//#endregion
|
|
115
|
-
export { QuestionAnswerService };
|
|
116
114
|
//# sourceMappingURL=QuestionAnswerService.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerService.d.mts","names":[],"sources":["../../src/services/QuestionAnswerService.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuestionAnswerService.d.mts","names":[],"sources":["../../src/services/QuestionAnswerService.ts"],"mappings":";;;;;;;;;;qBAYa;UACH;UACA;UACA;EAGN,YAAA,0BAA0B,0BAC1B,cAAc,cACmB,QAAQ;;;;;;;;;;EAe9B,eACX,cAAc,cACd,sBACA;IACE;IACA,gBAAgB;IAChB;MACD;;;;;;;;;;EAoCU,uBACX,gBAAgB,6BAA6B,mBAC5C,QAAQ;;;;;;;;EA0CE,aAAa,cAAc,cAAc,sBAAsB,sBAAsB,mBAAgB;;;;;;;;;;EAqBrG,cACX,gBAAgB,6BAA6B,iBAC5C,QAAQ;;;;;;;;;UAgCG;UAkBA;;;;;;;;;;EAiCP,2BACL,cAAc,cACd,sBACA,mBACC,QAAQ;;;;;;;;EAcJ,4BACL,cAAc,cACd,sBACA,mBACC,QAAQ;;;;;;;;;EAeJ,QAAQ,cAAc,cAAc,2BAA2B,QAAQ;;;;;;;;EAWvE,SAAS,cAAc,cAAc,2BAA2B,QAAQ;;;;;;;;EAWxE,OAAO,cAAc,eAAY,QAAA;EAI3B,eACX,cAAc,cACd,OAAO,MAAM,uBACb,eAAe,eAAY,QAAA"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import __decorateMetadata from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.mjs";
|
|
2
|
+
import __decorate from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.mjs";
|
|
3
3
|
import { AnswerMessage } from "../messages/AnswerMessage.mjs";
|
|
4
|
-
import
|
|
4
|
+
import "../models/QuestionAnswerState.mjs";
|
|
5
5
|
import { QuestionMessage } from "../messages/QuestionMessage.mjs";
|
|
6
6
|
import "../messages/index.mjs";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import "../QuestionAnswerEvents.mjs";
|
|
8
|
+
import "../QuestionAnswerRole.mjs";
|
|
9
9
|
import { QuestionAnswerRecord } from "../repository/QuestionAnswerRecord.mjs";
|
|
10
|
-
import
|
|
10
|
+
import __decorateParam from "../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.mjs";
|
|
11
11
|
import { QuestionAnswerRepository } from "../repository/QuestionAnswerRepository.mjs";
|
|
12
12
|
import "../repository/index.mjs";
|
|
13
13
|
import { CredoError, EventEmitter, InjectionSymbols, inject, injectable } from "@credo-ts/core";
|
|
14
|
-
|
|
15
14
|
//#region src/services/QuestionAnswerService.ts
|
|
16
|
-
var _ref, _ref2;
|
|
17
15
|
let QuestionAnswerService = class QuestionAnswerService {
|
|
18
16
|
constructor(questionAnswerRepository, eventEmitter, logger) {
|
|
19
17
|
this.questionAnswerRepository = questionAnswerRepository;
|
|
@@ -41,14 +39,14 @@ let QuestionAnswerService = class QuestionAnswerService {
|
|
|
41
39
|
questionDetail: questionMessage.questionDetail,
|
|
42
40
|
threadId: questionMessage.threadId,
|
|
43
41
|
connectionId,
|
|
44
|
-
role:
|
|
42
|
+
role: "questioner",
|
|
45
43
|
signatureRequired: false,
|
|
46
|
-
state:
|
|
44
|
+
state: "question-sent",
|
|
47
45
|
validResponses: questionMessage.validResponses
|
|
48
46
|
});
|
|
49
47
|
await this.questionAnswerRepository.save(agentContext, questionAnswerRecord);
|
|
50
48
|
this.eventEmitter.emit(agentContext, {
|
|
51
|
-
type:
|
|
49
|
+
type: "QuestionAnswerStateChanged",
|
|
52
50
|
payload: {
|
|
53
51
|
previousState: null,
|
|
54
52
|
questionAnswerRecord
|
|
@@ -75,14 +73,14 @@ let QuestionAnswerService = class QuestionAnswerService {
|
|
|
75
73
|
questionDetail: questionMessage.questionDetail,
|
|
76
74
|
connectionId: connection?.id,
|
|
77
75
|
threadId: questionMessage.threadId,
|
|
78
|
-
role:
|
|
76
|
+
role: "responder",
|
|
79
77
|
signatureRequired: false,
|
|
80
|
-
state:
|
|
78
|
+
state: "question-received",
|
|
81
79
|
validResponses: questionMessage.validResponses
|
|
82
80
|
});
|
|
83
81
|
await this.questionAnswerRepository.save(messageContext.agentContext, questionAnswerRecord);
|
|
84
82
|
this.eventEmitter.emit(messageContext.agentContext, {
|
|
85
|
-
type:
|
|
83
|
+
type: "QuestionAnswerStateChanged",
|
|
86
84
|
payload: {
|
|
87
85
|
previousState: null,
|
|
88
86
|
questionAnswerRecord
|
|
@@ -102,9 +100,9 @@ let QuestionAnswerService = class QuestionAnswerService {
|
|
|
102
100
|
response,
|
|
103
101
|
threadId: questionAnswerRecord.threadId
|
|
104
102
|
});
|
|
105
|
-
questionAnswerRecord.assertState(
|
|
103
|
+
questionAnswerRecord.assertState("question-received");
|
|
106
104
|
questionAnswerRecord.response = response;
|
|
107
|
-
if (questionAnswerRecord.validResponses.some((e) => e.text === response)) await this.updateState(agentContext, questionAnswerRecord,
|
|
105
|
+
if (questionAnswerRecord.validResponses.some((e) => e.text === response)) await this.updateState(agentContext, questionAnswerRecord, "answer-sent");
|
|
108
106
|
else throw new CredoError("Response does not match valid responses");
|
|
109
107
|
return {
|
|
110
108
|
answerMessage,
|
|
@@ -123,10 +121,10 @@ let QuestionAnswerService = class QuestionAnswerService {
|
|
|
123
121
|
const connection = messageContext.assertReadyConnection();
|
|
124
122
|
const questionAnswerRecord = await this.findByThreadAndConnectionId(messageContext.agentContext, connection.id, answerMessage.threadId);
|
|
125
123
|
if (!questionAnswerRecord) throw new CredoError(`Question Answer record with thread Id ${answerMessage.threadId} not found.`);
|
|
126
|
-
questionAnswerRecord.assertState(
|
|
127
|
-
questionAnswerRecord.assertRole(
|
|
124
|
+
questionAnswerRecord.assertState("question-sent");
|
|
125
|
+
questionAnswerRecord.assertRole("questioner");
|
|
128
126
|
questionAnswerRecord.response = answerMessage.response;
|
|
129
|
-
await this.updateState(messageContext.agentContext, questionAnswerRecord,
|
|
127
|
+
await this.updateState(messageContext.agentContext, questionAnswerRecord, "answer-received");
|
|
130
128
|
return questionAnswerRecord;
|
|
131
129
|
}
|
|
132
130
|
/**
|
|
@@ -142,7 +140,7 @@ let QuestionAnswerService = class QuestionAnswerService {
|
|
|
142
140
|
questionAnswerRecord.state = newState;
|
|
143
141
|
await this.questionAnswerRepository.update(agentContext, questionAnswerRecord);
|
|
144
142
|
this.eventEmitter.emit(agentContext, {
|
|
145
|
-
type:
|
|
143
|
+
type: "QuestionAnswerStateChanged",
|
|
146
144
|
payload: {
|
|
147
145
|
previousState,
|
|
148
146
|
questionAnswerRecord
|
|
@@ -228,12 +226,12 @@ QuestionAnswerService = __decorate([
|
|
|
228
226
|
injectable(),
|
|
229
227
|
__decorateParam(2, inject(InjectionSymbols.Logger)),
|
|
230
228
|
__decorateMetadata("design:paramtypes", [
|
|
231
|
-
typeof
|
|
232
|
-
typeof
|
|
229
|
+
typeof QuestionAnswerRepository === "undefined" ? Object : QuestionAnswerRepository,
|
|
230
|
+
typeof EventEmitter === "undefined" ? Object : EventEmitter,
|
|
233
231
|
Object
|
|
234
232
|
])
|
|
235
233
|
], QuestionAnswerService);
|
|
236
|
-
|
|
237
234
|
//#endregion
|
|
238
235
|
export { QuestionAnswerService };
|
|
236
|
+
|
|
239
237
|
//# sourceMappingURL=QuestionAnswerService.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuestionAnswerService.mjs","names":[],"sources":["../../src/services/QuestionAnswerService.ts"],"sourcesContent":["import type { AgentContext, Query, QueryOptions } from '@credo-ts/core'\nimport { CredoError, EventEmitter, InjectionSymbols, inject, injectable, type Logger } from '@credo-ts/core'\nimport type { DidCommInboundMessageContext } from '@credo-ts/didcomm'\nimport { AnswerMessage, QuestionMessage } from '../messages'\nimport type { ValidResponse } from '../models'\nimport { QuestionAnswerState } from '../models'\nimport type { QuestionAnswerStateChangedEvent } from '../QuestionAnswerEvents'\nimport { QuestionAnswerEventTypes } from '../QuestionAnswerEvents'\nimport { QuestionAnswerRole } from '../QuestionAnswerRole'\nimport { QuestionAnswerRecord, QuestionAnswerRepository } from '../repository'\n\n@injectable()\nexport class QuestionAnswerService {\n private questionAnswerRepository: QuestionAnswerRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n public constructor(\n questionAnswerRepository: QuestionAnswerRepository,\n eventEmitter: EventEmitter,\n @inject(InjectionSymbols.Logger) logger: Logger\n ) {\n this.questionAnswerRepository = questionAnswerRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n /**\n * Create a question message and a new QuestionAnswer record for the questioner role\n *\n * @param question text for question message\n * @param details optional details for question message\n * @param connectionId connection for QuestionAnswer record\n * @param validResponses array of valid responses for question\n * @returns question message and QuestionAnswer record\n */\n public async createQuestion(\n agentContext: AgentContext,\n connectionId: string,\n config: {\n question: string\n validResponses: ValidResponse[]\n detail?: string\n }\n ) {\n const questionMessage = new QuestionMessage({\n questionText: config.question,\n questionDetail: config?.detail,\n signatureRequired: false,\n validResponses: config.validResponses,\n })\n\n const questionAnswerRecord = await this.createRecord({\n questionText: questionMessage.questionText,\n questionDetail: questionMessage.questionDetail,\n threadId: questionMessage.threadId,\n connectionId: connectionId,\n role: QuestionAnswerRole.Questioner,\n signatureRequired: false,\n state: QuestionAnswerState.QuestionSent,\n validResponses: questionMessage.validResponses,\n })\n\n await this.questionAnswerRepository.save(agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: { previousState: null, questionAnswerRecord },\n })\n\n return { questionMessage, questionAnswerRecord }\n }\n\n /**\n * receive question message and create record for responder role\n *\n * @param messageContext the message context containing a question message\n * @returns QuestionAnswer record\n */\n public async processReceiveQuestion(\n messageContext: DidCommInboundMessageContext<QuestionMessage>\n ): Promise<QuestionAnswerRecord> {\n const { message: questionMessage } = messageContext\n\n this.logger.debug(`Receiving question message with id ${questionMessage.id}`)\n\n const connection = messageContext.assertReadyConnection()\n const questionRecord = await this.findByThreadAndConnectionId(\n messageContext.agentContext,\n connection.id,\n questionMessage.id\n )\n if (questionRecord) {\n throw new CredoError(`Question answer record with thread Id ${questionMessage.id} already exists.`)\n }\n const questionAnswerRecord = await this.createRecord({\n questionText: questionMessage.questionText,\n questionDetail: questionMessage.questionDetail,\n connectionId: connection?.id,\n threadId: questionMessage.threadId,\n role: QuestionAnswerRole.Responder,\n signatureRequired: false,\n state: QuestionAnswerState.QuestionReceived,\n validResponses: questionMessage.validResponses,\n })\n\n await this.questionAnswerRepository.save(messageContext.agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(messageContext.agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: { previousState: null, questionAnswerRecord },\n })\n\n return questionAnswerRecord\n }\n\n /**\n * create answer message, check that response is valid\n *\n * @param questionAnswerRecord record containing question and valid responses\n * @param response response used in answer message\n * @returns answer message and QuestionAnswer record\n */\n public async createAnswer(agentContext: AgentContext, questionAnswerRecord: QuestionAnswerRecord, response: string) {\n const answerMessage = new AnswerMessage({ response: response, threadId: questionAnswerRecord.threadId })\n\n questionAnswerRecord.assertState(QuestionAnswerState.QuestionReceived)\n\n questionAnswerRecord.response = response\n\n if (questionAnswerRecord.validResponses.some((e) => e.text === response)) {\n await this.updateState(agentContext, questionAnswerRecord, QuestionAnswerState.AnswerSent)\n } else {\n throw new CredoError('Response does not match valid responses')\n }\n return { answerMessage, questionAnswerRecord }\n }\n\n /**\n * receive answer as questioner\n *\n * @param messageContext the message context containing an answer message message\n * @returns QuestionAnswer record\n */\n public async receiveAnswer(\n messageContext: DidCommInboundMessageContext<AnswerMessage>\n ): Promise<QuestionAnswerRecord> {\n const { message: answerMessage } = messageContext\n\n this.logger.debug(`Receiving answer message with id ${answerMessage.id}`)\n\n const connection = messageContext.assertReadyConnection()\n const questionAnswerRecord = await this.findByThreadAndConnectionId(\n messageContext.agentContext,\n connection.id,\n answerMessage.threadId\n )\n if (!questionAnswerRecord) {\n throw new CredoError(`Question Answer record with thread Id ${answerMessage.threadId} not found.`)\n }\n questionAnswerRecord.assertState(QuestionAnswerState.QuestionSent)\n questionAnswerRecord.assertRole(QuestionAnswerRole.Questioner)\n\n questionAnswerRecord.response = answerMessage.response\n\n await this.updateState(messageContext.agentContext, questionAnswerRecord, QuestionAnswerState.AnswerReceived)\n\n return questionAnswerRecord\n }\n\n /**\n * Update the record to a new state and emit an state changed event. Also updates the record\n * in storage.\n *\n * @param questionAnswerRecord The question answer record to update the state for\n * @param newState The state to update to\n *\n */\n private async updateState(\n agentContext: AgentContext,\n questionAnswerRecord: QuestionAnswerRecord,\n newState: QuestionAnswerState\n ) {\n const previousState = questionAnswerRecord.state\n questionAnswerRecord.state = newState\n await this.questionAnswerRepository.update(agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: {\n previousState,\n questionAnswerRecord: questionAnswerRecord,\n },\n })\n }\n\n private async createRecord(options: {\n questionText: string\n questionDetail?: string\n connectionId: string\n role: QuestionAnswerRole\n signatureRequired: boolean\n state: QuestionAnswerState\n threadId: string\n validResponses: ValidResponse[]\n }): Promise<QuestionAnswerRecord> {\n const questionMessageRecord = new QuestionAnswerRecord({\n questionText: options.questionText,\n questionDetail: options.questionDetail,\n connectionId: options.connectionId,\n threadId: options.threadId,\n role: options.role,\n signatureRequired: options.signatureRequired,\n state: options.state,\n validResponses: options.validResponses,\n })\n\n return questionMessageRecord\n }\n\n /**\n * Retrieve a question answer record by connection id and thread id\n *\n * @param connectionId The connection id\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The question answer record\n */\n public getByThreadAndConnectionId(\n agentContext: AgentContext,\n connectionId: string,\n threadId: string\n ): Promise<QuestionAnswerRecord> {\n return this.questionAnswerRepository.getSingleByQuery(agentContext, {\n connectionId,\n threadId,\n })\n }\n\n /**\n * Retrieve a question answer record by thread id\n *\n * @param connectionId The connection id\n * @param threadId The thread id\n * @returns The question answer record or null if not found\n */\n public findByThreadAndConnectionId(\n agentContext: AgentContext,\n connectionId: string,\n threadId: string\n ): Promise<QuestionAnswerRecord | null> {\n return this.questionAnswerRepository.findSingleByQuery(agentContext, {\n connectionId,\n threadId,\n })\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The question answer record\n *\n */\n public getById(agentContext: AgentContext, questionAnswerId: string): Promise<QuestionAnswerRecord> {\n return this.questionAnswerRepository.getById(agentContext, questionAnswerId)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public findById(agentContext: AgentContext, questionAnswerId: string): Promise<QuestionAnswerRecord | null> {\n return this.questionAnswerRepository.findById(agentContext, questionAnswerId)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public getAll(agentContext: AgentContext) {\n return this.questionAnswerRepository.getAll(agentContext)\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<QuestionAnswerRecord>,\n queryOptions?: QueryOptions\n ) {\n return this.questionAnswerRepository.findByQuery(agentContext, query, queryOptions)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAYO,kCAAM,sBAAsB;CAKjC,AAAO,YACL,0BACA,cACA,AAAiC,QACjC;AACA,OAAK,2BAA2B;AAChC,OAAK,eAAe;AACpB,OAAK,SAAS;;;;;;;;;;;CAWhB,MAAa,eACX,cACA,cACA,QAKA;EACA,MAAM,kBAAkB,IAAI,gBAAgB;GAC1C,cAAc,OAAO;GACrB,gBAAgB,QAAQ;GACxB,mBAAmB;GACnB,gBAAgB,OAAO;GACxB,CAAC;EAEF,MAAM,uBAAuB,MAAM,KAAK,aAAa;GACnD,cAAc,gBAAgB;GAC9B,gBAAgB,gBAAgB;GAChC,UAAU,gBAAgB;GACZ;GACd,MAAM,mBAAmB;GACzB,mBAAmB;GACnB,OAAO,oBAAoB;GAC3B,gBAAgB,gBAAgB;GACjC,CAAC;AAEF,QAAM,KAAK,yBAAyB,KAAK,cAAc,qBAAqB;AAE5E,OAAK,aAAa,KAAsC,cAAc;GACpE,MAAM,yBAAyB;GAC/B,SAAS;IAAE,eAAe;IAAM;IAAsB;GACvD,CAAC;AAEF,SAAO;GAAE;GAAiB;GAAsB;;;;;;;;CASlD,MAAa,uBACX,gBAC+B;EAC/B,MAAM,EAAE,SAAS,oBAAoB;AAErC,OAAK,OAAO,MAAM,sCAAsC,gBAAgB,KAAK;EAE7E,MAAM,aAAa,eAAe,uBAAuB;AAMzD,MALuB,MAAM,KAAK,4BAChC,eAAe,cACf,WAAW,IACX,gBAAgB,GACjB,CAEC,OAAM,IAAI,WAAW,yCAAyC,gBAAgB,GAAG,kBAAkB;EAErG,MAAM,uBAAuB,MAAM,KAAK,aAAa;GACnD,cAAc,gBAAgB;GAC9B,gBAAgB,gBAAgB;GAChC,cAAc,YAAY;GAC1B,UAAU,gBAAgB;GAC1B,MAAM,mBAAmB;GACzB,mBAAmB;GACnB,OAAO,oBAAoB;GAC3B,gBAAgB,gBAAgB;GACjC,CAAC;AAEF,QAAM,KAAK,yBAAyB,KAAK,eAAe,cAAc,qBAAqB;AAE3F,OAAK,aAAa,KAAsC,eAAe,cAAc;GACnF,MAAM,yBAAyB;GAC/B,SAAS;IAAE,eAAe;IAAM;IAAsB;GACvD,CAAC;AAEF,SAAO;;;;;;;;;CAUT,MAAa,aAAa,cAA4B,sBAA4C,UAAkB;EAClH,MAAM,gBAAgB,IAAI,cAAc;GAAY;GAAU,UAAU,qBAAqB;GAAU,CAAC;AAExG,uBAAqB,YAAY,oBAAoB,iBAAiB;AAEtE,uBAAqB,WAAW;AAEhC,MAAI,qBAAqB,eAAe,MAAM,MAAM,EAAE,SAAS,SAAS,CACtE,OAAM,KAAK,YAAY,cAAc,sBAAsB,oBAAoB,WAAW;MAE1F,OAAM,IAAI,WAAW,0CAA0C;AAEjE,SAAO;GAAE;GAAe;GAAsB;;;;;;;;CAShD,MAAa,cACX,gBAC+B;EAC/B,MAAM,EAAE,SAAS,kBAAkB;AAEnC,OAAK,OAAO,MAAM,oCAAoC,cAAc,KAAK;EAEzE,MAAM,aAAa,eAAe,uBAAuB;EACzD,MAAM,uBAAuB,MAAM,KAAK,4BACtC,eAAe,cACf,WAAW,IACX,cAAc,SACf;AACD,MAAI,CAAC,qBACH,OAAM,IAAI,WAAW,yCAAyC,cAAc,SAAS,aAAa;AAEpG,uBAAqB,YAAY,oBAAoB,aAAa;AAClE,uBAAqB,WAAW,mBAAmB,WAAW;AAE9D,uBAAqB,WAAW,cAAc;AAE9C,QAAM,KAAK,YAAY,eAAe,cAAc,sBAAsB,oBAAoB,eAAe;AAE7G,SAAO;;;;;;;;;;CAWT,MAAc,YACZ,cACA,sBACA,UACA;EACA,MAAM,gBAAgB,qBAAqB;AAC3C,uBAAqB,QAAQ;AAC7B,QAAM,KAAK,yBAAyB,OAAO,cAAc,qBAAqB;AAE9E,OAAK,aAAa,KAAsC,cAAc;GACpE,MAAM,yBAAyB;GAC/B,SAAS;IACP;IACsB;IACvB;GACF,CAAC;;CAGJ,MAAc,aAAa,SASO;AAYhC,SAX8B,IAAI,qBAAqB;GACrD,cAAc,QAAQ;GACtB,gBAAgB,QAAQ;GACxB,cAAc,QAAQ;GACtB,UAAU,QAAQ;GAClB,MAAM,QAAQ;GACd,mBAAmB,QAAQ;GAC3B,OAAO,QAAQ;GACf,gBAAgB,QAAQ;GACzB,CAAC;;;;;;;;;;;CAcJ,AAAO,2BACL,cACA,cACA,UAC+B;AAC/B,SAAO,KAAK,yBAAyB,iBAAiB,cAAc;GAClE;GACA;GACD,CAAC;;;;;;;;;CAUJ,AAAO,4BACL,cACA,cACA,UACsC;AACtC,SAAO,KAAK,yBAAyB,kBAAkB,cAAc;GACnE;GACA;GACD,CAAC;;;;;;;;;;CAWJ,AAAO,QAAQ,cAA4B,kBAAyD;AAClG,SAAO,KAAK,yBAAyB,QAAQ,cAAc,iBAAiB;;;;;;;;;CAU9E,AAAO,SAAS,cAA4B,kBAAgE;AAC1G,SAAO,KAAK,yBAAyB,SAAS,cAAc,iBAAiB;;;;;;;;;CAU/E,AAAO,OAAO,cAA4B;AACxC,SAAO,KAAK,yBAAyB,OAAO,aAAa;;CAG3D,MAAa,eACX,cACA,OACA,cACA;AACA,SAAO,KAAK,yBAAyB,YAAY,cAAc,OAAO,aAAa;;;;CA7RtF,YAAY;oBASR,OAAO,iBAAiB,OAAO"}
|
|
1
|
+
{"version":3,"file":"QuestionAnswerService.mjs","names":[],"sources":["../../src/services/QuestionAnswerService.ts"],"sourcesContent":["import type { AgentContext, Query, QueryOptions } from '@credo-ts/core'\nimport { CredoError, EventEmitter, InjectionSymbols, inject, injectable, type Logger } from '@credo-ts/core'\nimport type { DidCommInboundMessageContext } from '@credo-ts/didcomm'\nimport { AnswerMessage, QuestionMessage } from '../messages'\nimport type { ValidResponse } from '../models'\nimport { QuestionAnswerState } from '../models'\nimport type { QuestionAnswerStateChangedEvent } from '../QuestionAnswerEvents'\nimport { QuestionAnswerEventTypes } from '../QuestionAnswerEvents'\nimport { QuestionAnswerRole } from '../QuestionAnswerRole'\nimport { QuestionAnswerRecord, QuestionAnswerRepository } from '../repository'\n\n@injectable()\nexport class QuestionAnswerService {\n private questionAnswerRepository: QuestionAnswerRepository\n private eventEmitter: EventEmitter\n private logger: Logger\n\n public constructor(\n questionAnswerRepository: QuestionAnswerRepository,\n eventEmitter: EventEmitter,\n @inject(InjectionSymbols.Logger) logger: Logger\n ) {\n this.questionAnswerRepository = questionAnswerRepository\n this.eventEmitter = eventEmitter\n this.logger = logger\n }\n /**\n * Create a question message and a new QuestionAnswer record for the questioner role\n *\n * @param question text for question message\n * @param details optional details for question message\n * @param connectionId connection for QuestionAnswer record\n * @param validResponses array of valid responses for question\n * @returns question message and QuestionAnswer record\n */\n public async createQuestion(\n agentContext: AgentContext,\n connectionId: string,\n config: {\n question: string\n validResponses: ValidResponse[]\n detail?: string\n }\n ) {\n const questionMessage = new QuestionMessage({\n questionText: config.question,\n questionDetail: config?.detail,\n signatureRequired: false,\n validResponses: config.validResponses,\n })\n\n const questionAnswerRecord = await this.createRecord({\n questionText: questionMessage.questionText,\n questionDetail: questionMessage.questionDetail,\n threadId: questionMessage.threadId,\n connectionId: connectionId,\n role: QuestionAnswerRole.Questioner,\n signatureRequired: false,\n state: QuestionAnswerState.QuestionSent,\n validResponses: questionMessage.validResponses,\n })\n\n await this.questionAnswerRepository.save(agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: { previousState: null, questionAnswerRecord },\n })\n\n return { questionMessage, questionAnswerRecord }\n }\n\n /**\n * receive question message and create record for responder role\n *\n * @param messageContext the message context containing a question message\n * @returns QuestionAnswer record\n */\n public async processReceiveQuestion(\n messageContext: DidCommInboundMessageContext<QuestionMessage>\n ): Promise<QuestionAnswerRecord> {\n const { message: questionMessage } = messageContext\n\n this.logger.debug(`Receiving question message with id ${questionMessage.id}`)\n\n const connection = messageContext.assertReadyConnection()\n const questionRecord = await this.findByThreadAndConnectionId(\n messageContext.agentContext,\n connection.id,\n questionMessage.id\n )\n if (questionRecord) {\n throw new CredoError(`Question answer record with thread Id ${questionMessage.id} already exists.`)\n }\n const questionAnswerRecord = await this.createRecord({\n questionText: questionMessage.questionText,\n questionDetail: questionMessage.questionDetail,\n connectionId: connection?.id,\n threadId: questionMessage.threadId,\n role: QuestionAnswerRole.Responder,\n signatureRequired: false,\n state: QuestionAnswerState.QuestionReceived,\n validResponses: questionMessage.validResponses,\n })\n\n await this.questionAnswerRepository.save(messageContext.agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(messageContext.agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: { previousState: null, questionAnswerRecord },\n })\n\n return questionAnswerRecord\n }\n\n /**\n * create answer message, check that response is valid\n *\n * @param questionAnswerRecord record containing question and valid responses\n * @param response response used in answer message\n * @returns answer message and QuestionAnswer record\n */\n public async createAnswer(agentContext: AgentContext, questionAnswerRecord: QuestionAnswerRecord, response: string) {\n const answerMessage = new AnswerMessage({ response: response, threadId: questionAnswerRecord.threadId })\n\n questionAnswerRecord.assertState(QuestionAnswerState.QuestionReceived)\n\n questionAnswerRecord.response = response\n\n if (questionAnswerRecord.validResponses.some((e) => e.text === response)) {\n await this.updateState(agentContext, questionAnswerRecord, QuestionAnswerState.AnswerSent)\n } else {\n throw new CredoError('Response does not match valid responses')\n }\n return { answerMessage, questionAnswerRecord }\n }\n\n /**\n * receive answer as questioner\n *\n * @param messageContext the message context containing an answer message message\n * @returns QuestionAnswer record\n */\n public async receiveAnswer(\n messageContext: DidCommInboundMessageContext<AnswerMessage>\n ): Promise<QuestionAnswerRecord> {\n const { message: answerMessage } = messageContext\n\n this.logger.debug(`Receiving answer message with id ${answerMessage.id}`)\n\n const connection = messageContext.assertReadyConnection()\n const questionAnswerRecord = await this.findByThreadAndConnectionId(\n messageContext.agentContext,\n connection.id,\n answerMessage.threadId\n )\n if (!questionAnswerRecord) {\n throw new CredoError(`Question Answer record with thread Id ${answerMessage.threadId} not found.`)\n }\n questionAnswerRecord.assertState(QuestionAnswerState.QuestionSent)\n questionAnswerRecord.assertRole(QuestionAnswerRole.Questioner)\n\n questionAnswerRecord.response = answerMessage.response\n\n await this.updateState(messageContext.agentContext, questionAnswerRecord, QuestionAnswerState.AnswerReceived)\n\n return questionAnswerRecord\n }\n\n /**\n * Update the record to a new state and emit an state changed event. Also updates the record\n * in storage.\n *\n * @param questionAnswerRecord The question answer record to update the state for\n * @param newState The state to update to\n *\n */\n private async updateState(\n agentContext: AgentContext,\n questionAnswerRecord: QuestionAnswerRecord,\n newState: QuestionAnswerState\n ) {\n const previousState = questionAnswerRecord.state\n questionAnswerRecord.state = newState\n await this.questionAnswerRepository.update(agentContext, questionAnswerRecord)\n\n this.eventEmitter.emit<QuestionAnswerStateChangedEvent>(agentContext, {\n type: QuestionAnswerEventTypes.QuestionAnswerStateChanged,\n payload: {\n previousState,\n questionAnswerRecord: questionAnswerRecord,\n },\n })\n }\n\n private async createRecord(options: {\n questionText: string\n questionDetail?: string\n connectionId: string\n role: QuestionAnswerRole\n signatureRequired: boolean\n state: QuestionAnswerState\n threadId: string\n validResponses: ValidResponse[]\n }): Promise<QuestionAnswerRecord> {\n const questionMessageRecord = new QuestionAnswerRecord({\n questionText: options.questionText,\n questionDetail: options.questionDetail,\n connectionId: options.connectionId,\n threadId: options.threadId,\n role: options.role,\n signatureRequired: options.signatureRequired,\n state: options.state,\n validResponses: options.validResponses,\n })\n\n return questionMessageRecord\n }\n\n /**\n * Retrieve a question answer record by connection id and thread id\n *\n * @param connectionId The connection id\n * @param threadId The thread id\n * @throws {RecordNotFoundError} If no record is found\n * @throws {RecordDuplicateError} If multiple records are found\n * @returns The question answer record\n */\n public getByThreadAndConnectionId(\n agentContext: AgentContext,\n connectionId: string,\n threadId: string\n ): Promise<QuestionAnswerRecord> {\n return this.questionAnswerRepository.getSingleByQuery(agentContext, {\n connectionId,\n threadId,\n })\n }\n\n /**\n * Retrieve a question answer record by thread id\n *\n * @param connectionId The connection id\n * @param threadId The thread id\n * @returns The question answer record or null if not found\n */\n public findByThreadAndConnectionId(\n agentContext: AgentContext,\n connectionId: string,\n threadId: string\n ): Promise<QuestionAnswerRecord | null> {\n return this.questionAnswerRepository.findSingleByQuery(agentContext, {\n connectionId,\n threadId,\n })\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @throws {RecordNotFoundError} If no record is found\n * @return The question answer record\n *\n */\n public getById(agentContext: AgentContext, questionAnswerId: string): Promise<QuestionAnswerRecord> {\n return this.questionAnswerRepository.getById(agentContext, questionAnswerId)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public findById(agentContext: AgentContext, questionAnswerId: string): Promise<QuestionAnswerRecord | null> {\n return this.questionAnswerRepository.findById(agentContext, questionAnswerId)\n }\n\n /**\n * Retrieve a question answer record by id\n *\n * @param questionAnswerId The questionAnswer record id\n * @return The question answer record or null if not found\n *\n */\n public getAll(agentContext: AgentContext) {\n return this.questionAnswerRepository.getAll(agentContext)\n }\n\n public async findAllByQuery(\n agentContext: AgentContext,\n query: Query<QuestionAnswerRecord>,\n queryOptions?: QueryOptions\n ) {\n return this.questionAnswerRepository.findByQuery(agentContext, query, queryOptions)\n }\n}\n"],"mappings":"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"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { QuestionAnswerService } from "./QuestionAnswerService.mjs";
|
|
1
|
+
import { QuestionAnswerService } from "./QuestionAnswerService.mjs";
|
|
2
|
+
export { QuestionAnswerService };
|
package/build/services/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
".": "./build/index.mjs",
|
|
5
5
|
"./package.json": "./package.json"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.7.2
|
|
7
|
+
"version": "0.7.2",
|
|
8
8
|
"files": [
|
|
9
9
|
"build"
|
|
10
10
|
],
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"class-transformer": "0.5.1",
|
|
23
23
|
"class-validator": "^0.14.3",
|
|
24
24
|
"rxjs": "^7.8.2",
|
|
25
|
-
"@credo-ts/core": "0.7.2
|
|
26
|
-
"@credo-ts/didcomm": "0.7.2
|
|
25
|
+
"@credo-ts/core": "0.7.2",
|
|
26
|
+
"@credo-ts/didcomm": "0.7.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"reflect-metadata": "0.2.2",
|
|
30
30
|
"typescript": "~5.9.3",
|
|
31
|
-
"@credo-ts/node": "0.7.2
|
|
31
|
+
"@credo-ts/node": "0.7.2"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsdown --config-loader unrun"
|