@credo-ts/question-answer 0.4.1-alpha.157

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 (60) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +65 -0
  3. package/build/QuestionAnswerApi.d.ts +53 -0
  4. package/build/QuestionAnswerApi.js +106 -0
  5. package/build/QuestionAnswerApi.js.map +1 -0
  6. package/build/QuestionAnswerEvents.d.ts +13 -0
  7. package/build/QuestionAnswerEvents.js +8 -0
  8. package/build/QuestionAnswerEvents.js.map +1 -0
  9. package/build/QuestionAnswerModule.d.ts +9 -0
  10. package/build/QuestionAnswerModule.js +29 -0
  11. package/build/QuestionAnswerModule.js.map +1 -0
  12. package/build/QuestionAnswerRole.d.ts +4 -0
  13. package/build/QuestionAnswerRole.js +9 -0
  14. package/build/QuestionAnswerRole.js.map +1 -0
  15. package/build/handlers/AnswerMessageHandler.d.ts +9 -0
  16. package/build/handlers/AnswerMessageHandler.js +15 -0
  17. package/build/handlers/AnswerMessageHandler.js.map +1 -0
  18. package/build/handlers/QuestionMessageHandler.d.ts +9 -0
  19. package/build/handlers/QuestionMessageHandler.js +15 -0
  20. package/build/handlers/QuestionMessageHandler.js.map +1 -0
  21. package/build/handlers/index.d.ts +2 -0
  22. package/build/handlers/index.js +19 -0
  23. package/build/handlers/index.js.map +1 -0
  24. package/build/index.d.ts +8 -0
  25. package/build/index.js +25 -0
  26. package/build/index.js.map +1 -0
  27. package/build/messages/AnswerMessage.d.ts +15 -0
  28. package/build/messages/AnswerMessage.js +42 -0
  29. package/build/messages/AnswerMessage.js.map +1 -0
  30. package/build/messages/QuestionMessage.d.ts +23 -0
  31. package/build/messages/QuestionMessage.js +70 -0
  32. package/build/messages/QuestionMessage.js.map +1 -0
  33. package/build/messages/index.d.ts +2 -0
  34. package/build/messages/index.js +19 -0
  35. package/build/messages/index.js.map +1 -0
  36. package/build/models/QuestionAnswerState.d.ts +11 -0
  37. package/build/models/QuestionAnswerState.js +16 -0
  38. package/build/models/QuestionAnswerState.js.map +1 -0
  39. package/build/models/ValidResponse.d.ts +4 -0
  40. package/build/models/ValidResponse.js +12 -0
  41. package/build/models/ValidResponse.js.map +1 -0
  42. package/build/models/index.d.ts +2 -0
  43. package/build/models/index.js +19 -0
  44. package/build/models/index.js.map +1 -0
  45. package/build/repository/QuestionAnswerRecord.d.ts +48 -0
  46. package/build/repository/QuestionAnswerRecord.js +44 -0
  47. package/build/repository/QuestionAnswerRecord.js.map +1 -0
  48. package/build/repository/QuestionAnswerRepository.d.ts +5 -0
  49. package/build/repository/QuestionAnswerRepository.js +29 -0
  50. package/build/repository/QuestionAnswerRepository.js.map +1 -0
  51. package/build/repository/index.d.ts +2 -0
  52. package/build/repository/index.js +19 -0
  53. package/build/repository/index.js.map +1 -0
  54. package/build/services/QuestionAnswerService.d.ts +107 -0
  55. package/build/services/QuestionAnswerService.js +234 -0
  56. package/build/services/QuestionAnswerService.js.map +1 -0
  57. package/build/services/index.d.ts +1 -0
  58. package/build/services/index.js +18 -0
  59. package/build/services/index.js.map +1 -0
  60. package/package.json +39 -0
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.QuestionAnswerService = void 0;
16
+ const core_1 = require("@credo-ts/core");
17
+ const QuestionAnswerEvents_1 = require("../QuestionAnswerEvents");
18
+ const QuestionAnswerRole_1 = require("../QuestionAnswerRole");
19
+ const messages_1 = require("../messages");
20
+ const models_1 = require("../models");
21
+ const repository_1 = require("../repository");
22
+ let QuestionAnswerService = class QuestionAnswerService {
23
+ constructor(questionAnswerRepository, eventEmitter, logger) {
24
+ this.questionAnswerRepository = questionAnswerRepository;
25
+ this.eventEmitter = eventEmitter;
26
+ this.logger = logger;
27
+ }
28
+ /**
29
+ * Create a question message and a new QuestionAnswer record for the questioner role
30
+ *
31
+ * @param question text for question message
32
+ * @param details optional details for question message
33
+ * @param connectionId connection for QuestionAnswer record
34
+ * @param validResponses array of valid responses for question
35
+ * @returns question message and QuestionAnswer record
36
+ */
37
+ async createQuestion(agentContext, connectionId, config) {
38
+ const questionMessage = new messages_1.QuestionMessage({
39
+ questionText: config.question,
40
+ questionDetail: config === null || config === void 0 ? void 0 : config.detail,
41
+ signatureRequired: false,
42
+ validResponses: config.validResponses,
43
+ });
44
+ const questionAnswerRecord = await this.createRecord({
45
+ questionText: questionMessage.questionText,
46
+ questionDetail: questionMessage.questionDetail,
47
+ threadId: questionMessage.threadId,
48
+ connectionId: connectionId,
49
+ role: QuestionAnswerRole_1.QuestionAnswerRole.Questioner,
50
+ signatureRequired: false,
51
+ state: models_1.QuestionAnswerState.QuestionSent,
52
+ validResponses: questionMessage.validResponses,
53
+ });
54
+ await this.questionAnswerRepository.save(agentContext, questionAnswerRecord);
55
+ this.eventEmitter.emit(agentContext, {
56
+ type: QuestionAnswerEvents_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged,
57
+ payload: { previousState: null, questionAnswerRecord },
58
+ });
59
+ return { questionMessage, questionAnswerRecord };
60
+ }
61
+ /**
62
+ * receive question message and create record for responder role
63
+ *
64
+ * @param messageContext the message context containing a question message
65
+ * @returns QuestionAnswer record
66
+ */
67
+ async processReceiveQuestion(messageContext) {
68
+ const { message: questionMessage } = messageContext;
69
+ this.logger.debug(`Receiving question message with id ${questionMessage.id}`);
70
+ const connection = messageContext.assertReadyConnection();
71
+ const questionRecord = await this.findByThreadAndConnectionId(messageContext.agentContext, connection.id, questionMessage.id);
72
+ if (questionRecord) {
73
+ throw new core_1.CredoError(`Question answer record with thread Id ${questionMessage.id} already exists.`);
74
+ }
75
+ const questionAnswerRecord = await this.createRecord({
76
+ questionText: questionMessage.questionText,
77
+ questionDetail: questionMessage.questionDetail,
78
+ connectionId: connection === null || connection === void 0 ? void 0 : connection.id,
79
+ threadId: questionMessage.threadId,
80
+ role: QuestionAnswerRole_1.QuestionAnswerRole.Responder,
81
+ signatureRequired: false,
82
+ state: models_1.QuestionAnswerState.QuestionReceived,
83
+ validResponses: questionMessage.validResponses,
84
+ });
85
+ await this.questionAnswerRepository.save(messageContext.agentContext, questionAnswerRecord);
86
+ this.eventEmitter.emit(messageContext.agentContext, {
87
+ type: QuestionAnswerEvents_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged,
88
+ payload: { previousState: null, questionAnswerRecord },
89
+ });
90
+ return questionAnswerRecord;
91
+ }
92
+ /**
93
+ * create answer message, check that response is valid
94
+ *
95
+ * @param questionAnswerRecord record containing question and valid responses
96
+ * @param response response used in answer message
97
+ * @returns answer message and QuestionAnswer record
98
+ */
99
+ async createAnswer(agentContext, questionAnswerRecord, response) {
100
+ const answerMessage = new messages_1.AnswerMessage({ response: response, threadId: questionAnswerRecord.threadId });
101
+ questionAnswerRecord.assertState(models_1.QuestionAnswerState.QuestionReceived);
102
+ questionAnswerRecord.response = response;
103
+ if (questionAnswerRecord.validResponses.some((e) => e.text === response)) {
104
+ await this.updateState(agentContext, questionAnswerRecord, models_1.QuestionAnswerState.AnswerSent);
105
+ }
106
+ else {
107
+ throw new core_1.CredoError(`Response does not match valid responses`);
108
+ }
109
+ return { answerMessage, questionAnswerRecord };
110
+ }
111
+ /**
112
+ * receive answer as questioner
113
+ *
114
+ * @param messageContext the message context containing an answer message message
115
+ * @returns QuestionAnswer record
116
+ */
117
+ async receiveAnswer(messageContext) {
118
+ const { message: answerMessage } = messageContext;
119
+ this.logger.debug(`Receiving answer message with id ${answerMessage.id}`);
120
+ const connection = messageContext.assertReadyConnection();
121
+ const questionAnswerRecord = await this.findByThreadAndConnectionId(messageContext.agentContext, connection.id, answerMessage.threadId);
122
+ if (!questionAnswerRecord) {
123
+ throw new core_1.CredoError(`Question Answer record with thread Id ${answerMessage.threadId} not found.`);
124
+ }
125
+ questionAnswerRecord.assertState(models_1.QuestionAnswerState.QuestionSent);
126
+ questionAnswerRecord.assertRole(QuestionAnswerRole_1.QuestionAnswerRole.Questioner);
127
+ questionAnswerRecord.response = answerMessage.response;
128
+ await this.updateState(messageContext.agentContext, questionAnswerRecord, models_1.QuestionAnswerState.AnswerReceived);
129
+ return questionAnswerRecord;
130
+ }
131
+ /**
132
+ * Update the record to a new state and emit an state changed event. Also updates the record
133
+ * in storage.
134
+ *
135
+ * @param questionAnswerRecord The question answer record to update the state for
136
+ * @param newState The state to update to
137
+ *
138
+ */
139
+ async updateState(agentContext, questionAnswerRecord, newState) {
140
+ const previousState = questionAnswerRecord.state;
141
+ questionAnswerRecord.state = newState;
142
+ await this.questionAnswerRepository.update(agentContext, questionAnswerRecord);
143
+ this.eventEmitter.emit(agentContext, {
144
+ type: QuestionAnswerEvents_1.QuestionAnswerEventTypes.QuestionAnswerStateChanged,
145
+ payload: {
146
+ previousState,
147
+ questionAnswerRecord: questionAnswerRecord,
148
+ },
149
+ });
150
+ }
151
+ async createRecord(options) {
152
+ const questionMessageRecord = new repository_1.QuestionAnswerRecord({
153
+ questionText: options.questionText,
154
+ questionDetail: options.questionDetail,
155
+ connectionId: options.connectionId,
156
+ threadId: options.threadId,
157
+ role: options.role,
158
+ signatureRequired: options.signatureRequired,
159
+ state: options.state,
160
+ validResponses: options.validResponses,
161
+ });
162
+ return questionMessageRecord;
163
+ }
164
+ /**
165
+ * Retrieve a question answer record by connection id and thread id
166
+ *
167
+ * @param connectionId The connection id
168
+ * @param threadId The thread id
169
+ * @throws {RecordNotFoundError} If no record is found
170
+ * @throws {RecordDuplicateError} If multiple records are found
171
+ * @returns The question answer record
172
+ */
173
+ getByThreadAndConnectionId(agentContext, connectionId, threadId) {
174
+ return this.questionAnswerRepository.getSingleByQuery(agentContext, {
175
+ connectionId,
176
+ threadId,
177
+ });
178
+ }
179
+ /**
180
+ * Retrieve a question answer record by thread id
181
+ *
182
+ * @param connectionId The connection id
183
+ * @param threadId The thread id
184
+ * @returns The question answer record or null if not found
185
+ */
186
+ findByThreadAndConnectionId(agentContext, connectionId, threadId) {
187
+ return this.questionAnswerRepository.findSingleByQuery(agentContext, {
188
+ connectionId,
189
+ threadId,
190
+ });
191
+ }
192
+ /**
193
+ * Retrieve a question answer record by id
194
+ *
195
+ * @param questionAnswerId The questionAnswer record id
196
+ * @throws {RecordNotFoundError} If no record is found
197
+ * @return The question answer record
198
+ *
199
+ */
200
+ getById(agentContext, questionAnswerId) {
201
+ return this.questionAnswerRepository.getById(agentContext, questionAnswerId);
202
+ }
203
+ /**
204
+ * Retrieve a question answer record by id
205
+ *
206
+ * @param questionAnswerId The questionAnswer record id
207
+ * @return The question answer record or null if not found
208
+ *
209
+ */
210
+ findById(agentContext, questionAnswerId) {
211
+ return this.questionAnswerRepository.findById(agentContext, questionAnswerId);
212
+ }
213
+ /**
214
+ * Retrieve a question answer record by id
215
+ *
216
+ * @param questionAnswerId The questionAnswer record id
217
+ * @return The question answer record or null if not found
218
+ *
219
+ */
220
+ getAll(agentContext) {
221
+ return this.questionAnswerRepository.getAll(agentContext);
222
+ }
223
+ async findAllByQuery(agentContext, query) {
224
+ return this.questionAnswerRepository.findByQuery(agentContext, query);
225
+ }
226
+ };
227
+ QuestionAnswerService = __decorate([
228
+ (0, core_1.injectable)(),
229
+ __param(2, (0, core_1.inject)(core_1.InjectionSymbols.Logger)),
230
+ __metadata("design:paramtypes", [repository_1.QuestionAnswerRepository,
231
+ core_1.EventEmitter, Object])
232
+ ], QuestionAnswerService);
233
+ exports.QuestionAnswerService = QuestionAnswerService;
234
+ //# sourceMappingURL=QuestionAnswerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionAnswerService.js","sourceRoot":"","sources":["../../src/services/QuestionAnswerService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,yCAAuG;AAEvG,kEAAkE;AAClE,8DAA0D;AAC1D,0CAA4D;AAC5D,sCAA+C;AAC/C,8CAA8E;AAGvE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAKhC,YACE,wBAAkD,EAClD,YAA0B,EACO,MAAc;QAE/C,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAA;QACxD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IACD;;;;;;;;OAQG;IACI,KAAK,CAAC,cAAc,CACzB,YAA0B,EAC1B,YAAoB,EACpB,MAIC;QAED,MAAM,eAAe,GAAG,IAAI,0BAAe,CAAC;YAC1C,YAAY,EAAE,MAAM,CAAC,QAAQ;YAC7B,cAAc,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM;YAC9B,iBAAiB,EAAE,KAAK;YACxB,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,CAAC,CAAA;QAEF,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC;YACnD,YAAY,EAAE,eAAe,CAAC,YAAY;YAC1C,cAAc,EAAE,eAAe,CAAC,cAAc;YAC9C,QAAQ,EAAE,eAAe,CAAC,QAAQ;YAClC,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,uCAAkB,CAAC,UAAU;YACnC,iBAAiB,EAAE,KAAK;YACxB,KAAK,EAAE,4BAAmB,CAAC,YAAY;YACvC,cAAc,EAAE,eAAe,CAAC,cAAc;SA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A;IACvE,CAAC;CACF,CAAA;AAxRY,qBAAqB;IADjC,IAAA,iBAAU,GAAE;IASR,WAAA,IAAA,aAAM,EAAC,uBAAgB,CAAC,MAAM,CAAC,CAAA;qCAFN,qCAAwB;QACpC,mBAAY;GAPjB,qBAAqB,CAwRjC;AAxRY,sDAAqB"}
@@ -0,0 +1 @@
1
+ export * from './QuestionAnswerService';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./QuestionAnswerService"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@credo-ts/question-answer",
3
+ "main": "build/index",
4
+ "types": "build/index",
5
+ "version": "0.4.1-alpha.157+b83c5173",
6
+ "files": [
7
+ "build"
8
+ ],
9
+ "license": "Apache-2.0",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/question-answer",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/openwallet-foundation/credo-ts",
17
+ "directory": "packages/question-answer"
18
+ },
19
+ "scripts": {
20
+ "build": "yarn run clean && yarn run compile",
21
+ "clean": "rimraf ./build",
22
+ "compile": "tsc -p tsconfig.build.json",
23
+ "prepublishOnly": "yarn run build",
24
+ "test": "jest"
25
+ },
26
+ "dependencies": {
27
+ "@credo-ts/core": "0.4.1-alpha.157+b83c5173",
28
+ "class-transformer": "0.5.1",
29
+ "class-validator": "0.14.1",
30
+ "rxjs": "^7.8.0"
31
+ },
32
+ "devDependencies": {
33
+ "@credo-ts/node": "0.4.1-alpha.157+b83c5173",
34
+ "reflect-metadata": "^0.1.13",
35
+ "rimraf": "^4.4.0",
36
+ "typescript": "~4.9.5"
37
+ },
38
+ "gitHead": "b83c5173070594448d92f801331b3a31c7ac8049"
39
+ }