Skip to content

Commit

Permalink
fix: env in db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kriptonian1 committed Feb 22, 2024
1 parent 46833aa commit 8cfcbaf
Show file tree
Hide file tree
Showing 136 changed files with 2,108 additions and 891 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

61 changes: 0 additions & 61 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run lint:fix && pnpm run prettier:fix && pnpm run test:api
pnpm lint && pnpm test:api
Empty file added .turbo/cookies/1.cookie
Empty file.
Empty file added .turbo/cookies/10.cookie
Empty file.
Empty file added .turbo/cookies/11.cookie
Empty file.
Empty file added .turbo/cookies/12.cookie
Empty file.
Empty file added .turbo/cookies/13.cookie
Empty file.
Empty file added .turbo/cookies/14.cookie
Empty file.
Empty file added .turbo/cookies/15.cookie
Empty file.
Empty file added .turbo/cookies/16.cookie
Empty file.
Empty file added .turbo/cookies/17.cookie
Empty file.
Empty file added .turbo/cookies/18.cookie
Empty file.
Empty file added .turbo/cookies/19.cookie
Empty file.
Empty file added .turbo/cookies/2.cookie
Empty file.
Empty file added .turbo/cookies/20.cookie
Empty file.
Empty file added .turbo/cookies/21.cookie
Empty file.
Empty file added .turbo/cookies/22.cookie
Empty file.
Empty file added .turbo/cookies/23.cookie
Empty file.
Empty file added .turbo/cookies/24.cookie
Empty file.
Empty file added .turbo/cookies/25.cookie
Empty file.
Empty file added .turbo/cookies/26.cookie
Empty file.
Empty file added .turbo/cookies/27.cookie
Empty file.
Empty file added .turbo/cookies/28.cookie
Empty file.
Empty file added .turbo/cookies/29.cookie
Empty file.
Empty file added .turbo/cookies/3.cookie
Empty file.
Empty file added .turbo/cookies/30.cookie
Empty file.
Empty file added .turbo/cookies/31.cookie
Empty file.
Empty file added .turbo/cookies/32.cookie
Empty file.
Empty file added .turbo/cookies/33.cookie
Empty file.
Empty file added .turbo/cookies/34.cookie
Empty file.
Empty file added .turbo/cookies/35.cookie
Empty file.
Empty file added .turbo/cookies/36.cookie
Empty file.
Empty file added .turbo/cookies/37.cookie
Empty file.
Empty file added .turbo/cookies/38.cookie
Empty file.
Empty file added .turbo/cookies/39.cookie
Empty file.
Empty file added .turbo/cookies/4.cookie
Empty file.
Empty file added .turbo/cookies/40.cookie
Empty file.
Empty file added .turbo/cookies/41.cookie
Empty file.
Empty file added .turbo/cookies/42.cookie
Empty file.
Empty file added .turbo/cookies/43.cookie
Empty file.
Empty file added .turbo/cookies/44.cookie
Empty file.
Empty file added .turbo/cookies/45.cookie
Empty file.
Empty file added .turbo/cookies/46.cookie
Empty file.
Empty file added .turbo/cookies/47.cookie
Empty file.
Empty file added .turbo/cookies/48.cookie
Empty file.
Empty file added .turbo/cookies/49.cookie
Empty file.
Empty file added .turbo/cookies/5.cookie
Empty file.
Empty file added .turbo/cookies/50.cookie
Empty file.
Empty file added .turbo/cookies/51.cookie
Empty file.
Empty file added .turbo/cookies/52.cookie
Empty file.
Empty file added .turbo/cookies/53.cookie
Empty file.
Empty file added .turbo/cookies/54.cookie
Empty file.
Empty file added .turbo/cookies/55.cookie
Empty file.
Empty file added .turbo/cookies/56.cookie
Empty file.
Empty file added .turbo/cookies/57.cookie
Empty file.
Empty file added .turbo/cookies/58.cookie
Empty file.
Empty file added .turbo/cookies/59.cookie
Empty file.
Empty file added .turbo/cookies/6.cookie
Empty file.
Empty file added .turbo/cookies/7.cookie
Empty file.
Empty file added .turbo/cookies/8.cookie
Empty file.
Empty file added .turbo/cookies/9.cookie
Empty file.
25 changes: 25 additions & 0 deletions apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
18 changes: 0 additions & 18 deletions apps/api/.eslintrc.json

This file was deleted.

5 changes: 5 additions & 0 deletions apps/api/.turbo/turbo-build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


> [email protected] build /home/kriptonian/Desktop/work/keyshade_xyz/keyshade/apps/api
> nest build

5 changes: 5 additions & 0 deletions apps/api/.turbo/turbo-lint.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


> [email protected] lint /home/kriptonian/Desktop/work/keyshade_xyz/keyshade/apps/api
> eslint "{src,apps,libs,test}/**/*.ts" --fix

1,302 changes: 1,302 additions & 0 deletions apps/api/.turbo/turbo-test.log

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions apps/api/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
},
"entryFile": "../../../dist/apps/api/main.js"
}
90 changes: 90 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"name": "api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.0",
"@nestjs/core": "^10.0.0",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/platform-fastify": "^10.3.3",
"@nestjs/schedule": "^4.0.1",
"@nestjs/swagger": "^7.3.0",
"@prisma/client": "^5.10.1",
"@supabase/supabase-js": "^2.39.6",
"chalk": "^5.3.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"eccrypto": "^1.1.6",
"moment": "^2.30.1",
"nodemailer": "^6.9.9",
"passport-github2": "^0.1.12",
"prisma": "^5.10.1",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"uuid": "^9.0.1"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^6.0.0",
"@types/eccrypto": "^1.1.6",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.5",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"keywords": [],
"author": "",
"license": "ISC"
}
103 changes: 0 additions & 103 deletions apps/api/project.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CreateApiKey } from './create.api-key';
import { CreateApiKey } from './create.api-key'

describe('CreateApiKey', () => {
it('should be defined', () => {
expect(new CreateApiKey()).toBeDefined();
});
});
expect(new CreateApiKey()).toBeDefined()
})
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UpdateApiKey } from './update.api-key';
import { UpdateApiKey } from './update.api-key'

describe('UpdateApiKey', () => {
it('should be defined', () => {
expect(new UpdateApiKey()).toBeDefined();
});
});
expect(new UpdateApiKey()).toBeDefined()
})
})
3 changes: 3 additions & 0 deletions apps/api/src/auth/guard/auth/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export class AuthGuard implements CanActivate {
}

private extractApiKeyFromHeader(request: Request): string | undefined {
if (Array.isArray(request.headers[X_KEYSHADE_TOKEN])) {
throw new Error('Bad auth')
}
return request.headers[X_KEYSHADE_TOKEN]
}
}
2 changes: 1 addition & 1 deletion apps/api/src/common/create-key-pair.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import eccrypto from 'eccrypto'
import * as eccrypto from 'eccrypto'

export const createKeyPair = (): {
publicKey: string
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/common/decrypt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import eccrypto from 'eccrypto'
import * as eccrypto from 'eccrypto'

export const decrypt = async (
privateKey: string,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/common/encrypt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import eccrypto from 'eccrypto'
import * as eccrypto from 'eccrypto'

export const encrypt = async (
publicKey: string,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/common/fetch-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default async function fetchEvents(
app: NestFastifyApplication,
user: User,
query?: string
) {
): Promise<any> {
return app.inject({
method: 'GET',
headers: {
Expand Down
Loading

0 comments on commit 8cfcbaf

Please sign in to comment.