@graphoria/server 0.1.5 → 0.2.0
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/analyzeQuery/resolveVariables.d.ts.map +1 -1
- package/dist/src/config/helpers/operationHelper.d.ts +60 -6
- package/dist/src/config/helpers/operationHelper.d.ts.map +1 -1
- package/dist/src/config/helpers/operationHelper.test.d.ts +2 -0
- package/dist/src/config/helpers/operationHelper.test.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +65 -60
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/types/ai.d.ts +9 -3
- package/dist/src/config/types/ai.d.ts.map +1 -1
- package/dist/src/config/types/auth.d.ts +55 -15
- package/dist/src/config/types/auth.d.ts.map +1 -1
- package/dist/src/config/types/cron.d.ts +96 -2
- package/dist/src/config/types/cron.d.ts.map +1 -1
- package/dist/src/config/types/db.d.ts +102 -29
- package/dist/src/config/types/db.d.ts.map +1 -1
- package/dist/src/config/types/index.d.ts +1 -1
- package/dist/src/config/types/index.d.ts.map +1 -1
- package/dist/src/config/types/operation.d.ts +49 -17
- package/dist/src/config/types/operation.d.ts.map +1 -1
- package/dist/src/config/types/queue.d.ts +59 -12
- package/dist/src/config/types/queue.d.ts.map +1 -1
- package/dist/src/config/types/remote-rest.d.ts +10 -1
- package/dist/src/config/types/remote-rest.d.ts.map +1 -1
- package/dist/src/config/types/remote-schema.d.ts +13 -3
- package/dist/src/config/types/remote-schema.d.ts.map +1 -1
- package/dist/src/config/types/virtual-columns.d.ts +1 -1
- package/dist/src/config/types/virtual-columns.d.ts.map +1 -1
- package/dist/src/configuration/getSchemas/index.d.ts +4 -4
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts +2 -2
- package/dist/src/configuration/getSchemas/mergeEntities/index.d.ts.map +1 -1
- package/dist/src/configuration/getSchemas/mergeEntities/index.test.d.ts +2 -0
- package/dist/src/configuration/getSchemas/mergeEntities/index.test.d.ts.map +1 -0
- package/dist/src/configuration/getSchemas/type-definition-generator/index.d.ts.map +1 -1
- package/dist/src/configuration/index.d.ts +4 -4
- package/dist/src/configuration/rest/generateOpenAPI.d.ts.map +1 -1
- package/dist/src/configuration/rest/handleRESTRequestFactory.d.ts.map +1 -1
- package/dist/src/databases/common.d.ts +3 -1
- package/dist/src/databases/common.d.ts.map +1 -1
- package/dist/src/databases/core/query-builder.d.ts +1 -1
- package/dist/src/databases/directives.d.ts.map +1 -1
- package/dist/src/databases/engines/mssql/connection.d.ts +1 -1
- package/dist/src/databases/engines/mssql/connection.d.ts.map +1 -1
- package/dist/src/databases/engines/mssql/query/index.d.ts.map +1 -1
- package/dist/src/databases/engines/mysql/connection.d.ts.map +1 -1
- package/dist/src/databases/engines/mysql/getStructure.d.ts.map +1 -1
- package/dist/src/databases/engines/mysql/placeholders.d.ts +22 -0
- package/dist/src/databases/engines/mysql/placeholders.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/placeholders.test.d.ts +2 -0
- package/dist/src/databases/engines/mysql/placeholders.test.d.ts.map +1 -0
- package/dist/src/databases/engines/mysql/query/index.d.ts.map +1 -1
- package/dist/src/databases/engines/postgresql/query/index.d.ts.map +1 -1
- package/dist/src/databases/high-level-operations.d.ts +1 -1
- package/dist/src/databases/sqlTypeUtils.d.ts.map +1 -1
- package/dist/src/databases/transformers/data-transformers.d.ts +2 -2
- package/dist/src/singletons/env.d.ts +3 -3
- package/dist/src/types/env.d.ts +52 -52
- package/dist/src/types/resolver.d.ts +12 -2
- package/dist/src/types/resolver.d.ts.map +1 -1
- package/dist/src/types/zod/auth.d.ts +6 -6
- package/dist/src/types/zod/configuration.d.ts +46 -46
- package/dist/src/types/zod/configuration.d.ts.map +1 -1
- package/dist/src/types/zod/cron.d.ts +1 -1
- package/dist/src/types/zod/cron.d.ts.map +1 -1
- package/dist/src/types/zod/db.d.ts +12 -12
- package/dist/src/types/zod/queue.d.ts +26 -26
- package/dist/src/types/zod/strict-keys.test.d.ts +2 -0
- package/dist/src/types/zod/strict-keys.test.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/analyzeQuery/resolveVariables.ts +37 -7
- package/src/config/helpers/operationHelper.ts +146 -5
- package/src/config/index.ts +139 -62
- package/src/config/types/ai.ts +2 -2
- package/src/config/types/auth.ts +37 -6
- package/src/config/types/cron.ts +1 -1
- package/src/config/types/db.ts +10 -10
- package/src/config/types/index.ts +2 -0
- package/src/config/types/operation.ts +49 -9
- package/src/config/types/queue.ts +8 -8
- package/src/config/types/remote-rest.ts +1 -1
- package/src/config/types/remote-schema.ts +2 -2
- package/src/config/types/virtual-columns.ts +1 -1
- package/src/configuration/getSchemas/mergeEntities/index.ts +6 -0
- package/src/configuration/getSchemas/type-definition-generator/index.ts +13 -4
- package/src/configuration/rest/generateOpenAPI.ts +5 -9
- package/src/configuration/rest/handleRESTRequestFactory.ts +40 -14
- package/src/databases/common.ts +151 -65
- package/src/databases/directives.ts +26 -8
- package/src/databases/engines/mssql/connection.ts +1 -1
- package/src/databases/engines/mssql/query/index.ts +29 -11
- package/src/databases/engines/mysql/auth.ts +2 -2
- package/src/databases/engines/mysql/connection.ts +5 -4
- package/src/databases/engines/mysql/getStructure.ts +61 -30
- package/src/databases/engines/mysql/placeholders.ts +84 -0
- package/src/databases/engines/mysql/query/index.ts +49 -4
- package/src/databases/engines/postgresql/query/index.ts +40 -2
- package/src/databases/sqlTypeUtils.ts +3 -1
- package/src/subscriptions/strategies/index.ts +1 -1
- package/src/subscriptions/strategies/queue.ts +1 -1
- package/src/types/resolver.ts +17 -1
- package/src/types/zod/configuration.ts +1 -1
|
@@ -35,37 +35,131 @@ export type CronTickCallback<TVariables = Record<string, unknown>> = (options: {
|
|
|
35
35
|
* This allows TypeScript to infer the variables type
|
|
36
36
|
*/
|
|
37
37
|
export declare const createTypedCronJobZod: <TVariables extends DefaultVariables>() => z.ZodObject<{
|
|
38
|
+
/**
|
|
39
|
+
* Unique name/identifier for the cron job
|
|
40
|
+
*/
|
|
38
41
|
name: z.ZodString;
|
|
42
|
+
/**
|
|
43
|
+
* Cron pattern or ISO 8601 date string
|
|
44
|
+
* Examples:
|
|
45
|
+
* - "0 0 * * *" (daily at midnight)
|
|
46
|
+
* - "*\/5 * * * *" (every 5 minutes)
|
|
47
|
+
* - "2024-01-23T00:00:00" (specific date/time)
|
|
48
|
+
*/
|
|
39
49
|
pattern: z.ZodString;
|
|
50
|
+
/**
|
|
51
|
+
* Optional GraphQL query to execute when the cron job runs
|
|
52
|
+
* If not provided, you must use the gqlQuery function in onTick callback
|
|
53
|
+
*/
|
|
40
54
|
query: z.ZodOptional<z.ZodString>;
|
|
55
|
+
/**
|
|
56
|
+
* Optional variables to pass to the GraphQL query
|
|
57
|
+
*/
|
|
41
58
|
variables: z.ZodOptional<z.ZodCustom<TVariables, TVariables>>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional timezone (e.g., "America/New_York", "Europe/Stockholm")
|
|
61
|
+
*/
|
|
42
62
|
timezone: z.ZodOptional<z.ZodString>;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the job should be paused from start
|
|
65
|
+
*/
|
|
43
66
|
paused: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
67
|
+
/**
|
|
68
|
+
* Maximum number of times the job should run
|
|
69
|
+
*/
|
|
44
70
|
maxRuns: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
/**
|
|
72
|
+
* Minimum number of seconds between triggers
|
|
73
|
+
*/
|
|
45
74
|
interval: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
/**
|
|
76
|
+
* ISO 8601 formatted datetime to start the job
|
|
77
|
+
*/
|
|
46
78
|
startAt: z.ZodOptional<z.ZodString>;
|
|
79
|
+
/**
|
|
80
|
+
* ISO 8601 formatted datetime to stop the job
|
|
81
|
+
*/
|
|
47
82
|
stopAt: z.ZodOptional<z.ZodString>;
|
|
83
|
+
/**
|
|
84
|
+
* Enable over-run protection (blocks new triggers while old one is in progress)
|
|
85
|
+
*/
|
|
48
86
|
protect: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Whether to catch errors silently or handle them
|
|
89
|
+
*/
|
|
49
90
|
catchErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
91
|
+
/**
|
|
92
|
+
* Context to pass along with the cron job (for logging, etc.)
|
|
93
|
+
*/
|
|
50
94
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
95
|
+
/**
|
|
96
|
+
* Callback executed on each tick
|
|
97
|
+
*/
|
|
51
98
|
onTick: z.ZodOptional<z.ZodCustom<CronTickCallback<TVariables>, CronTickCallback<TVariables>>>;
|
|
52
|
-
}, z.core.$
|
|
99
|
+
}, z.core.$strict>;
|
|
53
100
|
export declare const TypedCronJobZod: z.ZodObject<{
|
|
101
|
+
/**
|
|
102
|
+
* Unique name/identifier for the cron job
|
|
103
|
+
*/
|
|
54
104
|
name: z.ZodString;
|
|
105
|
+
/**
|
|
106
|
+
* Cron pattern or ISO 8601 date string
|
|
107
|
+
* Examples:
|
|
108
|
+
* - "0 0 * * *" (daily at midnight)
|
|
109
|
+
* - "*\/5 * * * *" (every 5 minutes)
|
|
110
|
+
* - "2024-01-23T00:00:00" (specific date/time)
|
|
111
|
+
*/
|
|
55
112
|
pattern: z.ZodString;
|
|
113
|
+
/**
|
|
114
|
+
* Optional GraphQL query to execute when the cron job runs
|
|
115
|
+
* If not provided, you must use the gqlQuery function in onTick callback
|
|
116
|
+
*/
|
|
56
117
|
query: z.ZodOptional<z.ZodString>;
|
|
118
|
+
/**
|
|
119
|
+
* Optional variables to pass to the GraphQL query
|
|
120
|
+
*/
|
|
57
121
|
variables: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
122
|
+
/**
|
|
123
|
+
* Optional timezone (e.g., "America/New_York", "Europe/Stockholm")
|
|
124
|
+
*/
|
|
58
125
|
timezone: z.ZodOptional<z.ZodString>;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the job should be paused from start
|
|
128
|
+
*/
|
|
59
129
|
paused: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
130
|
+
/**
|
|
131
|
+
* Maximum number of times the job should run
|
|
132
|
+
*/
|
|
60
133
|
maxRuns: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
/**
|
|
135
|
+
* Minimum number of seconds between triggers
|
|
136
|
+
*/
|
|
61
137
|
interval: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
/**
|
|
139
|
+
* ISO 8601 formatted datetime to start the job
|
|
140
|
+
*/
|
|
62
141
|
startAt: z.ZodOptional<z.ZodString>;
|
|
142
|
+
/**
|
|
143
|
+
* ISO 8601 formatted datetime to stop the job
|
|
144
|
+
*/
|
|
63
145
|
stopAt: z.ZodOptional<z.ZodString>;
|
|
146
|
+
/**
|
|
147
|
+
* Enable over-run protection (blocks new triggers while old one is in progress)
|
|
148
|
+
*/
|
|
64
149
|
protect: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
/**
|
|
151
|
+
* Whether to catch errors silently or handle them
|
|
152
|
+
*/
|
|
65
153
|
catchErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
154
|
+
/**
|
|
155
|
+
* Context to pass along with the cron job (for logging, etc.)
|
|
156
|
+
*/
|
|
66
157
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
158
|
+
/**
|
|
159
|
+
* Callback executed on each tick
|
|
160
|
+
*/
|
|
67
161
|
onTick: z.ZodOptional<z.ZodCustom<CronTickCallback<Record<string, unknown>>, CronTickCallback<Record<string, unknown>>>>;
|
|
68
|
-
}, z.core.$
|
|
162
|
+
}, z.core.$strict>;
|
|
69
163
|
export type CronJobType = z.input<typeof TypedCronJobZod>;
|
|
70
164
|
/**
|
|
71
165
|
* Typed cron job definition
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.d.ts","sourceRoot":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,EAAE,CAAA;CAAE,KAC7C,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,SAAS,gBAAgB;IAErE;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;kBAEH,CAAC;AAEL,eAAO,MAAM,eAAe;IA5ExB;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;kBAI+C,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,GAAG,gBAAgB,IAAI,IAAI,CAC5D,WAAW,EACX,WAAW,GAAG,QAAQ,CACvB,GAAG;IACF,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,UAAU,GAAG,gBAAgB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -11,8 +11,11 @@ export declare const RELATIONSHIP_CONDITION_OPERATORS: readonly ["eq", "neq", "g
|
|
|
11
11
|
* A `value` is required for every operator except `is_null` / `is_not_null`.
|
|
12
12
|
*/
|
|
13
13
|
export declare const RelationshipConditionZod: z.ZodObject<{
|
|
14
|
+
/** Column on the declaring (source) table */
|
|
14
15
|
source: z.ZodOptional<z.ZodString>;
|
|
16
|
+
/** Column on the referenced (target) table */
|
|
15
17
|
target: z.ZodOptional<z.ZodString>;
|
|
18
|
+
/** Comparison operator (default `eq`) */
|
|
16
19
|
operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
17
20
|
eq: "eq";
|
|
18
21
|
neq: "neq";
|
|
@@ -24,8 +27,9 @@ export declare const RelationshipConditionZod: z.ZodObject<{
|
|
|
24
27
|
is_null: "is_null";
|
|
25
28
|
is_not_null: "is_not_null";
|
|
26
29
|
}>>>;
|
|
30
|
+
/** Literal compared against the column (omit for `is_null` / `is_not_null`) */
|
|
27
31
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
28
|
-
}, z.core.$
|
|
32
|
+
}, z.core.$strict>;
|
|
29
33
|
export type RelationshipCondition = z.input<typeof RelationshipConditionZod>;
|
|
30
34
|
export declare const TableRelationshipZod: z.ZodObject<{
|
|
31
35
|
schema: z.ZodString;
|
|
@@ -33,10 +37,14 @@ export declare const TableRelationshipZod: z.ZodObject<{
|
|
|
33
37
|
columns: z.ZodArray<z.ZodObject<{
|
|
34
38
|
source: z.ZodString;
|
|
35
39
|
target: z.ZodString;
|
|
36
|
-
}, z.core.$
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
/** Static-value predicates ANDed into the JOIN condition */
|
|
37
42
|
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
|
+
/** Column on the declaring (source) table */
|
|
38
44
|
source: z.ZodOptional<z.ZodString>;
|
|
45
|
+
/** Column on the referenced (target) table */
|
|
39
46
|
target: z.ZodOptional<z.ZodString>;
|
|
47
|
+
/** Comparison operator (default `eq`) */
|
|
40
48
|
operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
41
49
|
eq: "eq";
|
|
42
50
|
neq: "neq";
|
|
@@ -48,9 +56,10 @@ export declare const TableRelationshipZod: z.ZodObject<{
|
|
|
48
56
|
is_null: "is_null";
|
|
49
57
|
is_not_null: "is_not_null";
|
|
50
58
|
}>>>;
|
|
59
|
+
/** Literal compared against the column (omit for `is_null` / `is_not_null`) */
|
|
51
60
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
52
|
-
}, z.core.$
|
|
53
|
-
}, z.core.$
|
|
61
|
+
}, z.core.$strict>>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
54
63
|
export type TableRelationship = z.input<typeof TableRelationshipZod>;
|
|
55
64
|
export declare const TableSchemaConfigZod: z.ZodObject<{
|
|
56
65
|
columns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -62,17 +71,21 @@ export declare const TableSchemaConfigZod: z.ZodObject<{
|
|
|
62
71
|
function: z.ZodOptional<z.ZodString>;
|
|
63
72
|
params: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
73
|
expression: z.ZodOptional<z.ZodString>;
|
|
65
|
-
}, z.core.$
|
|
74
|
+
}, z.core.$strict>>>>;
|
|
66
75
|
relationships: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
76
|
schema: z.ZodString;
|
|
68
77
|
name: z.ZodString;
|
|
69
78
|
columns: z.ZodArray<z.ZodObject<{
|
|
70
79
|
source: z.ZodString;
|
|
71
80
|
target: z.ZodString;
|
|
72
|
-
}, z.core.$
|
|
81
|
+
}, z.core.$strict>>;
|
|
82
|
+
/** Static-value predicates ANDed into the JOIN condition */
|
|
73
83
|
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
84
|
+
/** Column on the declaring (source) table */
|
|
74
85
|
source: z.ZodOptional<z.ZodString>;
|
|
86
|
+
/** Column on the referenced (target) table */
|
|
75
87
|
target: z.ZodOptional<z.ZodString>;
|
|
88
|
+
/** Comparison operator (default `eq`) */
|
|
76
89
|
operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
77
90
|
eq: "eq";
|
|
78
91
|
neq: "neq";
|
|
@@ -84,12 +97,15 @@ export declare const TableSchemaConfigZod: z.ZodObject<{
|
|
|
84
97
|
is_null: "is_null";
|
|
85
98
|
is_not_null: "is_not_null";
|
|
86
99
|
}>>>;
|
|
100
|
+
/** Literal compared against the column (omit for `is_null` / `is_not_null`) */
|
|
87
101
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
88
|
-
}, z.core.$
|
|
89
|
-
}, z.core.$
|
|
102
|
+
}, z.core.$strict>>>;
|
|
103
|
+
}, z.core.$strict>>>>;
|
|
104
|
+
/** Overrides the table description from the database */
|
|
90
105
|
description: z.ZodOptional<z.ZodString>;
|
|
106
|
+
/** Overrides column descriptions from the database, keyed by column name */
|
|
91
107
|
columnDescriptions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
92
|
-
}, z.core.$
|
|
108
|
+
}, z.core.$strict>;
|
|
93
109
|
export type TableSchemaConfig = z.input<typeof TableSchemaConfigZod>;
|
|
94
110
|
export declare const DatabaseSchemaConfigZod: z.ZodObject<{
|
|
95
111
|
database: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
@@ -102,17 +118,21 @@ export declare const DatabaseSchemaConfigZod: z.ZodObject<{
|
|
|
102
118
|
function: z.ZodOptional<z.ZodString>;
|
|
103
119
|
params: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
120
|
expression: z.ZodOptional<z.ZodString>;
|
|
105
|
-
}, z.core.$
|
|
121
|
+
}, z.core.$strict>>>>;
|
|
106
122
|
relationships: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
123
|
schema: z.ZodString;
|
|
108
124
|
name: z.ZodString;
|
|
109
125
|
columns: z.ZodArray<z.ZodObject<{
|
|
110
126
|
source: z.ZodString;
|
|
111
127
|
target: z.ZodString;
|
|
112
|
-
}, z.core.$
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
/** Static-value predicates ANDed into the JOIN condition */
|
|
113
130
|
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
131
|
+
/** Column on the declaring (source) table */
|
|
114
132
|
source: z.ZodOptional<z.ZodString>;
|
|
133
|
+
/** Column on the referenced (target) table */
|
|
115
134
|
target: z.ZodOptional<z.ZodString>;
|
|
135
|
+
/** Comparison operator (default `eq`) */
|
|
116
136
|
operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
117
137
|
eq: "eq";
|
|
118
138
|
neq: "neq";
|
|
@@ -124,46 +144,66 @@ export declare const DatabaseSchemaConfigZod: z.ZodObject<{
|
|
|
124
144
|
is_null: "is_null";
|
|
125
145
|
is_not_null: "is_not_null";
|
|
126
146
|
}>>>;
|
|
147
|
+
/** Literal compared against the column (omit for `is_null` / `is_not_null`) */
|
|
127
148
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
128
|
-
}, z.core.$
|
|
129
|
-
}, z.core.$
|
|
149
|
+
}, z.core.$strict>>>;
|
|
150
|
+
}, z.core.$strict>>>>;
|
|
151
|
+
/** Overrides the table description from the database */
|
|
130
152
|
description: z.ZodOptional<z.ZodString>;
|
|
153
|
+
/** Overrides column descriptions from the database, keyed by column name */
|
|
131
154
|
columnDescriptions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
132
|
-
}, z.core.$
|
|
155
|
+
}, z.core.$strict>>>>>>>;
|
|
133
156
|
excludedTables: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
134
|
-
}, z.core.$
|
|
157
|
+
}, z.core.$strict>;
|
|
135
158
|
export type DatabaseSchemaConfig = z.input<typeof DatabaseSchemaConfigZod>;
|
|
136
159
|
/**
|
|
137
160
|
* Connection pool and transport options for PostgreSQL and MySQL (Bun SQL).
|
|
138
161
|
* All timeout values are in seconds.
|
|
139
162
|
*/
|
|
140
163
|
export declare const BunSQLConnectionOptionsZod: z.ZodObject<{
|
|
164
|
+
/** Maximum number of connections in the pool */
|
|
141
165
|
max: z.ZodDefault<z.ZodNumber>;
|
|
166
|
+
/** Maximum time in seconds a connection can be idle before being closed */
|
|
142
167
|
idleTimeout: z.ZodDefault<z.ZodNumber>;
|
|
168
|
+
/** Maximum time in seconds to wait when establishing a connection */
|
|
143
169
|
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
170
|
+
/** Maximum lifetime in seconds of a connection */
|
|
144
171
|
maxLifetime: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
/** Whether to use TLS/SSL for the connection */
|
|
145
173
|
tls: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
/** Automatic creation of prepared statements (default: true) */
|
|
146
175
|
prepare: z.ZodDefault<z.ZodBoolean>;
|
|
176
|
+
/** Return values outside i32 range as BigInts instead of strings (default: false) */
|
|
147
177
|
bigint: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
-
}, z.core.$
|
|
178
|
+
}, z.core.$strict>;
|
|
149
179
|
export type BunSQLConnectionOptions = z.input<typeof BunSQLConnectionOptionsZod>;
|
|
150
180
|
/**
|
|
151
181
|
* Connection pool and transport options for MSSQL.
|
|
152
182
|
* All timeout values are in seconds (converted to milliseconds internally).
|
|
153
183
|
*/
|
|
154
184
|
export declare const MSSQLConnectionOptionsZod: z.ZodObject<{
|
|
185
|
+
/** Connection pool options */
|
|
155
186
|
pool: z.ZodDefault<z.ZodObject<{
|
|
187
|
+
/** Maximum number of connections in the pool */
|
|
156
188
|
max: z.ZodDefault<z.ZodNumber>;
|
|
189
|
+
/** Minimum number of connections in the pool */
|
|
157
190
|
min: z.ZodDefault<z.ZodNumber>;
|
|
191
|
+
/** Maximum time in seconds a connection can be idle before being closed */
|
|
158
192
|
idleTimeout: z.ZodDefault<z.ZodNumber>;
|
|
159
|
-
}, z.core.$
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
/** Maximum time in seconds to wait when establishing a connection */
|
|
160
195
|
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
196
|
+
/** Maximum time in seconds to wait for a request to complete */
|
|
161
197
|
requestTimeout: z.ZodDefault<z.ZodNumber>;
|
|
198
|
+
/** Whether to encrypt the connection */
|
|
162
199
|
encrypt: z.ZodDefault<z.ZodBoolean>;
|
|
200
|
+
/** Whether to trust the server certificate without validation */
|
|
163
201
|
trustServerCertificate: z.ZodDefault<z.ZodBoolean>;
|
|
202
|
+
/** Whether to use Windows Authentication (trusted connection) */
|
|
164
203
|
trustedConnection: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
/** Whether to automatically parse JSON responses */
|
|
165
205
|
parseJSON: z.ZodDefault<z.ZodBoolean>;
|
|
166
|
-
}, z.core.$
|
|
206
|
+
}, z.core.$strict>;
|
|
167
207
|
export type MSSQLConnectionOptions = z.input<typeof MSSQLConnectionOptionsZod>;
|
|
168
208
|
/**
|
|
169
209
|
* Maps database type to the corresponding native connection type.
|
|
@@ -186,19 +226,27 @@ export type OnConnectHandler<T extends DatabaseType = DatabaseType> = (connectio
|
|
|
186
226
|
*/
|
|
187
227
|
export type ConnectionOptionsForType<T extends DatabaseType> = T extends "pg" | "mysql" ? BunSQLConnectionOptions : T extends "mssql" ? MSSQLConnectionOptions : never;
|
|
188
228
|
export declare const DatabaseConnectionZod: z.ZodObject<{
|
|
229
|
+
/** Unique name for the database connection */
|
|
189
230
|
name: z.ZodString;
|
|
231
|
+
/** Whether the database is enabled */
|
|
190
232
|
enabled: z.ZodBoolean;
|
|
233
|
+
/** Database type */
|
|
191
234
|
type: z.ZodUnion<readonly [z.ZodLiteral<"mssql">, z.ZodLiteral<"pg">, z.ZodLiteral<"mysql">]>;
|
|
235
|
+
/** Connection configuration */
|
|
192
236
|
connection: z.ZodObject<{
|
|
193
237
|
host: z.ZodString;
|
|
194
238
|
port: z.ZodNumber;
|
|
195
239
|
user: z.ZodString;
|
|
196
240
|
password: z.ZodString;
|
|
197
241
|
database: z.ZodString;
|
|
198
|
-
}, z.core.$
|
|
242
|
+
}, z.core.$strict>;
|
|
243
|
+
/** Field naming pattern (default: "{schema}_{name}") */
|
|
199
244
|
fieldNaming: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
245
|
+
/** Factory function to create custom database repository */
|
|
200
246
|
repository: z.ZodOptional<z.ZodCustom<CustomRepositoryFactory<DatabaseType>, CustomRepositoryFactory<DatabaseType>>>;
|
|
247
|
+
/** Handler run once at startup against the connected database */
|
|
201
248
|
onConnect: z.ZodOptional<z.ZodCustom<OnConnectHandler<DatabaseType>, OnConnectHandler<DatabaseType>>>;
|
|
249
|
+
/** Schema configuration (virtual columns, relationships, excluded tables) */
|
|
202
250
|
schema: z.ZodOptional<z.ZodObject<{
|
|
203
251
|
database: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
204
252
|
columns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -210,17 +258,21 @@ export declare const DatabaseConnectionZod: z.ZodObject<{
|
|
|
210
258
|
function: z.ZodOptional<z.ZodString>;
|
|
211
259
|
params: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
260
|
expression: z.ZodOptional<z.ZodString>;
|
|
213
|
-
}, z.core.$
|
|
261
|
+
}, z.core.$strict>>>>;
|
|
214
262
|
relationships: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
215
263
|
schema: z.ZodString;
|
|
216
264
|
name: z.ZodString;
|
|
217
265
|
columns: z.ZodArray<z.ZodObject<{
|
|
218
266
|
source: z.ZodString;
|
|
219
267
|
target: z.ZodString;
|
|
220
|
-
}, z.core.$
|
|
268
|
+
}, z.core.$strict>>;
|
|
269
|
+
/** Static-value predicates ANDed into the JOIN condition */
|
|
221
270
|
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
271
|
+
/** Column on the declaring (source) table */
|
|
222
272
|
source: z.ZodOptional<z.ZodString>;
|
|
273
|
+
/** Column on the referenced (target) table */
|
|
223
274
|
target: z.ZodOptional<z.ZodString>;
|
|
275
|
+
/** Comparison operator (default `eq`) */
|
|
224
276
|
operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
225
277
|
eq: "eq";
|
|
226
278
|
neq: "neq";
|
|
@@ -232,36 +284,57 @@ export declare const DatabaseConnectionZod: z.ZodObject<{
|
|
|
232
284
|
is_null: "is_null";
|
|
233
285
|
is_not_null: "is_not_null";
|
|
234
286
|
}>>>;
|
|
287
|
+
/** Literal compared against the column (omit for `is_null` / `is_not_null`) */
|
|
235
288
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
236
|
-
}, z.core.$
|
|
237
|
-
}, z.core.$
|
|
289
|
+
}, z.core.$strict>>>;
|
|
290
|
+
}, z.core.$strict>>>>;
|
|
291
|
+
/** Overrides the table description from the database */
|
|
238
292
|
description: z.ZodOptional<z.ZodString>;
|
|
293
|
+
/** Overrides column descriptions from the database, keyed by column name */
|
|
239
294
|
columnDescriptions: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
240
|
-
}, z.core.$
|
|
295
|
+
}, z.core.$strict>>>>>>>;
|
|
241
296
|
excludedTables: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
242
|
-
}, z.core.$
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
/** Optional connection pool and transport options */
|
|
243
299
|
connectionOptions: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
300
|
+
/** Maximum number of connections in the pool */
|
|
244
301
|
max: z.ZodDefault<z.ZodNumber>;
|
|
302
|
+
/** Maximum time in seconds a connection can be idle before being closed */
|
|
245
303
|
idleTimeout: z.ZodDefault<z.ZodNumber>;
|
|
304
|
+
/** Maximum time in seconds to wait when establishing a connection */
|
|
246
305
|
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
306
|
+
/** Maximum lifetime in seconds of a connection */
|
|
247
307
|
maxLifetime: z.ZodDefault<z.ZodNumber>;
|
|
308
|
+
/** Whether to use TLS/SSL for the connection */
|
|
248
309
|
tls: z.ZodDefault<z.ZodBoolean>;
|
|
310
|
+
/** Automatic creation of prepared statements (default: true) */
|
|
249
311
|
prepare: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
/** Return values outside i32 range as BigInts instead of strings (default: false) */
|
|
250
313
|
bigint: z.ZodDefault<z.ZodBoolean>;
|
|
251
|
-
}, z.core.$
|
|
314
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
315
|
+
/** Connection pool options */
|
|
252
316
|
pool: z.ZodDefault<z.ZodObject<{
|
|
317
|
+
/** Maximum number of connections in the pool */
|
|
253
318
|
max: z.ZodDefault<z.ZodNumber>;
|
|
319
|
+
/** Minimum number of connections in the pool */
|
|
254
320
|
min: z.ZodDefault<z.ZodNumber>;
|
|
321
|
+
/** Maximum time in seconds a connection can be idle before being closed */
|
|
255
322
|
idleTimeout: z.ZodDefault<z.ZodNumber>;
|
|
256
|
-
}, z.core.$
|
|
323
|
+
}, z.core.$strict>>;
|
|
324
|
+
/** Maximum time in seconds to wait when establishing a connection */
|
|
257
325
|
connectionTimeout: z.ZodDefault<z.ZodNumber>;
|
|
326
|
+
/** Maximum time in seconds to wait for a request to complete */
|
|
258
327
|
requestTimeout: z.ZodDefault<z.ZodNumber>;
|
|
328
|
+
/** Whether to encrypt the connection */
|
|
259
329
|
encrypt: z.ZodDefault<z.ZodBoolean>;
|
|
330
|
+
/** Whether to trust the server certificate without validation */
|
|
260
331
|
trustServerCertificate: z.ZodDefault<z.ZodBoolean>;
|
|
332
|
+
/** Whether to use Windows Authentication (trusted connection) */
|
|
261
333
|
trustedConnection: z.ZodDefault<z.ZodBoolean>;
|
|
334
|
+
/** Whether to automatically parse JSON responses */
|
|
262
335
|
parseJSON: z.ZodDefault<z.ZodBoolean>;
|
|
263
|
-
}, z.core.$
|
|
264
|
-
}, z.core.$
|
|
336
|
+
}, z.core.$strict>]>>;
|
|
337
|
+
}, z.core.$strict>;
|
|
265
338
|
/**
|
|
266
339
|
* Database connection shape (derived from the Zod schema).
|
|
267
340
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../../src/config/types/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;AAMpD,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,oFAUnC,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../../src/config/types/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;AAMpD,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,oFAUnC,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;IAEjC,6CAA6C;;IAE7C,8CAA8C;;IAE9C,yCAAyC;;;;;;;;;;;;IAEzC,+EAA+E;;kBAUhF,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB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n, } from "./virtual-columns";
|
|
2
2
|
export { virtualColumnFunction, virtualColumnExpression, createYAndNToBooleanMSSQL, createOneToBooleanMSSQL, VirtualColumnZod, } from "./virtual-columns";
|
|
3
|
-
export type { DefaultInput, OperationRestConfig, OperationGraphQLConfig, OperationCacheConfig, BeforeRequestContext, AfterRequestContext, GqlQueryResult, OperationOptions, OperationInitHook, OperationBeforeRequestHook, OperationAfterRequestHook, OperationHandler, BaseOperation, QueryOperation, HandlerOperation, TypedOperation, Operation, Operations, } from "./operation";
|
|
3
|
+
export type { DefaultInput, AnyQueryDocument, QueryResultOf, OperationRestConfig, OperationGraphQLConfig, OperationCacheConfig, BeforeRequestContext, AfterRequestContext, GqlQueryResult, OperationOptions, OperationInitHook, OperationBeforeRequestHook, OperationAfterRequestHook, OperationHandler, BaseOperation, QueryOperation, HandlerOperation, TypedOperation, Operation, Operations, } from "./operation";
|
|
4
4
|
export { OperationRestConfigZod, OperationGraphQLConfigZod, OperationCacheConfigZod, OperationZod, OperationsZod, } from "./operation";
|
|
5
5
|
export type { CronTickCallback, CronJobConfig } from "./cron";
|
|
6
6
|
export type { AIConfig, MCPConfig } from "./ai";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,aAA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uB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,MAAM,CAAC;AAEd,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG9D,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGhD,YAAY,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAG3F,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,GACd,MAAM,QAAQ,CAAC;AAGhB,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,gCAAgC,EAChC,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,MAAM,CAAC;AAEd,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -3,6 +3,22 @@ import { z } from "zod";
|
|
|
3
3
|
* Default input type when no schema is provided
|
|
4
4
|
*/
|
|
5
5
|
export type DefaultInput = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* A gql.tada / `TypedDocumentNode` query document. Every GraphQL AST node has a
|
|
8
|
+
* `kind`, which distinguishes a document from a plain string query; documents
|
|
9
|
+
* additionally carry their result type on the `__apiType` phantom property.
|
|
10
|
+
*/
|
|
11
|
+
export type AnyQueryDocument = {
|
|
12
|
+
readonly kind: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Extracts a query document's result type (the GraphQL `data` payload) from its
|
|
16
|
+
* gql.tada / TypedDocumentNode `__apiType` phantom. A plain string query (or a
|
|
17
|
+
* document without embedded types) resolves to `unknown`.
|
|
18
|
+
*/
|
|
19
|
+
export type QueryResultOf<TQuery> = TQuery extends string ? unknown : TQuery extends {
|
|
20
|
+
__apiType?: (variables: any) => infer TResult;
|
|
21
|
+
} ? TResult : unknown;
|
|
6
22
|
/**
|
|
7
23
|
* Zod schema for REST configuration
|
|
8
24
|
*/
|
|
@@ -18,14 +34,14 @@ export declare const OperationRestConfigZod: z.ZodObject<{
|
|
|
18
34
|
pathParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
19
35
|
queryParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
20
36
|
body: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
21
|
-
}, z.core.$
|
|
37
|
+
}, z.core.$strict>;
|
|
22
38
|
/**
|
|
23
39
|
* Zod schema for GraphQL configuration
|
|
24
40
|
*/
|
|
25
41
|
export declare const OperationGraphQLConfigZod: z.ZodObject<{
|
|
26
42
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
27
43
|
name: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$
|
|
44
|
+
}, z.core.$strict>;
|
|
29
45
|
/**
|
|
30
46
|
* Zod schema for cache configuration
|
|
31
47
|
*/
|
|
@@ -37,7 +53,7 @@ export declare const OperationCacheConfigZod: z.ZodObject<{
|
|
|
37
53
|
updateAgeOnGet: z.ZodOptional<z.ZodBoolean>;
|
|
38
54
|
updateAgeOnHas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
39
55
|
ttlAutopurge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
40
|
-
}, z.core.$
|
|
56
|
+
}, z.core.$strict>;
|
|
41
57
|
/**
|
|
42
58
|
* REST exposure configuration for an operation
|
|
43
59
|
*/
|
|
@@ -60,7 +76,7 @@ export declare const OperationZod: z.ZodObject<{
|
|
|
60
76
|
init: z.ZodOptional<z.ZodCustom<OperationInitHook<any>, OperationInitHook<any>>>;
|
|
61
77
|
beforeRequest: z.ZodOptional<z.ZodCustom<OperationBeforeRequestHook<any, any, any>, OperationBeforeRequestHook<any, any, any>>>;
|
|
62
78
|
afterRequest: z.ZodOptional<z.ZodCustom<OperationAfterRequestHook<any>, OperationAfterRequestHook<any>>>;
|
|
63
|
-
}, z.core.$
|
|
79
|
+
}, z.core.$strict>>;
|
|
64
80
|
rest: z.ZodOptional<z.ZodObject<{
|
|
65
81
|
path: z.ZodString;
|
|
66
82
|
method: z.ZodDefault<z.ZodEnum<{
|
|
@@ -73,11 +89,11 @@ export declare const OperationZod: z.ZodObject<{
|
|
|
73
89
|
pathParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
74
90
|
queryParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
75
91
|
body: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
76
|
-
}, z.core.$
|
|
92
|
+
}, z.core.$strict>>;
|
|
77
93
|
graphql: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
78
94
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
79
95
|
name: z.ZodOptional<z.ZodString>;
|
|
80
|
-
}, z.core.$
|
|
96
|
+
}, z.core.$strict>>>;
|
|
81
97
|
cache: z.ZodOptional<z.ZodObject<{
|
|
82
98
|
max: z.ZodOptional<z.ZodNumber>;
|
|
83
99
|
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -86,8 +102,8 @@ export declare const OperationZod: z.ZodObject<{
|
|
|
86
102
|
updateAgeOnGet: z.ZodOptional<z.ZodBoolean>;
|
|
87
103
|
updateAgeOnHas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
88
104
|
ttlAutopurge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
89
|
-
}, z.core.$
|
|
90
|
-
}, z.core.$
|
|
105
|
+
}, z.core.$strict>>;
|
|
106
|
+
}, z.core.$strict>;
|
|
91
107
|
export type Operation = z.input<typeof OperationZod>;
|
|
92
108
|
export declare const OperationsZod: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
93
109
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -99,7 +115,7 @@ export declare const OperationsZod: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
99
115
|
init: z.ZodOptional<z.ZodCustom<OperationInitHook<any>, OperationInitHook<any>>>;
|
|
100
116
|
beforeRequest: z.ZodOptional<z.ZodCustom<OperationBeforeRequestHook<any, any, any>, OperationBeforeRequestHook<any, any, any>>>;
|
|
101
117
|
afterRequest: z.ZodOptional<z.ZodCustom<OperationAfterRequestHook<any>, OperationAfterRequestHook<any>>>;
|
|
102
|
-
}, z.core.$
|
|
118
|
+
}, z.core.$strict>>;
|
|
103
119
|
rest: z.ZodOptional<z.ZodObject<{
|
|
104
120
|
path: z.ZodString;
|
|
105
121
|
method: z.ZodDefault<z.ZodEnum<{
|
|
@@ -112,11 +128,11 @@ export declare const OperationsZod: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
112
128
|
pathParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
113
129
|
queryParams: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
114
130
|
body: z.ZodOptional<z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
115
|
-
}, z.core.$
|
|
131
|
+
}, z.core.$strict>>;
|
|
116
132
|
graphql: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
117
133
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
118
134
|
name: z.ZodOptional<z.ZodString>;
|
|
119
|
-
}, z.core.$
|
|
135
|
+
}, z.core.$strict>>>;
|
|
120
136
|
cache: z.ZodOptional<z.ZodObject<{
|
|
121
137
|
max: z.ZodOptional<z.ZodNumber>;
|
|
122
138
|
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -125,17 +141,28 @@ export declare const OperationsZod: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
125
141
|
updateAgeOnGet: z.ZodOptional<z.ZodBoolean>;
|
|
126
142
|
updateAgeOnHas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
127
143
|
ttlAutopurge: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
128
|
-
}, z.core.$
|
|
129
|
-
}, z.core.$
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
130
146
|
export type Operations = z.input<typeof OperationsZod>;
|
|
131
147
|
/**
|
|
132
|
-
* Context passed to beforeRequest hook
|
|
148
|
+
* Context passed to beforeRequest hook.
|
|
149
|
+
*
|
|
150
|
+
* `input` is the merged view of every REST parameter source. `pathParams`,
|
|
151
|
+
* `queryParams`, and `body` expose each source separately (parsed with its own
|
|
152
|
+
* schema), or `undefined` when that source has no schema configured.
|
|
133
153
|
*/
|
|
134
|
-
export type BeforeRequestContext<TInput = DefaultInput> = {
|
|
154
|
+
export type BeforeRequestContext<TInput = DefaultInput, TPathParams = unknown, TQueryParams = unknown, TBody = unknown> = {
|
|
135
155
|
input: TInput;
|
|
156
|
+
pathParams?: TPathParams;
|
|
157
|
+
queryParams?: TQueryParams;
|
|
158
|
+
body?: TBody;
|
|
136
159
|
};
|
|
137
160
|
/**
|
|
138
|
-
* Context passed to afterRequest hook
|
|
161
|
+
* Context passed to the afterRequest hook.
|
|
162
|
+
*
|
|
163
|
+
* `output` is the operation's output payload — for query-based operations the
|
|
164
|
+
* unwrapped GraphQL `data` (the hook's return replaces `data` in the response
|
|
165
|
+
* envelope); for handler-based operations the value the handler returned.
|
|
139
166
|
*/
|
|
140
167
|
export type AfterRequestContext<TOutput = unknown> = {
|
|
141
168
|
output: TOutput;
|
|
@@ -171,7 +198,12 @@ export type OperationInitHook<TInitData = unknown> = (options: OperationOptions)
|
|
|
171
198
|
*/
|
|
172
199
|
export type OperationBeforeRequestHook<TInput = DefaultInput, TInitData = unknown, TVariables = Record<string, unknown>> = (context: BeforeRequestContext<TInput>, initData: TInitData | undefined) => TVariables | Promise<TVariables>;
|
|
173
200
|
/**
|
|
174
|
-
* AfterRequest hook
|
|
201
|
+
* AfterRequest hook — transforms the output after a successful query/handler.
|
|
202
|
+
*
|
|
203
|
+
* Receives the output payload and returns the (possibly transformed) payload.
|
|
204
|
+
* Runs on success only; throw to turn a successful response into an error. For
|
|
205
|
+
* cached query operations it runs on the cache miss and the transformed result
|
|
206
|
+
* is cached, so cache hits reuse it without re-invoking the hook.
|
|
175
207
|
*/
|
|
176
208
|
export type OperationAfterRequestHook<TOutput = unknown> = (context: AfterRequestContext<TOutput>) => TOutput | Promise<TOutput>;
|
|
177
209
|
/**
|