Skip to content

Commit

Permalink
🚑 New structure
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Dec 5, 2023
1 parent dfab062 commit 17078cc
Show file tree
Hide file tree
Showing 197 changed files with 551 additions and 1,291 deletions.
112 changes: 17 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: CI

on:
push:
branches:
- main
branches: ["main"]
pull_request:
branches:
- main
branches: ["main"]

jobs:
build-api:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -21,104 +21,26 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
working-directory: packages/api

- name: Set script permissions
run: chmod +x ./scripts/pull-database.sh
working-directory: packages/api
fetch-depth: 2

- name: Lint, Build & Test
run: pnpm run ci
working-directory: packages/api

build-sdk:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: pnpm/[email protected]
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
working-directory: packages/sdk

- name: Lint, Build & Test
run: pnpm run ci
working-directory: packages/sdk

build-react-snippet:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Check out code
uses: actions/checkout@v3
version: 6.32.2

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
working-directory: packages/frontend-snippet

- name: Lint, Build & Test
run: pnpm run ci
working-directory: packages/frontend-snippet
run: pnpm install

build-docs:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install --no-frozen-lockfile
working-directory: website-docs
- name: Lint
run: pnpm lint

- name: Build
run: pnpm run build
working-directory: website-docs
run: pnpm build
#- name: Set script permissions
#run: chmod +x ./scripts/pull-database.sh
#working-directory: apps/api
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: npm install -g pnpm

