mirror of
https://github.com/unraid/api.git
synced 2025-12-30 13:09:52 -06:00
separates Unraid Connect from the API ## Summary by CodeRabbit - **New Features** - Introduced a unified, JSON-schema-based settings system for API configuration and plugin settings, accessible via new GraphQL queries and mutations. - Added modular NestJS plugin architecture for Unraid Connect, including new modules for cloud, remote access, and system/network management. - Added granular connection and remote access state tracking, with new GraphQL types and resolvers for cloud and connection status. - Implemented event-driven and service-based management for SSO users, API keys, and dynamic remote access. - Enhanced UI components and queries to support unified settings and restart detection. - **Improvements** - Refactored configuration and state management to use service-based patterns, replacing direct store access and Redux logic. - Migrated legacy config files to new JSON formats with validation and persistence helpers. - Centralized global dependencies and shared services for plugins and CLI modules. - Improved logging, error handling, and lifecycle management for connections and background jobs. - Updated and expanded documentation for plugin development and settings management. - **Bug Fixes** - Improved handling of missing config files and ensured safe persistence. - Enhanced error reporting and validation in remote access and connection services. - **Removals** - Removed deprecated Redux slices, listeners, and legacy cloud/remote access logic. - Deleted obsolete test files, scripts, and unused code related to the old state/store approach. - **Tests** - Added new unit tests for settings merging, URL resolution, and cloud connectivity checks. - **Style** - Applied consistent formatting, import reorganization, and code style improvements across modules. - **Chores** - Updated build scripts, Dockerfiles, and development environment setup to support new dependencies and workflows. - Expanded .gitignore and configuration files for improved build artifact management.
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
|
|
const config: CodegenConfig = {
|
|
overwrite: true,
|
|
emitLegacyCommonJSImports: false,
|
|
verbose: true,
|
|
config: {
|
|
namingConvention: {
|
|
enumValues: 'change-case-all#upperCase',
|
|
transformUnderscore: true,
|
|
useTypeImports: true,
|
|
},
|
|
scalars: {
|
|
DateTime: 'string',
|
|
Long: 'number',
|
|
JSON: 'Record<string, any>',
|
|
URL: 'URL',
|
|
Port: 'number',
|
|
UUID: 'string',
|
|
},
|
|
scalarSchemas: {
|
|
URL: 'z.instanceof(URL)',
|
|
Long: 'z.number()',
|
|
JSON: 'z.record(z.string(), z.any())',
|
|
Port: 'z.number()',
|
|
UUID: 'z.string()',
|
|
},
|
|
},
|
|
generates: {
|
|
// Generate Types for Mothership GraphQL Client
|
|
'src/graphql/generated/client/': {
|
|
documents: './src/graphql/**/*.ts',
|
|
schema: {
|
|
[process.env.MOTHERSHIP_GRAPHQL_LINK ?? 'https://staging.mothership.unraid.net/ws']: {
|
|
headers: {
|
|
origin: 'https://forums.unraid.net',
|
|
},
|
|
},
|
|
},
|
|
preset: 'client',
|
|
presetConfig: {
|
|
gqlTagName: 'graphql',
|
|
},
|
|
config: {
|
|
useTypeImports: true,
|
|
withObjectType: true,
|
|
},
|
|
plugins: [{ add: { content: '/* eslint-disable */' } }],
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|