graphor 0.12.2 → 0.14.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/CHANGELOG.md +67 -0
- package/README.md +320 -31
- package/client.d.mts +3 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -6
- package/client.d.ts.map +1 -1
- package/client.js +15 -20
- package/client.js.map +1 -1
- package/client.mjs +15 -20
- package/client.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sources.d.mts +496 -332
- package/resources/sources.d.mts.map +1 -1
- package/resources/sources.d.ts +496 -332
- package/resources/sources.d.ts.map +1 -1
- package/resources/sources.js +200 -236
- package/resources/sources.js.map +1 -1
- package/resources/sources.mjs +200 -236
- package/resources/sources.mjs.map +1 -1
- package/src/client.ts +52 -40
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/index.ts +17 -8
- package/src/resources/sources.ts +617 -367
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0 (2026-03-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.13.0...v0.14.0](https://github.com/synapseops/graphor-typescript-sdk/compare/v0.13.0...v0.14.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([79530bb](https://github.com/synapseops/graphor-typescript-sdk/commit/79530bb7d40167582d8223efcf74543e19b46d9b))
|
|
10
|
+
* **api:** api update ([bdb16b8](https://github.com/synapseops/graphor-typescript-sdk/commit/bdb16b89b4fccd7a662443b4725196f9f1042ba3))
|
|
11
|
+
* **api:** manual updates ([1a97076](https://github.com/synapseops/graphor-typescript-sdk/commit/1a97076dc1938e61b1979b0f6c14c39b3655bcde))
|
|
12
|
+
* **api:** manual updates ([5ff7a35](https://github.com/synapseops/graphor-typescript-sdk/commit/5ff7a35f23cf186029622dc9d1f40342592a7972))
|
|
13
|
+
* **api:** manual updates ([7a889c7](https://github.com/synapseops/graphor-typescript-sdk/commit/7a889c7c7d616b87328ddbe8f5a4d51022666f1e))
|
|
14
|
+
* **api:** manual updates ([f5f2308](https://github.com/synapseops/graphor-typescript-sdk/commit/f5f2308b82e8be4e29c7490eb835505419b3c618))
|
|
15
|
+
* **mcp:** add an option to disable code tool ([e94c0ff](https://github.com/synapseops/graphor-typescript-sdk/commit/e94c0ff15bcddf04d9ed695b0d8e252be17848d6))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **client:** preserve URL params already embedded in path ([f15a979](https://github.com/synapseops/graphor-typescript-sdk/commit/f15a979aa41e9df7732389ac958e2c80c45a21fc))
|
|
21
|
+
* **mcp:** update prompt ([820c100](https://github.com/synapseops/graphor-typescript-sdk/commit/820c1009a2be558ebc6ea72f1ae5c1f4e2b2b1b5))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
|
|
26
|
+
* **ci:** skip uploading artifacts on stainless-internal branches ([793e4b8](https://github.com/synapseops/graphor-typescript-sdk/commit/793e4b8c62f5285d32c9f31740d0b00277dbda99))
|
|
27
|
+
* **internal:** codegen related update ([352b490](https://github.com/synapseops/graphor-typescript-sdk/commit/352b490a035cd599359fb9a8fd375c272bd1f4fa))
|
|
28
|
+
* **internal:** codegen related update ([1a22c92](https://github.com/synapseops/graphor-typescript-sdk/commit/1a22c92ac2f4515a8f858ba97ff27710f6731c7d))
|
|
29
|
+
* **internal:** use x-stainless-mcp-client-envs header for MCP remote code tool calls ([b4ef17e](https://github.com/synapseops/graphor-typescript-sdk/commit/b4ef17e9c0a7404731f96391133c934980d868f5))
|
|
30
|
+
* **internal:** version bump ([5b2cd41](https://github.com/synapseops/graphor-typescript-sdk/commit/5b2cd418f89f6149cf3107e3863d395feda56e80))
|
|
31
|
+
* **mcp-server:** improve instructions ([bb8ce84](https://github.com/synapseops/graphor-typescript-sdk/commit/bb8ce845d864439df5c8724c35ffb44f81af53d3))
|
|
32
|
+
* **mcp-server:** return access instructions for 404 without API key ([6b897c3](https://github.com/synapseops/graphor-typescript-sdk/commit/6b897c30b19ea6a6c8e9a692739f89206da5edae))
|
|
33
|
+
* update placeholder string ([4f59192](https://github.com/synapseops/graphor-typescript-sdk/commit/4f59192cc36983c724bed3da0561735690391397))
|
|
34
|
+
|
|
35
|
+
## 0.13.0 (2026-03-06)
|
|
36
|
+
|
|
37
|
+
Full Changelog: [v0.12.2...v0.13.0](https://github.com/synapseops/graphor-typescript-sdk/compare/v0.12.2...v0.13.0)
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* **api:** api update ([b28ea3a](https://github.com/synapseops/graphor-typescript-sdk/commit/b28ea3a44b51ce9531a8a13cc2bb7b5b10a0bda0))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* **docs/contributing:** correct pnpm link command ([3a5d8bd](https://github.com/synapseops/graphor-typescript-sdk/commit/3a5d8bd20c3586f5fd08a50693bbdbb9fba7d98e))
|
|
47
|
+
* **mcp:** initialize SDK lazily to avoid failing the connection on init errors ([8b17815](https://github.com/synapseops/graphor-typescript-sdk/commit/8b178159df1d809ba76f68487fbe1e48659452c9))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Chores
|
|
51
|
+
|
|
52
|
+
* **internal/client:** fix form-urlencoded requests ([3310edf](https://github.com/synapseops/graphor-typescript-sdk/commit/3310edfbdd3e9f9c70b099d6c2565b1377ebe0a6))
|
|
53
|
+
* **internal:** allow setting x-stainless-api-key header on mcp server requests ([b5adbfb](https://github.com/synapseops/graphor-typescript-sdk/commit/b5adbfbd7bf1be3f0c8b7ce4e65f2cf1e8f0e89b))
|
|
54
|
+
* **internal:** cache fetch instruction calls in MCP server ([117ddaa](https://github.com/synapseops/graphor-typescript-sdk/commit/117ddaac88f0cd18f2fac20984670ca292204b86))
|
|
55
|
+
* **internal:** codegen related update ([b4697bf](https://github.com/synapseops/graphor-typescript-sdk/commit/b4697bf2ae457dccd0ba4a71bd7b4d2d92851bb4))
|
|
56
|
+
* **internal:** codegen related update ([16abe1f](https://github.com/synapseops/graphor-typescript-sdk/commit/16abe1fad057b1f1f624afb551f2dd55a0c7e3e8))
|
|
57
|
+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([331032b](https://github.com/synapseops/graphor-typescript-sdk/commit/331032b7cb9cefa80a6ea1b41be5f0823efe95c2))
|
|
58
|
+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([87e1ac3](https://github.com/synapseops/graphor-typescript-sdk/commit/87e1ac36843648894835198fdec8b9a85fbe74f7))
|
|
59
|
+
* **internal:** improve layout of generated MCP server files ([300c1f4](https://github.com/synapseops/graphor-typescript-sdk/commit/300c1f497f0334c0b4bab26b92dbfa86f539ef79))
|
|
60
|
+
* **internal:** make MCP code execution location configurable via a flag ([6c9d349](https://github.com/synapseops/graphor-typescript-sdk/commit/6c9d349e363c458e0c04b8a01679bab2d1b712e5))
|
|
61
|
+
* **internal:** move stringifyQuery implementation to internal function ([1a850c9](https://github.com/synapseops/graphor-typescript-sdk/commit/1a850c97236da08ce870eb666484986ca842d8b0))
|
|
62
|
+
* **internal:** remove mock server code ([644bd1f](https://github.com/synapseops/graphor-typescript-sdk/commit/644bd1f56c4af9570c5af4994c5c48cdb84271ee))
|
|
63
|
+
* **internal:** update agents version ([867b145](https://github.com/synapseops/graphor-typescript-sdk/commit/867b14553875fc8c339150dad698d17c1551dd13))
|
|
64
|
+
* **internal:** upgrade @modelcontextprotocol/sdk and hono ([982814b](https://github.com/synapseops/graphor-typescript-sdk/commit/982814b043d6fe92ade4a283febb60e28e2e85a2))
|
|
65
|
+
* **internal:** upgrade pnpm version ([2417ce5](https://github.com/synapseops/graphor-typescript-sdk/commit/2417ce5a71b3a43e483de6121532baf3a71f3649))
|
|
66
|
+
* **internal:** version bump ([61e1675](https://github.com/synapseops/graphor-typescript-sdk/commit/61e167518cdda73f400d2a959c5ef29a0f9265fc))
|
|
67
|
+
* **mcp:** correctly update version in sync with sdk ([ef520aa](https://github.com/synapseops/graphor-typescript-sdk/commit/ef520aa4a03ef0c45aaa7611fe28770bc8f110d7))
|
|
68
|
+
* update mock server docs ([ecd27ed](https://github.com/synapseops/graphor-typescript-sdk/commit/ecd27ed8935b8e62d4ac504e5e9f2dca82471de9))
|
|
69
|
+
|
|
3
70
|
## 0.12.2 (2026-02-26)
|
|
4
71
|
|
|
5
72
|
Full Changelog: [v0.12.1...v0.12.2](https://github.com/synapseops/graphor-typescript-sdk/compare/v0.12.1...v0.12.2)
|
package/README.md
CHANGED
|
@@ -398,8 +398,19 @@ https://mcp.graphor.workers.dev/sse
|
|
|
398
398
|
|
|
399
399
|
**Web apps (e.g. Claude.ai)** — in Claude.ai, go to **Settings > Connectors > Add custom connector**, fill in the name and the remote MCP server URL. You will be redirected to log in through the OAuth flow:
|
|
400
400
|
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
The full API of this library can be found in [api.md](api.md).
|
|
402
|
+
|
|
403
|
+
<!-- prettier-ignore -->
|
|
404
|
+
```js
|
|
405
|
+
import Graphor from 'graphor';
|
|
406
|
+
|
|
407
|
+
const client = new Graphor({
|
|
408
|
+
apiKey: process.env['GRAPHOR_API_KEY'], // This is the default and can be omitted
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
const response = await client.sources.ingestURL({ url: 'url' });
|
|
412
|
+
|
|
413
|
+
console.log(response.build_id);
|
|
403
414
|
```
|
|
404
415
|
|
|
405
416
|
**Desktop clients (e.g. Claude Desktop)** — use [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) as a local proxy:
|
|
@@ -427,50 +438,328 @@ const client = new MultiServerMCPClient({
|
|
|
427
438
|
}
|
|
428
439
|
});
|
|
429
440
|
|
|
430
|
-
const
|
|
431
|
-
|
|
441
|
+
const params: Graphor.SourceIngestURLParams = { url: 'url' };
|
|
442
|
+
const response: Graphor.SourceIngestURLResponse = await client.sources.ingestURL(params);
|
|
432
443
|
```
|
|
433
444
|
|
|
434
|
-
|
|
445
|
+
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
435
446
|
|
|
436
|
-
##
|
|
447
|
+
## File uploads
|
|
437
448
|
|
|
438
|
-
|
|
449
|
+
Request parameters that correspond to file uploads can be passed in many different forms:
|
|
450
|
+
|
|
451
|
+
- `File` (or an object with the same structure)
|
|
452
|
+
- a `fetch` `Response` (or an object with the same structure)
|
|
453
|
+
- an `fs.ReadStream`
|
|
454
|
+
- the return value of our `toFile` helper
|
|
439
455
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
| `sources.uploadUrl()` | Upload from web URL | [📖](https://docs.graphorlm.com/sdk/sources/upload#upload-from-url) |
|
|
444
|
-
| `sources.uploadGithub()` | Upload from GitHub | [📖](https://docs.graphorlm.com/sdk/sources/upload#upload-from-github) |
|
|
445
|
-
| `sources.uploadYoutube()` | Upload from YouTube | [📖](https://docs.graphorlm.com/sdk/sources/upload#upload-from-youtube) |
|
|
446
|
-
| `sources.parse()` | Reprocess with different method | [📖](https://docs.graphorlm.com/sdk/sources/process) |
|
|
447
|
-
| `sources.list()` | List all sources | [📖](https://docs.graphorlm.com/sdk/sources/list) |
|
|
448
|
-
| `sources.delete()` | Delete a source | [📖](https://docs.graphorlm.com/sdk/sources/delete) |
|
|
449
|
-
| `sources.loadElements()` | Get parsed elements | [📖](https://docs.graphorlm.com/sdk/sources/list-elements) |
|
|
456
|
+
```ts
|
|
457
|
+
import fs from 'fs';
|
|
458
|
+
import Graphor, { toFile } from 'graphor';
|
|
450
459
|
|
|
451
|
-
|
|
460
|
+
const client = new Graphor();
|
|
452
461
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
| `sources.ask()` | Ask questions about documents | [📖](https://docs.graphorlm.com/sdk/chat) |
|
|
456
|
-
| `sources.extract()` | Extract structured data | [📖](https://docs.graphorlm.com/sdk/extract) |
|
|
457
|
-
| `sources.retrieveChunks()` | Retrieve chunks for RAG | [📖](https://docs.graphorlm.com/sdk/prebuilt-rag) |
|
|
462
|
+
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
|
|
463
|
+
await client.sources.ingestFile({ file: fs.createReadStream('/path/to/file') });
|
|
458
464
|
|
|
459
|
-
|
|
465
|
+
// Or if you have the web `File` API you can pass a `File` instance:
|
|
466
|
+
await client.sources.ingestFile({ file: new File(['my bytes'], 'file') });
|
|
460
467
|
|
|
461
|
-
|
|
468
|
+
// You can also pass a `fetch` `Response`:
|
|
469
|
+
await client.sources.ingestFile({ file: await fetch('https://somesite/file') });
|
|
462
470
|
|
|
463
|
-
|
|
464
|
-
|
|
471
|
+
// Finally, if none of the above are convenient, you can use our `toFile` helper:
|
|
472
|
+
await client.sources.ingestFile({ file: await toFile(Buffer.from('my bytes'), 'file') });
|
|
473
|
+
await client.sources.ingestFile({ file: await toFile(new Uint8Array([0, 1, 2]), 'file') });
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
## Handling errors
|
|
477
|
+
|
|
478
|
+
When the library is unable to connect to the API,
|
|
479
|
+
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
|
|
480
|
+
a subclass of `APIError` will be thrown:
|
|
481
|
+
|
|
482
|
+
<!-- prettier-ignore -->
|
|
483
|
+
```ts
|
|
484
|
+
const response = await client.sources.ingestURL({ url: 'url' }).catch(async (err) => {
|
|
485
|
+
if (err instanceof Graphor.APIError) {
|
|
486
|
+
console.log(err.status); // 400
|
|
487
|
+
console.log(err.name); // BadRequestError
|
|
488
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
489
|
+
} else {
|
|
490
|
+
throw err;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
Error codes are as follows:
|
|
496
|
+
|
|
497
|
+
| Status Code | Error Type |
|
|
498
|
+
| ----------- | -------------------------- |
|
|
499
|
+
| 400 | `BadRequestError` |
|
|
500
|
+
| 401 | `AuthenticationError` |
|
|
501
|
+
| 403 | `PermissionDeniedError` |
|
|
502
|
+
| 404 | `NotFoundError` |
|
|
503
|
+
| 422 | `UnprocessableEntityError` |
|
|
504
|
+
| 429 | `RateLimitError` |
|
|
505
|
+
| >=500 | `InternalServerError` |
|
|
506
|
+
| N/A | `APIConnectionError` |
|
|
507
|
+
|
|
508
|
+
### Retries
|
|
509
|
+
|
|
510
|
+
Certain errors will be automatically retried 0 times by default, with a short exponential backoff.
|
|
511
|
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
512
|
+
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
513
|
+
|
|
514
|
+
You can use the `maxRetries` option to configure or disable this:
|
|
515
|
+
|
|
516
|
+
<!-- prettier-ignore -->
|
|
517
|
+
```js
|
|
518
|
+
// Configure the default for all requests:
|
|
519
|
+
const client = new Graphor({
|
|
520
|
+
maxRetries: 0, // default is 2
|
|
521
|
+
});
|
|
465
522
|
|
|
523
|
+
// Or, configure per-request:
|
|
524
|
+
await client.sources.ingestURL({ url: 'url' }, {
|
|
525
|
+
maxRetries: 5,
|
|
526
|
+
});
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### Timeouts
|
|
530
|
+
|
|
531
|
+
Requests time out after 10 minutes by default. You can configure this with a `timeout` option:
|
|
532
|
+
|
|
533
|
+
<!-- prettier-ignore -->
|
|
534
|
+
```ts
|
|
535
|
+
// Configure the default for all requests:
|
|
536
|
+
const client = new Graphor({
|
|
537
|
+
timeout: 20 * 1000, // 20 seconds (default is 10 minutes)
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
// Override per-request:
|
|
541
|
+
await client.sources.ingestURL({ url: 'url' }, {
|
|
542
|
+
timeout: 5 * 1000,
|
|
543
|
+
});
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
On timeout, an `APIConnectionTimeoutError` is thrown.
|
|
547
|
+
|
|
548
|
+
Note that requests which time out will be [retried twice by default](#retries).
|
|
549
|
+
|
|
550
|
+
## Advanced Usage
|
|
551
|
+
|
|
552
|
+
### Accessing raw Response data (e.g., headers)
|
|
553
|
+
|
|
554
|
+
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
555
|
+
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
|
|
556
|
+
|
|
557
|
+
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
558
|
+
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
|
|
559
|
+
|
|
560
|
+
<!-- prettier-ignore -->
|
|
561
|
+
```ts
|
|
466
562
|
const client = new Graphor();
|
|
467
563
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
564
|
+
const response = await client.sources.ingestURL({ url: 'url' }).asResponse();
|
|
565
|
+
console.log(response.headers.get('X-My-Header'));
|
|
566
|
+
console.log(response.statusText); // access the underlying Response object
|
|
567
|
+
|
|
568
|
+
const { data: response, response: raw } = await client.sources
|
|
569
|
+
.ingestURL({ url: 'url' })
|
|
570
|
+
.withResponse();
|
|
571
|
+
console.log(raw.headers.get('X-My-Header'));
|
|
572
|
+
console.log(response.build_id);
|
|
471
573
|
```
|
|
472
574
|
|
|
473
|
-
|
|
575
|
+
### Logging
|
|
576
|
+
|
|
577
|
+
> [!IMPORTANT]
|
|
578
|
+
> All log messages are intended for debugging only. The format and content of log messages
|
|
579
|
+
> may change between releases.
|
|
580
|
+
|
|
581
|
+
#### Log levels
|
|
582
|
+
|
|
583
|
+
The log level can be configured in two ways:
|
|
584
|
+
|
|
585
|
+
1. Via the `GRAPHOR_LOG` environment variable
|
|
586
|
+
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
587
|
+
|
|
588
|
+
```ts
|
|
589
|
+
import Graphor from 'graphor';
|
|
590
|
+
|
|
591
|
+
const client = new Graphor({
|
|
592
|
+
logLevel: 'debug', // Show all log messages
|
|
593
|
+
});
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
Available log levels, from most to least verbose:
|
|
597
|
+
|
|
598
|
+
- `'debug'` - Show debug messages, info, warnings, and errors
|
|
599
|
+
- `'info'` - Show info messages, warnings, and errors
|
|
600
|
+
- `'warn'` - Show warnings and errors (default)
|
|
601
|
+
- `'error'` - Show only errors
|
|
602
|
+
- `'off'` - Disable all logging
|
|
603
|
+
|
|
604
|
+
At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
|
|
605
|
+
Some authentication-related headers are redacted, but sensitive data in request and response bodies
|
|
606
|
+
may still be visible.
|
|
607
|
+
|
|
608
|
+
#### Custom logger
|
|
609
|
+
|
|
610
|
+
By default, this library logs to `globalThis.console`. You can also provide a custom logger.
|
|
611
|
+
Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
|
|
612
|
+
|
|
613
|
+
When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
|
|
614
|
+
below the configured level will not be sent to your logger.
|
|
615
|
+
|
|
616
|
+
```ts
|
|
617
|
+
import Graphor from 'graphor';
|
|
618
|
+
import pino from 'pino';
|
|
619
|
+
|
|
620
|
+
const logger = pino();
|
|
621
|
+
|
|
622
|
+
const client = new Graphor({
|
|
623
|
+
logger: logger.child({ name: 'Graphor' }),
|
|
624
|
+
logLevel: 'debug', // Send all messages to pino, allowing it to filter
|
|
625
|
+
});
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Making custom/undocumented requests
|
|
629
|
+
|
|
630
|
+
This library is typed for convenient access to the documented API. If you need to access undocumented
|
|
631
|
+
endpoints, params, or response properties, the library can still be used.
|
|
632
|
+
|
|
633
|
+
#### Undocumented endpoints
|
|
634
|
+
|
|
635
|
+
To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
|
|
636
|
+
Options on the client, such as retries, will be respected when making these requests.
|
|
637
|
+
|
|
638
|
+
```ts
|
|
639
|
+
await client.post('/some/path', {
|
|
640
|
+
body: { some_prop: 'foo' },
|
|
641
|
+
query: { some_query_arg: 'bar' },
|
|
642
|
+
});
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
#### Undocumented request params
|
|
646
|
+
|
|
647
|
+
To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
|
|
648
|
+
parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
|
|
649
|
+
send will be sent as-is.
|
|
650
|
+
|
|
651
|
+
```ts
|
|
652
|
+
client.sources.ingestURL({
|
|
653
|
+
// ...
|
|
654
|
+
// @ts-expect-error baz is not yet public
|
|
655
|
+
baz: 'undocumented option',
|
|
656
|
+
});
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
|
|
660
|
+
extra param in the body.
|
|
661
|
+
|
|
662
|
+
If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
|
|
663
|
+
options.
|
|
664
|
+
|
|
665
|
+
#### Undocumented response properties
|
|
666
|
+
|
|
667
|
+
To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
|
|
668
|
+
the response object, or cast the response object to the requisite type. Like the request params, we do not
|
|
669
|
+
validate or strip extra properties from the response from the API.
|
|
670
|
+
|
|
671
|
+
### Customizing the fetch client
|
|
672
|
+
|
|
673
|
+
By default, this library expects a global `fetch` function is defined.
|
|
674
|
+
|
|
675
|
+
If you want to use a different `fetch` function, you can either polyfill the global:
|
|
676
|
+
|
|
677
|
+
```ts
|
|
678
|
+
import fetch from 'my-fetch';
|
|
679
|
+
|
|
680
|
+
globalThis.fetch = fetch;
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
Or pass it to the client:
|
|
684
|
+
|
|
685
|
+
```ts
|
|
686
|
+
import Graphor from 'graphor';
|
|
687
|
+
import fetch from 'my-fetch';
|
|
688
|
+
|
|
689
|
+
const client = new Graphor({ fetch });
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Fetch options
|
|
693
|
+
|
|
694
|
+
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
|
|
695
|
+
|
|
696
|
+
```ts
|
|
697
|
+
import Graphor from 'graphor';
|
|
698
|
+
|
|
699
|
+
const client = new Graphor({
|
|
700
|
+
fetchOptions: {
|
|
701
|
+
// `RequestInit` options
|
|
702
|
+
},
|
|
703
|
+
});
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
#### Configuring proxies
|
|
707
|
+
|
|
708
|
+
To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
|
|
709
|
+
options to requests:
|
|
710
|
+
|
|
711
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
|
|
712
|
+
|
|
713
|
+
```ts
|
|
714
|
+
import Graphor from 'graphor';
|
|
715
|
+
import * as undici from 'undici';
|
|
716
|
+
|
|
717
|
+
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
|
|
718
|
+
const client = new Graphor({
|
|
719
|
+
fetchOptions: {
|
|
720
|
+
dispatcher: proxyAgent,
|
|
721
|
+
},
|
|
722
|
+
});
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
|
|
726
|
+
|
|
727
|
+
```ts
|
|
728
|
+
import Graphor from 'graphor';
|
|
729
|
+
|
|
730
|
+
const client = new Graphor({
|
|
731
|
+
fetchOptions: {
|
|
732
|
+
proxy: 'http://localhost:8888',
|
|
733
|
+
},
|
|
734
|
+
});
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
|
|
738
|
+
|
|
739
|
+
```ts
|
|
740
|
+
import Graphor from 'npm:graphor';
|
|
741
|
+
|
|
742
|
+
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
|
|
743
|
+
const client = new Graphor({
|
|
744
|
+
fetchOptions: {
|
|
745
|
+
client: httpClient,
|
|
746
|
+
},
|
|
747
|
+
});
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
## Frequently Asked Questions
|
|
751
|
+
|
|
752
|
+
## Semantic versioning
|
|
753
|
+
|
|
754
|
+
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
755
|
+
|
|
756
|
+
1. Changes that only affect static types, without breaking runtime behavior.
|
|
757
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
758
|
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
759
|
+
|
|
760
|
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
761
|
+
|
|
762
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/synapseops/graphor-typescript-sdk/issues) with questions, bugs, or suggestions.
|
|
474
763
|
|
|
475
764
|
## Requirements
|
|
476
765
|
|
package/client.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Errors from "./core/error.mjs";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.mjs";
|
|
7
7
|
import * as API from "./resources/index.mjs";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { Element, Method, PublicSource, SourceAskParams, SourceAskResponse, SourceDeleteParams, SourceDeleteResponse, SourceExtractParams, SourceExtractResponse, SourceGetBuildStatusParams, SourceGetBuildStatusResponse, SourceGetElementsParams, SourceGetElementsResponse, SourceIngestFileParams, SourceIngestFileResponse, SourceIngestGitHubParams, SourceIngestGitHubResponse, SourceIngestURLParams, SourceIngestURLResponse, SourceIngestYoutubeParams, SourceIngestYoutubeResponse, SourceListParams, SourceListResponse, SourceReprocessParams, SourceReprocessResponse, SourceRetrieveChunksParams, SourceRetrieveChunksResponse, Sources } from "./resources/sources.mjs";
|
|
10
10
|
import { type Fetch } from "./internal/builtin-types.mjs";
|
|
11
11
|
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
|
12
12
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
|
@@ -112,10 +112,7 @@ export declare class Graphor {
|
|
|
112
112
|
protected defaultQuery(): Record<string, string | undefined> | undefined;
|
|
113
113
|
protected validateHeaders({ values, nulls }: NullableHeaders): void;
|
|
114
114
|
protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
|
|
115
|
-
|
|
116
|
-
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
117
|
-
*/
|
|
118
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
115
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string;
|
|
119
116
|
private getUserAgent;
|
|
120
117
|
protected defaultIdempotencyKey(): string;
|
|
121
118
|
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
|
@@ -176,6 +173,6 @@ export declare class Graphor {
|
|
|
176
173
|
}
|
|
177
174
|
export declare namespace Graphor {
|
|
178
175
|
export type RequestOptions = Opts.RequestOptions;
|
|
179
|
-
export { Sources as Sources, type
|
|
176
|
+
export { Sources as Sources, type Element as Element, type Method as Method, type PublicSource as PublicSource, type SourceListResponse as SourceListResponse, type SourceDeleteResponse as SourceDeleteResponse, type SourceAskResponse as SourceAskResponse, type SourceExtractResponse as SourceExtractResponse, type SourceGetBuildStatusResponse as SourceGetBuildStatusResponse, type SourceGetElementsResponse as SourceGetElementsResponse, type SourceIngestFileResponse as SourceIngestFileResponse, type SourceIngestGitHubResponse as SourceIngestGitHubResponse, type SourceIngestURLResponse as SourceIngestURLResponse, type SourceIngestYoutubeResponse as SourceIngestYoutubeResponse, type SourceReprocessResponse as SourceReprocessResponse, type SourceRetrieveChunksResponse as SourceRetrieveChunksResponse, type SourceListParams as SourceListParams, type SourceDeleteParams as SourceDeleteParams, type SourceAskParams as SourceAskParams, type SourceExtractParams as SourceExtractParams, type SourceGetBuildStatusParams as SourceGetBuildStatusParams, type SourceGetElementsParams as SourceGetElementsParams, type SourceIngestFileParams as SourceIngestFileParams, type SourceIngestGitHubParams as SourceIngestGitHubParams, type SourceIngestURLParams as SourceIngestURLParams, type SourceIngestYoutubeParams as SourceIngestYoutubeParams, type SourceReprocessParams as SourceReprocessParams, type SourceRetrieveChunksParams as SourceRetrieveChunksParams, };
|
|
180
177
|
}
|
|
181
178
|
//# sourceMappingURL=client.d.mts.map
|
package/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EACL,OAAO,EACP,MAAM,EACN,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,OAAO,EACR;OACM,EAAE,KAAK,KAAK,EAAE;OACd,EAAE,WAAW,EAAE,eAAe,EAAgB;OAC9C,EAAE,mBAAmB,EAAE,cAAc,EAAE;OAEvC,EACL,KAAK,QAAQ,EACb,KAAK,MAAM,EAIZ;AAGD,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B;;;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C/C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
package/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Errors from "./core/error.js";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.js";
|
|
7
7
|
import * as API from "./resources/index.js";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Element, Method, PublicSource, SourceAskParams, SourceAskResponse, SourceDeleteParams, SourceDeleteResponse, SourceExtractParams, SourceExtractResponse, SourceGetBuildStatusParams, SourceGetBuildStatusResponse, SourceGetElementsParams, SourceGetElementsResponse, SourceIngestFileParams, SourceIngestFileResponse, SourceIngestGitHubParams, SourceIngestGitHubResponse, SourceIngestURLParams, SourceIngestURLResponse, SourceIngestYoutubeParams, SourceIngestYoutubeResponse, SourceListParams, SourceListResponse, SourceReprocessParams, SourceReprocessResponse, SourceRetrieveChunksParams, SourceRetrieveChunksResponse, Sources } from "./resources/sources.js";
|
|
10
10
|
import { type Fetch } from "./internal/builtin-types.js";
|
|
11
11
|
import { HeadersLike, NullableHeaders } from "./internal/headers.js";
|
|
12
12
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
|
|
@@ -112,10 +112,7 @@ export declare class Graphor {
|
|
|
112
112
|
protected defaultQuery(): Record<string, string | undefined> | undefined;
|
|
113
113
|
protected validateHeaders({ values, nulls }: NullableHeaders): void;
|
|
114
114
|
protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
|
|
115
|
-
|
|
116
|
-
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
117
|
-
*/
|
|
118
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
115
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string;
|
|
119
116
|
private getUserAgent;
|
|
120
117
|
protected defaultIdempotencyKey(): string;
|
|
121
118
|
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
|
@@ -176,6 +173,6 @@ export declare class Graphor {
|
|
|
176
173
|
}
|
|
177
174
|
export declare namespace Graphor {
|
|
178
175
|
export type RequestOptions = Opts.RequestOptions;
|
|
179
|
-
export { Sources as Sources, type
|
|
176
|
+
export { Sources as Sources, type Element as Element, type Method as Method, type PublicSource as PublicSource, type SourceListResponse as SourceListResponse, type SourceDeleteResponse as SourceDeleteResponse, type SourceAskResponse as SourceAskResponse, type SourceExtractResponse as SourceExtractResponse, type SourceGetBuildStatusResponse as SourceGetBuildStatusResponse, type SourceGetElementsResponse as SourceGetElementsResponse, type SourceIngestFileResponse as SourceIngestFileResponse, type SourceIngestGitHubResponse as SourceIngestGitHubResponse, type SourceIngestURLResponse as SourceIngestURLResponse, type SourceIngestYoutubeResponse as SourceIngestYoutubeResponse, type SourceReprocessResponse as SourceReprocessResponse, type SourceRetrieveChunksResponse as SourceRetrieveChunksResponse, type SourceListParams as SourceListParams, type SourceDeleteParams as SourceDeleteParams, type SourceAskParams as SourceAskParams, type SourceExtractParams as SourceExtractParams, type SourceGetBuildStatusParams as SourceGetBuildStatusParams, type SourceGetElementsParams as SourceGetElementsParams, type SourceIngestFileParams as SourceIngestFileParams, type SourceIngestGitHubParams as SourceIngestGitHubParams, type SourceIngestURLParams as SourceIngestURLParams, type SourceIngestYoutubeParams as SourceIngestYoutubeParams, type SourceReprocessParams as SourceReprocessParams, type SourceRetrieveChunksParams as SourceRetrieveChunksParams, };
|
|
180
177
|
}
|
|
181
178
|
//# sourceMappingURL=client.d.ts.map
|
package/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EACL,OAAO,EACP,MAAM,EACN,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,OAAO,EACR;OACM,EAAE,KAAK,KAAK,EAAE;OACd,EAAE,WAAW,EAAE,eAAe,EAAgB;OAC9C,EAAE,mBAAmB,EAAE,cAAc,EAAE;OAEvC,EACL,KAAK,QAAQ,EACb,KAAK,MAAM,EAIZ;AAGD,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG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