Skip to content

Commit

Permalink
:feat: Add Plus rank features
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachwahl committed Aug 2, 2024
1 parent 981ff88 commit 2f2cfed
Show file tree
Hide file tree
Showing 13 changed files with 3,921 additions and 2,940 deletions.
74 changes: 35 additions & 39 deletions .idea/workspace.xml

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

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN yarn install
RUN yarn run build



FROM node:lts
WORKDIR /app
COPY package.json ./
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
"@adyen/api-library": "^14.0.0",
"@keycloak/keycloak-admin-client": "^22.0.1",
"@prisma/client": "^5.2.0",
"@stripe/react-stripe-js": "^2.7.0",
"@stripe/stripe-js": "^3.3.0",
"@turf/center": "^6.5.0",
"@turf/turf": "^6.5.0",
"axios": "^1.7.3",
"body-parser": "^1.20.2",
"chalk": "^5.3.0",
"discord.js": "^14.13.0",
Expand All @@ -61,7 +64,9 @@
"reflect-metadata": "^0.1.13",
"rfdc": "^1.3.0",
"socket.io": "^4.7.2",
"stripe": "^16.5.0",
"supercluster": "^8.0.1",
"tailwindcss": "^3.4.3",
"winston": "^3.10.0",
"yup": "^1.2.0"
},
Expand Down
10 changes: 6 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ datasource db {
}

model User {
id String @id @default(uuid())
ssoId String @unique
accountLinks AccountLink[]
roles String @default("[]")
id String @id @default(uuid())
ssoId String @unique
accountLinks AccountLink[]
roles String @default("[]")
plus Boolean @default(false)
stripeCustomerId String?
}

enum AccountLinkType {
Expand Down
13 changes: 7 additions & 6 deletions src/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import DiscordIntegration from "./util/DiscordIntegration.js";
import S3Controller from "./util/S3Controller.js";
import * as winston from "winston";
import Keycloak from "keycloak-connect";
import adyen from '@adyen/api-library';
const { Client } = adyen;
import Stripe from 'stripe';


class Core {
web: Web;
Expand All @@ -26,7 +26,7 @@ class Core {
discord: DiscordIntegration;
s3: S3Controller;
logger: winston.Logger;
adyenClient: adyen.Client;
stripeClient: Stripe;

constructor() {
this.setUpLogger();
Expand All @@ -43,8 +43,10 @@ class Core {
})
this.discord = new DiscordIntegration(this);
this.s3 = new S3Controller(this);
this.getLogger().debug(process.env.ADYEN_KEY)
this.adyenClient = new Client({ apiKey: process.env.ADYEN_KEY, environment: process.env.ADYEN_ENV as Environment })
this.stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY, {

});

}

private setUpLogger(): void {
Expand Down Expand Up @@ -84,7 +86,6 @@ class Core {
public getDiscord = (): DiscordIntegration => this.discord;
public getWeb = (): Web => this.web;
public getS3 = (): S3Controller => this.s3;
public getAdyenClient = (): adyen.Client => this.adyenClient;

}

Expand Down
5 changes: 2 additions & 3 deletions src/controllers/LinkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ class LinkController {
id: linkCode.id
}
})
/*
TODO: Add mcuuid to keycloak when keycloak not broken anymore
let kcUser = await this.core.getKeycloakAdmin().getKeycloakAdminClient().users.findOne({

/*let kcUser = await this.core.getKeycloakAdmin().getKeycloakAdminClient().users.findOne({
id: request.kauth.grant.access_token.content.sub
})
await this.core.getKeycloakAdmin().getKeycloakAdminClient().users.update({
Expand Down
Loading

0 comments on commit 2f2cfed

Please sign in to comment.