Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): add dependency module & apis #552

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ CASDOOR_ORG_NAME=laf
CASDOOR_APP_NAME=laf
CASDOOR_CLIENT_ID=a71f65e93723c436027e
CASDOOR_CLIENT_SECRET=0d7e157be08055867b81456df3c222ea7c68a097
CASDOOR_REDIRECT_URI=http://localhost:3001/login_callback
CASDOOR_REDIRECT_URI=http://localhost:3001/login_callback


NODE_RUNTIME_BUILTIN_DEPENDENCIES=@aws-sdk/client-s3@3.72.0,@aws-sdk/client-sts@3.72.0,@aws-sdk/s3-request-presigner@3.72.0,@kubernetes/client-node@0.17.1,alipay-sdk@3.1.7,axios@0.21.1,database-proxy@0.8.2,dayjs@1.10.7,dotenv@8.2.0,ejs@3.1.6,express@4.17.1,express-xml-bodyparser@0.3.0,fs-extra@9.1.0,jsonwebtoken@8.5.1,lodash@4.17.21,log4js@6.7.1,minio@7.0.28,mongodb@4.1.3,mongodb-uri@0.9.7,multer@1.4.5-lts.1,node-modules-utils@0.8.2,nodemailer@6.6.3,validator@13.7.0,ws@8.2.3
123 changes: 121 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
"name": "laf-server",
"version": "1.0.0-alpha.0",
"description": "",
"author": "",
"author": "maslow(wangfugen@!26.com)",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "npm run generate && rimraf dist",
"generate": "prisma generate",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"push-db": "prisma db push --skip-generate",
"start": "nest start",
"watch": "nest start --watch",
"start:dev": "nest start --watch",
Expand Down Expand Up @@ -49,6 +50,7 @@
"mongodb": "^4.12.1",
"ms": "^2.1.3",
"nanoid": "^3.3.4",
"npm-package-arg": "^10.1.0",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
Expand All @@ -66,6 +68,7 @@
"@types/express": "^4.17.13",
"@types/jest": "28.1.8",
"@types/node": "^16.0.0",
"@types/npm-package-arg": "^6.1.1",
"@types/passport-jwt": "^3.0.7",
"@types/passport-local": "^1.0.34",
"@types/supertest": "^2.0.11",
Expand Down
18 changes: 10 additions & 8 deletions server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
// previewFeatures = ["interactiveTransactions"]
// binaryTargets = ["native", "linux-arm64-openssl-1.1.x"]
binaryTargets = ["native"]
Expand Down Expand Up @@ -93,18 +93,18 @@ enum ApplicationPhase {
}

model Application {
id String @id @default(auto()) @map("_id") @db.ObjectId
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
appid String @unique
appid String @unique
regionName String
bundleName String
runtimeName String
state ApplicationState
phase ApplicationPhase
tags String[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String @db.ObjectId
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String @db.ObjectId

region Region @relation(fields: [regionName], references: [name])
runtime Runtime @relation(fields: [runtimeName], references: [name])
Expand All @@ -121,8 +121,10 @@ model ApplicationConfiguration {
id String @id @default(auto()) @map("_id") @db.ObjectId
appid String @unique
environments EnvironmentVariable[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
dependencies String[] @default([])

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

application Application @relation(fields: [appid], references: [appid])
}
Expand Down
4 changes: 3 additions & 1 deletion server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { ScheduleModule } from '@nestjs/schedule'
import { DatabaseModule } from './database/database.module'
import { PrismaService } from './prisma.service'
import { StorageModule } from './storage/storage.module'
import { LogModule } from './log/log.module';
import { LogModule } from './log/log.module'
import { DependencyModule } from './dependency/dependency.module'

@Module({
imports: [
Expand All @@ -34,6 +35,7 @@ import { LogModule } from './log/log.module';
DatabaseModule,
StorageModule,
LogModule,
DependencyModule,
],
controllers: [AppController],
providers: [AppService, PrismaService],
Expand Down
1 change: 1 addition & 0 deletions server/src/application/application.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class ApplicationService {
configuration: {
create: {
environments: [appSecret],
dependencies: [],
},
},
}
Expand Down
Loading