fix(#revert ads): revert ads #229
Merged
andrey.dekterev
merged 1 commits from revert-ads into develop 3 years ago
@ -1 +0,0 @@ |
|||||||
export * from './isVideo' |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
const regexp = /^https?:\/\/\S+(?:mp4)$/ |
|
||||||
export const checkVideo = (url: string) => regexp.test(url) |
|
||||||
@ -1 +0,0 @@ |
|||||||
export const COUNTRY = 'COUNTRY' |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
export * from './getAds' |
|
||||||
export * from './updateAdsView' |
|
||||||
@ -0,0 +1,31 @@ |
|||||||
|
/* eslint-disable */ |
||||||
|
import { |
||||||
|
createServer, |
||||||
|
Model, |
||||||
|
} from 'miragejs' |
||||||
|
|
||||||
|
import { ResponseType } from 'requests/getFavouriteTeam' |
||||||
|
|
||||||
|
import { surveys } from './fixtures/surveys' |
||||||
|
|
||||||
|
export function makeServer({ environment = 'test' } = {}) { |
||||||
|
const server = createServer({ |
||||||
|
environment, |
||||||
|
factories: {}, |
||||||
|
fixtures: { |
||||||
|
surveys, |
||||||
|
}, |
||||||
|
models: { |
||||||
|
surveys: Model.extend<Partial<ResponseType>>({}), |
||||||
|
}, |
||||||
|
routes() { |
||||||
|
this.passthrough('https://api.insports.tv/***') |
||||||
|
this.passthrough('https://insports.tv/***') |
||||||
|
this.passthrough('https://images.insports.tv/***') |
||||||
|
this.passthrough('https://auth.insports.tv/***') |
||||||
|
this.passthrough('${URL_AWS}/***') |
||||||
|
this.get('https://api.insports.tv/v1/survey/teams/1/131/30', (schema: any) => schema.all('surveys').models[0].attrs) |
||||||
|
}, |
||||||
|
}) |
||||||
|
return server |
||||||
|
} |
||||||
@ -1,300 +0,0 @@ |
|||||||
/* eslint-disable */ |
|
||||||
export const getAds = () => { |
|
||||||
return { |
|
||||||
"mobile": [ |
|
||||||
{ |
|
||||||
"id": 71, |
|
||||||
"name": "Test 2", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 12, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 2 (1x1)", |
|
||||||
"name_rus": "Веб: главная 2 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 2, |
|
||||||
"duration": 120, |
|
||||||
"time_close": 150, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/71/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
},{ |
|
||||||
"id": 71, |
|
||||||
"name": "Test 2", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 25, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 2 (1x1)", |
|
||||||
"name_rus": "Веб: главная 2 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 2, |
|
||||||
"duration": 120, |
|
||||||
"time_close": 150, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/71/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
}, |
|
||||||
{ |
|
||||||
"id": 72, |
|
||||||
"name": "Best mens boots for sport advertise here", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 11, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 7 (1x1)", |
|
||||||
"name_rus": "Веб: главная 7 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 2, |
|
||||||
"frequency": 1, |
|
||||||
"duration": 300, |
|
||||||
"time_close": 500, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/72/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
} |
|
||||||
], |
|
||||||
"match_cell": [ |
|
||||||
{ |
|
||||||
"id": 71, |
|
||||||
"name": "Test 2", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 1, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 2 (1x1)", |
|
||||||
"name_rus": "Веб: главная 2 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 2, |
|
||||||
"duration": 15, |
|
||||||
"time_close": 15, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/71/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
}, |
|
||||||
{ |
|
||||||
"id": 71, |
|
||||||
"name": "Test 2", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 2, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 2 (1x1)", |
|
||||||
"name_rus": "Веб: главная 2 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 2, |
|
||||||
"duration": 12, |
|
||||||
"time_close": 15, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/71/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
}, |
|
||||||
{ |
|
||||||
"id": 72, |
|
||||||
"name": "Test 3", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 3, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad 7 (1x1)", |
|
||||||
"name_rus": "Веб: главная 7 (1x1)" |
|
||||||
}, |
|
||||||
"link": "https://www.google.com/", |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 3, |
|
||||||
"duration": 15, |
|
||||||
"time_close": 15, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/72/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 9 |
|
||||||
} |
|
||||||
], |
|
||||||
"header": [ |
|
||||||
// {
|
|
||||||
// "id": 77,
|
|
||||||
// "name": "Test 8",
|
|
||||||
// "type": {
|
|
||||||
// "id": 1,
|
|
||||||
// "name_eng": "Main",
|
|
||||||
// "name_rus": "Главная"
|
|
||||||
// },
|
|
||||||
// "position": {
|
|
||||||
// "id": 8,
|
|
||||||
// "source_type": "Web",
|
|
||||||
// "name_eng": "Web main ad 2 (3x1)",
|
|
||||||
// "name_rus": "Веб: главная 2(3x1)"
|
|
||||||
// },
|
|
||||||
// "link": null,
|
|
||||||
// "impressions": 10,
|
|
||||||
// "frequency": 2,
|
|
||||||
// "duration": 120,
|
|
||||||
// "time_close": 15,
|
|
||||||
// "media": {
|
|
||||||
// "url": "https://cf-aws-staging.insports.tv/media/folder/77/en/web.png"
|
|
||||||
// },
|
|
||||||
// "remaining_views": 10
|
|
||||||
// },
|
|
||||||
{ |
|
||||||
"id": 78, |
|
||||||
"name": "Test 9", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 9, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad (6x1)", |
|
||||||
"name_rus": "Веб: главная (6x1)" |
|
||||||
}, |
|
||||||
"link": null, |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 2, |
|
||||||
"duration": 10, |
|
||||||
"time_close": 15, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/78/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 15 |
|
||||||
}, |
|
||||||
{ |
|
||||||
"id": 76, |
|
||||||
"name": "Test 7", |
|
||||||
"type": { |
|
||||||
"id": 1, |
|
||||||
"name_eng": "Main", |
|
||||||
"name_rus": "Главная" |
|
||||||
}, |
|
||||||
"position": { |
|
||||||
"id": 7, |
|
||||||
"source_type": "Web", |
|
||||||
"name_eng": "Web main ad (3x1)", |
|
||||||
"name_rus": "Веб: главная (3x1)" |
|
||||||
}, |
|
||||||
"link": null, |
|
||||||
"impressions": 10, |
|
||||||
"frequency": 4, |
|
||||||
"duration": 10, |
|
||||||
"time_close": 15, |
|
||||||
"media": { |
|
||||||
"url": "https://cf-aws-staging.insports.tv/media/folder/76/en/web.png" |
|
||||||
}, |
|
||||||
"remaining_views": 15 |
|
||||||
} |
|
||||||
], |
|
||||||
"block": [ |
|
||||||
// {
|
|
||||||
// "id": 75,
|
|
||||||
// "name": "Test 6",
|
|
||||||
// "type": {
|
|
||||||
// "id": 1,
|
|
||||||
// "name_eng": "Main",
|
|
||||||
// "name_rus": "Главная"
|
|
||||||
// },
|
|
||||||
// "position": {
|
|
||||||
// "id": 6,
|
|
||||||
// "source_type": "Web",
|
|
||||||
// "name_eng": "Web main ad (2x2)",
|
|
||||||
// "name_rus": "Веб: главная (2x2)"
|
|
||||||
// },
|
|
||||||
// "link": null,
|
|
||||||
// "impressions": 10,
|
|
||||||
// "frequency": 3,
|
|
||||||
// "duration": 120,
|
|
||||||
// "time_close": null,
|
|
||||||
// "media": {
|
|
||||||
// "url": "https://cf-aws-staging.insports.tv/media/folder/75/en/web.png"
|
|
||||||
// },
|
|
||||||
// "remaining_views": 10
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": 73,
|
|
||||||
// "name": "Test 4",
|
|
||||||
// "type": {
|
|
||||||
// "id": 1,
|
|
||||||
// "name_eng": "Main",
|
|
||||||
// "name_rus": "Главная"
|
|
||||||
// },
|
|
||||||
// "position": {
|
|
||||||
// "id": 4,
|
|
||||||
// "source_type": "Web",
|
|
||||||
// "name_eng": "Web main ad (2x1)",
|
|
||||||
// "name_rus": "Веб: главная (2x1)"
|
|
||||||
// },
|
|
||||||
// "link": null,
|
|
||||||
// "impressions": 10,
|
|
||||||
// "frequency": 1,
|
|
||||||
// "duration": 120,
|
|
||||||
// "time_close": null,
|
|
||||||
// "media": {
|
|
||||||
// "url": "https://cf-aws-staging.insports.tv/media/folder/73/en/web.png"
|
|
||||||
// },
|
|
||||||
// "remaining_views": 9
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "id": 74,
|
|
||||||
// "name": "Test 5",
|
|
||||||
// "type": {
|
|
||||||
// "id": 1,
|
|
||||||
// "name_eng": "Main",
|
|
||||||
// "name_rus": "Главная"
|
|
||||||
// },
|
|
||||||
// "position": {
|
|
||||||
// "id": 5,
|
|
||||||
// "source_type": "Web",
|
|
||||||
// "name_eng": "Web main ad (1x2)",
|
|
||||||
// "name_rus": "Веб: главная (1x2)"
|
|
||||||
// },
|
|
||||||
// "link": null,
|
|
||||||
// "impressions": 10,
|
|
||||||
// "frequency": 2,
|
|
||||||
// "duration": 120,
|
|
||||||
// "time_close": null,
|
|
||||||
// "media": {
|
|
||||||
// "url": "https://cf-aws-staging.insports.tv/media/folder/74/en/web.png"
|
|
||||||
// },
|
|
||||||
// "remaining_views": 9
|
|
||||||
// }
|
|
||||||
] |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
export * from './getAds' |
|
||||||
export * from './surveys' |
|
||||||
@ -1,8 +0,0 @@ |
|||||||
/* eslint-disable */ |
|
||||||
import { Model } from 'miragejs' |
|
||||||
import type { ResponseType, AdResponse } from 'requests' |
|
||||||
|
|
||||||
export const models = { |
|
||||||
ads: Model.extend<Partial<AdResponse>>({}), |
|
||||||
surveys: Model.extend<Partial<ResponseType>>({}), |
|
||||||
} |
|
||||||
@ -1,44 +0,0 @@ |
|||||||
/* eslint-disable */ |
|
||||||
import { |
|
||||||
createServer, |
|
||||||
} from 'miragejs' |
|
||||||
|
|
||||||
import { |
|
||||||
ADS_API_URL, |
|
||||||
APIS, |
|
||||||
AUTH_SERVICE, |
|
||||||
STATS_API_URL, |
|
||||||
URL_AWS, |
|
||||||
VIEWS_API, |
|
||||||
} from 'config' |
|
||||||
import { API_ROOT } from 'features/AuthServiceApp/config/routes' |
|
||||||
|
|
||||||
import { surveys, getAds } from './fixtures' |
|
||||||
import { models } from './models' |
|
||||||
|
|
||||||
|
|
||||||
const mainDomain = 'insports.tv' |
|
||||||
export function makeServer({ environment = 'test' } = {}) { |
|
||||||
const server = createServer({ |
|
||||||
environment, |
|
||||||
fixtures: { |
|
||||||
surveys, |
|
||||||
ads: getAds(), |
|
||||||
}, |
|
||||||
models: models, |
|
||||||
routes() { |
|
||||||
this.passthrough(`${API_ROOT}/***`) |
|
||||||
this.passthrough(`${VIEWS_API}/***`) |
|
||||||
this.passthrough(`${STATS_API_URL}/***`) |
|
||||||
this.passthrough(`${APIS.production.api}/***`) |
|
||||||
this.passthrough(`${APIS.staging.api}/***`) |
|
||||||
this.passthrough(`${AUTH_SERVICE}/***`) |
|
||||||
this.passthrough(`https://${mainDomain}/***`) |
|
||||||
this.passthrough(`https://images.${mainDomain}/***`) |
|
||||||
this.passthrough(`${URL_AWS}/***`) |
|
||||||
this.post(`${ADS_API_URL}`, getAds) |
|
||||||
this.logging = true; |
|
||||||
}, |
|
||||||
}) |
|
||||||
return server |
|
||||||
} |
|
||||||
Loading…
Reference in new issue