Skip to content

Commit

Permalink
fix:reverting
Browse files Browse the repository at this point in the history
  • Loading branch information
uptownhr committed Dec 17, 2023
1 parent 0e3a18c commit 1a294fd
Show file tree
Hide file tree
Showing 245 changed files with 2,470 additions and 3,187 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/atob-npm-2.1.2-bcb583261e-dfeeeb7009.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/css-npm-3.0.0-ef426b63b3-4273ac816d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/nx-npm-15.9.6-96b166dbb8-27ffd25596.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/rxjs-npm-6.6.7-055046ea3c-bc334edef1.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.2.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.6.2.cjs
yarnPath: .yarn/releases/yarn-3.6.3.cjs
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [1.5.0](https://github.com/uptownhr/uptownhr/compare/v1.4.2...v1.5.0) (2023-12-17)


### Features

* adding playwright ([476f46a](https://github.com/uptownhr/uptownhr/commit/476f46a28ad78e0f4f6cca943235025243cf3345))

## [1.4.2](https://github.com/uptownhr/uptownhr/compare/v1.4.1...v1.4.2) (2023-09-02)


### Bug Fixes

* **deps:** update dependency @astrojs/mdx to v1 ([e6ac75e](https://github.com/uptownhr/uptownhr/commit/e6ac75e66d35039354891f1268e79b8b5786fe51))
* **deps:** update dependency @astrojs/rss to v3 ([c9c4cc1](https://github.com/uptownhr/uptownhr/commit/c9c4cc1803d01187e725aa1556f93e0a9300beb1))
* **deps:** update dependency @astrojs/sitemap to v3 ([6b664be](https://github.com/uptownhr/uptownhr/commit/6b664bee5c5352e4f50a3ddce3b4edd4801291c3))
* **deps:** update dependency @astrojs/svelte to v4 ([ff5cda7](https://github.com/uptownhr/uptownhr/commit/ff5cda719523f8e38b2207cd84c08b22434a4327))
* **deps:** update dependency @astrojs/tailwind to v5 ([b5eb98e](https://github.com/uptownhr/uptownhr/commit/b5eb98eca33f55b245c8892cd7d41d13e206fb85))
* **deps:** update dependency @nestjs/config to v3 ([b9188c7](https://github.com/uptownhr/uptownhr/commit/b9188c7560d6640834fd1cdbf0287be5d480787e))
* **deps:** update dependency axios to v1.5.0 ([5d21a97](https://github.com/uptownhr/uptownhr/commit/5d21a97ba1e7a8ed0097d29dc658153228d1881e))
* **deps:** update dependency svelte to v4 ([2b59f89](https://github.com/uptownhr/uptownhr/commit/2b59f89cd0f8eb19b5287672a4e91d13e9511e29))

## [1.4.1](https://github.com/uptownhr/uptownhr/compare/v1.4.0...v1.4.1) (2023-08-26)


Expand Down
61 changes: 58 additions & 3 deletions apps/backend/src/app/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Param,
ParseIntPipe,
Post,
Query,
UseGuards,
} from '@nestjs/common';

Expand All @@ -23,11 +24,14 @@ import {
} from './app.model';
import { ApiResponse } from '@nestjs/swagger';

import { firefox } from 'playwright';
import { Page as PlayPage } from 'playwright';

@Controller()
export class AppController {
constructor(
private readonly appService: AppService,
private readonly lovDb: LovDb
private readonly lovDb: LovDb,
) {}

@Get()
Expand All @@ -41,6 +45,57 @@ export class AppController {
return 'test';
}

@Get('play')
async play(@Query('url') url: string) {
if (!url) {
throw new HttpException('url is required', 400);
}

const browser = await firefox.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();

await page.goto(url, {
waitUntil: 'domcontentloaded',
timeout: 60000,
});

await page.waitForTimeout(4000);

async function getRedfinPropertyValueFromPage(page: PlayPage) {
const scriptEls = await page.$$('script[type="application/ld+json"]');
const elTexts = await Promise.all(
scriptEls.map(async (el) => {
const text = await el.innerText();
console.log('text', text);
try {
const json = JSON.parse(text);

return json;
} catch (e) {
return;
}
}),
);

console.log('elTexts', elTexts);

const sfrPropertyEl = elTexts
.filter((el) => el)
.find((el) => {
const type = el['@type'];

return type?.[0] === 'Product';
});

return sfrPropertyEl.offers.price;
}

const price = await getRedfinPropertyValueFromPage(page);

return price;
}

@ApiResponse({ type: Page, status: 201 })
@Post('page')
async createPage(@Body() input: CreatePageInput): Promise<Page> {
Expand Down Expand Up @@ -104,7 +159,7 @@ export class AppController {
@ApiResponse({ type: PageWithQuestions, status: 200 })
@Get('page/:id/questions')
async getPageQuestions(
@Param('id', ParseIntPipe) pageId: number
@Param('id', ParseIntPipe) pageId: number,
): Promise<PageWithQuestions> {
const page = await this.lovDb.page.findUnique({
where: {
Expand Down Expand Up @@ -166,7 +221,7 @@ export class AppController {
@ApiResponse({ type: Answer, status: 200, isArray: true })
@Get('question/:id/answers')
async getQuestionAnswers(
@Param('id', ParseIntPipe) questionId: number
@Param('id', ParseIntPipe) questionId: number,
): Promise<Answer[]> {
const answers = await this.lovDb.answer.findMany({
where: {
Expand Down
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uptownhr",
"type": "commonjs",
"version": "1.4.1",
"version": "1.5.0",
"private": true,
"scripts": {
"dev": "astro dev",
Expand All @@ -14,26 +14,27 @@
"backend:production": "nx run backend:serve:production"
},
"dependencies": {
"@astrojs/mdx": "^0.19.0",
"@astrojs/rss": "^2.0.0",
"@astrojs/sitemap": "^1.0.0",
"@astrojs/svelte": "^2.0.0",
"@astrojs/tailwind": "^3.0.0",
"@astrojs/mdx": "^1.0.0",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.0",
"@astrojs/svelte": "^4.0.0",
"@astrojs/tailwind": "^5.0.0",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/config": "^3.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@prisma/client": "^5.1.1",
"axios": "^1.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"playwright": "^1.40.1",
"posthog-js": "^1.42.2",
"prisma": "^5.1.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.0.0",
"store": "^2.0.12",
"supertokens-node": "^12.1.6",
"svelte": "^3.54.0",
"svelte": "^4.0.0",
"tslib": "^2.3.0",
"uuid": "^9.0.0"
},
Expand All @@ -42,37 +43,37 @@
"@nestjs/schematics": "^9.0.0",
"@nestjs/swagger": "^7.1.8",
"@nestjs/testing": "^9.0.0",
"@nrwl/cypress": "^15.6.3",
"@nrwl/eslint-plugin-nx": "^15.6.3",
"@nrwl/jest": "15.9.6",
"@nrwl/linter": "^15.6.3",
"@nrwl/nest": "^15.6.3",
"@nrwl/node": "15.9.6",
"@nrwl/webpack": "15.9.6",
"@nrwl/workspace": "^15.6.3",
"@nrwl/cypress": "^16.0.0",
"@nrwl/eslint-plugin-nx": "^16.0.0",
"@nrwl/jest": "16.7.4",
"@nrwl/linter": "^16.0.0",
"@nrwl/nest": "^16.0.0",
"@nrwl/node": "16.7.4",
"@nrwl/webpack": "16.7.4",
"@nrwl/workspace": "^16.0.0",
"@nx-tools/nx-prisma": "^5.0.2",
"@nx/devkit": "^16.7.0",
"@nxtensions/astro": "^3.3.0",
"@types/jest": "29.5.3",
"@types/node": "18.17.11",
"@nxtensions/astro": "^16.0.0",
"@types/jest": "29.5.4",
"@types/node": "18.17.13",
"@types/storejs": "^2.0.3",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vercel/ncc": "^0.36.1",
"astro": "^2.0.0",
"cypress": "^12.4.1",
"cypress": "^13.0.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-cypress": "^2.12.1",
"jest": "29.6.3",
"jest-environment-jsdom": "29.6.2",
"nx": "^15.6.3",
"prettier": "^2.8.3",
"prettier-plugin-svelte": "^2.9.0",
"jest": "29.6.4",
"jest-environment-jsdom": "29.6.4",
"nx": "^16.0.0",
"prettier": "^3.0.0",
"prettier-plugin-svelte": "^3.0.0",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"typescript": "^4.9.4"
"typescript": "^5.0.0"
},
"packageManager": "yarn@3.6.2"
"packageManager": "yarn@3.6.3"
}

0 comments on commit 1a294fd

Please sign in to comment.