@yojinhq/jintel-client 0.1.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/client.d.ts +78 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +268 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/queries.d.ts +22 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +237 -0
- package/dist/queries.js.map +1 -0
- package/dist/types.d.ts +1179 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +200 -0
- package/dist/types.js.map +1 -0
- package/package.json +49 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { EnrichmentField, Entity, EntityType, GraphQLError, GraphQLResponse, JintelClientConfig, MarketQuote, RequestOptions, SanctionsMatch } from "./types.js";
|
|
2
|
+
export interface ValidationResult {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
errors: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function validateQuery(query: string): ValidationResult;
|
|
7
|
+
export declare class JintelError extends Error {
|
|
8
|
+
readonly code?: string;
|
|
9
|
+
constructor(message: string, code?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class JintelAuthError extends JintelError {
|
|
12
|
+
constructor(message: string);
|
|
13
|
+
}
|
|
14
|
+
export declare class JintelUnreachableError extends JintelError {
|
|
15
|
+
constructor(message: string);
|
|
16
|
+
}
|
|
17
|
+
export declare class JintelValidationError extends JintelError {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
export type JintelResult<T> = {
|
|
21
|
+
success: true;
|
|
22
|
+
data: T;
|
|
23
|
+
} | {
|
|
24
|
+
success: false;
|
|
25
|
+
error: string;
|
|
26
|
+
};
|
|
27
|
+
export interface GraphQLRequestResult<T = unknown> {
|
|
28
|
+
data: T;
|
|
29
|
+
errors?: GraphQLError[];
|
|
30
|
+
extensions?: GraphQLResponse["extensions"];
|
|
31
|
+
}
|
|
32
|
+
export declare const JINTEL_API_URL = "https://api.jintel.ai/api";
|
|
33
|
+
export declare class JintelClient {
|
|
34
|
+
private readonly baseUrl;
|
|
35
|
+
private readonly apiKey;
|
|
36
|
+
private readonly timeout;
|
|
37
|
+
private readonly debug;
|
|
38
|
+
constructor(config: JintelClientConfig);
|
|
39
|
+
private execute;
|
|
40
|
+
private handleError;
|
|
41
|
+
/**
|
|
42
|
+
* Execute any GraphQL query. Throws on HTTP, auth, and GraphQL errors.
|
|
43
|
+
* Auto-extracts the data when the response has a single root field.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Untyped
|
|
48
|
+
* const quotes = await client.request(QUOTES, { tickers: ["AAPL"] });
|
|
49
|
+
*
|
|
50
|
+
* // Typed via generic
|
|
51
|
+
* const quotes = await client.request<MarketQuote[]>(QUOTES, { tickers: ["AAPL"] });
|
|
52
|
+
*
|
|
53
|
+
* // Typed + validated via Zod schema
|
|
54
|
+
* const quotes = await client.request(QUOTES, { tickers: ["AAPL"] }, {
|
|
55
|
+
* schema: z.array(MarketQuoteSchema),
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
request<T = unknown>(query: string, variables?: Record<string, unknown>, options?: RequestOptions<T>): Promise<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Execute a GraphQL query and return the full response including errors and extensions.
|
|
62
|
+
* Does NOT throw on GraphQL errors — use this when you want to handle errors yourself.
|
|
63
|
+
*/
|
|
64
|
+
rawRequest<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<GraphQLRequestResult<T>>;
|
|
65
|
+
searchEntities(query: string, options?: {
|
|
66
|
+
type?: EntityType;
|
|
67
|
+
limit?: number;
|
|
68
|
+
}): Promise<JintelResult<Entity[]>>;
|
|
69
|
+
enrichEntity(ticker: string, fields?: EnrichmentField[]): Promise<JintelResult<Entity>>;
|
|
70
|
+
quotes(tickers: string[]): Promise<JintelResult<MarketQuote[]>>;
|
|
71
|
+
sanctionsScreen(name: string, country?: string): Promise<JintelResult<SanctionsMatch[]>>;
|
|
72
|
+
healthCheck(): Promise<{
|
|
73
|
+
healthy: boolean;
|
|
74
|
+
latencyMs: number;
|
|
75
|
+
error?: string;
|
|
76
|
+
}>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,MAAM,EACN,UAAU,EACV,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAsD7D;AAID,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAK3C;AAED,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,qBAAsB,SAAQ,WAAW;gBACxC,OAAO,EAAE,MAAM;CAI5B;AAID,MAAM,MAAM,YAAY,CAAC,CAAC,IACtB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAC1B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CA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,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;IAW/D,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC,CAAC;IAgBpC,WAAW,IAAI,OAAO,CAAC;QAC3B,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CAUH"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { QUOTES, SANCTIONS_SCREEN, SEARCH_ENTITIES, buildEnrichQuery, } from "./queries.js";
|
|
2
|
+
import { ALL_ENRICHMENT_FIELDS, GraphQLResponseSchema } from "./types.js";
|
|
3
|
+
export function validateQuery(query) {
|
|
4
|
+
const errors = [];
|
|
5
|
+
const trimmed = (query ?? "").trim();
|
|
6
|
+
if (!trimmed) {
|
|
7
|
+
return { valid: false, errors: ["Query string is empty"] };
|
|
8
|
+
}
|
|
9
|
+
// Must start with a valid operation keyword or shorthand '{'
|
|
10
|
+
const operationPattern = /^(query|mutation|subscription)\b|^\{/;
|
|
11
|
+
if (!operationPattern.test(trimmed)) {
|
|
12
|
+
errors.push("Query must start with 'query', 'mutation', 'subscription', or '{'");
|
|
13
|
+
}
|
|
14
|
+
// Check balanced braces, accounting for strings
|
|
15
|
+
let depth = 0;
|
|
16
|
+
let inString = false;
|
|
17
|
+
let escapeNext = false;
|
|
18
|
+
for (const char of trimmed) {
|
|
19
|
+
if (escapeNext) {
|
|
20
|
+
escapeNext = false;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (char === "\\") {
|
|
24
|
+
escapeNext = true;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (char === '"') {
|
|
28
|
+
inString = !inString;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (inString)
|
|
32
|
+
continue;
|
|
33
|
+
if (char === "{")
|
|
34
|
+
depth++;
|
|
35
|
+
if (char === "}")
|
|
36
|
+
depth--;
|
|
37
|
+
if (depth < 0) {
|
|
38
|
+
errors.push("Unexpected closing brace '}'");
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (depth > 0) {
|
|
43
|
+
errors.push(`${depth} unclosed brace(s) '{'`);
|
|
44
|
+
}
|
|
45
|
+
if (inString) {
|
|
46
|
+
errors.push("Unterminated string literal");
|
|
47
|
+
}
|
|
48
|
+
// Check for empty selection set
|
|
49
|
+
if (/\{\s*\}/.test(trimmed)) {
|
|
50
|
+
errors.push("Empty selection set detected");
|
|
51
|
+
}
|
|
52
|
+
return { valid: errors.length === 0, errors };
|
|
53
|
+
}
|
|
54
|
+
// ── Error Classes ─────────────────────────────────────────────────────────
|
|
55
|
+
export class JintelError extends Error {
|
|
56
|
+
code;
|
|
57
|
+
constructor(message, code) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.name = "JintelError";
|
|
60
|
+
this.code = code;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class JintelAuthError extends JintelError {
|
|
64
|
+
constructor(message) {
|
|
65
|
+
super(message, "AUTH_ERROR");
|
|
66
|
+
this.name = "JintelAuthError";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class JintelUnreachableError extends JintelError {
|
|
70
|
+
constructor(message) {
|
|
71
|
+
super(message, "UNREACHABLE");
|
|
72
|
+
this.name = "JintelUnreachableError";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export class JintelValidationError extends JintelError {
|
|
76
|
+
constructor(message) {
|
|
77
|
+
super(message, "VALIDATION_ERROR");
|
|
78
|
+
this.name = "JintelValidationError";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// ── Client ────────────────────────────────────────────────────────────────
|
|
82
|
+
export const JINTEL_API_URL = "https://api.jintel.ai/api";
|
|
83
|
+
export class JintelClient {
|
|
84
|
+
baseUrl;
|
|
85
|
+
apiKey;
|
|
86
|
+
timeout;
|
|
87
|
+
debug;
|
|
88
|
+
constructor(config) {
|
|
89
|
+
if (!config.apiKey) {
|
|
90
|
+
throw new JintelAuthError("apiKey is required and must not be empty");
|
|
91
|
+
}
|
|
92
|
+
this.baseUrl = config.baseUrl ?? JINTEL_API_URL;
|
|
93
|
+
this.apiKey = config.apiKey;
|
|
94
|
+
this.timeout = config.timeout ?? 30_000;
|
|
95
|
+
this.debug = config.debug ?? false;
|
|
96
|
+
}
|
|
97
|
+
// ── Private ─────────────────────────────────────────────────────────────
|
|
98
|
+
async execute(query, variables) {
|
|
99
|
+
const headers = {
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
102
|
+
};
|
|
103
|
+
if (this.debug) {
|
|
104
|
+
headers["X-Debug"] = "true";
|
|
105
|
+
}
|
|
106
|
+
let response;
|
|
107
|
+
try {
|
|
108
|
+
response = await fetch(`${this.baseUrl}/graphql`, {
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers,
|
|
111
|
+
body: JSON.stringify({ query, variables }),
|
|
112
|
+
signal: AbortSignal.timeout(this.timeout),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
if (err instanceof TypeError) {
|
|
117
|
+
throw new JintelUnreachableError(`Jintel API unreachable: ${err.message}`);
|
|
118
|
+
}
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
121
|
+
if (response.status === 401) {
|
|
122
|
+
throw new JintelAuthError("Authentication failed: invalid or expired API key");
|
|
123
|
+
}
|
|
124
|
+
if (!response.ok) {
|
|
125
|
+
throw new JintelError(`HTTP ${response.status}: ${response.statusText}`, `HTTP_${response.status}`);
|
|
126
|
+
}
|
|
127
|
+
const json = await response.json();
|
|
128
|
+
return GraphQLResponseSchema.parse(json);
|
|
129
|
+
}
|
|
130
|
+
handleError(err) {
|
|
131
|
+
if (err instanceof JintelError) {
|
|
132
|
+
return { success: false, error: err.message };
|
|
133
|
+
}
|
|
134
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
135
|
+
return { success: false, error: msg };
|
|
136
|
+
}
|
|
137
|
+
// ── Generic Public API ──────────────────────────────────────────────────
|
|
138
|
+
/**
|
|
139
|
+
* Execute any GraphQL query. Throws on HTTP, auth, and GraphQL errors.
|
|
140
|
+
* Auto-extracts the data when the response has a single root field.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* // Untyped
|
|
145
|
+
* const quotes = await client.request(QUOTES, { tickers: ["AAPL"] });
|
|
146
|
+
*
|
|
147
|
+
* // Typed via generic
|
|
148
|
+
* const quotes = await client.request<MarketQuote[]>(QUOTES, { tickers: ["AAPL"] });
|
|
149
|
+
*
|
|
150
|
+
* // Typed + validated via Zod schema
|
|
151
|
+
* const quotes = await client.request(QUOTES, { tickers: ["AAPL"] }, {
|
|
152
|
+
* schema: z.array(MarketQuoteSchema),
|
|
153
|
+
* });
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
async request(query, variables, options) {
|
|
157
|
+
const response = await this.execute(query, variables);
|
|
158
|
+
if (response.errors?.length) {
|
|
159
|
+
const firstError = response.errors[0];
|
|
160
|
+
const code = firstError.extensions?.code;
|
|
161
|
+
if (code === "UNAUTHENTICATED") {
|
|
162
|
+
throw new JintelAuthError(firstError.message);
|
|
163
|
+
}
|
|
164
|
+
throw new JintelError(firstError.message, code ?? undefined);
|
|
165
|
+
}
|
|
166
|
+
const data = response.data;
|
|
167
|
+
if (!data) {
|
|
168
|
+
throw new JintelError("No data returned", "NO_DATA");
|
|
169
|
+
}
|
|
170
|
+
// Extract by key, or auto-extract single root field
|
|
171
|
+
let result;
|
|
172
|
+
if (options?.key) {
|
|
173
|
+
result = data[options.key];
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
const keys = Object.keys(data);
|
|
177
|
+
result = keys.length === 1 ? data[keys[0]] : data;
|
|
178
|
+
}
|
|
179
|
+
if (options?.schema) {
|
|
180
|
+
const parsed = options.schema.safeParse(result);
|
|
181
|
+
if (!parsed.success) {
|
|
182
|
+
throw new JintelValidationError(`Response validation failed: ${parsed.error.message}`);
|
|
183
|
+
}
|
|
184
|
+
return parsed.data;
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Execute a GraphQL query and return the full response including errors and extensions.
|
|
190
|
+
* Does NOT throw on GraphQL errors — use this when you want to handle errors yourself.
|
|
191
|
+
*/
|
|
192
|
+
async rawRequest(query, variables) {
|
|
193
|
+
const response = await this.execute(query, variables);
|
|
194
|
+
return {
|
|
195
|
+
data: (response.data ?? null),
|
|
196
|
+
errors: response.errors,
|
|
197
|
+
extensions: response.extensions,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// ── Convenience Methods ─────────────────────────────────────────────────
|
|
201
|
+
async searchEntities(query, options) {
|
|
202
|
+
try {
|
|
203
|
+
const variables = { query };
|
|
204
|
+
if (options?.type)
|
|
205
|
+
variables.type = options.type;
|
|
206
|
+
if (options?.limit != null)
|
|
207
|
+
variables.limit = options.limit;
|
|
208
|
+
const data = await this.request(SEARCH_ENTITIES, variables, {
|
|
209
|
+
key: "searchEntities",
|
|
210
|
+
});
|
|
211
|
+
return { success: true, data: data ?? [] };
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
return this.handleError(err);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
async enrichEntity(ticker, fields) {
|
|
218
|
+
try {
|
|
219
|
+
const selectedFields = fields ?? ALL_ENRICHMENT_FIELDS;
|
|
220
|
+
const query = buildEnrichQuery(selectedFields);
|
|
221
|
+
const data = await this.request(query, { id: ticker }, {
|
|
222
|
+
key: "entity",
|
|
223
|
+
});
|
|
224
|
+
if (!data) {
|
|
225
|
+
return { success: false, error: `Entity not found: ${ticker}` };
|
|
226
|
+
}
|
|
227
|
+
return { success: true, data };
|
|
228
|
+
}
|
|
229
|
+
catch (err) {
|
|
230
|
+
return this.handleError(err);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async quotes(tickers) {
|
|
234
|
+
try {
|
|
235
|
+
const data = await this.request(QUOTES, { tickers }, {
|
|
236
|
+
key: "quotes",
|
|
237
|
+
});
|
|
238
|
+
return { success: true, data: data ?? [] };
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
return this.handleError(err);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
async sanctionsScreen(name, country) {
|
|
245
|
+
try {
|
|
246
|
+
const variables = { name };
|
|
247
|
+
if (country)
|
|
248
|
+
variables.country = country;
|
|
249
|
+
const data = await this.request(SANCTIONS_SCREEN, variables, { key: "sanctionsScreen" });
|
|
250
|
+
return { success: true, data: data ?? [] };
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
return this.handleError(err);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
async healthCheck() {
|
|
257
|
+
const start = Date.now();
|
|
258
|
+
try {
|
|
259
|
+
await this.execute("{ __typename }");
|
|
260
|
+
return { healthy: true, latencyMs: Date.now() - start };
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
264
|
+
return { healthy: false, latencyMs: Date.now() - start, error: msg };
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAYtB,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,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;QACzB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;YACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;QAC1D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACvE,CAAC;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { JintelClient, JintelError, JintelAuthError, JintelUnreachableError, JintelValidationError, JINTEL_API_URL, validateQuery, } from "./client.js";
|
|
2
|
+
export type { JintelResult, GraphQLRequestResult, ValidationResult, } from "./client.js";
|
|
3
|
+
export { EntityTypeSchema, SeveritySchema, RiskSignalTypeSchema, FilingTypeSchema, GdpTypeSchema, SP500SeriesSchema, MarketQuoteSchema, FundamentalsSchema, MarketDataSchema, RiskSignalSchema, RiskProfileSchema, SanctionsMatchSchema, FilingSchema, RegulatoryDataSchema, OfficerSchema, CorporateDataSchema, EntitySchema, EconomicDataPointSchema, SP500DataPointSchema, FuturesCurvePointSchema, OptionsChainEntrySchema, GraphQLErrorSchema, GraphQLResponseSchema, ALL_ENRICHMENT_FIELDS, } from "./types.js";
|
|
4
|
+
export type { EntityType, Severity, RiskSignalType, FilingType, GdpType, SP500Series, MarketQuote, Fundamentals, MarketData, RiskSignal, RiskProfile, SanctionsMatch, Filing, RegulatoryData, Officer, CorporateData, Entity, EconomicDataPoint, SP500DataPoint, FuturesCurvePoint, OptionsChainEntry, GraphQLError, GraphQLResponse, JintelClientConfig, RequestOptions, EnrichmentField, WebResult, } from "./types.js";
|
|
5
|
+
export { SEARCH_ENTITIES, ENTITY, ENTITY_BY_TICKER, MARKET_QUOTE, QUOTES, BATCH_QUOTES, SANCTIONS_SCREEN, GDP, INFLATION, INTEREST_RATES, SP500_MULTIPLES, FUTURES_CURVE, OPTIONS_CHAIN, buildEnrichQuery, MARKET_QUOTE_FIELDS, FUNDAMENTALS_FIELDS, RISK_FIELDS, REGULATORY_FIELDS, CORPORATE_FIELDS, } from "./queries.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EAEjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EAEvB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,UAAU,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,MAAM,EACN,cAAc,EACd,OAAO,EACP,aAAa,EACb,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAEL,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EAEb,gBAAgB,EAEhB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { JintelClient, JintelError, JintelAuthError, JintelUnreachableError, JintelValidationError, JINTEL_API_URL, validateQuery, } from "./client.js";
|
|
2
|
+
export {
|
|
3
|
+
// Enums
|
|
4
|
+
EntityTypeSchema, SeveritySchema, RiskSignalTypeSchema, FilingTypeSchema, GdpTypeSchema, SP500SeriesSchema,
|
|
5
|
+
// Data schemas
|
|
6
|
+
MarketQuoteSchema, FundamentalsSchema, MarketDataSchema, RiskSignalSchema, RiskProfileSchema, SanctionsMatchSchema, FilingSchema, RegulatoryDataSchema, OfficerSchema, CorporateDataSchema, EntitySchema, EconomicDataPointSchema, SP500DataPointSchema, FuturesCurvePointSchema, OptionsChainEntrySchema,
|
|
7
|
+
// Response
|
|
8
|
+
GraphQLErrorSchema, GraphQLResponseSchema, ALL_ENRICHMENT_FIELDS, } from "./types.js";
|
|
9
|
+
export {
|
|
10
|
+
// Query strings
|
|
11
|
+
SEARCH_ENTITIES, ENTITY, ENTITY_BY_TICKER, MARKET_QUOTE, QUOTES, BATCH_QUOTES, SANCTIONS_SCREEN, GDP, INFLATION, INTEREST_RATES, SP500_MULTIPLES, FUTURES_CURVE, OPTIONS_CHAIN,
|
|
12
|
+
// Dynamic builder
|
|
13
|
+
buildEnrichQuery,
|
|
14
|
+
// Fragments
|
|
15
|
+
MARKET_QUOTE_FIELDS, FUNDAMENTALS_FIELDS, RISK_FIELDS, REGULATORY_FIELDS, CORPORATE_FIELDS, } from "./queries.js";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAOrB,OAAO;AACL,QAAQ;AACR,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,iBAAiB;AACjB,eAAe;AACf,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB;AACvB,WAAW;AACX,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAgCpB,OAAO;AACL,gBAAgB;AAChB,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa;AACb,kBAAkB;AAClB,gBAAgB;AAChB,YAAY;AACZ,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { EnrichmentField } from "./types.js";
|
|
2
|
+
export declare const MARKET_QUOTE_FIELDS = "\n quote {\n ticker\n price\n open\n high\n low\n previousClose\n change\n changePercent\n volume\n marketCap\n timestamp\n source\n }";
|
|
3
|
+
export declare const FUNDAMENTALS_FIELDS = "\n fundamentals {\n marketCap\n revenue\n netIncome\n eps\n peRatio\n dividendYield\n beta\n fiftyTwoWeekHigh\n fiftyTwoWeekLow\n debtToEquity\n sector\n industry\n source\n }";
|
|
4
|
+
export declare const RISK_FIELDS = "\n risk {\n overallScore\n signals {\n type\n severity\n description\n source\n date\n }\n sanctionsHits\n adverseMediaHits\n regulatoryActions\n }";
|
|
5
|
+
export declare const REGULATORY_FIELDS = "\n regulatory {\n sanctions {\n listName\n matchedName\n score\n details\n }\n filings {\n type\n date\n url\n description\n }\n }";
|
|
6
|
+
export declare const CORPORATE_FIELDS = "\n corporate {\n legalName\n jurisdiction\n incorporationDate\n status\n officers {\n name\n role\n appointedDate\n }\n registeredAddress\n }";
|
|
7
|
+
export declare const SEARCH_ENTITIES = "\n query SearchEntities($query: String!, $type: EntityType, $limit: Int) {\n searchEntities(query: $query, type: $type, limit: $limit) {\n id\n name\n type\n tickers\n domain\n country\n }\n }";
|
|
8
|
+
export declare const ENTITY = "\n query Entity($id: ID!) {\n entity(id: $id) {\n id\n name\n type\n tickers\n domain\n country\n }\n }";
|
|
9
|
+
export declare const ENTITY_BY_TICKER = "\n query EntityByTicker($ticker: String!) {\n entityByTicker(ticker: $ticker) {\n id\n name\n type\n tickers\n domain\n country\n }\n }";
|
|
10
|
+
export declare const MARKET_QUOTE = "\n query MarketQuote($ticker: String!) {\n marketQuote(ticker: $ticker) {\n ticker\n price\n open\n high\n low\n previousClose\n change\n changePercent\n volume\n marketCap\n timestamp\n source\n }\n }";
|
|
11
|
+
export declare const QUOTES = "\n query Quotes($tickers: [String!]!) {\n quotes(tickers: $tickers) {\n ticker\n price\n open\n high\n low\n previousClose\n change\n changePercent\n volume\n marketCap\n timestamp\n source\n }\n }";
|
|
12
|
+
/** @deprecated Use QUOTES instead */
|
|
13
|
+
export declare const BATCH_QUOTES = "\n query Quotes($tickers: [String!]!) {\n quotes(tickers: $tickers) {\n ticker\n price\n open\n high\n low\n previousClose\n change\n changePercent\n volume\n marketCap\n timestamp\n source\n }\n }";
|
|
14
|
+
export declare const SANCTIONS_SCREEN = "\n query SanctionsScreen($name: String!, $country: String) {\n sanctionsScreen(name: $name, country: $country) {\n listName\n matchedName\n score\n details\n }\n }";
|
|
15
|
+
export declare const GDP = "\n query Gdp($country: String!, $type: GdpType) {\n gdp(country: $country, type: $type) {\n date\n country\n value\n }\n }";
|
|
16
|
+
export declare const INFLATION = "\n query Inflation($country: String!) {\n inflation(country: $country) {\n date\n country\n value\n }\n }";
|
|
17
|
+
export declare const INTEREST_RATES = "\n query InterestRates($country: String!) {\n interestRates(country: $country) {\n date\n country\n value\n }\n }";
|
|
18
|
+
export declare const SP500_MULTIPLES = "\n query SP500Multiples($series: SP500Series!) {\n sp500Multiples(series: $series) {\n date\n name\n value\n }\n }";
|
|
19
|
+
export declare const FUTURES_CURVE = "\n query FuturesCurve($symbol: String!) {\n futuresCurve(symbol: $symbol) {\n expiration\n price\n }\n }";
|
|
20
|
+
export declare const OPTIONS_CHAIN = "\n query OptionsChain($symbol: String!) {\n optionsChain(symbol: $symbol) {\n contractSymbol\n expiration\n strike\n optionType\n openInterest\n volume\n lastTradePrice\n bid\n ask\n impliedVolatility\n delta\n gamma\n theta\n vega\n }\n }";
|
|
21
|
+
export declare function buildEnrichQuery(fields: EnrichmentField[]): string;
|
|
22
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,eAAO,MAAM,mBAAmB,iLAc5B,CAAC;AAEL,eAAO,MAAM,mBAAmB,6NAe5B,CAAC;AAEL,eAAO,MAAM,WAAW,qMAapB,CAAC;AAEL,eAAO,MAAM,iBAAiB,6LAc1B,CAAC;AAEL,eAAO,MAAM,gBAAgB,wLAYzB,CAAC;AAIL,eAAO,MAAM,eAAe,2OAUxB,CAAC;AAEL,eAAO,MAAM,MAAM,kJAUf,CAAC;AAEL,eAAO,MAAM,gBAAgB,kLAUzB,CAAC;AAEL,eAAO,MAAM,YAAY,kRAgBrB,CAAC;AAEL,eAAO,MAAM,MAAM,8QAgBf,CAAC;AAEL,qCAAqC;AACrC,eAAO,MAAM,YAAY,8QAAS,CAAC;AAEnC,eAAO,MAAM,gBAAgB,oMAQzB,CAAC;AAEL,eAAO,MAAM,GAAG,sJAOZ,CAAC;AAEL,eAAO,MAAM,SAAS,qIAOlB,CAAC;AAEL,eAAO,MAAM,cAAc,6IAOvB,CAAC;AAEL,eAAO,MAAM,eAAe,8IAOxB,CAAC;AAEL,eAAO,MAAM,aAAa,+HAMtB,CAAC;AAEL,eAAO,MAAM,aAAa,kUAkBtB,CAAC;AAWL,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAkBlE"}
|
package/dist/queries.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// ── Field Fragments ────────────────────────────────────────────────────────
|
|
2
|
+
export const MARKET_QUOTE_FIELDS = `
|
|
3
|
+
quote {
|
|
4
|
+
ticker
|
|
5
|
+
price
|
|
6
|
+
open
|
|
7
|
+
high
|
|
8
|
+
low
|
|
9
|
+
previousClose
|
|
10
|
+
change
|
|
11
|
+
changePercent
|
|
12
|
+
volume
|
|
13
|
+
marketCap
|
|
14
|
+
timestamp
|
|
15
|
+
source
|
|
16
|
+
}`;
|
|
17
|
+
export const FUNDAMENTALS_FIELDS = `
|
|
18
|
+
fundamentals {
|
|
19
|
+
marketCap
|
|
20
|
+
revenue
|
|
21
|
+
netIncome
|
|
22
|
+
eps
|
|
23
|
+
peRatio
|
|
24
|
+
dividendYield
|
|
25
|
+
beta
|
|
26
|
+
fiftyTwoWeekHigh
|
|
27
|
+
fiftyTwoWeekLow
|
|
28
|
+
debtToEquity
|
|
29
|
+
sector
|
|
30
|
+
industry
|
|
31
|
+
source
|
|
32
|
+
}`;
|
|
33
|
+
export const RISK_FIELDS = `
|
|
34
|
+
risk {
|
|
35
|
+
overallScore
|
|
36
|
+
signals {
|
|
37
|
+
type
|
|
38
|
+
severity
|
|
39
|
+
description
|
|
40
|
+
source
|
|
41
|
+
date
|
|
42
|
+
}
|
|
43
|
+
sanctionsHits
|
|
44
|
+
adverseMediaHits
|
|
45
|
+
regulatoryActions
|
|
46
|
+
}`;
|
|
47
|
+
export const REGULATORY_FIELDS = `
|
|
48
|
+
regulatory {
|
|
49
|
+
sanctions {
|
|
50
|
+
listName
|
|
51
|
+
matchedName
|
|
52
|
+
score
|
|
53
|
+
details
|
|
54
|
+
}
|
|
55
|
+
filings {
|
|
56
|
+
type
|
|
57
|
+
date
|
|
58
|
+
url
|
|
59
|
+
description
|
|
60
|
+
}
|
|
61
|
+
}`;
|
|
62
|
+
export const CORPORATE_FIELDS = `
|
|
63
|
+
corporate {
|
|
64
|
+
legalName
|
|
65
|
+
jurisdiction
|
|
66
|
+
incorporationDate
|
|
67
|
+
status
|
|
68
|
+
officers {
|
|
69
|
+
name
|
|
70
|
+
role
|
|
71
|
+
appointedDate
|
|
72
|
+
}
|
|
73
|
+
registeredAddress
|
|
74
|
+
}`;
|
|
75
|
+
// ── Static Queries ─────────────────────────────────────────────────────────
|
|
76
|
+
export const SEARCH_ENTITIES = `
|
|
77
|
+
query SearchEntities($query: String!, $type: EntityType, $limit: Int) {
|
|
78
|
+
searchEntities(query: $query, type: $type, limit: $limit) {
|
|
79
|
+
id
|
|
80
|
+
name
|
|
81
|
+
type
|
|
82
|
+
tickers
|
|
83
|
+
domain
|
|
84
|
+
country
|
|
85
|
+
}
|
|
86
|
+
}`;
|
|
87
|
+
export const ENTITY = `
|
|
88
|
+
query Entity($id: ID!) {
|
|
89
|
+
entity(id: $id) {
|
|
90
|
+
id
|
|
91
|
+
name
|
|
92
|
+
type
|
|
93
|
+
tickers
|
|
94
|
+
domain
|
|
95
|
+
country
|
|
96
|
+
}
|
|
97
|
+
}`;
|
|
98
|
+
export const ENTITY_BY_TICKER = `
|
|
99
|
+
query EntityByTicker($ticker: String!) {
|
|
100
|
+
entityByTicker(ticker: $ticker) {
|
|
101
|
+
id
|
|
102
|
+
name
|
|
103
|
+
type
|
|
104
|
+
tickers
|
|
105
|
+
domain
|
|
106
|
+
country
|
|
107
|
+
}
|
|
108
|
+
}`;
|
|
109
|
+
export const MARKET_QUOTE = `
|
|
110
|
+
query MarketQuote($ticker: String!) {
|
|
111
|
+
marketQuote(ticker: $ticker) {
|
|
112
|
+
ticker
|
|
113
|
+
price
|
|
114
|
+
open
|
|
115
|
+
high
|
|
116
|
+
low
|
|
117
|
+
previousClose
|
|
118
|
+
change
|
|
119
|
+
changePercent
|
|
120
|
+
volume
|
|
121
|
+
marketCap
|
|
122
|
+
timestamp
|
|
123
|
+
source
|
|
124
|
+
}
|
|
125
|
+
}`;
|
|
126
|
+
export const QUOTES = `
|
|
127
|
+
query Quotes($tickers: [String!]!) {
|
|
128
|
+
quotes(tickers: $tickers) {
|
|
129
|
+
ticker
|
|
130
|
+
price
|
|
131
|
+
open
|
|
132
|
+
high
|
|
133
|
+
low
|
|
134
|
+
previousClose
|
|
135
|
+
change
|
|
136
|
+
changePercent
|
|
137
|
+
volume
|
|
138
|
+
marketCap
|
|
139
|
+
timestamp
|
|
140
|
+
source
|
|
141
|
+
}
|
|
142
|
+
}`;
|
|
143
|
+
/** @deprecated Use QUOTES instead */
|
|
144
|
+
export const BATCH_QUOTES = QUOTES;
|
|
145
|
+
export const SANCTIONS_SCREEN = `
|
|
146
|
+
query SanctionsScreen($name: String!, $country: String) {
|
|
147
|
+
sanctionsScreen(name: $name, country: $country) {
|
|
148
|
+
listName
|
|
149
|
+
matchedName
|
|
150
|
+
score
|
|
151
|
+
details
|
|
152
|
+
}
|
|
153
|
+
}`;
|
|
154
|
+
export const GDP = `
|
|
155
|
+
query Gdp($country: String!, $type: GdpType) {
|
|
156
|
+
gdp(country: $country, type: $type) {
|
|
157
|
+
date
|
|
158
|
+
country
|
|
159
|
+
value
|
|
160
|
+
}
|
|
161
|
+
}`;
|
|
162
|
+
export const INFLATION = `
|
|
163
|
+
query Inflation($country: String!) {
|
|
164
|
+
inflation(country: $country) {
|
|
165
|
+
date
|
|
166
|
+
country
|
|
167
|
+
value
|
|
168
|
+
}
|
|
169
|
+
}`;
|
|
170
|
+
export const INTEREST_RATES = `
|
|
171
|
+
query InterestRates($country: String!) {
|
|
172
|
+
interestRates(country: $country) {
|
|
173
|
+
date
|
|
174
|
+
country
|
|
175
|
+
value
|
|
176
|
+
}
|
|
177
|
+
}`;
|
|
178
|
+
export const SP500_MULTIPLES = `
|
|
179
|
+
query SP500Multiples($series: SP500Series!) {
|
|
180
|
+
sp500Multiples(series: $series) {
|
|
181
|
+
date
|
|
182
|
+
name
|
|
183
|
+
value
|
|
184
|
+
}
|
|
185
|
+
}`;
|
|
186
|
+
export const FUTURES_CURVE = `
|
|
187
|
+
query FuturesCurve($symbol: String!) {
|
|
188
|
+
futuresCurve(symbol: $symbol) {
|
|
189
|
+
expiration
|
|
190
|
+
price
|
|
191
|
+
}
|
|
192
|
+
}`;
|
|
193
|
+
export const OPTIONS_CHAIN = `
|
|
194
|
+
query OptionsChain($symbol: String!) {
|
|
195
|
+
optionsChain(symbol: $symbol) {
|
|
196
|
+
contractSymbol
|
|
197
|
+
expiration
|
|
198
|
+
strike
|
|
199
|
+
optionType
|
|
200
|
+
openInterest
|
|
201
|
+
volume
|
|
202
|
+
lastTradePrice
|
|
203
|
+
bid
|
|
204
|
+
ask
|
|
205
|
+
impliedVolatility
|
|
206
|
+
delta
|
|
207
|
+
gamma
|
|
208
|
+
theta
|
|
209
|
+
vega
|
|
210
|
+
}
|
|
211
|
+
}`;
|
|
212
|
+
// ── Dynamic Query Builder ──────────────────────────────────────────────────
|
|
213
|
+
const FIELD_BLOCK_MAP = {
|
|
214
|
+
market: `market {\n ${MARKET_QUOTE_FIELDS.trim()}\n ${FUNDAMENTALS_FIELDS.trim()}\n }`,
|
|
215
|
+
risk: RISK_FIELDS.trim(),
|
|
216
|
+
regulatory: REGULATORY_FIELDS.trim(),
|
|
217
|
+
corporate: CORPORATE_FIELDS.trim(),
|
|
218
|
+
};
|
|
219
|
+
export function buildEnrichQuery(fields) {
|
|
220
|
+
const blocks = fields
|
|
221
|
+
.filter((f) => f in FIELD_BLOCK_MAP)
|
|
222
|
+
.map((f) => ` ${FIELD_BLOCK_MAP[f]}`)
|
|
223
|
+
.join("\n");
|
|
224
|
+
return `
|
|
225
|
+
query EnrichEntity($id: ID!) {
|
|
226
|
+
entity(id: $id) {
|
|
227
|
+
id
|
|
228
|
+
name
|
|
229
|
+
type
|
|
230
|
+
tickers
|
|
231
|
+
domain
|
|
232
|
+
country
|
|
233
|
+
${blocks}
|
|
234
|
+
}
|
|
235
|
+
}`;
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAE9E,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;IAc/B,CAAC;AAEL,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;IAe/B,CAAC;AAEL,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;IAavB,CAAC;AAEL,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;IAc7B,CAAC;AAEL,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;IAY5B,CAAC;AAEL,8EAA8E;AAE9E,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;IAU3B,CAAC;AAEL,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;IAUlB,CAAC;AAEL,MAAM,CAAC,MAAM,gBAAg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