@credo-ts/question-answer 0.6.2-alpha-20260204082017 → 0.6.2-alpha-20260204094529

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.
Files changed (32) hide show
  1. package/build/QuestionAnswerApi.d.mts.map +1 -1
  2. package/build/QuestionAnswerApi.mjs +3 -3
  3. package/build/QuestionAnswerApi.mjs.map +1 -1
  4. package/build/QuestionAnswerEvents.d.mts +1 -1
  5. package/build/QuestionAnswerEvents.d.mts.map +1 -1
  6. package/build/QuestionAnswerEvents.mjs +3 -3
  7. package/build/QuestionAnswerEvents.mjs.map +1 -1
  8. package/build/QuestionAnswerModule.d.mts.map +1 -1
  9. package/build/QuestionAnswerRole.d.mts +1 -1
  10. package/build/QuestionAnswerRole.d.mts.map +1 -1
  11. package/build/QuestionAnswerRole.mjs +4 -4
  12. package/build/QuestionAnswerRole.mjs.map +1 -1
  13. package/build/_virtual/{_@oxc-project_runtime@0.99.0 → _@oxc-project_runtime@0.110.0}/helpers/decorate.mjs +1 -1
  14. package/build/_virtual/{_@oxc-project_runtime@0.99.0 → _@oxc-project_runtime@0.110.0}/helpers/decorateMetadata.mjs +1 -1
  15. package/build/_virtual/{_@oxc-project_runtime@0.99.0 → _@oxc-project_runtime@0.110.0}/helpers/decorateParam.mjs +1 -1
  16. package/build/messages/AnswerMessage.d.mts.map +1 -1
  17. package/build/messages/AnswerMessage.mjs +2 -2
  18. package/build/messages/QuestionMessage.d.mts.map +1 -1
  19. package/build/messages/QuestionMessage.mjs +2 -2
  20. package/build/models/QuestionAnswerState.d.mts +1 -1
  21. package/build/models/QuestionAnswerState.d.mts.map +1 -1
  22. package/build/models/QuestionAnswerState.mjs +6 -6
  23. package/build/models/QuestionAnswerState.mjs.map +1 -1
  24. package/build/models/ValidResponse.d.mts.map +1 -1
  25. package/build/repository/QuestionAnswerRecord.d.mts.map +1 -1
  26. package/build/repository/QuestionAnswerRepository.d.mts.map +1 -1
  27. package/build/repository/QuestionAnswerRepository.mjs +4 -4
  28. package/build/repository/QuestionAnswerRepository.mjs.map +1 -1
  29. package/build/services/QuestionAnswerService.d.mts.map +1 -1
  30. package/build/services/QuestionAnswerService.mjs +4 -4
  31. package/build/services/QuestionAnswerService.mjs.map +1 -1
  32. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerApi.d.mts","names":[],"sources":["../src/QuestionAnswerApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAQa,iBAAA;;;EAAA,QAAA,iBAAiB;EAOH,QAAA,YAAA;EACR,WAAA,CAAA,qBAAA,EADQ,qBACR,EAAA,aAAA,EAAA,oBAAA,EAAA,iBAAA,EACI,wBADJ,EAAA,YAAA,EAED,YAFC;EACI;;;;;;;;EAkFR,YAAA,CAAA,YAAA,EAAA,MAAA,EAAA,MAAA,EAAA;IASsB,QAAA,EAAA,MAAA;IAAN,cAAA,EAtET,aAsES,EAAA;IAA4C,MAAA,CAAA,EAAA,MAAA;EAAY,CAAA,CAAA,EApElF,OAoEkF,CApElF,oBAoEkF,CAAA;EAAA;;;;;;;0DApCnB,QAAA;;;;;;YA2BrD,QAAA;;;;;;wBASgB,MAAM,sCAAsC,eAAY,QAAA;;;;;;;;sCAW7C,QAAA"}
