@ticketmaster/allure-mock
Advanced tools
Comparing version 4.0.11-alpha.0 to 4.0.11-alpha.1
@@ -289,2 +289,12 @@ import { Response, createServer } from 'miragejs'; | ||
const applicationsMock = (server) => { | ||
server.get(`/api/v1/applications`, () => { | ||
const applications = APPLICATIONS_LIST; | ||
return applications | ||
? new Response(200, {}, applications) | ||
: new Response(401); | ||
}); | ||
return server; | ||
}; | ||
const IDENTITY_JWT_SECRET = "secret"; | ||
@@ -345,24 +355,2 @@ const IDENTITY_LOGIN_URL = "https://login-dev1.tmtools.nonprod.public.tmaws.eu/login"; | ||
const getApplicationsFromRequest = (request) => { | ||
var _a; | ||
const session = getSessionFromRequest(request); | ||
const sessionPortalApplications = ((_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.portalApplications) || []; | ||
return session | ||
? sessionPortalApplications | ||
.map(({ code }) => APPLICATIONS_LIST.find(({ code: appCode }) => String(code) === String(appCode))) | ||
.filter((r) => r !== undefined) | ||
: null; | ||
}; | ||
const applicationsMock = (server) => { | ||
server.get(`/api/v1/applications`, (schema, request) => { | ||
console.log("called"); | ||
const applications = getApplicationsFromRequest(request); | ||
return applications | ||
? new Response(200, {}, applications) | ||
: new Response(401); | ||
}, { timing: 1000 }); | ||
return server; | ||
}; | ||
const configurationMock = (server) => { | ||
@@ -369,0 +357,0 @@ server.get(`/api/v1/globalconfiguration`, (schema, request) => { |
@@ -295,2 +295,12 @@ 'use strict'; | ||
const applicationsMock = (server) => { | ||
server.get(`/api/v1/applications`, () => { | ||
const applications = APPLICATIONS_LIST; | ||
return applications | ||
? new miragejs.Response(200, {}, applications) | ||
: new miragejs.Response(401); | ||
}); | ||
return server; | ||
}; | ||
const IDENTITY_JWT_SECRET = "secret"; | ||
@@ -351,24 +361,2 @@ const IDENTITY_LOGIN_URL = "https://login-dev1.tmtools.nonprod.public.tmaws.eu/login"; | ||
const getApplicationsFromRequest = (request) => { | ||
var _a; | ||
const session = getSessionFromRequest(request); | ||
const sessionPortalApplications = ((_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.portalApplications) || []; | ||
return session | ||
? sessionPortalApplications | ||
.map(({ code }) => APPLICATIONS_LIST.find(({ code: appCode }) => String(code) === String(appCode))) | ||
.filter((r) => r !== undefined) | ||
: null; | ||
}; | ||
const applicationsMock = (server) => { | ||
server.get(`/api/v1/applications`, (schema, request) => { | ||
console.log("called"); | ||
const applications = getApplicationsFromRequest(request); | ||
return applications | ||
? new miragejs.Response(200, {}, applications) | ||
: new miragejs.Response(401); | ||
}, { timing: 1000 }); | ||
return server; | ||
}; | ||
const configurationMock = (server) => { | ||
@@ -375,0 +363,0 @@ server.get(`/api/v1/globalconfiguration`, (schema, request) => { |
{ | ||
"name": "@ticketmaster/allure-mock", | ||
"version": "4.0.11-alpha.0", | ||
"version": "4.0.11-alpha.1", | ||
"author": "Ticketmaster (https://www.ticketmaster.com/)", | ||
@@ -17,3 +17,3 @@ "contributors": [ | ||
"devDependencies": { | ||
"@ticketmaster/allure-command": "^4.0.11-alpha.0" | ||
"@ticketmaster/allure-command": "^4.0.11-alpha.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62025
1467