Reviewed-on: #12 Co-authored-by: Luciano Giacchetta <giacchetta-@outlook.com> Co-committed-by: Luciano Giacchetta <giacchetta-@outlook.com>
49 lines
967 B
TypeScript
49 lines
967 B
TypeScript
import { createDirectus, rest, staticToken } from '@directus/sdk';
|
|
|
|
type Post = {
|
|
slug: string;
|
|
status: string;
|
|
title: string;
|
|
description: string;
|
|
tags: [];
|
|
cover_image: string;
|
|
content: string;
|
|
}
|
|
|
|
type Course = {
|
|
id: string;
|
|
status: string;
|
|
user_created: string;
|
|
date_created: string;
|
|
user_updated: string;
|
|
date_updated: string;
|
|
name: string;
|
|
level: string;
|
|
version: string;
|
|
type: string;
|
|
category: string;
|
|
language: string;
|
|
description: string;
|
|
image: string;
|
|
features: [];
|
|
content: string;
|
|
modules: [];
|
|
}
|
|
|
|
import type { Careers } from '../types/codyops-careers';
|
|
|
|
type Schema = {
|
|
codyops_posts: Post[];
|
|
codyops_courses: Course[];
|
|
codyops_campaigns: [];
|
|
codyops_reviews: [];
|
|
codyops_currencies: [];
|
|
codyops_careers: Careers[];
|
|
}
|
|
|
|
const directus = createDirectus<Schema>(import.meta.env.ASTRO_DIRECTUS_API)
|
|
.with(staticToken(import.meta.env.ASTRO_DIRECTUS_TOKEN))
|
|
.with(rest());
|
|
|
|
export default directus;
|