@graphoria/server 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/configuration/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/configuration/index.ts +8 -1
- package/dist/src/console/App.d.ts +0 -3
- package/dist/src/console/App.d.ts.map +0 -1
- package/dist/src/console/Login.d.ts +0 -6
- package/dist/src/console/Login.d.ts.map +0 -1
- package/dist/src/console/client.d.ts +0 -67
- package/dist/src/console/client.d.ts.map +0 -1
- package/dist/src/console/frontend.d.ts +0 -8
- package/dist/src/console/frontend.d.ts.map +0 -1
- package/dist/src/console/pages/ConfigPage.d.ts +0 -2
- package/dist/src/console/pages/ConfigPage.d.ts.map +0 -1
- package/dist/src/console/pages/RolesPage.d.ts +0 -2
- package/dist/src/console/pages/RolesPage.d.ts.map +0 -1
- package/dist/src/console/pages/StatusPage.d.ts +0 -2
- package/dist/src/console/pages/StatusPage.d.ts.map +0 -1
- package/dist/src/console/pages/TablesPage.d.ts +0 -2
- package/dist/src/console/pages/TablesPage.d.ts.map +0 -1
- package/dist/src/console/useApi.d.ts +0 -8
- package/dist/src/console/useApi.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphoria/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Auto-generated GraphQL and REST APIs from database schema - Connect your database to modern APIs instantly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auto-generated",
|
|
@@ -116,4 +116,4 @@
|
|
|
116
116
|
"engines": {
|
|
117
117
|
"bun": ">=1.3.4"
|
|
118
118
|
}
|
|
119
|
-
}
|
|
119
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "path";
|
|
2
|
+
|
|
1
3
|
import { isFunction, isPlainObject } from "es-toolkit";
|
|
2
4
|
import { z } from "zod";
|
|
3
5
|
|
|
@@ -22,8 +24,13 @@ import { generateOpenAPI } from "./rest/generateOpenAPI";
|
|
|
22
24
|
|
|
23
25
|
export const loadConfiguration = async (config: string): Promise<Configuration> => {
|
|
24
26
|
try {
|
|
27
|
+
// A dynamic import() with a relative specifier resolves against this module,
|
|
28
|
+
// not the project root. Resolve relative paths against the process cwd (the
|
|
29
|
+
// project root) so CONFIGURATION="graphoria.ts" works like an absolute path.
|
|
30
|
+
const configPath = isAbsolute(config) ? config : resolve(process.cwd(), config);
|
|
31
|
+
|
|
25
32
|
// Dynamic import of the TypeScript file
|
|
26
|
-
const configModule = await import(
|
|
33
|
+
const configModule = await import(configPath);
|
|
27
34
|
|
|
28
35
|
if (isFunction(configModule?.default)) {
|
|
29
36
|
return configModule.default({
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../src/console/App.tsx"],"names":[],"mappings":"AAaA,OAAO,aAAa,CAAC;AASrB,eAAO,MAAM,GAAG,+CA6Df,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../../src/console/Login.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,eAAO,MAAM,KAAK,GAAI,qBAAqB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,IAAI,CAAA;CAAE,4CAwC/E,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const apiBase: string;
|
|
2
|
-
export type Meta = {
|
|
3
|
-
name: string;
|
|
4
|
-
version: string;
|
|
5
|
-
adminSecretHeader: string;
|
|
6
|
-
};
|
|
7
|
-
export type TablesResponse = {
|
|
8
|
-
tables: {
|
|
9
|
-
schema: string;
|
|
10
|
-
name: string;
|
|
11
|
-
entityType: string;
|
|
12
|
-
description: string | null;
|
|
13
|
-
columns: {
|
|
14
|
-
name: string;
|
|
15
|
-
dataType?: string;
|
|
16
|
-
isNullable?: boolean;
|
|
17
|
-
description?: string | null;
|
|
18
|
-
}[];
|
|
19
|
-
relationships: {
|
|
20
|
-
schema: string;
|
|
21
|
-
name: string;
|
|
22
|
-
}[];
|
|
23
|
-
}[];
|
|
24
|
-
};
|
|
25
|
-
export type PermissionValue = "ALL" | string[] | Record<string, "ALL" | {
|
|
26
|
-
columns?: "ALL" | string[];
|
|
27
|
-
filter?: unknown;
|
|
28
|
-
orderBy?: unknown;
|
|
29
|
-
}>;
|
|
30
|
-
export type RolesResponse = {
|
|
31
|
-
roles: string[];
|
|
32
|
-
permissions: Record<string, Record<string, PermissionValue>>;
|
|
33
|
-
};
|
|
34
|
-
export type StatusResponse = {
|
|
35
|
-
uptimeSeconds: number;
|
|
36
|
-
tokenStrategy: string;
|
|
37
|
-
databases: {
|
|
38
|
-
name: string;
|
|
39
|
-
type: string;
|
|
40
|
-
connected: boolean;
|
|
41
|
-
}[];
|
|
42
|
-
publishers: string[];
|
|
43
|
-
cron: {
|
|
44
|
-
name: string;
|
|
45
|
-
pattern: string;
|
|
46
|
-
executionCount: number;
|
|
47
|
-
isRunning: boolean;
|
|
48
|
-
isBusy: boolean;
|
|
49
|
-
nextRun: string | null;
|
|
50
|
-
}[];
|
|
51
|
-
};
|
|
52
|
-
export type ConfigResponse = {
|
|
53
|
-
name: string;
|
|
54
|
-
version: string;
|
|
55
|
-
prefixes: Record<string, string>;
|
|
56
|
-
features: Record<string, boolean>;
|
|
57
|
-
};
|
|
58
|
-
export declare const getSecret: () => string | null;
|
|
59
|
-
export declare const setSecret: (secret: string) => void;
|
|
60
|
-
export declare const clearSecret: () => void;
|
|
61
|
-
export declare class AuthError extends Error {
|
|
62
|
-
}
|
|
63
|
-
export declare const setAdminHeaderName: (name: string) => void;
|
|
64
|
-
export declare const onAuthFail: (handler: () => void) => void;
|
|
65
|
-
export declare const getMeta: () => Promise<Meta>;
|
|
66
|
-
export declare const apiFetch: <T>(path: string) => Promise<T>;
|
|
67
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/console/client.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,QAAiD,CAAC;AAEtE,MAAM,MAAM,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,OAAO,CAAC;YACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC7B,EAAE,CAAC;QACJ,aAAa,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACnD,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,MAAM,EAAE,GACR,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEhG,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,C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,0 @@
|
|
|
1
|
-
{"version":3,"file":"frontend.d.ts","sourceRoot":"","sources":["../../../src/console/frontend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigPage.d.ts","sourceRoot":"","sources":["../../../../src/console/pages/ConfigPage.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,+CA+CtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RolesPage.d.ts","sourceRoot":"","sources":["../../../../src/console/pages/RolesPage.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,SAAS,+CAqCrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusPage.d.ts","sourceRoot":"","sources":["../../../../src/console/pages/StatusPage.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,+CAiFtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TablesPage.d.ts","sourceRoot":"","sources":["../../../../src/console/pages/TablesPage.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,+CAiDtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useApi.d.ts","sourceRoot":"","sources":["../../../src/console/useApi.ts"],"names":[],"mappings":"AAIA,KAAK,QAAQ,CAAC,CAAC,IAAI;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,MAAM,MAAM,KAAG,QAAQ,CAAC,CAAC,CAgBlD,CAAC"}
|