Initial commit: add .gitignore and README
This commit is contained in:
29
packages/api-client/package.json
Normal file
29
packages/api-client/package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@dbis/api-client",
|
||||
"version": "1.0.0",
|
||||
"description": "API client for DBIS services",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest",
|
||||
"lint": "eslint src",
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@workspace/api-client": "workspace:*",
|
||||
"@dbis/shared-types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4",
|
||||
"vitest": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
}
|
||||
}
|
||||
|
||||
17
packages/api-client/src/index.ts
Normal file
17
packages/api-client/src/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @dbis/api-client
|
||||
* API client for DBIS services
|
||||
*/
|
||||
|
||||
import { createApiClient } from '@workspace/api-client';
|
||||
import type { DBISConfig } from '@dbis/shared-types';
|
||||
|
||||
export function createDBISClient(config: DBISConfig) {
|
||||
return createApiClient({
|
||||
baseURL: config.apiUrl,
|
||||
headers: {
|
||||
'X-API-Key': config.apiKey,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
28
packages/shared-auth/package.json
Normal file
28
packages/shared-auth/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@dbis/shared-auth",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared authentication utilities for DBIS projects",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest",
|
||||
"lint": "eslint src",
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@workspace/shared-auth": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4",
|
||||
"vitest": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
}
|
||||
}
|
||||
|
||||
19
packages/shared-auth/src/index.ts
Normal file
19
packages/shared-auth/src/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @dbis/shared-auth
|
||||
* Shared authentication utilities for DBIS projects
|
||||
*/
|
||||
|
||||
// Re-export workspace shared auth
|
||||
export * from '@workspace/shared-auth';
|
||||
|
||||
// DBIS-specific auth utilities
|
||||
export function hasDBISRole(user: { roles: string[] }, role: string): boolean {
|
||||
return user.roles.includes(role);
|
||||
}
|
||||
|
||||
export function requireDBISRole(user: { roles: string[] }, role: string): void {
|
||||
if (!hasDBISRole(user, role)) {
|
||||
throw new Error(`User does not have required role: ${role}`);
|
||||
}
|
||||
}
|
||||
|
||||
28
packages/shared-types/package.json
Normal file
28
packages/shared-types/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@dbis/shared-types",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared TypeScript types for DBIS projects",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest",
|
||||
"lint": "eslint src",
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@workspace/shared-types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4",
|
||||
"vitest": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
}
|
||||
}
|
||||
|
||||
31
packages/shared-types/src/index.ts
Normal file
31
packages/shared-types/src/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @dbis/shared-types
|
||||
* Shared TypeScript types for DBIS projects
|
||||
*/
|
||||
|
||||
// Re-export workspace shared types
|
||||
export * from '@workspace/shared-types';
|
||||
|
||||
// DBIS-specific types
|
||||
export interface DBISConfig {
|
||||
apiUrl: string;
|
||||
apiKey: string;
|
||||
environment: 'development' | 'staging' | 'production';
|
||||
}
|
||||
|
||||
export interface DBISUser {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface DBISProject {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
status: 'active' | 'inactive' | 'archived';
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
28
packages/shared-utils/package.json
Normal file
28
packages/shared-utils/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@dbis/shared-utils",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared utility functions for DBIS projects",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest",
|
||||
"lint": "eslint src",
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@workspace/shared-utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4",
|
||||
"vitest": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
}
|
||||
}
|
||||
|
||||
17
packages/shared-utils/src/index.ts
Normal file
17
packages/shared-utils/src/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @dbis/shared-utils
|
||||
* Shared utility functions for DBIS projects
|
||||
*/
|
||||
|
||||
// Re-export workspace shared utils
|
||||
export * from '@workspace/shared-utils';
|
||||
|
||||
// DBIS-specific utilities
|
||||
export function formatDBISDate(date: Date): string {
|
||||
return date.toISOString().split('T')[0];
|
||||
}
|
||||
|
||||
export function validateDBISEmail(email: string): boolean {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) && email.endsWith('@dbis.example.com');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user