@reveldigital/mcp-graphql-proxy 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.
- package/dist/bin/cli.d.ts +6 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +7 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/core/cache.d.ts +61 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +147 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/graphql-client.d.ts +48 -0
- package/dist/core/graphql-client.d.ts.map +1 -0
- package/dist/core/graphql-client.js +210 -0
- package/dist/core/graphql-client.js.map +1 -0
- package/dist/core/query-builder.d.ts +90 -0
- package/dist/core/query-builder.d.ts.map +1 -0
- package/dist/core/query-builder.js +259 -0
- package/dist/core/query-builder.js.map +1 -0
- package/dist/core/response-optimizer.d.ts +59 -0
- package/dist/core/response-optimizer.d.ts.map +1 -0
- package/dist/core/response-optimizer.js +197 -0
- package/dist/core/response-optimizer.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +377 -0
- package/dist/index.js.map +1 -0
- package/dist/types/auth.d.ts +146 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +22 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/cache.d.ts +162 -0
- package/dist/types/cache.d.ts.map +1 -0
- package/dist/types/cache.js +34 -0
- package/dist/types/cache.js.map +1 -0
- package/dist/types/config.d.ts +108 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +37 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/graphql-proxy.d.ts +243 -0
- package/dist/types/graphql-proxy.d.ts.map +1 -0
- package/dist/types/graphql-proxy.js +142 -0
- package/dist/types/graphql-proxy.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/logging.d.ts +223 -0
- package/dist/types/logging.d.ts.map +1 -0
- package/dist/types/logging.js +67 -0
- package/dist/types/logging.js.map +1 -0
- package/dist/types/mcp.d.ts +160 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +126 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/metrics.d.ts +237 -0
- package/dist/types/metrics.d.ts.map +1 -0
- package/dist/types/metrics.js +26 -0
- package/dist/types/metrics.js.map +1 -0
- package/dist/types/rate-limit.d.ts +144 -0
- package/dist/types/rate-limit.d.ts.map +1 -0
- package/dist/types/rate-limit.js +43 -0
- package/dist/types/rate-limit.js.map +1 -0
- package/dist/types/tenant.d.ts +176 -0
- package/dist/types/tenant.d.ts.map +1 -0
- package/dist/types/tenant.js +63 -0
- package/dist/types/tenant.js.map +1 -0
- package/dist/types/transformation.d.ts +198 -0
- package/dist/types/transformation.d.ts.map +1 -0
- package/dist/types/transformation.js +51 -0
- package/dist/types/transformation.js.map +1 -0
- package/package.json +77 -0
- package/src/types/schema.graphql +2712 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AACA;;GAEG;AAGH,OAAO,aAAa,CAAC"}
|
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AACA;;GAEG;AAEH,4BAA4B;AAC5B,OAAO,aAAa,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple in-memory cache for GraphQL responses
|
|
3
|
+
* Optimized for reducing API calls and improving response times
|
|
4
|
+
*/
|
|
5
|
+
import type { GraphQLCacheStats } from '../types/graphql-proxy.js';
|
|
6
|
+
export declare class ResponseCache {
|
|
7
|
+
private cache;
|
|
8
|
+
private stats;
|
|
9
|
+
private defaultTtl;
|
|
10
|
+
private maxEntries;
|
|
11
|
+
constructor(defaultTtl?: number, maxEntries?: number);
|
|
12
|
+
/**
|
|
13
|
+
* Generate a hash key for the query
|
|
14
|
+
*/
|
|
15
|
+
private generateKey;
|
|
16
|
+
/**
|
|
17
|
+
* Check if entry is expired
|
|
18
|
+
*/
|
|
19
|
+
private isExpired;
|
|
20
|
+
/**
|
|
21
|
+
* Get cached response
|
|
22
|
+
*/
|
|
23
|
+
get<T = unknown>(query: string, variables?: Record<string, unknown>): T | null;
|
|
24
|
+
/**
|
|
25
|
+
* Store response in cache
|
|
26
|
+
*/
|
|
27
|
+
set<T = unknown>(query: string, variables: Record<string, unknown> | undefined, data: T, ttl?: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Invalidate specific cache entry
|
|
30
|
+
*/
|
|
31
|
+
invalidate(query: string, variables?: Record<string, unknown>): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Invalidate all entries matching a pattern
|
|
34
|
+
*/
|
|
35
|
+
invalidatePattern(pattern: RegExp): number;
|
|
36
|
+
/**
|
|
37
|
+
* Clear all cache entries
|
|
38
|
+
*/
|
|
39
|
+
clear(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Evict oldest entries
|
|
42
|
+
*/
|
|
43
|
+
private evictOldest;
|
|
44
|
+
/**
|
|
45
|
+
* Remove expired entries
|
|
46
|
+
*/
|
|
47
|
+
cleanup(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Update stats
|
|
50
|
+
*/
|
|
51
|
+
private updateStats;
|
|
52
|
+
/**
|
|
53
|
+
* Get cache statistics
|
|
54
|
+
*/
|
|
55
|
+
getStats(): GraphQLCacheStats;
|
|
56
|
+
/**
|
|
57
|
+
* Get cache hit rate
|
|
58
|
+
*/
|
|
59
|
+
getHitRate(): number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.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Simple in-memory cache for GraphQL responses
|
|
3
|
+
* Optimized for reducing API calls and improving response times
|
|
4
|
+
*/
|
|
5
|
+
import crypto from 'crypto';
|
|
6
|
+
export class ResponseCache {
|
|
7
|
+
cache = new Map();
|
|
8
|
+
stats = { hits: 0, misses: 0, size: 0, entries: 0 };
|
|
9
|
+
defaultTtl;
|
|
10
|
+
maxEntries;
|
|
11
|
+
constructor(defaultTtl = 300, maxEntries = 1000) {
|
|
12
|
+
this.defaultTtl = defaultTtl;
|
|
13
|
+
this.maxEntries = maxEntries;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generate a hash key for the query
|
|
17
|
+
*/
|
|
18
|
+
generateKey(query, variables) {
|
|
19
|
+
const content = JSON.stringify({ query, variables });
|
|
20
|
+
return crypto.createHash('sha256').update(content).digest('hex').substring(0, 16);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check if entry is expired
|
|
24
|
+
*/
|
|
25
|
+
isExpired(entry) {
|
|
26
|
+
return Date.now() > entry.timestamp + entry.ttl * 1000;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get cached response
|
|
30
|
+
*/
|
|
31
|
+
get(query, variables) {
|
|
32
|
+
const key = this.generateKey(query, variables);
|
|
33
|
+
const entry = this.cache.get(key);
|
|
34
|
+
if (!entry) {
|
|
35
|
+
this.stats.misses++;
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (this.isExpired(entry)) {
|
|
39
|
+
this.cache.delete(key);
|
|
40
|
+
this.stats.misses++;
|
|
41
|
+
this.updateStats();
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
this.stats.hits++;
|
|
45
|
+
return entry.data;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Store response in cache
|
|
49
|
+
*/
|
|
50
|
+
set(query, variables, data, ttl) {
|
|
51
|
+
// Evict oldest entries if at capacity
|
|
52
|
+
if (this.cache.size >= this.maxEntries) {
|
|
53
|
+
this.evictOldest();
|
|
54
|
+
}
|
|
55
|
+
const key = this.generateKey(query, variables);
|
|
56
|
+
const entry = {
|
|
57
|
+
data,
|
|
58
|
+
timestamp: Date.now(),
|
|
59
|
+
ttl: ttl ?? this.defaultTtl,
|
|
60
|
+
queryHash: key,
|
|
61
|
+
};
|
|
62
|
+
this.cache.set(key, entry);
|
|
63
|
+
this.updateStats();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Invalidate specific cache entry
|
|
67
|
+
*/
|
|
68
|
+
invalidate(query, variables) {
|
|
69
|
+
const key = this.generateKey(query, variables);
|
|
70
|
+
const deleted = this.cache.delete(key);
|
|
71
|
+
this.updateStats();
|
|
72
|
+
return deleted;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Invalidate all entries matching a pattern
|
|
76
|
+
*/
|
|
77
|
+
invalidatePattern(pattern) {
|
|
78
|
+
let count = 0;
|
|
79
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
80
|
+
// Check if the original query matches pattern (we'd need to store query)
|
|
81
|
+
// For now, just invalidate by key
|
|
82
|
+
if (pattern.test(key)) {
|
|
83
|
+
this.cache.delete(key);
|
|
84
|
+
count++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this.updateStats();
|
|
88
|
+
return count;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Clear all cache entries
|
|
92
|
+
*/
|
|
93
|
+
clear() {
|
|
94
|
+
this.cache.clear();
|
|
95
|
+
this.stats = { hits: 0, misses: 0, size: 0, entries: 0 };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Evict oldest entries
|
|
99
|
+
*/
|
|
100
|
+
evictOldest(count = 100) {
|
|
101
|
+
const entries = Array.from(this.cache.entries())
|
|
102
|
+
.sort((a, b) => a[1].timestamp - b[1].timestamp)
|
|
103
|
+
.slice(0, count);
|
|
104
|
+
for (const [key] of entries) {
|
|
105
|
+
this.cache.delete(key);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Remove expired entries
|
|
110
|
+
*/
|
|
111
|
+
cleanup() {
|
|
112
|
+
let removed = 0;
|
|
113
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
114
|
+
if (this.isExpired(entry)) {
|
|
115
|
+
this.cache.delete(key);
|
|
116
|
+
removed++;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this.updateStats();
|
|
120
|
+
return removed;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Update stats
|
|
124
|
+
*/
|
|
125
|
+
updateStats() {
|
|
126
|
+
let totalSize = 0;
|
|
127
|
+
for (const entry of this.cache.values()) {
|
|
128
|
+
totalSize += JSON.stringify(entry.data).length;
|
|
129
|
+
}
|
|
130
|
+
this.stats.size = totalSize;
|
|
131
|
+
this.stats.entries = this.cache.size;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get cache statistics
|
|
135
|
+
*/
|
|
136
|
+
getStats() {
|
|
137
|
+
return { ...this.stats };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get cache hit rate
|
|
141
|
+
*/
|
|
142
|
+
getHitRate() {
|
|
143
|
+
const total = this.stats.hits + this.stats.misses;
|
|
144
|
+
return total > 0 ? this.stats.hits / total : 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,MAAM,OAAO,aAAa;IAChB,KAAK,GAAmC,IAAI,GAAG,EAAE,CAAC;IAClD,KAAK,GAAsB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,C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IAED;;OAEG;IACK,WAAW;QACjB,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YACxC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAClD,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Client for Revel Digital API
|
|
3
|
+
* Handles authentication, request execution, and response processing
|
|
4
|
+
*/
|
|
5
|
+
import type { GraphQLRequest, GraphQLResponse, GraphQLProxyConfig } from '../types/graphql-proxy.js';
|
|
6
|
+
export declare class GraphQLClient {
|
|
7
|
+
private config;
|
|
8
|
+
private authHeaders;
|
|
9
|
+
constructor(config: GraphQLProxyConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Set Bearer token for authentication (Authorization: Bearer header)
|
|
12
|
+
* This is the only authentication method supported by the Revel Digital GraphQL API
|
|
13
|
+
*/
|
|
14
|
+
setBearerToken(token: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Set custom headers (proxied from client)
|
|
17
|
+
*/
|
|
18
|
+
setCustomHeaders(headers: Record<string, string>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Clear all authentication headers
|
|
21
|
+
*/
|
|
22
|
+
clearAuth(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Execute a GraphQL query
|
|
25
|
+
*/
|
|
26
|
+
execute<T = unknown>(request: GraphQLRequest): Promise<GraphQLResponse<T>>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a raw query string with optional variables
|
|
29
|
+
*/
|
|
30
|
+
query<T = unknown>(query: string, variables?: Record<string, unknown>, operationName?: string): Promise<GraphQLResponse<T>>;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the GraphQL schema (introspection)
|
|
33
|
+
*/
|
|
34
|
+
introspect(): Promise<GraphQLResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch type information for a specific type
|
|
37
|
+
*/
|
|
38
|
+
introspectType(typeName: string): Promise<GraphQLResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Get current configuration
|
|
41
|
+
*/
|
|
42
|
+
getConfig(): GraphQLProxyConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Check if authenticated
|
|
45
|
+
*/
|
|
46
|
+
isAuthenticated(): boolean;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/core/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAErG,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,WAAW,CAA8B;gBAErC,MAAM,EAAE,kBAAkB;IAQtC;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAInC;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAIvD;;OAEG;IACH,SAAS,IAAI,IAAI;IAIjB;;OAEG;IACG,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA0ChF;;OAEG;IACG,KAAK,CAAC,CAAC,GAAG,OAAO,EACrB,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAI9B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC;IAmE5C;;OAEG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAgDhE;;OAEG;IACH,SAAS,IAAI,kBAAkB;IAI/B;;OAEG;IACH,eAAe,IAAI,OAAO;CAG3B"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Client for Revel Digital API
|
|
3
|
+
* Handles authentication, request execution, and response processing
|
|
4
|
+
*/
|
|
5
|
+
export class GraphQLClient {
|
|
6
|
+
config;
|
|
7
|
+
authHeaders = {};
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
// Set auth token if provided (Authorization: Bearer header)
|
|
11
|
+
if (config.authToken) {
|
|
12
|
+
this.setBearerToken(config.authToken);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Set Bearer token for authentication (Authorization: Bearer header)
|
|
17
|
+
* This is the only authentication method supported by the Revel Digital GraphQL API
|
|
18
|
+
*/
|
|
19
|
+
setBearerToken(token) {
|
|
20
|
+
this.authHeaders['Authorization'] = `Bearer ${token}`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Set custom headers (proxied from client)
|
|
24
|
+
*/
|
|
25
|
+
setCustomHeaders(headers) {
|
|
26
|
+
Object.assign(this.authHeaders, headers);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Clear all authentication headers
|
|
30
|
+
*/
|
|
31
|
+
clearAuth() {
|
|
32
|
+
this.authHeaders = {};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Execute a GraphQL query
|
|
36
|
+
*/
|
|
37
|
+
async execute(request) {
|
|
38
|
+
const startTime = Date.now();
|
|
39
|
+
try {
|
|
40
|
+
const response = await fetch(this.config.endpoint, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
'Accept': 'application/json',
|
|
45
|
+
...this.authHeaders,
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify({
|
|
48
|
+
query: request.query,
|
|
49
|
+
variables: request.variables,
|
|
50
|
+
operationName: request.operationName,
|
|
51
|
+
}),
|
|
52
|
+
signal: AbortSignal.timeout(this.config.timeout),
|
|
53
|
+
});
|
|
54
|
+
if (!response.ok) {
|
|
55
|
+
const errorText = await response.text();
|
|
56
|
+
throw new Error(`GraphQL request failed: ${response.status} ${response.statusText} - ${errorText}`);
|
|
57
|
+
}
|
|
58
|
+
const result = await response.json();
|
|
59
|
+
if (this.config.debug) {
|
|
60
|
+
console.error(`[GraphQL] Query executed in ${Date.now() - startTime}ms`);
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof Error) {
|
|
66
|
+
if (error.name === 'TimeoutError') {
|
|
67
|
+
throw new Error(`GraphQL request timed out after ${this.config.timeout}ms`);
|
|
68
|
+
}
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
throw new Error('Unknown error during GraphQL request');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Execute a raw query string with optional variables
|
|
76
|
+
*/
|
|
77
|
+
async query(query, variables, operationName) {
|
|
78
|
+
return this.execute({ query, variables, operationName });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fetch the GraphQL schema (introspection)
|
|
82
|
+
*/
|
|
83
|
+
async introspect() {
|
|
84
|
+
const introspectionQuery = `
|
|
85
|
+
query IntrospectionQuery {
|
|
86
|
+
__schema {
|
|
87
|
+
queryType { name }
|
|
88
|
+
types {
|
|
89
|
+
kind
|
|
90
|
+
name
|
|
91
|
+
description
|
|
92
|
+
fields(includeDeprecated: true) {
|
|
93
|
+
name
|
|
94
|
+
description
|
|
95
|
+
isDeprecated
|
|
96
|
+
deprecationReason
|
|
97
|
+
args {
|
|
98
|
+
name
|
|
99
|
+
description
|
|
100
|
+
type {
|
|
101
|
+
kind
|
|
102
|
+
name
|
|
103
|
+
ofType {
|
|
104
|
+
kind
|
|
105
|
+
name
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
defaultValue
|
|
109
|
+
}
|
|
110
|
+
type {
|
|
111
|
+
kind
|
|
112
|
+
name
|
|
113
|
+
ofType {
|
|
114
|
+
kind
|
|
115
|
+
name
|
|
116
|
+
ofType {
|
|
117
|
+
kind
|
|
118
|
+
name
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
inputFields {
|
|
124
|
+
name
|
|
125
|
+
description
|
|
126
|
+
type {
|
|
127
|
+
kind
|
|
128
|
+
name
|
|
129
|
+
ofType {
|
|
130
|
+
kind
|
|
131
|
+
name
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
defaultValue
|
|
135
|
+
}
|
|
136
|
+
enumValues(includeDeprecated: true) {
|
|
137
|
+
name
|
|
138
|
+
description
|
|
139
|
+
isDeprecated
|
|
140
|
+
deprecationReason
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
return this.execute({ query: introspectionQuery });
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Fetch type information for a specific type
|
|
150
|
+
*/
|
|
151
|
+
async introspectType(typeName) {
|
|
152
|
+
const typeQuery = `
|
|
153
|
+
query TypeQuery($name: String!) {
|
|
154
|
+
__type(name: $name) {
|
|
155
|
+
kind
|
|
156
|
+
name
|
|
157
|
+
description
|
|
158
|
+
fields(includeDeprecated: true) {
|
|
159
|
+
name
|
|
160
|
+
description
|
|
161
|
+
isDeprecated
|
|
162
|
+
deprecationReason
|
|
163
|
+
args {
|
|
164
|
+
name
|
|
165
|
+
description
|
|
166
|
+
type {
|
|
167
|
+
kind
|
|
168
|
+
name
|
|
169
|
+
ofType { kind name ofType { kind name } }
|
|
170
|
+
}
|
|
171
|
+
defaultValue
|
|
172
|
+
}
|
|
173
|
+
type {
|
|
174
|
+
kind
|
|
175
|
+
name
|
|
176
|
+
ofType { kind name ofType { kind name ofType { kind name } } }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
inputFields {
|
|
180
|
+
name
|
|
181
|
+
description
|
|
182
|
+
type {
|
|
183
|
+
kind
|
|
184
|
+
name
|
|
185
|
+
ofType { kind name }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
enumValues(includeDeprecated: true) {
|
|
189
|
+
name
|
|
190
|
+
description
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`;
|
|
195
|
+
return this.execute({ query: typeQuery, variables: { name: typeName } });
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get current configuration
|
|
199
|
+
*/
|
|
200
|
+
getConfig() {
|
|
201
|
+
return { ...this.config };
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Check if authenticated
|
|
205
|
+
*/
|
|
206
|
+
isAuthenticated() {
|
|
207
|
+
return Object.keys(this.authHeaders).length > 0;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=graphql-client.js.map
|
|
@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A6D1B,CAAC;QAEF,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,QAAgB;QACnC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0CjB,CAAC;QAEF,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Query Builder for Revel Digital API
|
|
3
|
+
* Helps agents construct optimized queries with proper field selection and filtering
|
|
4
|
+
*/
|
|
5
|
+
declare const QUERY_OPERATIONS: Record<string, {
|
|
6
|
+
returnType: string;
|
|
7
|
+
supportsFilter: boolean;
|
|
8
|
+
requiresDateRange: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export interface QueryBuilderOptions {
|
|
11
|
+
operation: string;
|
|
12
|
+
fields: string[];
|
|
13
|
+
arguments?: Record<string, unknown>;
|
|
14
|
+
filter?: Record<string, unknown>;
|
|
15
|
+
orderBy?: {
|
|
16
|
+
field: string;
|
|
17
|
+
direction: 'ASC' | 'DESC';
|
|
18
|
+
};
|
|
19
|
+
limit?: number;
|
|
20
|
+
preset?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class QueryBuilder {
|
|
23
|
+
/**
|
|
24
|
+
* Build a GraphQL query from options
|
|
25
|
+
*/
|
|
26
|
+
static build(options: QueryBuilderOptions): {
|
|
27
|
+
query: string;
|
|
28
|
+
variables: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Build field selection string, handling nested fields
|
|
32
|
+
*/
|
|
33
|
+
private static buildFieldSelection;
|
|
34
|
+
/**
|
|
35
|
+
* Build filter input from simple object
|
|
36
|
+
*/
|
|
37
|
+
private static buildFilterInput;
|
|
38
|
+
/**
|
|
39
|
+
* Infer GraphQL type from variable name and value
|
|
40
|
+
*/
|
|
41
|
+
private static inferGraphQLType;
|
|
42
|
+
/**
|
|
43
|
+
* Capitalize first letter
|
|
44
|
+
*/
|
|
45
|
+
private static capitalizeFirst;
|
|
46
|
+
/**
|
|
47
|
+
* Get available operations
|
|
48
|
+
*/
|
|
49
|
+
static getOperations(): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Get operation info
|
|
52
|
+
*/
|
|
53
|
+
static getOperationInfo(operation: string): typeof QUERY_OPERATIONS[string] | null;
|
|
54
|
+
/**
|
|
55
|
+
* Get field presets for an operation
|
|
56
|
+
*/
|
|
57
|
+
static getFieldPresets(operation: string): Record<string, string[]> | null;
|
|
58
|
+
/**
|
|
59
|
+
* Build a quick query for common use cases
|
|
60
|
+
*/
|
|
61
|
+
static quick: {
|
|
62
|
+
/** Get all devices with status */
|
|
63
|
+
devicesStatus: () => {
|
|
64
|
+
query: string;
|
|
65
|
+
variables: Record<string, unknown>;
|
|
66
|
+
};
|
|
67
|
+
/** Get online devices only */
|
|
68
|
+
onlineDevices: () => {
|
|
69
|
+
query: string;
|
|
70
|
+
variables: Record<string, unknown>;
|
|
71
|
+
};
|
|
72
|
+
/** Get recent media */
|
|
73
|
+
recentMedia: (limit?: number) => {
|
|
74
|
+
query: string;
|
|
75
|
+
variables: Record<string, unknown>;
|
|
76
|
+
};
|
|
77
|
+
/** Get active schedules */
|
|
78
|
+
activeSchedules: () => {
|
|
79
|
+
query: string;
|
|
80
|
+
variables: Record<string, unknown>;
|
|
81
|
+
};
|
|
82
|
+
/** Get play logs for date range */
|
|
83
|
+
playLogs: (startDate: string, endDate: string, deviceId?: string[]) => {
|
|
84
|
+
query: string;
|
|
85
|
+
variables: Record<string, unknown>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=query-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../../src/core/query-builder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,CAsBjH,CAAC;AAiCF,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE;IA0EjG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IA2BlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAgB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