@studyportals/sp-lurch-interface 3.3.2-0 → 3.3.2-1
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/index.d.ts +4 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lurch-client.d.ts +2 -1
- package/src/lurch-client.js +4 -4
- package/src/lurch-client.js.map +1 -1
- package/src/results/retrieve-survey-result.class.d.ts +8 -0
- package/src/results/retrieve-survey-result.class.js +19 -0
- package/src/results/retrieve-survey-result.class.js.map +1 -0
- package/src/survey/interfaces/i-retrieved-survey-answer.interface.d.ts +5 -0
- package/src/survey/interfaces/i-retrieved-survey-answer.interface.js +3 -0
- package/src/survey/interfaces/i-retrieved-survey-answer.interface.js.map +1 -0
- package/src/survey/interfaces/i-retrieved-survey-answered-question.interface.d.ts +7 -0
- package/src/survey/interfaces/i-retrieved-survey-answered-question.interface.js +3 -0
- package/src/survey/interfaces/i-retrieved-survey-answered-question.interface.js.map +1 -0
package/index.d.ts
CHANGED
|
@@ -26,4 +26,7 @@ import { RetrieveSurveyQuestionsResult } from './src/results/retrieve-survey-que
|
|
|
26
26
|
import { IDomainCategoryOverview } from './src/input-batches/interfaces/i-domain-category-overview.interface';
|
|
27
27
|
import { DomainCategory } from './src/input-batches/domain-category';
|
|
28
28
|
import { ISubmitMatches } from './src/input-batches/interfaces/i-submit-matches.interface';
|
|
29
|
-
|
|
29
|
+
import { IRetrievedSurveyAnswer } from './src/survey/interfaces/i-retrieved-survey-answer.interface';
|
|
30
|
+
import { IRetrievedSurveyAnsweredQuestion } from './src/survey/interfaces/i-retrieved-survey-answered-question.interface';
|
|
31
|
+
import { RetrieveSurveyResult } from './src/results/retrieve-survey-result.class';
|
|
32
|
+
export { IIntake, IMatch, IInputBatch, IntakeDto, MatchDto, OrganisationDto, IOrganisation, InputBatchDto, SubmitMatchesResult, DiscardInputBatchresult, RetrieveIntakesResult, RetrieveIntakeResult, RetrieveInputBatchResult, RetrieveInputBatchesResult, InputBatchStatus, IntakeStageType, LurchClient, IMicrositeStudentProfile, MicrositeStudentProfileResult, RetrieveOrganisationsResult, RetrieveSurveyQuestionsResult, ISurveyQuestion, ISurveyQuestionOption, RetrieveSurveyResult, IRetrievedSurveyAnsweredQuestion, IRetrievedSurveyAnswer, SurveyAnswerType, RetrieveInputBatchDomainOverviewResult, IDomainCategoryOverview, DomainCategory, ISubmitMatches };
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DomainCategory = exports.RetrieveInputBatchDomainOverviewResult = exports.SurveyAnswerType = exports.RetrieveSurveyQuestionsResult = exports.RetrieveOrganisationsResult = exports.MicrositeStudentProfileResult = exports.LurchClient = exports.IntakeStageType = exports.InputBatchStatus = exports.RetrieveInputBatchesResult = exports.RetrieveInputBatchResult = exports.RetrieveIntakeResult = exports.RetrieveIntakesResult = exports.DiscardInputBatchresult = exports.SubmitMatchesResult = exports.InputBatchDto = exports.OrganisationDto = exports.MatchDto = exports.IntakeDto = void 0;
|
|
3
|
+
exports.DomainCategory = exports.RetrieveInputBatchDomainOverviewResult = exports.SurveyAnswerType = exports.RetrieveSurveyResult = exports.RetrieveSurveyQuestionsResult = exports.RetrieveOrganisationsResult = exports.MicrositeStudentProfileResult = exports.LurchClient = exports.IntakeStageType = exports.InputBatchStatus = exports.RetrieveInputBatchesResult = exports.RetrieveInputBatchResult = exports.RetrieveIntakeResult = exports.RetrieveIntakesResult = exports.DiscardInputBatchresult = exports.SubmitMatchesResult = exports.InputBatchDto = exports.OrganisationDto = exports.MatchDto = exports.IntakeDto = void 0;
|
|
4
4
|
const input_batch_dto_class_1 = require("./src/input-batches/input-batch-dto.class");
|
|
5
5
|
Object.defineProperty(exports, "InputBatchDto", { enumerable: true, get: function () { return input_batch_dto_class_1.InputBatchDto; } });
|
|
6
6
|
const input_batch_status_1 = require("./src/input-batches/input-batch-status");
|
|
@@ -39,4 +39,6 @@ const retrieve_survey_questions_result_class_1 = require("./src/results/retrieve
|
|
|
39
39
|
Object.defineProperty(exports, "RetrieveSurveyQuestionsResult", { enumerable: true, get: function () { return retrieve_survey_questions_result_class_1.RetrieveSurveyQuestionsResult; } });
|
|
40
40
|
const domain_category_1 = require("./src/input-batches/domain-category");
|
|
41
41
|
Object.defineProperty(exports, "DomainCategory", { enumerable: true, get: function () { return domain_category_1.DomainCategory; } });
|
|
42
|
+
const retrieve_survey_result_class_1 = require("./src/results/retrieve-survey-result.class");
|
|
43
|
+
Object.defineProperty(exports, "RetrieveSurveyResult", { enumerable: true, get: function () { return retrieve_survey_result_class_1.RetrieveSurveyResult; } });
|
|
42
44
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,qFAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,qFAA0E;AAwCzE,8FAxCQ,qCAAa,OAwCR;AAvCd,+EAA0E;AA8CzE,iGA9CQ,qCAAgB,OA8CR;AA5CjB,qEAA2D;AAiC1D,0FAjCQ,4BAAS,OAiCR;AAhCV,uEAAkE;AA4CjE,gGA5CQ,mCAAe,OA4CR;AAzChB,mEAAyD;AA8BxD,yFA9BQ,0BAAQ,OA8BR;AA7BT,uGAA2F;AAqC1F,yGArCQ,4DAAwB,OAqCR;AApCzB,2GAA+F;AAqC9F,2GArCQ,gEAA0B,OAqCR;AApC3B,6FAAkF;AAkCjF,qGAlCQ,mDAAoB,OAkCR;AAjCrB,+FAAoF;AAgCnF,sGAhCQ,qDAAqB,OAgCR;AA/BtB,2FAAgF;AA6B/E,oGA7BQ,iDAAmB,OA6BR;AA5BpB,qGAAyF;AA6BxF,wGA7BQ,0DAAuB,OA6BR;AA5BxB,qDAAgD;AAmC/C,4FAnCQ,0BAAW,OAmCR;AAjCZ,iHAAqG;AAmCpG,8GAnCQ,sEAA6B,OAmCR;AAlC9B,2GAAgG;AAmC/F,4GAnCQ,iEAA2B,OAmCR;AAlC5B,uIAAyH;AA0CxH,uHA1CQ,0FAAsC,OA0CR;AAxCvC,+FAAqF;AAkBpF,gGAlBQ,wCAAe,OAkBR;AAfhB,wFAA8E;AAoC7E,iGApCQ,0CAAgB,OAoCR;AAnCjB,iHAAqG;AA6BpG,8GA7BQ,sEAA6B,OA6BR;AA3B9B,yEAAqE;AAoCpE,+FApCQ,gCAAc,OAoCR;AAhCf,6FAAkF;AA0BjF,qGA1BQ,mDAAoB,OA0BR"}
|
package/package.json
CHANGED
package/src/lurch-client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { IDomainCategoryOverview } from './input-batches/interfaces/i-domain-cat
|
|
|
5
5
|
import { OrganisationsDto } from "./entities/organisation/organisations-dto";
|
|
6
6
|
import { ISurveyQuestion } from "./survey/interfaces/i-survey-question.interface";
|
|
7
7
|
import { ISubmitMatches } from "./input-batches/interfaces/i-submit-matches.interface";
|
|
8
|
+
import { IRetrievedSurveyAnsweredQuestion } from "./survey/interfaces/i-retrieved-survey-answered-question.interface";
|
|
8
9
|
export declare class LurchClient {
|
|
9
10
|
private superAgentRequestFactory;
|
|
10
11
|
private requestSender;
|
|
@@ -18,7 +19,7 @@ export declare class LurchClient {
|
|
|
18
19
|
retrieveInputBatchDomainOverview(inputBatchIdentity: string, organisationId: string): Promise<IDomainCategoryOverview[]>;
|
|
19
20
|
retrieveOrganisationsFromUser(): Promise<OrganisationsDto>;
|
|
20
21
|
retrieveSurvey(): Promise<ISurveyQuestion[]>;
|
|
21
|
-
retrieveSurveyResult
|
|
22
|
+
retrieveSurveyResult(inputBatchIdentity: string): Promise<IRetrievedSurveyAnsweredQuestion[]>;
|
|
22
23
|
submitSurvey<TSubmitSurveyRequest extends object>(payload: TSubmitSurveyRequest): Promise<void>;
|
|
23
24
|
private createGetRequest;
|
|
24
25
|
private createPostRequest;
|
package/src/lurch-client.js
CHANGED
|
@@ -58,10 +58,10 @@ class LurchClient {
|
|
|
58
58
|
const result = await this.requestSender.sendAndExtractBody(request);
|
|
59
59
|
return result.questions;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
return
|
|
61
|
+
async retrieveSurveyResult(inputBatchIdentity) {
|
|
62
|
+
const request = this.createGetRequest(`/survey/${inputBatchIdentity}`);
|
|
63
|
+
const result = await this.requestSender.sendAndExtractBody(request);
|
|
64
|
+
return result.answeredQuestions;
|
|
65
65
|
}
|
|
66
66
|
// TODO: TSubmitSurveyRequest is a placeholder type. Once we have the actual survey submission payload structure defined, we should replace this with a more specific type.
|
|
67
67
|
async submitSurvey(payload) {
|
package/src/lurch-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lurch-client.js","sourceRoot":"","sources":["../../src/lurch-client.ts"],"names":[],"mappings":";;;AASA,iFAA6E;
|
|
1
|
+
{"version":3,"file":"lurch-client.js","sourceRoot":"","sources":["../../src/lurch-client.ts"],"names":[],"mappings":";;;AASA,iFAA6E;AAO7E,MAAa,WAAW;IAGvB,IAAc,OAAO;QACpB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,YACS,wBAAmD,EACnD,aAA6B,EACrC,UAAkB,EAAE;QAFZ,6BAAwB,GAAxB,wBAAwB,CAA2B;QACnD,kBAAa,GAAb,aAAa,CAAgB;QAGrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,uBAAuB;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAA6B,OAAO,CAAC,CAAC;QAEhG,OAAO,MAAM,CAAC,YAAY,CAA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C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IAEO,iBAAiB,CAAC,WAAmB,EAAE;QAC9C,OAAO,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpE,CAAC;IAEO,QAAQ,CAAC,QAAgB;QAChC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;IACrC,CAAC;CACD;AAzGD,kCAyGC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SuccessResult } from "@studyportals/sp-r2d2-interface";
|
|
2
|
+
import { IRetrievedSurveyAnsweredQuestion } from "../survey/interfaces/i-retrieved-survey-answered-question.interface";
|
|
3
|
+
export declare class RetrieveSurveyResult extends SuccessResult {
|
|
4
|
+
readonly answeredQuestions: IRetrievedSurveyAnsweredQuestion[];
|
|
5
|
+
readonly __retrieve_survey_result__: true;
|
|
6
|
+
constructor(answeredQuestions: IRetrievedSurveyAnsweredQuestion[]);
|
|
7
|
+
protected toJSON(): object;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetrieveSurveyResult = void 0;
|
|
4
|
+
const sp_r2d2_interface_1 = require("@studyportals/sp-r2d2-interface");
|
|
5
|
+
class RetrieveSurveyResult extends sp_r2d2_interface_1.SuccessResult {
|
|
6
|
+
constructor(answeredQuestions) {
|
|
7
|
+
super();
|
|
8
|
+
this.answeredQuestions = answeredQuestions;
|
|
9
|
+
this.__retrieve_survey_result__ = true;
|
|
10
|
+
}
|
|
11
|
+
toJSON() {
|
|
12
|
+
const obj = super.toJSON();
|
|
13
|
+
obj["__retrieve_survey_result__"] = this.__retrieve_survey_result__;
|
|
14
|
+
obj["answeredQuestions"] = this.answeredQuestions;
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.RetrieveSurveyResult = RetrieveSurveyResult;
|
|
19
|
+
//# sourceMappingURL=retrieve-survey-result.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-survey-result.class.js","sourceRoot":"","sources":["../../../src/results/retrieve-survey-result.class.ts"],"names":[],"mappings":";;;AAAA,uEAAgE;AAGhE,MAAa,oBAAqB,SAAQ,iCAAa;IAGtD,YAAmC,iBAAqD;QACvF,KAAK,EAAE,CAAC;QAD0B,sBAAiB,GAAjB,iBAAiB,CAAoC;QAFxE,+BAA0B,GAAS,IAAI,CAAC;IAIxD,CAAC;IAES,MAAM;QACf,MAAM,GAAG,GAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QAEhC,GAAG,CAAC,4BAA4B,CAAC,GAAG,IAAI,CAAC,0BAA0B,CAAC;QACpE,GAAG,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAElD,OAAO,GAAG,CAAC;IACZ,CAAC;CACD;AAfD,oDAeC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-retrieved-survey-answer.interface.js","sourceRoot":"","sources":["../../../../src/survey/interfaces/i-retrieved-survey-answer.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-retrieved-survey-answered-question.interface.js","sourceRoot":"","sources":["../../../../src/survey/interfaces/i-retrieved-survey-answered-question.interface.ts"],"names":[],"mappings":""}
|