Skip to content
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
8 changes: 1 addition & 7 deletions web-server/libdefs/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ declare type Org = {
created_at: Date;
name: string;
domain: string;
onboarding_state: OnboardingStep[];
onboarding_state: string[];
integrations: Partial<IntegrationsMap>;
};

declare enum OnboardingStep {
'WELCOME_SCREEN' = 'WELCOME_SCREEN',
'CODE_PROVIDER_INTEGRATED' = 'CODE_PROVIDER_INTEGRATED',
'TEAM_CREATED' = 'TEAM_CREATED'
}

declare type ONBOARDING_STEP =
| 'WELCOME_INTRODUCTION_STEP'
| 'TOOLS_INTEGRATION_STEP'
Expand Down
1 change: 1 addition & 0 deletions web-server/pages/api/resources/orgs/[org_id]/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as yup from 'yup';

import { Endpoint, nullSchema } from '@/api-helpers/global';
import { Columns, Table } from '@/constants/db';
import { OnboardingStep } from '@/types/resources';
import { db } from '@/utils/db';

const putSchema = yup.object().shape({
Expand Down
2 changes: 1 addition & 1 deletion web-server/pages/api/resources/orgs/[org_id]/teams/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Columns, Table } from '@/constants/db';
import { Integration } from '@/constants/integrations';
import { getTeamV2Mock } from '@/mocks/teams';
import { BaseTeam } from '@/types/api/teams';
import { ReqOrgRepo } from '@/types/resources';
import { OnboardingStep, ReqOrgRepo } from '@/types/resources';
import { db, getFirstRow } from '@/utils/db';

const getSchema = yup.object().shape({
Expand Down
2 changes: 1 addition & 1 deletion web-server/src/constants/useRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRouter } from 'next/router';
import { useEffect } from 'react';

import { useAuth } from '@/hooks/useAuth';
import { UserRole } from '@/types/resources';
import { OnboardingStep, UserRole } from '@/types/resources';

import { ROUTES } from './routes';

Expand Down
2 changes: 1 addition & 1 deletion web-server/src/contexts/ThirdPartyAuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
initialState as initialAuthState
} from '@/slices/auth';
import { useDispatch, useSelector } from '@/store';
import { UserRole, IntegrationGroup } from '@/types/resources';
import { UserRole, IntegrationGroup, OnboardingStep } from '@/types/resources';
import { depFn } from '@/utils/fn';

export interface AuthContextValue extends AuthState {
Expand Down
6 changes: 6 additions & 0 deletions web-server/src/types/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,9 @@ export interface UserStat {
MERGED: number;
REVIEWED: number;
}

export enum OnboardingStep {
'WELCOME_SCREEN' = 'WELCOME_SCREEN',
'CODE_PROVIDER_INTEGRATED' = 'CODE_PROVIDER_INTEGRATED',
'TEAM_CREATED' = 'TEAM_CREATED'
}
4 changes: 2 additions & 2 deletions web-server/src/utils/auth-supplementary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { privateDecrypt, publicEncrypt } from 'crypto';

const CHUNK_SIZE = 127;
export const enc = (data?: string) => {
const key = process.env.SECRET_PUBLIC_KEY;
const key = Buffer.from(process.env.SECRET_PUBLIC_KEY, 'base64');
try {
return data
? splitEvery(CHUNK_SIZE, data).map((chunk) =>
Expand All @@ -17,7 +17,7 @@ export const enc = (data?: string) => {
};

export const dec = (chunks: string[]) => {
const key = process.env.SECRET_PRIVATE_KEY;
const key = Buffer.from(process.env.SECRET_PRIVATE_KEY, 'base64');
return chunks
.map((chunk) => privateDecrypt(key, Buffer.from(chunk, 'base64')))
.join('');
Expand Down