1
+ {"version":3,"file":"QuestionAnswerApi.d.mts","names":[],"sources":["../src/QuestionAnswerApi.ts"],"mappings":";;;;;;;;;cAQa,iBAAA;EAAA,QACH,qBAAA;EAAA,QACA,aAAA;EAAA,QACA,iBAAA;EAAA,QACA,YAAA;cAGN,qBAAA,EAAuB,qBAAA,EACvB,aAAA,EAAe,oBAAA,EACf,iBAAA,EAAmB,wBAAA,EACnB,YAAA,EAAc,YAAA;EAHS;;;;;;;;EAmBZ,YAAA,CACX,YAAA,UACA,MAAA;IACE,QAAA;IACA,cAAA,EAAgB,aAAA;IAChB,MAAA;EAAA,IACD,OAAA,CAAA,oBAAA;EAoEsE;;;;;;;EApC5D,UAAA,CAAW,gBAAA,UAA0B,QAAA,WAAgB,OAAA,CAAA,oBAAA;EA9D1D;;;;;EAyFD,MAAA,CAAA,GAAM,OAAA,CAAA,oBAAA;EAnFI;;;;;EA4FV,cAAA,CAAe,KAAA,EAAO,KAAA,CAAM,oBAAA,GAAuB,YAAA,GAAe,YAAA,GAAY,OAAA,CAAA,oBAAA;EA1ExE;;;;;;;EAqFN,QAAA,CAAS,gBAAA,WAAwB,OAAA,CAAA,oBAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "./_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
2
- import { __decorate } from "./_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
1
+ import { __decorateMetadata } from "./_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs";
2
+ import { __decorate } from "./_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.mjs";
3
3
  import { ValidResponse } from "./models/ValidResponse.mjs";
4
4
  import { QuestionAnswerService } from "./services/QuestionAnswerService.mjs";
5
5
  import "./services/index.mjs";
@@ -8,7 +8,7 @@ import { AgentContext, injectable } from "@credo-ts/core";
8
8
 
9
9
  //#region src/QuestionAnswerApi.ts
10
10
  var _ref, _ref2, _ref3, _ref4;
11
- let QuestionAnswerApi = class QuestionAnswerApi$1 {
11
+ let QuestionAnswerApi = class QuestionAnswerApi {
12
12
  constructor(questionAnswerService, messageSender, connectionService, agentContext) {
13
13
  this.questionAnswerService = questionAnswerService;
14
14
  this.messageSender = messageSender;
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerApi.mjs","names":["QuestionAnswerApi"],"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,8BAAMA,oBAAkB;CAM7B,AAAO,YACL,uBACA,eACA,mBACA,cACA;AACA,OAAK,wBAAwB;AAC7B,OAAK,gBAAgB;AACrB,OAAK,oBAAoB;AACzB,OAAK,eAAe;;;;;;;;;;CAWtB,MAAa,aACX,cACA,QAKA;EACA,MAAM,aAAa,MAAM,KAAK,kBAAkB,QAAQ,KAAK,cAAc,aAAa;AACxF,aAAW,aAAa;EAExB,MAAM,EAAE,iBAAiB,yBAAyB,MAAM,KAAK,sBAAsB,eACjF,KAAK,cACL,cACA;GACE,UAAU,OAAO;GACjB,gBAAgB,OAAO,eAAe,KAAK,SAAS,IAAI,cAAc,KAAK,CAAC;GAC5E,QAAQ,QAAQ;GACjB,CACF;EACD,MAAM,yBAAyB,MAAM,iCAAiC,KAAK,cAAc;GACvF,SAAS;GACT,kBAAkB;GAClB,kBAAkB;GACnB,CAAC;AAEF,QAAM,KAAK,cAAc,YAAY,uBAAuB;AAE5D,SAAO;;;;;;;;;CAUT,MAAa,WAAW,kBAA0B,UAAkB;EAClE,MAAM,iBAAiB,MAAM,KAAK,sBAAsB,QAAQ,KAAK,cAAc,iBAAiB;EAEpG,MAAM,EAAE,eAAe,yBAAyB,MAAM,KAAK,sBAAsB,aAC/E,KAAK,cACL,gBACA,SACD;EAED,MAAM,aAAa,MAAM,KAAK,kBAAkB,QAAQ,KAAK,cAAc,eAAe,aAAa;EAEvG,MAAM,yBAAyB,MAAM,iCAAiC,KAAK,cAAc;GACvF,SAAS;GACT,kBAAkB;GAClB,kBAAkB;GACnB,CAAC;AAEF,QAAM,KAAK,cAAc,YAAY,uBAAuB;AAE5D,SAAO;;;;;;;CAQT,AAAO,SAAS;AACd,SAAO,KAAK,sBAAsB,OAAO,KAAK,aAAa;;;;;;;CAQ7D,AAAO,eAAe,OAAoC,cAA6B;AACrF,SAAO,KAAK,sBAAsB,eAAe,KAAK,cAAc,OAAO,aAAa;;;;;;;;;CAU1F,AAAO,SAAS,kBAA0B;AACxC,SAAO,KAAK,sBAAsB,SAAS,KAAK,cAAc,iBAAiB;;;gCAjHlF,YAAY"}
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,8BAAM,kBAAkB;CAM7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AAc,iBAAiB;;;gCAjHlF,YAAY"}
@@ -5,7 +5,7 @@ import { BaseEvent } from "@credo-ts/core";
5
5
 
6
6
  //#region src/QuestionAnswerEvents.d.ts
7
7
  declare enum QuestionAnswerEventTypes {
8
- QuestionAnswerStateChanged = "QuestionAnswerStateChanged",
8
+ QuestionAnswerStateChanged = "QuestionAnswerStateChanged"
9
9
  }
10
10
  interface QuestionAnswerStateChangedEvent extends BaseEvent {
11
11
  type: typeof QuestionAnswerEventTypes.QuestionAnswerStateChanged;
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerEvents.d.mts","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"sourcesContent":[],"mappings":";;;;;;aAIY,wBAAA;;;AAAA,UAGK,+BAAA,SAAwC,SAHrB,CAAA;EAGnB,IAAA,EAAA,OACF,wBAAA,CAAyB,0BADS;EAClC,OAAA,EAAA;IAEI,aAAA,EAAA,mBAAA,GAAA,IAAA;IACO,oBAAA,EAAA,oBAAA;EAJ+B,CAAA"}
1
+ {"version":3,"file":"QuestionAnswerEvents.d.mts","names":[],"sources":["../src/QuestionAnswerEvents.ts"],"mappings":";;;;;;aAIY,wBAAA;EACV,0BAAA;AAAA;AAAA,UAEe,+BAAA,SAAwC,SAAA;EACvD,IAAA,SAAa,wBAAA,CAAyB,0BAAA;EACtC,OAAA;IACE,aAAA,EAAe,mBAAA;IACf,oBAAA,EAAsB,oBAAA;EAAA;AAAA"}
@@ -1,7 +1,7 @@
1
1
  //#region src/QuestionAnswerEvents.ts
2
- let QuestionAnswerEventTypes = /* @__PURE__ */ function(QuestionAnswerEventTypes$1) {
3
- QuestionAnswerEventTypes$1["QuestionAnswerStateChanged"] = "QuestionAnswerStateChanged";
4
- return QuestionAnswerEventTypes$1;
2
+ let QuestionAnswerEventTypes = /* @__PURE__ */ function(QuestionAnswerEventTypes) {
3
+ QuestionAnswerEventTypes["QuestionAnswerStateChanged"] = "QuestionAnswerStateChanged";
4
+ return QuestionAnswerEventTypes;
5
5
  }({});
6
6
 
7
7
  //#endregion
@@ -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,gFAAL;AACL"}
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,8EAAL;AACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerModule.d.mts","names":[],"sources":["../src/QuestionAnswerModule.ts"],"sourcesContent":[],"mappings":";;;;cASa,oBAAA,YAAgC;uBACxB;EADR;;;EAc2B,QAAA,CAAA,iBAAA,EARH,iBAQG,CAAA,EAAA,IAAA;EAAY,UAAA,CAAA,YAAA,EAAZ,YAAY,CAAA,EAAA,OAAA,CAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"QuestionAnswerModule.d.mts","names":[],"sources":["../src/QuestionAnswerModule.ts"],"mappings":";;;;cASa,oBAAA,YAAgC,MAAA;EAAA,SAC3B,GAAA,SAAG,iBAAA;EADR;;;EAMJ,QAAA,CAAS,iBAAA,EAAmB,iBAAA;EAQtB,UAAA,CAAW,YAAA,EAAc,YAAA,GAAY,OAAA;AAAA"}
@@ -1,7 +1,7 @@
1
1
  //#region src/QuestionAnswerRole.d.ts
2
2
  declare enum QuestionAnswerRole {
3
3
  Questioner = "questioner",
4
- Responder = "responder",
4
+ Responder = "responder"
5
5
  }
6
6
  //#endregion
7
7
  export { QuestionAnswerRole };
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerRole.d.mts","names":[],"sources":["../src/QuestionAnswerRole.ts"],"sourcesContent":[],"mappings":";aAAY,kBAAA;EAAA,UAAA,GAAA,YAAkB"}
1
+ {"version":3,"file":"QuestionAnswerRole.d.mts","names":[],"sources":["../src/QuestionAnswerRole.ts"],"mappings":";aAAY,kBAAA;EACV,UAAA;EACA,SAAA;AAAA"}
@@ -1,8 +1,8 @@
1
1
  //#region src/QuestionAnswerRole.ts
2
- let QuestionAnswerRole = /* @__PURE__ */ function(QuestionAnswerRole$1) {
3
- QuestionAnswerRole$1["Questioner"] = "questioner";
4
- QuestionAnswerRole$1["Responder"] = "responder";
5
- return QuestionAnswerRole$1;
2
+ let QuestionAnswerRole = /* @__PURE__ */ function(QuestionAnswerRole) {
3
+ QuestionAnswerRole["Questioner"] = "questioner";
4
+ QuestionAnswerRole["Responder"] = "responder";
5
+ return QuestionAnswerRole;
6
6
  }({});
7
7
 
8
8
  //#endregion
@@ -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,oEAAL;AACL;AACA"}
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,kEAAL;AACL;AACA"}
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.99.0/helpers/decorate.js
1
+ //#region \0@oxc-project+runtime@0.110.0/helpers/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);
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.99.0/helpers/decorateMetadata.js
1
+ //#region \0@oxc-project+runtime@0.110.0/helpers/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
  }
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.99.0/helpers/decorateParam.js
1
+ //#region \0@oxc-project+runtime@0.110.0/helpers/decorateParam.js
2
2
  function __decorateParam(paramIndex, decorator) {
3
3
  return function(target, key) {
4
4
  decorator(target, key, paramIndex);
@@ -1 +1 @@
1
- {"version":3,"file":"AnswerMessage.d.mts","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"sourcesContent":[],"mappings":";;;;cAIa,aAAA,SAAsB,cAAA;;;AAAnC;;;;;;;;wBAA2B,kBAAA,CAiBE"}
1
+ {"version":3,"file":"AnswerMessage.d.mts","names":[],"sources":["../../src/messages/AnswerMessage.ts"],"mappings":";;;;cAIa,aAAA,SAAsB,cAAA;;;AAAnC;;cAKqB,OAAA;IAAW,EAAA;IAAa,QAAA;IAAkB,QAAA;EAAA;EAAA,SAW7C,IAAA;EAAA,gBACO,IAAA,EAjBE,kBAAA,CAiBE,iBAAA;EAIpB,QAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
2
- import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
1
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs";
2
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/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";
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionMessage.d.mts","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"sourcesContent":[],"mappings":";;;;;cAMa,eAAA,SAAwB,cAAA;;;AAArC;;EAQiC,WAAA,CAAA,OAmBJ,EAAA;IAeH,YAAA,EAAA,MAAA;IA1CW,cAAA,CAAA,EAAA,MAAA;IAAc,cAAA,EAQ/B,aAR+B,EAAA;;;;;;wBAQlB,kBAAA,CAmBJ;;;kBAeH"}
1
+ {"version":3,"file":"QuestionMessage.d.mts","names":[],"sources":["../../src/messages/QuestionMessage.ts"],"mappings":";;;;;cAMa,eAAA,SAAwB,cAAA;;;AAArC;;cAKqB,OAAA;IACjB,YAAA;IACA,cAAA;IACA,cAAA,EAAgB,aAAA;IAChB,iBAAA;IACA,EAAA;IACA,KAAA;EAAA;EAAA,SAec,IAAA;EAAA,gBACO,IAAA,EAnBQ,kBAAA,CAmBJ,iBAAA;EAIpB,KAAA;EAKA,iBAAA;EAMA,cAAA,EAAiB,aAAA;EAIjB,YAAA;EAKA,cAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
2
- import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
1
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs";
2
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/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";
@@ -8,7 +8,7 @@ declare enum QuestionAnswerState {
8
8
  QuestionSent = "question-sent",
9
9
  QuestionReceived = "question-received",
10
10
  AnswerReceived = "answer-received",
11
- AnswerSent = "answer-sent",
11
+ AnswerSent = "answer-sent"
12
12
  }
13
13
  //#endregion
14
14
  export { QuestionAnswerState };
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerState.d.mts","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"sourcesContent":[],"mappings":";;AAKA;;;;aAAY,mBAAA"}
1
+ {"version":3,"file":"QuestionAnswerState.d.mts","names":[],"sources":["../../src/models/QuestionAnswerState.ts"],"mappings":";;AAKA;;;;aAAY,mBAAA;EACV,YAAA;EACA,gBAAA;EACA,cAAA;EACA,UAAA;AAAA"}
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0113-question-answer/README.md
6
6
  */
7
- let QuestionAnswerState = /* @__PURE__ */ function(QuestionAnswerState$1) {
8
- QuestionAnswerState$1["QuestionSent"] = "question-sent";
9
- QuestionAnswerState$1["QuestionReceived"] = "question-received";
10
- QuestionAnswerState$1["AnswerReceived"] = "answer-received";
11
- QuestionAnswerState$1["AnswerSent"] = "answer-sent";
12
- return QuestionAnswerState$1;
7
+ let QuestionAnswerState = /* @__PURE__ */ function(QuestionAnswerState) {
8
+ QuestionAnswerState["QuestionSent"] = "question-sent";
9
+ QuestionAnswerState["QuestionReceived"] = "question-received";
10
+ QuestionAnswerState["AnswerReceived"] = "answer-received";
11
+ QuestionAnswerState["AnswerSent"] = "answer-sent";
12
+ return QuestionAnswerState;
13
13
  }({});
14
14
 
15
15
  //#endregion
@@ -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,sEAAL;AACL;AACA;AACA;AACA"}
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,oEAAL;AACL;AACA;AACA;AACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidResponse.d.mts","names":[],"sources":["../../src/models/ValidResponse.ts"],"sourcesContent":[],"mappings":";cAAa,aAAA;EAAA,WAAA,CAAA,OAAa,EACI,aAAA"}
1
+ {"version":3,"file":"ValidResponse.d.mts","names":[],"sources":["../../src/models/ValidResponse.ts"],"mappings":";cAAa,aAAA;cACQ,OAAA,EAAS,aAAA;EAMrB,IAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerRecord.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRecord.ts"],"sourcesContent":[],"mappings":";;;;;;KAKY,wBAAA,GAA2B;KAC3B,yBAAA;EADA,YAAA,EAAA,MAAA;EACA,IAAA,EAEJ,kBAFI;EAOA,KAAA,EAJH,mBAIqB;EAEb,QAAA,EAAA,MAAA;CAEH;AAEN,KANI,kBAAA,GAAqB,UAMzB,CANoC,oBAMpC,CAAA;AAEC,UANQ,0BAAA,CAMR;EACA,EAAA,CAAA,EAAA,MAAA;EA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A,EAAO,0BAAA;EAmBnB,OAAA,CAAA;;;;;;EAUA,UAAA,CAAW,YAAA,EAAc,kBAAA;EAMzB,WAAA,CAAY,cAAA,EAAgB,mBAAA,GAAsB,mBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerRepository.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"sourcesContent":[],"mappings":";;;;cAKa,wBAAA,SAAiC,WAAW;8BAEI,eAAe,qCAC1D;AAJlB"}
1
+ {"version":3,"file":"QuestionAnswerRepository.d.mts","names":[],"sources":["../../src/repository/QuestionAnswerRepository.ts"],"mappings":";;;;cAKa,wBAAA,SAAiC,UAAA,CAAW,oBAAA;cAEZ,cAAA,EAAgB,cAAA,CAAe,oBAAA,GACxE,YAAA,EAAc,YAAA;AAAA"}
@@ -1,12 +1,12 @@
1
- import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
2
- import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
1
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs";
2
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.mjs";
3
3
  import { QuestionAnswerRecord } from "./QuestionAnswerRecord.mjs";
4
- import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
4
+ import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateParam.mjs";
5
5
  import { EventEmitter, InjectionSymbols, Repository, inject, injectable } from "@credo-ts/core";
6
6
 
7
7
  //#region src/repository/QuestionAnswerRepository.ts
8
8
  var _ref;
9
- let QuestionAnswerRepository = class QuestionAnswerRepository$1 extends Repository {
9
+ let QuestionAnswerRepository = class QuestionAnswerRepository extends Repository {
10
10
  constructor(storageService, eventEmitter) {
11
11
  super(QuestionAnswerRecord, storageService, eventEmitter);
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerRepository.mjs","names":["QuestionAnswerRepository","storageService: StorageService<QuestionAnswerRecord>"],"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,qCAAMA,mCAAiC,WAAiC;CAC7E,AAAO,YACL,AAAyCC,gBACzC,cACA;AACA,QAAM,sBAAsB,gBAAgB,aAAa;;;;CAN5D,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}
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,qCAAM,iCAAiC,WAAiC;CAC7E,AAAO,YACL,AAAyC,gBACzC,cACA;AACA,QAAM,sBAAsB,gBAAgB,aAAa;;;;CAN5D,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerService.d.mts","names":[],"sources":["../../src/services/QuestionAnswerService.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAYa,qBAAA;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,UACA,MAAA;IACE,QAAA;IACA,cAAA,EAAgB,aAAA;IAChB,MAAA;EAAA,IACD,OAAA;;;;;;;;;;EAoCU,sBAAA,CACX,cAAA,EAAgB,4BAAA,CAA6B,eAAA,IAC5C,OAAA,CAAQ,oBAAA;EAqJK;;;;;;;EA3GH,YAAA,CAAa,YAAA,EAAc,YAAA,EAAc,oBAAA,EAAsB,oBAAA,EAAsB,QAAA,WAAgB,OAAA;;;;EA0J3C;;;;;;EArI1D,aAAA,CACX,cAAA,EAAgB,4BAAA,CAA6B,aAAA,IAC5C,OAAA,CAAQ,oBAAA;EAqJM;;;;;;;;EAAA,QArHH,WAAA;EAAA,QAkBA,YAAA;EAjLZ;;;;;;;;;EAkNK,0BAAA,CACL,YAAA,EAAc,YAAA,EACd,YAAA,UACA,QAAA,WACC,OAAA,CAAQ,oBAAA;EAhMP;;;;;;;EA8MG,2BAAA,CACL,YAAA,EAAc,YAAA,EACd,YAAA,UACA,QAAA,WACC,OAAA,CAAQ,oBAAA;;;;;;;;;EAeJ,OAAA,CAAQ,YAAA,EAAc,YAAA,EAAc,gBAAA,WAA2B,OAAA,CAAQ,oBAAA;EA/IpD;;;;;;;EA0JnB,QAAA,CAAS,YAAA,EAAc,YAAA,EAAc,gBAAA,WAA2B,OAAA,CAAQ,oBAAA;;;;;;;;EAWxE,MAAA,CAAO,YAAA,EAAc,YAAA,GAAY,OAAA,CAAA,oBAAA;EAI3B,cAAA,CACX,YAAA,EAAc,YAAA,EACd,KAAA,EAAO,KAAA,CAAM,oBAAA,GACb,YAAA,GAAe,YAAA,GAAY,OAAA,CAAA,oBAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
2
- import { __decorate } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
1
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorateMetadata.mjs";
2
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/decorate.mjs";
3
3
  import { AnswerMessage } from "../messages/AnswerMessage.mjs";
4
4
  import { QuestionAnswerState } from "../models/QuestionAnswerState.mjs";
5
5
  import { QuestionMessage } from "../messages/QuestionMessage.mjs";
@@ -7,14 +7,14 @@ import "../messages/index.mjs";
7
7
  import { QuestionAnswerEventTypes } from "../QuestionAnswerEvents.mjs";
8
8
  import { QuestionAnswerRole } from "../QuestionAnswerRole.mjs";
9
9
  import { QuestionAnswerRecord } from "../repository/QuestionAnswerRecord.mjs";
10
- import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs";
10
+ import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.110.0/helpers/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
14
 
15
15
  //#region src/services/QuestionAnswerService.ts
16
16
  var _ref, _ref2;
17
- let QuestionAnswerService = class QuestionAnswerService$1 {
17
+ let QuestionAnswerService = class QuestionAnswerService {
18
18
  constructor(questionAnswerRepository, eventEmitter, logger) {
19
19
  this.questionAnswerRepository = questionAnswerRepository;
20
20
  this.eventEmitter = eventEmitter;
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionAnswerService.mjs","names":["QuestionAnswerService","logger: Logger"],"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,kCAAMA,wBAAsB;CAKjC,AAAO,YACL,0BACA,cACA,AAAiCC,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,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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":";;;;;;;;;;;;;;;;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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AAO,aAAa;;;;CA7RtF,YAAY;oBASR,OAAO,iBAAiB,OAAO"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./build/index.mjs",
5
5
  "./package.json": "./package.json"
6
6
  },
7
- "version": "0.6.2-alpha-20260204082017",
7
+ "version": "0.6.2-alpha-20260204094529",
8
8
  "files": [
9
9
  "build"
10
10
  ],
@@ -20,18 +20,18 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "class-transformer": "0.5.1",
23
- "class-validator": "^0.14.1",
23
+ "class-validator": "^0.14.3",
24
24
  "rxjs": "^7.8.2",
25
- "@credo-ts/core": "0.6.2-alpha-20260204082017",
26
- "@credo-ts/didcomm": "0.6.2-alpha-20260204082017"
25
+ "@credo-ts/core": "0.6.2-alpha-20260204094529",
26
+ "@credo-ts/didcomm": "0.6.2-alpha-20260204094529"
27
27
  },
28
28
  "devDependencies": {
29
29
  "reflect-metadata": "0.2.2",
30
30
  "typescript": "~5.9.3",
31
- "@credo-ts/node": "0.6.2-alpha-20260204082017"
31
+ "@credo-ts/node": "0.6.2-alpha-20260204094529"
32
32
  },
33
33
  "scripts": {
34
- "build": "tsdown --config-loader unconfig"
34
+ "build": "tsdown --config-loader unrun"
35
35
  },
36
36
  "types": "./build/index.d.mts",
37
37
  "module": "./build/index.mjs"