@quickql/server 1.0.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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/dist/core/src/client.d.ts +57 -0
  4. package/dist/core/src/client.d.ts.map +1 -0
  5. package/dist/core/src/client.js +164 -0
  6. package/dist/core/src/client.js.map +1 -0
  7. package/dist/core/src/index.d.ts +13 -0
  8. package/dist/core/src/index.d.ts.map +1 -0
  9. package/dist/core/src/index.js +13 -0
  10. package/dist/core/src/index.js.map +1 -0
  11. package/dist/core/src/types.d.ts +82 -0
  12. package/dist/core/src/types.d.ts.map +1 -0
  13. package/dist/core/src/types.js +12 -0
  14. package/dist/core/src/types.js.map +1 -0
  15. package/dist/server/src/engine.d.ts +55 -0
  16. package/dist/server/src/engine.d.ts.map +1 -0
  17. package/dist/server/src/engine.js +422 -0
  18. package/dist/server/src/engine.js.map +1 -0
  19. package/dist/server/src/errors.d.ts +31 -0
  20. package/dist/server/src/errors.d.ts.map +1 -0
  21. package/dist/server/src/errors.js +73 -0
  22. package/dist/server/src/errors.js.map +1 -0
  23. package/dist/server/src/executor.d.ts +25 -0
  24. package/dist/server/src/executor.d.ts.map +1 -0
  25. package/dist/server/src/executor.js +121 -0
  26. package/dist/server/src/executor.js.map +1 -0
  27. package/dist/server/src/filters.d.ts +10 -0
  28. package/dist/server/src/filters.d.ts.map +1 -0
  29. package/dist/server/src/filters.js +47 -0
  30. package/dist/server/src/filters.js.map +1 -0
  31. package/dist/server/src/handler.d.ts +12 -0
  32. package/dist/server/src/handler.d.ts.map +1 -0
  33. package/dist/server/src/handler.js +138 -0
  34. package/dist/server/src/handler.js.map +1 -0
  35. package/dist/server/src/index.d.ts +25 -0
  36. package/dist/server/src/index.d.ts.map +1 -0
  37. package/dist/server/src/index.js +26 -0
  38. package/dist/server/src/index.js.map +1 -0
  39. package/dist/server/src/parser/parser.d.ts +21 -0
  40. package/dist/server/src/parser/parser.d.ts.map +1 -0
  41. package/dist/server/src/parser/parser.js +99 -0
  42. package/dist/server/src/parser/parser.js.map +1 -0
  43. package/dist/server/src/parser/tokenizer.d.ts +18 -0
  44. package/dist/server/src/parser/tokenizer.d.ts.map +1 -0
  45. package/dist/server/src/parser/tokenizer.js +94 -0
  46. package/dist/server/src/parser/tokenizer.js.map +1 -0
  47. package/dist/server/src/parser/transformer.d.ts +24 -0
  48. package/dist/server/src/parser/transformer.d.ts.map +1 -0
  49. package/dist/server/src/parser/transformer.js +61 -0
  50. package/dist/server/src/parser/transformer.js.map +1 -0
  51. package/dist/server/src/parser/types.d.ts +21 -0
  52. package/dist/server/src/parser/types.d.ts.map +1 -0
  53. package/dist/server/src/parser/types.js +11 -0
  54. package/dist/server/src/parser/types.js.map +1 -0
  55. package/dist/server/src/playground/assets.d.ts +16 -0
  56. package/dist/server/src/playground/assets.d.ts.map +1 -0
  57. package/dist/server/src/playground/assets.js +1113 -0
  58. package/dist/server/src/playground/assets.js.map +1 -0
  59. package/dist/server/src/playground/docs.d.ts +15 -0
  60. package/dist/server/src/playground/docs.d.ts.map +1 -0
  61. package/dist/server/src/playground/docs.js +223 -0
  62. package/dist/server/src/playground/docs.js.map +1 -0
  63. package/dist/server/src/playground/html.d.ts +20 -0
  64. package/dist/server/src/playground/html.d.ts.map +1 -0
  65. package/dist/server/src/playground/html.js +50 -0
  66. package/dist/server/src/playground/html.js.map +1 -0
  67. package/dist/server/src/plugins/index.d.ts +21 -0
  68. package/dist/server/src/plugins/index.d.ts.map +1 -0
  69. package/dist/server/src/plugins/index.js +38 -0
  70. package/dist/server/src/plugins/index.js.map +1 -0
  71. package/dist/server/src/relations.d.ts +22 -0
  72. package/dist/server/src/relations.d.ts.map +1 -0
  73. package/dist/server/src/relations.js +98 -0
  74. package/dist/server/src/relations.js.map +1 -0
  75. package/dist/server/src/resolver/generator.d.ts +25 -0
  76. package/dist/server/src/resolver/generator.d.ts.map +1 -0
  77. package/dist/server/src/resolver/generator.js +65 -0
  78. package/dist/server/src/resolver/generator.js.map +1 -0
  79. package/dist/server/src/resolver/mapper.d.ts +23 -0
  80. package/dist/server/src/resolver/mapper.d.ts.map +1 -0
  81. package/dist/server/src/resolver/mapper.js +96 -0
  82. package/dist/server/src/resolver/mapper.js.map +1 -0
  83. package/dist/server/src/schema/builder.d.ts +21 -0
  84. package/dist/server/src/schema/builder.d.ts.map +1 -0
  85. package/dist/server/src/schema/builder.js +23 -0
  86. package/dist/server/src/schema/builder.js.map +1 -0
  87. package/dist/server/src/schema/types.d.ts +81 -0
  88. package/dist/server/src/schema/types.d.ts.map +1 -0
  89. package/dist/server/src/schema/types.js +11 -0
  90. package/dist/server/src/schema/types.js.map +1 -0
  91. package/dist/server/src/schema/utils.d.ts +16 -0
  92. package/dist/server/src/schema/utils.d.ts.map +1 -0
  93. package/dist/server/src/schema/utils.js +42 -0
  94. package/dist/server/src/schema/utils.js.map +1 -0
  95. package/dist/server/src/security.d.ts +46 -0
  96. package/dist/server/src/security.d.ts.map +1 -0
  97. package/dist/server/src/security.js +189 -0
  98. package/dist/server/src/security.js.map +1 -0
  99. package/dist/server/src/types.d.ts +158 -0
  100. package/dist/server/src/types.d.ts.map +1 -0
  101. package/dist/server/src/types.js +11 -0
  102. package/dist/server/src/types.js.map +1 -0
  103. package/dist/server/src/validator.d.ts +30 -0
  104. package/dist/server/src/validator.d.ts.map +1 -0
  105. package/dist/server/src/validator.js +171 -0
  106. package/dist/server/src/validator.js.map +1 -0
  107. package/package.json +25 -0
