@diia-inhouse/test 8.3.46 → 8.4.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RandomGenerator } from "./randomGenerator.js";
|
|
2
2
|
import { GetUserActionArgumentsOps } from "./interfaces/index.js";
|
|
3
|
-
import { AcquirerSession, AcquirerTokenData, ActionSession, AppUserActionHeaders, AuthEntryPoint, DiiaOfficeUserSession, EResidentApplicantSession, EResidentApplicantTokenData, EResidentSession, EResidentTokenData, Gender, PartnerSession, PartnerTokenData,
|
|
3
|
+
import { AcquirerSession, AcquirerTokenData, ActionSession, AppUserActionHeaders, AuthEntryPoint, DiiaOfficeUserSession, EResidentApplicantSession, EResidentApplicantTokenData, EResidentSession, EResidentTokenData, Gender, PartnerSession, PartnerTokenData, ServiceEntranceSession, ServiceEntranceTokenData, ServiceUserSession, ServiceUserTokenData, SessionType, TemporarySession, TemporaryTokenData, UserActionArguments, UserSession, UserTokenData } from "@diia-inhouse/types";
|
|
4
4
|
|
|
5
5
|
//#region src/sessionGenerator.d.ts
|
|
6
6
|
declare class SessionGenerator {
|
|
@@ -21,7 +21,6 @@ declare class SessionGenerator {
|
|
|
21
21
|
getPartnerSessionStringId(tokenData?: Partial<PartnerTokenData>): PartnerSession;
|
|
22
22
|
getTemporarySession(tokenData?: Partial<TemporaryTokenData>): TemporarySession;
|
|
23
23
|
getServiceEntranceSession(tokenData?: Partial<ServiceEntranceTokenData>): ServiceEntranceSession;
|
|
24
|
-
getPortalUserSession(tokenData?: Partial<PortalUserTokenData>, validItn?: boolean): PortalUserSession;
|
|
25
24
|
getServiceUserSession(tokenData?: Partial<ServiceUserTokenData>): ServiceUserSession;
|
|
26
25
|
getSessionBySessionType(sessionType: SessionType, tokenData?: {}, validItn?: boolean): ActionSession | undefined;
|
|
27
26
|
getHeaders(headers?: Partial<AppUserActionHeaders>): AppUserActionHeaders;
|
package/dist/sessionGenerator.js
CHANGED
|
@@ -214,29 +214,6 @@ var SessionGenerator = class {
|
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
getPortalUserSession(tokenData = {}, validItn = false) {
|
|
218
|
-
const sessionType = SessionType.PortalUser;
|
|
219
|
-
const birthDate = tokenData.birthDay || this.getBirthDate();
|
|
220
|
-
const gender = this.getGender();
|
|
221
|
-
const itn = this.generateItn(birthDate, gender, validItn);
|
|
222
|
-
return {
|
|
223
|
-
sessionType,
|
|
224
|
-
user: {
|
|
225
|
-
sessionType,
|
|
226
|
-
refreshToken: {
|
|
227
|
-
value: randomUUID(),
|
|
228
|
-
expirationTime: Date.now() + 3e5
|
|
229
|
-
},
|
|
230
|
-
fName: "Дія",
|
|
231
|
-
lName: "Надія",
|
|
232
|
-
mName: "Володимирівна",
|
|
233
|
-
itn,
|
|
234
|
-
birthDay: birthDate,
|
|
235
|
-
identifier: randomUUID(),
|
|
236
|
-
...tokenData
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
217
|
getServiceUserSession(tokenData = {}) {
|
|
241
218
|
const sessionType = SessionType.ServiceUser;
|
|
242
219
|
return {
|
|
@@ -258,7 +235,6 @@ var SessionGenerator = class {
|
|
|
258
235
|
case SessionType.EResident: return this.getEResidentSession(tokenData, validItn);
|
|
259
236
|
case SessionType.EResidentApplicant: return this.getEResidentApplicantSession(tokenData);
|
|
260
237
|
case SessionType.Partner: return this.getPartnerSession(tokenData);
|
|
261
|
-
case SessionType.PortalUser: return this.getPortalUserSession(tokenData, validItn);
|
|
262
238
|
case SessionType.ServiceEntrance: return this.getServiceEntranceSession(tokenData);
|
|
263
239
|
case SessionType.ServiceUser: return this.getServiceUserSession(tokenData);
|
|
264
240
|
case SessionType.Temporary: return this.getTemporarySession(tokenData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/test",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "test-utils",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@diia-inhouse/configs": "7.2.3",
|
|
51
51
|
"@diia-inhouse/oxc-config": "3.2.0",
|
|
52
|
-
"@diia-inhouse/types": "14.
|
|
52
|
+
"@diia-inhouse/types": "14.11.0",
|
|
53
53
|
"@types/lodash": "4.17.24",
|
|
54
54
|
"@types/luxon": "3.7.1",
|
|
55
55
|
"bson": "7.2.0",
|