- name: Install dependencies
run: pnpm --recursive install --no-frozen-lockfile
run: pnpm install --no-frozen-lockfile

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/node_modules/
**/dist/
node_modules
pg_data/
pg_data/
.turbo
build/**
dist/**
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions packages/webapp/package.json → apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives",
"preview": "vite preview"
"preview": "vite preview",
"ci": "pnpm run lint && pnpm run build"
},
"dependencies": {
"@ant-design/icons": "^5.2.6",
Expand Down Expand Up @@ -43,7 +44,8 @@
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.22.4",
"zustand": "^4.4.7"
"zustand": "^4.4.7",
"api": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { Label } from "../ui/label";
import { Input } from "../ui/input";
import useApiKeys from "@/hooks/useApiKeys";
import {api_keys as ApiKey} from "@api/exports";
import { DataTableLoading } from "../shared/data-table-loading";

export default function ApiKeysPage() {
Expand All @@ -28,7 +27,7 @@ export default function ApiKeysPage() {
console.log("error apiKeys..");
}

const tsApiKeys = apiKeys?.map((key: ApiKey) => ({
const tsApiKeys = apiKeys?.map((key) => ({
name: key.id_api_key, // or any other property that corresponds to 'name'
token: key.api_key_hash, // or any other property that corresponds to 'token'
created: new Date().toISOString() // or any other property that corresponds to 'created'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import {
} from "@/components/ui/avatar"
import { Badge } from "@/components/ui/badge"
import { Skeleton } from "@/components/ui/skeleton";
import {linked_users as LinkedUser} from "@api/exports";

export function LinkedUsersPage({
linkedUsers,
isLoading
}: { linkedUsers: LinkedUser[] | undefined; isLoading: boolean }) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}: { linkedUsers: Record<string, any>[] | undefined; isLoading: boolean }) {

return (
<div className="space-y-8">
{linkedUsers && linkedUsers.map((linkedUser: LinkedUser)=>{
{linkedUsers && linkedUsers.map((linkedUser)=>{
return (
<div className="flex items-center">
<Avatar className="h-9 w-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Button } from "../ui/button";
import { PlusCircledIcon } from "@radix-ui/react-icons";
import CopyLinkInput from "./components/CopyLinkInput";
import useConnections from "@/hooks/useConnections";
import {connections as Connection} from "@api/exports";
import { DataTableLoading } from "../shared/data-table-loading";

export default function ConnectionTable() {
Expand All @@ -25,7 +24,7 @@ export default function ConnectionTable() {
console.log("error connections..");
}

const ts = connections?.map((connection: Connection) => ({
const ts = connections?.map((connection) => ({
organisation: connection.id_project, // replace with actual mapping
app: connection.provider_slug, // replace with actual mapping
category: connection.token_type, // replace with actual mapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { columns } from "./components/columns"
import { DataTable } from "../shared/data-table"
import useJobs from "@/hooks/useJobs";
import {jobs as Job} from "@api/exports";
import { DataTableLoading } from "../shared/data-table-loading";
import { jobs as Job } from "api";

export default function JobsTable() {
const { data: jobs, isLoading, error } = useJobs();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Line, LineChart, ResponsiveContainer} from "recharts";
import { Overview } from "../dashboard/components/overview";
import { Button } from "../ui/button";
import { CalendarDateRangePicker } from "./../dashboard/components/date-range-picker"
import { CalendarDateRangePicker } from "../dashboard/components/date-range-picker"
import {
Card,
CardContent,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import {DefineTargetFieldDto} from "@api/src/@core/field-mapping/dto/create-custom-field.dto"
import toast from 'react-hot-toast';

const useDefineFieldMutation = () => {
const defineField = async (data: DefineTargetFieldDto) => {
const defineField = async (data: any) => {
const response = await fetch(`${config.API_URL}/field-mapping/define`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import {CreateLinkedUserDto} from "@api/src/@core/linked-users/dto/create-linked-user.dto"
import toast from 'react-hot-toast';


const useLinkedUserMutation = () => {
const addLinkedUser = async (linkedUserData: CreateLinkedUserDto) => {
const addLinkedUser = async (linkedUserData: any) => {
const response = await fetch(`${config.API_URL}/linked-users/create`, {
method: 'POST',
body: JSON.stringify(linkedUserData),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import {MapFieldToProviderDto} from "@api/src/@core/field-mapping/dto/create-custom-field.dto"
import toast from 'react-hot-toast';


const useMapFieldMutation = () => {
const mapField = async (data: MapFieldToProviderDto) => {
const mapField = async (data: any) => {
const response = await fetch(`${config.API_URL}/field-mapping/map`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import {CreateOrganizationDto} from "@api/src/@core/organisations/dto/create-organization.dto"
import toast from 'react-hot-toast';


const useOrganisationMutation = () => {
const addOrg = async (data: CreateOrganizationDto) => {
const addOrg = async (data: any) => {
const response = await fetch(`${config.API_URL}/organisations/create`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useMutation } from '@tanstack/react-query';
import {CreateProjectDto} from "@api/src/@core/projects/dto/create-project.dto"
import toast from 'react-hot-toast';


const useProjectMutation = () => {
const addProject = async (data: CreateProjectDto) => {
const addProject = async (data: any) => {
const response = await fetch(`${config.API_URL}/projects/create`, {
method: 'POST',
body: JSON.stringify(data),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useQuery } from '@tanstack/react-query';
import {api_keys as ApiKey} from "@api/exports";


const useApiKeys = () => {
return useQuery({
queryKey: ['api-keys'],
queryFn: async (): Promise<ApiKey[]> => {
queryFn: async (): Promise<any[]> => {
const response = await fetch(`${config.API_URL}/auth/api-keys`);
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useQuery } from '@tanstack/react-query';
import {connections as Connection} from "@api/exports";


const useConnections = () => {
return useQuery({
queryKey: ['connections'],
queryFn: async (): Promise<Connection[]> => {
queryFn: async (): Promise<any[]> => {
const response = await fetch(`${config.API_URL}/connections`);
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// useGetMappingQuery.ts
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useQuery } from '@tanstack/react-query';
import config from '@/utils/config';
import {attribute as Attribute} from "@api/exports";

export const useFieldMapping = (id: string) => {
return useQuery({
queryKey: ['mapping', id],
queryFn: async (): Promise<Attribute> => {
queryFn: async (): Promise<any> => {
const response = await fetch(`${config.API_URL}/field-mapping/attribute/${id}`);
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useQuery } from '@tanstack/react-query';
import {attribute as Attribute} from "@api/exports";

const useFieldMappings = () => {
return useQuery({queryKey: ['mappings'], queryFn: async (): Promise<Attribute[]> => {
return useQuery({queryKey: ['mappings'], queryFn: async (): Promise<any[]> => {
const response = await fetch(`${config.API_URL}/field-mapping/attribute`);
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import config from '@/utils/config';
import { useQuery } from '@tanstack/react-query';
import {jobs as Job} from "@api/exports";

const fetchJobs = async (): Promise<Job[]> => {
const fetchJobs = async (): Promise<any[]> => {
const response = await fetch(`${config.API_URL}/jobs`);
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down
Loading

0 comments on commit 17078cc

Please sign in to comment.