@@ -0,0 +1,422 @@
1
+ /**
2
+ * QuickQL Server Engine
3
+ *
4
+ * Central orchestration layer for parsing, validating, and executing QuickQL requests.
5
+ *
6
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
7
+ * Author: Udinmo Inc. <engineering@udinmo.com>
8
+ * License: MIT
9
+ */
10
+ import { QueryValidator } from './validator';
11
+ import { QueryExecutor } from './executor';
12
+ import { SecurityEngine } from './security';
13
+ import { formatError, QuickQLServiceError } from './errors';
14
+ import { Tokenizer } from './parser/tokenizer';
15
+ import { Parser } from './parser/parser';
16
+ import { Transformer } from './parser/transformer';
17
+ import { ResolverGenerator } from './resolver/generator';
18
+ export class QuickQLServer {
19
+ options;
20
+ validator;
21
+ executor;
22
+ security;
23
+ cache = new Map();
24
+ activePlugins = [];
25
+ constructor(options) {
26
+ let finalSchema = options.schema || {};
27
+ if (options.schemaOptions) {
28
+ Object.entries(options.schemaOptions.collections).forEach(([key, col]) => {
29
+ finalSchema[key] = {
30
+ fields: col.fields,
31
+ relations: this.mapRelations(col),
32
+ resolver: ResolverGenerator.generateResolver(col),
33
+ mutationResolver: ResolverGenerator.generateMutationResolver(col)
34
+ };
35
+ });
36
+ }
37
+ this.options = {
38
+ schema: finalSchema,
39
+ schemaOptions: options.schemaOptions,
40
+ orm: options.orm,
41
+ maxDepth: options.maxDepth || 10,
42
+ rateLimit: options.rateLimit || 0,
43
+ maxComplexity: options.maxComplexity || 1000,
44
+ cors: options.cors ?? true,
45
+ plugins: options.plugins || [],
46
+ debug: options.debug ?? false,
47
+ playground: options.playground ?? true,
48
+ context: options.context || (async () => ({ orm: options.orm })),
49
+ auth: options.auth || {},
50
+ rbac: options.rbac || { roles: {} },
51
+ cache: options.cache || { enabled: true, ttl: 5000, maxItems: 1000 },
52
+ logging: options.logging || { level: 'info' },
53
+ directives: options.directives || [],
54
+ transformers: options.transformers || {},
55
+ errors: options.errors || { maskInternalErrors: false },
56
+ features: {
57
+ smartCollectionMatching: true,
58
+ smartRelationDiscovery: true,
59
+ superSelection: true,
60
+ smartHints: true,
61
+ ...options.features
62
+ },
63
+ transactionWrapper: options.transactionWrapper || (async (ctx, batch) => await batch(ctx.orm))
64
+ };
65
+ this.activePlugins = [...this.options.plugins];
66
+ this.security = new SecurityEngine({
67
+ maxDepth: this.options.maxDepth,
68
+ rateLimit: this.options.rateLimit,
69
+ maxComplexity: this.options.maxComplexity,
70
+ rbac: this.options.rbac,
71
+ auth: this.options.auth
72
+ });
73
+ this.validator = new QueryValidator(this.options.schema, this.options.maxDepth, this.options.schemaOptions, this.options.features);
74
+ this.executor = new QueryExecutor(this.options.schema, this.options.features, this.options.directives);
75
+ }
76
+ use(plugin) {
77
+ this.activePlugins.push(plugin);
78
+ return this;
79
+ }
80
+ getOptions() {
81
+ return this.options;
82
+ }
83
+ getSchemaSummary() {
84
+ return Object.entries(this.options.schema).map(([name, col]) => ({
85
+ name,
86
+ fields: col.fields,
87
+ relations: col.relations ? Object.entries(col.relations).map(([k, r]) => ({ name: k, target: r.from })) : []
88
+ }));
89
+ }
90
+ mapRelations(col) {
91
+ if (!col.relations)
92
+ return undefined;
93
+ const relations = {};
94
+ Object.entries(col.relations).forEach(([key, rel]) => {
95
+ relations[key] = {
96
+ from: rel.model,
97
+ isSingle: rel.type === 'one',
98
+ ...rel
99
+ };
100
+ });
101
+ return relations;
102
+ }
103
+ /**
104
+ * Main Entry Point with security enforcement and context building.
105
+ */
106
+ async handleRequest(requestInput, reqCtx) {
107
+ const startTime = Date.now();
108
+ const identifier = reqCtx?.ip || 'anon_user';
109
+ try {
110
+ // Apply global input transformations
111
+ const transformedInput = this.options.transformers?.onInput
112
+ ? this.options.transformers.onInput(requestInput)
113
+ : requestInput;
114
+ // Rate limiting enforcement
115
+ this.security.checkRateLimit(identifier);
116
+ // Build initial request context
117
+ const baseCtx = await this.options.context(transformedInput);
118
+ let ctx = {
119
+ ...baseCtx,
120
+ orm: this.options.orm,
121
+ ip: identifier
122
+ };
123
+ // Execute global authentication strategies
124
+ if (this.options.auth?.onAuth) {
125
+ const authResult = await this.options.auth.onAuth(ctx);
126
+ if (authResult === false) {
127
+ throw new QuickQLServiceError('SECURITY', 'Authentication failed');
128
+ }
129
+ if (typeof authResult === 'object') {
130
+ ctx = { ...ctx, ...authResult };
131
+ }
132
+ }
133
+ let request;
134
+ // Parsing syntax ... (omitted for brevity)
135
+ if (typeof transformedInput === 'string') {
136
+ const tokenizer = new Tokenizer(transformedInput);
137
+ const tokens = tokenizer.tokenize();
138
+ const parser = new Parser(tokens);
139
+ const ast = parser.parse();
140
+ request = Transformer.transformSchema(ast);
141
+ this.processSyntaxMutations(request);
142
+ }
143
+ else {
144
+ request = transformedInput;
145
+ }
146
+ // Handle operations with full context!
147
+ let response;
148
+ if (request.transaction && request.batch) {
149
+ // Execute batch as an atomic transaction
150
+ const results = await this.options.transactionWrapper(ctx, async (tx) => {
151
+ const transactionalCtx = { ...ctx, orm: tx };
152
+ return await Promise.all(request.batch.map(item => 'type' in item ? this.processMutation(item, transactionalCtx) : this.processQuery(item, transactionalCtx)));
153
+ });
154
+ response = { data: results };
155
+ }
156
+ else if (request.batch && Array.isArray(request.batch)) {
157
+ // Parallel batch execution with deduplication
158
+ const queryMap = new Map();
159
+ const results = await Promise.all(request.batch.map(async (item) => {
160
+ const key = JSON.stringify(item);
161
+ const existing = queryMap.get(key);
162
+ if (existing)
163
+ return existing;
164
+ const execution = 'type' in item ? this.processMutation(item, ctx) : this.processQuery(item, ctx);
165
+ queryMap.set(key, execution);
166
+ return execution;
167
+ }));
168
+ response = { data: results };
169
+ }
170
+ else if (request.queries) {
171
+ const queryNames = Object.keys(request.queries);
172
+ if (queryNames.length === 1) {
173
+ response = await this.processQuery(request.queries[queryNames[0]], ctx);
174
+ }
175
+ else {
176
+ const dataResults = {};
177
+ await Promise.all(queryNames.map(async (name) => {
178
+ const resp = await this.processQuery(request.queries[name], ctx);
179
+ dataResults[name] = resp.data;
180
+ }));
181
+ response = { data: dataResults };
182
+ }
183
+ }
184
+ else if (request.mutations) {
185
+ const mutationNames = Object.keys(request.mutations);
186
+ if (mutationNames.length === 1) {
187
+ response = await this.processMutation(request.mutations[mutationNames[0]], ctx);
188
+ }
189
+ else {
190
+ const dataResults = {};
191
+ await Promise.all(mutationNames.map(async (name) => {
192
+ const resp = await this.processMutation(request.mutations[name], ctx);
193
+ dataResults[name] = resp.data;
194
+ }));
195
+ response = { data: dataResults };
196
+ }
197
+ }
198
+ else {
199
+ throw new QuickQLServiceError('VALIDATION', 'Empty or invalid request');
200
+ }
201
+ const executionTime = Date.now() - startTime;
202
+ const finalResponse = {
203
+ ...response,
204
+ meta: { ...response.meta, executionTime }
205
+ };
206
+ // 4. Global Output Transformer
207
+ const output = this.options.transformers?.onOutput
208
+ ? this.options.transformers.onOutput(finalResponse)
209
+ : finalResponse;
210
+ this.log(`DEBUG: Final Response in ${executionTime}ms`, output);
211
+ return output;
212
+ }
213
+ catch (e) {
214
+ await this.runOnErrorHook(e, { orm: this.options.orm }); // Minimal ctx if building failed
215
+ this.log('ERROR: Exception caught in handleRequest', e);
216
+ const standardError = formatError(e, this.options.debug);
217
+ if (this.options.errors?.format) {
218
+ return this.options.errors.format(standardError, this.options.debug);
219
+ }
220
+ return standardError;
221
+ }
222
+ }
223
+ processSyntaxMutations(request) {
224
+ // Already defined in previous version ...
225
+ if (request.queries && this.options.schemaOptions?.mutations) {
226
+ const mutations = request.mutations || {};
227
+ for (const [key, node] of Object.entries(request.queries)) {
228
+ if (this.options.schemaOptions.mutations[node.from]) {
229
+ mutations[key] = { ...node, collection: node.from, type: 'update' };
230
+ delete request.queries[key];
231
+ }
232
+ }
233
+ if (Object.keys(mutations).length > 0)
234
+ request.mutations = mutations;
235
+ if (Object.keys(request.queries).length === 0)
236
+ delete request.queries;
237
+ }
238
+ }
239
+ async processQuery(query, ctx) {
240
+ const cacheKey = JSON.stringify({ query, user: ctx.user?.id });
241
+ const cached = this.cache.get(cacheKey);
242
+ if (cached && cached.expiry > Date.now())
243
+ return cached.value;
244
+ try {
245
+ this.log('DEBUG: Processing Query', query);
246
+ // 1. Authorization & Security
247
+ const col = this.options.schemaOptions?.collections[query.from];
248
+ if (col) {
249
+ await this.security.validateAuth(query.from, col, ctx);
250
+ }
251
+ let processedQuery = this.security.sanitize(query);
252
+ processedQuery = await this.runBeforeQueryHook(processedQuery, ctx);
253
+ this.validator.validateQuery(processedQuery);
254
+ this.security.validateDepth(processedQuery);
255
+ // 2. Execute
256
+ const rawData = await this.executor.execute(processedQuery, 0, ctx);
257
+ // 3. Field level security / Private fields
258
+ let finalData = rawData;
259
+ if (col) {
260
+ finalData = await this.security.filterResults(col, rawData, ctx);
261
+ }
262
+ // 4. After Hook & Response
263
+ finalData = await this.runAfterQueryHook(finalData, ctx);
264
+ const response = {
265
+ data: finalData,
266
+ meta: {
267
+ count: Array.isArray(finalData) ? finalData.length : 0,
268
+ hints: this.options.features.smartHints ? this.generateSmartHints(query, finalData) : undefined
269
+ }
270
+ };
271
+ this.cache.set(cacheKey, { value: response, expiry: Date.now() + 5000 });
272
+ // Simple cache management
273
+ if (this.cache.size > 1000) {
274
+ const firstKey = this.cache.keys().next().value;
275
+ if (firstKey)
276
+ this.cache.delete(firstKey);
277
+ }
278
+ return response;
279
+ }
280
+ catch (e) {
281
+ await this.runOnErrorHook(e, ctx);
282
+ return formatError(e, this.options.debug);
283
+ }
284
+ }
285
+ async processMutation(mutation, ctx) {
286
+ try {
287
+ this.log('DEBUG: Processing Mutation', mutation);
288
+ // 0. Plugin Transformation BEFORE anything
289
+ const processedMutation = await this.runBeforeMutationHook(mutation, ctx);
290
+ // 1. Global Custom Mutation Auth
291
+ const customMutation = this.options.schemaOptions?.mutations?.[processedMutation.collection];
292
+ if (customMutation) {
293
+ await this.security.validateAuth(processedMutation.collection, customMutation, ctx, true);
294
+ const data = await customMutation.resolve(processedMutation.data || processedMutation.where, ctx);
295
+ this.cache.clear();
296
+ await this.runOnMutationHook(processedMutation, ctx);
297
+ return { data: data };
298
+ }
299
+ // 2. Standard Collection Auth
300
+ const col = this.options.schemaOptions?.collections[processedMutation.collection];
301
+ if (col) {
302
+ await this.security.validateAuth(processedMutation.collection, col, ctx, true);
303
+ }
304
+ this.validator.validateMutation(processedMutation);
305
+ const data = await this.executor.executeMutation(processedMutation, ctx);
306
+ this.cache.clear();
307
+ await this.runOnMutationHook(processedMutation, ctx);
308
+ return { data: data };
309
+ }
310
+ catch (e) {
311
+ await this.runOnErrorHook(e, ctx);
312
+ return formatError(e, this.options.debug);
313
+ }
314
+ }
315
+ // Internal hook runners for plugin lifecycle management
316
+ async shouldRunHook(plugin, ctx) {
317
+ if (!plugin.when)
318
+ return true;
319
+ try {
320
+ return await plugin.when(ctx);
321
+ }
322
+ catch (e) {
323
+ return false;
324
+ }
325
+ }
326
+ async runBeforeQueryHook(query, ctx) {
327
+ let currentQuery = query;
328
+ for (const plugin of this.activePlugins) {
329
+ if (plugin.beforeQuery && await this.shouldRunHook(plugin, ctx)) {
330
+ const result = await plugin.beforeQuery(currentQuery, ctx);
331
+ if (result)
332
+ currentQuery = result;
333
+ }
334
+ }
335
+ return currentQuery;
336
+ }
337
+ async runAfterQueryHook(data, ctx) {
338
+ let currentData = data;
339
+ for (const plugin of this.activePlugins) {
340
+ if (plugin.afterQuery && await this.shouldRunHook(plugin, ctx)) {
341
+ const result = await plugin.afterQuery(currentData, ctx);
342
+ if (result)
343
+ currentData = result;
344
+ }
345
+ }
346
+ return currentData;
347
+ }
348
+ async runOnMutationHook(mutation, ctx) {
349
+ for (const plugin of this.activePlugins) {
350
+ if (plugin.onMutation && await this.shouldRunHook(plugin, ctx)) {
351
+ await plugin.onMutation(mutation, ctx);
352
+ }
353
+ }
354
+ }
355
+ async runBeforeMutationHook(mutation, ctx) {
356
+ let current = mutation;
357
+ for (const plugin of this.activePlugins) {
358
+ if (plugin.beforeMutation && await this.shouldRunHook(plugin, ctx)) {
359
+ const result = await plugin.beforeMutation(current, ctx);
360
+ if (result)
361
+ current = result;
362
+ }
363
+ }
364
+ return current;
365
+ }
366
+ async runOnErrorHook(error, ctx) {
367
+ for (const plugin of this.activePlugins) {
368
+ if (plugin.onError && await this.shouldRunHook(plugin, ctx)) {
369
+ await plugin.onError(error, ctx);
370
+ }
371
+ }
372
+ }
373
+ generateSmartHints(query, results) {
374
+ const hints = [];
375
+ if (!query.limit || query.limit > 100) {
376
+ hints.push('TIP: Adding a "limit" can improve query performance.');
377
+ }
378
+ if (results.length > 50 && !query.orderBy) {
379
+ hints.push('WARN: Large un-ordered result set detected. Performance may degrade.');
380
+ }
381
+ if (query.include) {
382
+ const depth = JSON.stringify(query.include).split('include').length;
383
+ if (depth > 3) {
384
+ hints.push('INFO: Query complexity is high. Monitor execution time.');
385
+ }
386
+ }
387
+ return hints;
388
+ }
389
+ log(message, ...args) {
390
+ const config = this.options.logging;
391
+ if (config.level === 'none')
392
+ return;
393
+ const level = message.split(':')[0] || 'INFO';
394
+ const timestamp = new Date().toLocaleTimeString();
395
+ if (config.customLogger) {
396
+ config.customLogger(level, message, args);
397
+ return;
398
+ }
399
+ const colorMap = {
400
+ 'DEBUG': '\x1b[36m',
401
+ 'ERROR': '\x1b[31m',
402
+ 'WARN': '\x1b[33m',
403
+ 'INFO': '\x1b[32m'
404
+ };
405
+ const color = colorMap[level] || '\x1b[0m';
406
+ console.log(`${color}[QuickQL][${timestamp}]\x1b[0m ${message}`);
407
+ if (this.options.debug) {
408
+ args.forEach(arg => {
409
+ if (arg instanceof Error) {
410
+ console.error(`\x1b[31m[Stacktrace]\x1b[0m ${arg.stack}`);
411
+ }
412
+ else {
413
+ console.dir(arg, { depth: null, colors: true });
414
+ }
415
+ });
416
+ }
417
+ }
418
+ }
419
+ export function createServer(options) {
420
+ return new QuickQLServer(options);
421
+ }
422
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAA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AU;YACnB,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,UAAU;SACrB,CAAC;QAEF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,aAAa,SAAS,YAAY,OAAO,EAAE,CAAC,CAAC;QAEjE,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACf,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;oBACvB,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC9D,CAAC;qBAAM,CAAC;oBACJ,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpD,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,YAAY,CAAC,OAA8B;IACzD,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { QuickQLError, QuickQLResponse } from '@quickql/core';
2
+ /**
3
+ * Built-in QuickQL Server Exception
4
+ */
5
+ export declare class QuickQLServiceError extends Error implements QuickQLError {
6
+ type: QuickQLError['type'];
7
+ message: string;
8
+ code?: string | undefined;
9
+ path?: string[] | undefined;
10
+ constructor(type: QuickQLError['type'], message: string, code?: string | undefined, path?: string[] | undefined);
11
+ toJSON(includeStack?: boolean): {
12
+ type: "VALIDATION" | "NETWORK" | "AUTH" | "INTERNAL" | "NOT_FOUND" | "SECURITY";
13
+ message: string;
14
+ code: string;
15
+ path: string[] | undefined;
16
+ stack: string | undefined;
17
+ };
18
+ }
19
+ /**
20
+ * Global Error Formatter
21
+ */
22
+ export declare function formatError(error: unknown, debug?: boolean): QuickQLResponse;
23
+ export declare const createValidationError: (message: string, path?: string[]) => QuickQLServiceError;
24
+ export declare const createNotFoundError: (message: string, path?: string[]) => QuickQLServiceError;
25
+ export declare const createSecurityError: (message: string, path?: string[]) => QuickQLServiceError;
26
+ export declare const createAuthError: (message: string, path?: string[]) => QuickQLServiceError;
27
+ /**
28
+ * Maps QuickQL error types to HTTP status codes
29
+ */
30
+ export declare function getHttpStatusCode(response: QuickQLResponse): number;
31
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE9D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAM,YAAW,YAAY;IAE3D,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM;IACf,IAAI,CAAC,EAAE,MAAM;IACb,IAAI,CAAC,EAAE,MAAM,EAAE;gBAHf,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAC1B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,IAAI,CAAC,EAAE,MAAM,EAAE,YAAA;IASxB,MAAM,CAAC,YAAY,GAAE,OAAe;;;;;;;CASrC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,OAAe,GAAG,eAAe,CAkBnF;AAED,eAAO,MAAM,qBAAqB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,EAAE,wBACK,CAAC;AAE5E,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,EAAE,wBACO,CAAC;AAE5E,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,EAAE,wBACM,CAAC;AAE3E,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,EAAE,wBACA,CAAC;AAEjE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAUnE"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Built-in QuickQL Server Exception
3
+ */
4
+ export class QuickQLServiceError extends Error {
5
+ type;
6
+ message;
7
+ code;
8
+ path;
9
+ constructor(type, message, code, path) {
10
+ super(message);
11
+ this.type = type;
12
+ this.message = message;
13
+ this.code = code;
14
+ this.path = path;
15
+ this.name = 'QuickQLServiceError';
16
+ // Ensure the prototype is correct for instanceof checks
17
+ Object.setPrototypeOf(this, QuickQLServiceError.prototype);
18
+ }
19
+ toJSON(includeStack = false) {
20
+ return {
21
+ type: this.type,
22
+ message: this.message,
23
+ code: this.code || this.name,
24
+ path: this.path,
25
+ stack: includeStack ? this.stack : undefined
26
+ };
27
+ }
28
+ }
29
+ /**
30
+ * Global Error Formatter
31
+ */
32
+ export function formatError(error, debug = false) {
33
+ if (error instanceof QuickQLServiceError) {
34
+ return {
35
+ data: null,
36
+ errors: [error.toJSON(debug)]
37
+ };
38
+ }
39
+ const err = error;
40
+ return {
41
+ data: null,
42
+ errors: [{
43
+ type: 'INTERNAL',
44
+ message: err.message || 'An unknown internal error occurred',
45
+ code: 'INTERNAL_SERVER_ERROR',
46
+ stack: debug ? err.stack : undefined
47
+ }]
48
+ };
49
+ }
50
+ export const createValidationError = (message, path) => new QuickQLServiceError('VALIDATION', message, 'VALIDATION_FAILED', path);
51
+ export const createNotFoundError = (message, path) => new QuickQLServiceError('NOT_FOUND', message, 'RESOURCE_NOT_FOUND', path);
52
+ export const createSecurityError = (message, path) => new QuickQLServiceError('SECURITY', message, 'SECURITY_VIOLATION', path);
53
+ export const createAuthError = (message, path) => new QuickQLServiceError('AUTH', message, 'UNAUTHORIZED', path);
54
+ /**
55
+ * Maps QuickQL error types to HTTP status codes
56
+ */
57
+ export function getHttpStatusCode(response) {
58
+ if (!response.errors || response.errors.length === 0)
59
+ return 200;
60
+ const types = response.errors.map(e => e.type);
61
+ if (types.includes('INTERNAL'))
62
+ return 500;
63
+ if (types.includes('AUTH'))
64
+ return 401;
65
+ if (types.includes('SECURITY'))
66
+ return 403;
67
+ if (types.includes('NOT_FOUND'))
68
+ return 404;
69
+ if (types.includes('VALIDATION'))
70
+ return 400;
71
+ return 444; // Edge case
72
+ }
73
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAEnC;IACA;IACA;IACA;IAJT,YACS,IAA0B,EAC1B,OAAe,EACf,IAAa,EACb,IAAe;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,SAAI,GAAJ,IAAI,CAAsB;QAC1B,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAS;QACb,SAAI,GAAJ,IAAI,CAAW;QAGtB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAElC,wDAAwD;QACxD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,eAAwB,KAAK;QAClC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;YAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SAC7C,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc,EAAE,QAAiB,KAAK;IAChE,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;Q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AC;IAEjE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3C,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3C,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;QAAE,OAAO,GAAG,CAAC;IAC5C,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;QAAE,OAAO,GAAG,CAAC;IAC7C,OAAO,GAAG,CAAC,CAAC,YAAY;AAC1B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * QuickQL Query Executor
3
+ *
4
+ * Handles the actual fetching, filtering, and field-level mapping
5
+ * between the schema and the raw data sources.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ import { Query, Mutation } from '@quickql/core';
12
+ import { SchemaConfig, ServerFeatures, DirectiveConfig } from './types';
13
+ export declare class QueryExecutor {
14
+ private schema;
15
+ private features;
16
+ private directives;
17
+ private relationEngine;
18
+ constructor(schema: SchemaConfig, features?: ServerFeatures, directives?: DirectiveConfig[]);
19
+ private collectionCache;
20
+ private resolveCollectionName;
21
+ execute(query: Query, depth?: number, ctx?: any): Promise<Record<string, unknown>[]>;
22
+ executeMutation(mutation: Mutation, ctx?: any): Promise<Record<string, unknown> | null>;
23
+ private applySelection;
24
+ }
25
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAIxE,qBAAa,aAAa;IAItB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,UAAU;IATpB,OAAO,CAAC,cAAc,CAAiB;gBAG7B,MAAM,EAAE,YAAY,EACpB,QAAQ,GAAE,cAIjB,EACO,UAAU,GAAE,eAAe,EAAO;IAK5C,OAAO,CAAC,eAAe,CAAoC;IAE3D,OAAO,CAAC,qBAAqB;IAmCvB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,SAAI,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAoC/E,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAM7F,OAAO,CAAC,cAAc;CAyCvB"}