@quickql/angular 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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * QuickQL Angular Bindings
3
+ *
4
+ * Provides Angular Services (QuickQLService) and Reactive Data fetching
5
+ * using RxJS observables for Angular v21+ applications.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ import { InjectionToken } from '@angular/core';
12
+ import { QuickQLClient, ClientOptions, Query, QuickQLResponse } from '@quickql/core';
13
+ import { Observable } from 'rxjs';
14
+ export declare const QUICKQL_OPTIONS: InjectionToken<ClientOptions>;
15
+ export declare class QuickQLService {
16
+ private options;
17
+ private client;
18
+ constructor(options: ClientOptions);
19
+ /**
20
+ * Return the internal QuickQL client instance for direct usage.
21
+ */
22
+ getClient(): QuickQLClient;
23
+ /**
24
+ * Executes a query as an RxJS Observable.
25
+ */
26
+ query<T = any>(query: Query, alias?: string): Observable<QuickQLResponse<T>>;
27
+ /**
28
+ * Executes a mutation as an RxJS Observable.
29
+ */
30
+ mutation<T = any>(mutation: any, alias?: string): Observable<QuickQLResponse<T>>;
31
+ /**
32
+ * Executes a batch request as an RxJS Observable.
33
+ */
34
+ batch(items: (Query | any)[]): Observable<QuickQLResponse>;
35
+ }
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,eAAe,+BAAuD,CAAC;AAEpF,qBAGa,cAAc;IAIE,OAAO,CAAC,OAAO;IAH1C,OAAO,CAAC,MAAM,CAAgB;gBAGK,OAAO,EAAE,aAAa;IAKzD;;OAEG;IACH,SAAS,IAAI,aAAa;IAI1B;;OAEG;IACH,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAE,MAAe,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAIpF;;OAEG;IACH,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,GAAE,MAAe,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAIxF;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC;CAG3D"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * QuickQL Angular Bindings
3
+ *
4
+ * Provides Angular Services (QuickQLService) and Reactive Data fetching
5
+ * using RxJS observables for Angular v21+ applications.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ var __metadata = (this && this.__metadata) || function (k, v) {
18
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
+ };
20
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
21
+ return function (target, key) { decorator(target, key, paramIndex); }
22
+ };
23
+ import { Injectable, Inject, InjectionToken } from '@angular/core';
24
+ import { QuickQLClient } from '@quickql/core';
25
+ import { from } from 'rxjs';
26
+ export const QUICKQL_OPTIONS = new InjectionToken('QUICKQL_OPTIONS');
27
+ let QuickQLService = class QuickQLService {
28
+ options;
29
+ client;
30
+ constructor(options) {
31
+ this.options = options;
32
+ this.client = new QuickQLClient(options);
33
+ }
34
+ /**
35
+ * Return the internal QuickQL client instance for direct usage.
36
+ */
37
+ getClient() {
38
+ return this.client;
39
+ }
40
+ /**
41
+ * Executes a query as an RxJS Observable.
42
+ */
43
+ query(query, alias = 'data') {
44
+ return from(this.client.query(query, alias));
45
+ }
46
+ /**
47
+ * Executes a mutation as an RxJS Observable.
48
+ */
49
+ mutation(mutation, alias = 'data') {
50
+ return from(this.client.mutation(mutation, alias));
51
+ }
52
+ /**
53
+ * Executes a batch request as an RxJS Observable.
54
+ */
55
+ batch(items) {
56
+ return from(this.client.batch(items));
57
+ }
58
+ };
59
+ QuickQLService = __decorate([
60
+ Injectable({
61
+ providedIn: 'root'
62
+ }),
63
+ __param(0, Inject(QUICKQL_OPTIONS)),
64
+ __metadata("design:paramtypes", [Object])
65
+ ], QuickQLService);
66
+ export { QuickQLService };
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,aAAa,EAAyC,MAAM,eAAe,CAAC;AACrF,OAAO,EAAc,IAAI,EAAE,MAAM,MAAM,CAAC;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,CAAC,CAAC;AAK7E,IAAM,cAAc,GAApB,MAAM,cAAc;IAIU;IAH3B,MAAM,CAAgB;IAE9B,YACmC,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,KAAK,CAAU,KAAY,EAAE,QAAgB,MAAM;QACjD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAI,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,QAAQ,CAAU,QAAa,EAAE,QAAgB,MAAM;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAI,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAsB;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;CACF,CAAA;AApCY,cAAc;IAH1B,UAAU,CAAC;QACV,UAAU,EAAE,MAAM;KACnB,CAAC;IAKG,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;;GAJf,cAAc,CAoC1B"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * QuickQL Core Client
3
+ *
4
+ * Standard HTTP client for interacting with QuickQL servers across
5
+ * all JavaScript environments. Handles batching, caching, and plugins.
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, QuickQLRequest, QuickQLResponse, QuickQLError } from './types';
12
+ export interface ClientOptions {
13
+ endpoint: string;
14
+ headers?: Record<string, string>;
15
+ timeout?: number;
16
+ retry?: number;
17
+ cacheTTL?: number;
18
+ plugins?: QuickQLPlugin[];
19
+ }
20
+ export type LifecycleHook = 'beforeRequest' | 'afterResponse' | 'onError';
21
+ export interface QuickQLPlugin {
22
+ name: string;
23
+ onBeforeRequest?: (request: QuickQLRequest, context: any) => QuickQLRequest | Promise<QuickQLRequest>;
24
+ onAfterResponse?: (response: QuickQLResponse, context: any) => QuickQLResponse | Promise<QuickQLResponse>;
25
+ onError?: (error: QuickQLError, context: any) => void | Promise<void>;
26
+ }
27
+ /**
28
+ * Universal QuickQL Client for Browser and Node.js
29
+ */
30
+ export declare class QuickQLClient {
31
+ private cache;
32
+ private options;
33
+ constructor(options: ClientOptions);
34
+ /**
35
+ * Main Query operation.
36
+ */
37
+ query<T = any>(query: Query, alias?: string): Promise<QuickQLResponse<T>>;
38
+ /**
39
+ * Main Mutation operation.
40
+ */
41
+ mutation<T = any>(mutation: Mutation, alias?: string): Promise<QuickQLResponse<T>>;
42
+ /**
43
+ * Batch multiple queries and mutations.
44
+ */
45
+ batch(items: (Query | Mutation)[], transaction?: boolean): Promise<QuickQLResponse<any>>;
46
+ /**
47
+ * Low-level execution logic with plugin support.
48
+ */
49
+ private execute;
50
+ private handleError;
51
+ private getCacheKey;
52
+ private getFromCache;
53
+ private setInCache;
54
+ clearCache(): void;
55
+ setHeaders(headers: Record<string, string>): void;
56
+ }
57
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../core/src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAC/D,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,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,OAAO,CAAC,UAAU;IASX,UAAU;IAIV,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAGlD"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * QuickQL Core Client
3
+ *
4
+ * Standard HTTP client for interacting with QuickQL servers across
5
+ * all JavaScript environments. Handles batching, caching, and plugins.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ /**
12
+ * Universal QuickQL Client for Browser and Node.js
13
+ */
14
+ export class QuickQLClient {
15
+ cache = new Map();
16
+ options;
17
+ constructor(options) {
18
+ this.options = {
19
+ endpoint: options.endpoint,
20
+ headers: {
21
+ 'Content-Type': 'application/json',
22
+ 'X-QuickQL-Version': '1.0.0',
23
+ ...(options.headers || {})
24
+ },
25
+ timeout: options.timeout || 15000,
26
+ retry: options.retry || 1,
27
+ cacheTTL: options.cacheTTL || 0,
28
+ plugins: options.plugins || []
29
+ };
30
+ }
31
+ /**
32
+ * Main Query operation.
33
+ */
34
+ async query(query, alias = 'data') {
35
+ const key = this.getCacheKey({ query, alias });
36
+ const cached = this.getFromCache(key);
37
+ if (cached)
38
+ return cached;
39
+ try {
40
+ const response = await this.execute({
41
+ queries: { [alias]: query }
42
+ });
43
+ const res = response;
44
+ if (res.data && !res.errors) {
45
+ this.setInCache(key, res);
46
+ }
47
+ return res;
48
+ }
49
+ catch (error) {
50
+ return this.handleError(error);
51
+ }
52
+ }
53
+ /**
54
+ * Main Mutation operation.
55
+ */
56
+ async mutation(mutation, alias = 'data') {
57
+ try {
58
+ const response = await this.execute({
59
+ mutations: { [alias]: mutation }
60
+ });
61
+ return response;
62
+ }
63
+ catch (error) {
64
+ return this.handleError(error);
65
+ }
66
+ }
67
+ /**
68
+ * Batch multiple queries and mutations.
69
+ */
70
+ async batch(items, transaction = false) {
71
+ try {
72
+ const response = await this.execute({ batch: items, transaction });
73
+ return response;
74
+ }
75
+ catch (error) {
76
+ return this.handleError(error);
77
+ }
78
+ }
79
+ /**
80
+ * Low-level execution logic with plugin support.
81
+ */
82
+ async execute(request, retries = this.options.retry) {
83
+ let currentRequest = request;
84
+ // Trigger onBeforeRequest hooks
85
+ for (const plugin of this.options.plugins) {
86
+ if (plugin.onBeforeRequest) {
87
+ currentRequest = await plugin.onBeforeRequest(currentRequest, this);
88
+ }
89
+ }
90
+ const controller = new AbortController();
91
+ const timeoutId = setTimeout(() => controller.abort(), this.options.timeout);
92
+ try {
93
+ const response = await fetch(this.options.endpoint, {
94
+ method: 'POST',
95
+ headers: this.options.headers,
96
+ body: JSON.stringify(currentRequest),
97
+ signal: controller.signal
98
+ });
99
+ clearTimeout(timeoutId);
100
+ if (!response.ok) {
101
+ throw new Error(`QuickQL Client Error: ${response.status} ${response.statusText}`);
102
+ }
103
+ let data = await response.json();
104
+ // Trigger onAfterResponse hooks
105
+ for (const plugin of this.options.plugins) {
106
+ if (plugin.onAfterResponse) {
107
+ data = await plugin.onAfterResponse(data, this);
108
+ }
109
+ }
110
+ return data;
111
+ }
112
+ catch (error) {
113
+ clearTimeout(timeoutId);
114
+ if (retries > 0 && error.name !== 'AbortError') {
115
+ return this.execute(request, retries - 1);
116
+ }
117
+ throw error;
118
+ }
119
+ }
120
+ handleError(error) {
121
+ const isTimeout = error.name === 'AbortError';
122
+ const quickError = {
123
+ type: isTimeout ? 'NETWORK' : 'INTERNAL',
124
+ message: error.message || 'Unknown QuickQL Client error',
125
+ code: isTimeout ? 'TIMEOUT' : 'CLIENT_EXCEPTION'
126
+ };
127
+ // Trigger plugins
128
+ for (const plugin of this.options.plugins) {
129
+ if (plugin.onError) {
130
+ plugin.onError(quickError, this);
131
+ }
132
+ }
133
+ return {
134
+ data: null,
135
+ errors: [quickError]
136
+ };
137
+ }
138
+ getCacheKey(request) {
139
+ return JSON.stringify(request);
140
+ }
141
+ getFromCache(key) {
142
+ const cached = this.cache.get(key);
143
+ if (cached && cached.expiry > Date.now()) {
144
+ return cached.value;
145
+ }
146
+ this.cache.delete(key);
147
+ return null;
148
+ }
149
+ setInCache(key, value) {
150
+ if (this.options.cacheTTL > 0) {
151
+ this.cache.set(key, {
152
+ value,
153
+ expiry: Date.now() + this.options.cacheTTL
154
+ });
155
+ }
156
+ }
157
+ clearCache() {
158
+ this.cache.clear();
159
+ }
160
+ setHeaders(headers) {
161
+ this.options.headers = { ...this.options.headers, ...headers };
162
+ }
163
+ }
164
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../core/src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwBH;;GAEG;AACH,MAAM,OAAO,aAAa;IAChB,KAAK,GAAG,IAAI,GAAG,EAA0C,CAAC;IAC1D,OAAO,CAA0B;IAEzC,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG;YACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,mBAAmB,EAAE,OAAO;gBAC5B,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;aAC3B;YACD,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;YACjC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;YACzB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;YAC/B,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;SAC/B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAU,KAAY,EAAE,QAAgB,MAAM;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,MAAM;YAAE,OAAO,MAAM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M,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACzC,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,UAAU,CAAC,GAAW,EAAE,KAAU;QACxC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE;gBAClB,KAAK;gBACL,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ;aAC3C,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAEM,UAAU,CAAC,OAA+B;QAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IACjE,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * QuickQL Core SDK
3
+ *
4
+ * Shared logic and client for the QuickQL ecosystem.
5
+ * Managed by Udinmo Inc.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ export * from './types';
12
+ export * from './client';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * QuickQL Core SDK
3
+ *
4
+ * Shared logic and client for the QuickQL ecosystem.
5
+ * Managed by Udinmo Inc.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ export * from './types';
12
+ export * from './client';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * QuickQL Core Types
3
+ *
4
+ * Shared type definitions for queries, mutations, and responses.
5
+ * Ensured parity between server and client expectations.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ /**
12
+ * QuickQL Core Types - Refined for Production
13
+ */
14
+ export type Operator = 'eq' | 'ne' | 'gt' | 'lt' | 'in' | 'contains' | 'startsWith' | 'endsWith';
15
+ export type WhereValue = string | number | boolean | Array<string | number | boolean> | null;
16
+ export type WhereCondition = {
17
+ [operator in Operator]?: WhereValue;
18
+ } | WhereValue;
19
+ export type LogicalCondition = {
20
+ AND?: (WhereClause | LogicalCondition)[];
21
+ OR?: (WhereClause | LogicalCondition)[];
22
+ };
23
+ export type WhereClause = {
24
+ [field: string]: WhereCondition | LogicalCondition;
25
+ };
26
+ export type IncludeClause = {
27
+ [relation: string]: Partial<Query>;
28
+ };
29
+ export type OrderDirection = 'asc' | 'desc';
30
+ export type OrderBy = {
31
+ [field: string]: OrderDirection;
32
+ };
33
+ export interface Query {
34
+ from: string;
35
+ select?: string[];
36
+ alias?: string;
37
+ where?: WhereClause | LogicalCondition;
38
+ include?: IncludeClause;
39
+ limit?: number;
40
+ offset?: number;
41
+ orderBy?: OrderBy;
42
+ aggregate?: {
43
+ count?: boolean;
44
+ sum?: string;
45
+ avg?: string;
46
+ max?: string;
47
+ min?: string;
48
+ };
49
+ directives?: Record<string, any>;
50
+ }
51
+ export type MutationType = 'create' | 'update' | 'delete';
52
+ export interface Mutation {
53
+ type: MutationType;
54
+ collection: string;
55
+ data?: Record<string, unknown>;
56
+ where?: WhereClause | LogicalCondition;
57
+ select?: string[];
58
+ }
59
+ export interface QuickQLRequest {
60
+ queries?: Record<string, Query>;
61
+ mutations?: Record<string, Mutation>;
62
+ batch?: (Query | Mutation)[];
63
+ transaction?: boolean;
64
+ }
65
+ export interface QuickQLError {
66
+ type: 'VALIDATION' | 'NETWORK' | 'AUTH' | 'INTERNAL' | 'NOT_FOUND' | 'SECURITY';
67
+ message: string;
68
+ code?: string;
69
+ path?: string[];
70
+ stack?: string;
71
+ }
72
+ export interface QuickQLResponse<T = unknown> {
73
+ data: T | null;
74
+ errors?: QuickQLError[];
75
+ meta?: {
76
+ count?: number;
77
+ total?: number;
78
+ executionTime?: number;
79
+ hints?: string[];
80
+ };
81
+ }
82
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../core/src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AAEH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEjG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;AAE7F,MAAM,MAAM,cAAc,GAAG;KAC1B,QAAQ,IAAI,QAAQ,CAAC,CAAC,EAAE,UAAU;CACpC,GAAG,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,EAAE,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAAC;IACzC,EAAE,CAAC,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OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * QuickQL Core Types
3
+ *
4
+ * Shared type definitions for queries, mutations, and responses.
5
+ * Ensured parity between server and client expectations.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../core/src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@quickql/angular",
3
+ "version": "1.0.0",
4
+ "description": "Angular Services and RxJS integration for QuickQL by Udinmo Inc.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "author": "Udinmo Inc. <engineering@udinmo.com>",
8
+ "license": "MIT",
9
+ "scripts": {
10
+ "build": "tsc"
11
+ },
12
+ "dependencies": {
13
+ "@quickql/core": "^1.0.0",
14
+ "rxjs": "^7.8.2"
15
+ },
16
+ "peerDependencies": {
17
+ "@angular/core": "^21.x"
18
+ }
19
+ }
package/src/index.ts ADDED
@@ -0,0 +1,57 @@
1
+ /**
2
+ * QuickQL Angular Bindings
3
+ *
4
+ * Provides Angular Services (QuickQLService) and Reactive Data fetching
5
+ * using RxJS observables for Angular v21+ applications.
6
+ *
7
+ * (c) 2024-2026 Udinmo Inc. All rights reserved.
8
+ * Author: Udinmo Inc. <engineering@udinmo.com>
9
+ * License: MIT
10
+ */
11
+
12
+ import { Injectable, Inject, InjectionToken } from '@angular/core';
13
+ import { QuickQLClient, ClientOptions, Query, QuickQLResponse } from '@quickql/core';
14
+ import { Observable, from } from 'rxjs';
15
+
16
+ export const QUICKQL_OPTIONS = new InjectionToken<ClientOptions>('QUICKQL_OPTIONS');
17
+
18
+ @Injectable({
19
+ providedIn: 'root'
20
+ })
21
+ export class QuickQLService {
22
+ private client: QuickQLClient;
23
+
24
+ constructor(
25
+ @Inject(QUICKQL_OPTIONS) private options: ClientOptions
26
+ ) {
27
+ this.client = new QuickQLClient(options);
28
+ }
29
+
30
+ /**
31
+ * Return the internal QuickQL client instance for direct usage.
32
+ */
33
+ getClient(): QuickQLClient {
34
+ return this.client;
35
+ }
36
+
37
+ /**
38
+ * Executes a query as an RxJS Observable.
39
+ */
40
+ query<T = any>(query: Query, alias: string = 'data'): Observable<QuickQLResponse<T>> {
41
+ return from(this.client.query<T>(query, alias));
42
+ }
43
+
44
+ /**
45
+ * Executes a mutation as an RxJS Observable.
46
+ */
47
+ mutation<T = any>(mutation: any, alias: string = 'data'): Observable<QuickQLResponse<T>> {
48
+ return from(this.client.mutation<T>(mutation, alias));
49
+ }
50
+
51
+ /**
52
+ * Executes a batch request as an RxJS Observable.
53
+ */
54
+ batch(items: (Query | any)[]): Observable<QuickQLResponse> {
55
+ return from(this.client.batch(items));
56
+ }
57
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist"
5
+ },
6
+ "include": ["src"]
7
+ }