├── .devcontainer ├── README.md ├── devcontainer.json └── setup.sh ├── .gitattributes ├── .github └── workflows │ ├── sdk_generation.yaml │ └── sdk_publish.yaml ├── .gitignore ├── .npmignore ├── .speakeasy ├── gen.lock ├── gen.yaml ├── workflow.lock └── workflow.yaml ├── CONTRIBUTING.md ├── FUNCTIONS.md ├── README.md ├── RELEASES.md ├── RUNTIMES.md ├── USAGE.md ├── docs ├── lib │ └── utils │ │ └── retryconfig.md ├── models │ ├── components │ │ ├── audiomodalitydata.md │ │ ├── connection.md │ │ ├── connectionbase.md │ │ ├── connectionbasemetadata.md │ │ ├── connectionlimitparams.md │ │ ├── connectionlist.md │ │ ├── connectionmetadata.md │ │ ├── connectionstats.md │ │ ├── connectorsource.md │ │ ├── connectorsourcetypeinfo.md │ │ ├── createdocumentfromurlparams.md │ │ ├── createdocumentfromurlparamsmetadata.md │ │ ├── createdocumentfromurlparamsmode.md │ │ ├── createdocumentparams.md │ │ ├── createdocumentrawparams.md │ │ ├── createdocumentrawparamsmetadata.md │ │ ├── createinstructionparams.md │ │ ├── createinstructionparamsscope.md │ │ ├── createpartitionparams.md │ │ ├── data.md │ │ ├── deleteconnectionpayload.md │ │ ├── disabledbysystemreason.md │ │ ├── document.md │ │ ├── documentchunk.md │ │ ├── documentchunkdetail.md │ │ ├── documentchunklist.md │ │ ├── documentdelete.md │ │ ├── documentfileupdate.md │ │ ├── documentget.md │ │ ├── documentgetmetadata.md │ │ ├── documentlist.md │ │ ├── documentmetadata.md │ │ ├── documentmetadataupdate.md │ │ ├── documentmetadataupdatemetadata.md │ │ ├── documentrawupdate.md │ │ ├── documentsummary.md │ │ ├── documenturlupdate.md │ │ ├── documentwithcontent.md │ │ ├── documentwithcontentmetadata.md │ │ ├── entity.md │ │ ├── entitylist.md │ │ ├── filet.md │ │ ├── instruction.md │ │ ├── link.md │ │ ├── listconnectorsourcetypeinfo.md │ │ ├── loc.md │ │ ├── mediamodeparam.md │ │ ├── metadata.md │ │ ├── modalitydata.md │ │ ├── mode.md │ │ ├── mode1.md │ │ ├── mode2.md │ │ ├── modestatic.md │ │ ├── modevideo.md │ │ ├── oauthurlcreate.md │ │ ├── oauthurlcreatemetadata.md │ │ ├── oauthurlcreatemode.md │ │ ├── oauthurlcreatemode1.md │ │ ├── oauthurlresponse.md │ │ ├── one.md │ │ ├── one1.md │ │ ├── one2.md │ │ ├── pagination.md │ │ ├── partition.md │ │ ├── partitiondetail.md │ │ ├── partitionlimitparams.md │ │ ├── partitionlimits.md │ │ ├── partitionlist.md │ │ ├── partitionstats.md │ │ ├── partitionstrategy.md │ │ ├── partitionstrategy1.md │ │ ├── patchdocumentmetadataparams.md │ │ ├── reason.md │ │ ├── responseok.md │ │ ├── retrieval.md │ │ ├── retrieveparams.md │ │ ├── scope.md │ │ ├── scoredchunk.md │ │ ├── security.md │ │ ├── setconnectionenabledpayload.md │ │ ├── source.md │ │ ├── static.md │ │ ├── theme.md │ │ ├── two.md │ │ ├── updatedocumentfileparams.md │ │ ├── updatedocumentfileparams11.md │ │ ├── updatedocumentfileparams12.md │ │ ├── updatedocumentfileparamsfile.md │ │ ├── updatedocumentfileparamsmode.md │ │ ├── updatedocumentfileparamsmode1.md │ │ ├── updatedocumentfileparamsmodestatic.md │ │ ├── updatedocumentfileparamsmodevideo.md │ │ ├── updatedocumentfromurlparams.md │ │ ├── updatedocumentfromurlparamsmode.md │ │ ├── updatedocumentfromurlparamsmode1.md │ │ ├── updatedocumentrawparams.md │ │ ├── updatedocumentrawparamsdata.md │ │ ├── updateinstructionparams.md │ │ ├── validationerror.md │ │ ├── video.md │ │ ├── videomodalitydata.md │ │ └── wordtimestamp.md │ ├── errors │ │ ├── errormessage.md │ │ └── httpvalidationerror.md │ └── operations │ │ ├── deleteconnectionconnectionsconnectioniddeletepostrequest.md │ │ ├── deletedocumentrequest.md │ │ ├── deleteinstructionrequest.md │ │ ├── deletepartitionpartitionspartitioniddeleterequest.md │ │ ├── getconnectionconnectionsconnectionidgetrequest.md │ │ ├── getconnectionstatsconnectionsconnectionidstatsgetrequest.md │ │ ├── getdocumentchunkcontentrequest.md │ │ ├── getdocumentchunkrequest.md │ │ ├── getdocumentchunksrequest.md │ │ ├── getdocumentcontentrequest.md │ │ ├── getdocumentrequest.md │ │ ├── getdocumentsourcerequest.md │ │ ├── getdocumentsummaryrequest.md │ │ ├── getpartitionpartitionspartitionidgetrequest.md │ │ ├── listconnectionsconnectionsgetrequest.md │ │ ├── listconnectionsconnectionsgetresponse.md │ │ ├── listdocumentsrequest.md │ │ ├── listdocumentsresponse.md │ │ ├── listentitiesbydocumentrequest.md │ │ ├── listentitiesbydocumentresponse.md │ │ ├── listentitiesbyinstructionrequest.md │ │ ├── listentitiesbyinstructionresponse.md │ │ ├── listpartitionspartitionsgetrequest.md │ │ ├── listpartitionspartitionsgetresponse.md │ │ ├── mediatype.md │ │ ├── one.md │ │ ├── patchdocumentmetadatarequest.md │ │ ├── queryparammediatype.md │ │ ├── setconnectionenabledconnectionsconnectionidenabledputrequest.md │ │ ├── setconnectionlimitsconnectionsconnectionidlimitputrequest.md │ │ ├── setpartitionlimitspartitionspartitionidlimitsputrequest.md │ │ ├── syncconnectionrequest.md │ │ ├── updateconnectionconnectionsconnectionidputrequest.md │ │ ├── updatedocumentfilerequest.md │ │ ├── updatedocumentfromurlrequest.md │ │ ├── updatedocumentrawrequest.md │ │ └── updateinstructionrequest.md └── sdks │ ├── connections │ └── README.md │ ├── documents │ └── README.md │ ├── entities │ └── README.md │ ├── partitions │ └── README.md │ ├── ragie │ └── README.md │ └── retrievals │ └── README.md ├── eslint.config.mjs ├── jsr.json ├── package-lock.json ├── package.json ├── src ├── core.ts ├── funcs │ ├── connectionsCreateOAuthRedirectUrl.ts │ ├── connectionsDelete.ts │ ├── connectionsGet.ts │ ├── connectionsGetStats.ts │ ├── connectionsList.ts │ ├── connectionsListConnectionSourceTypes.ts │ ├── connectionsSetEnabled.ts │ ├── connectionsSetLimits.ts │ ├── connectionsSync.ts │ ├── connectionsUpdate.ts │ ├── documentsCreate.ts │ ├── documentsCreateDocumentFromUrl.ts │ ├── documentsCreateRaw.ts │ ├── documentsDelete.ts │ ├── documentsGet.ts │ ├── documentsGetChunk.ts │ ├── documentsGetChunkContent.ts │ ├── documentsGetChunks.ts │ ├── documentsGetContent.ts │ ├── documentsGetSource.ts │ ├── documentsGetSummary.ts │ ├── documentsList.ts │ ├── documentsPatchMetadata.ts │ ├── documentsUpdateDocumentFromUrl.ts │ ├── documentsUpdateFile.ts │ ├── documentsUpdateRaw.ts │ ├── entitiesCreateInstruction.ts │ ├── entitiesDelete.ts │ ├── entitiesListByDocument.ts │ ├── entitiesListByInstruction.ts │ ├── entitiesListInstructions.ts │ ├── entitiesUpdateInstruction.ts │ ├── partitionsCreate.ts │ ├── partitionsDelete.ts │ ├── partitionsGet.ts │ ├── partitionsList.ts │ ├── partitionsSetLimits.ts │ └── retrievalsRetrieve.ts ├── hooks │ ├── hooks.ts │ ├── index.ts │ └── types.ts ├── index.ts ├── lib │ ├── base64.ts │ ├── config.ts │ ├── dlv.ts │ ├── encodings.ts │ ├── files.ts │ ├── http.ts │ ├── is-plain-object.ts │ ├── logger.ts │ ├── matchers.ts │ ├── primitives.ts │ ├── retries.ts │ ├── schemas.ts │ ├── sdks.ts │ ├── security.ts │ └── url.ts ├── mcp-server │ ├── build.mts │ ├── cli.ts │ ├── cli │ │ └── start │ │ │ ├── command.ts │ │ │ └── impl.ts │ ├── console-logger.ts │ ├── extensions.ts │ ├── mcp-server.ts │ ├── prompts.ts │ ├── resources.ts │ ├── scopes.ts │ ├── server.ts │ ├── shared.ts │ ├── tools.ts │ └── tools │ │ ├── connectionsCreateOAuthRedirectUrl.ts │ │ ├── connectionsDelete.ts │ │ ├── connectionsGet.ts │ │ ├── connectionsGetStats.ts │ │ ├── connectionsList.ts │ │ ├── connectionsListConnectionSourceTypes.ts │ │ ├── connectionsSetEnabled.ts │ │ ├── connectionsSetLimits.ts │ │ ├── connectionsSync.ts │ │ ├── connectionsUpdate.ts │ │ ├── documentsCreate.ts │ │ ├── documentsCreateDocumentFromUrl.ts │ │ ├── documentsCreateRaw.ts │ │ ├── documentsDelete.ts │ │ ├── documentsGet.ts │ │ ├── documentsGetChunk.ts │ │ ├── documentsGetChunkContent.ts │ │ ├── documentsGetChunks.ts │ │ ├── documentsGetContent.ts │ │ ├── documentsGetSource.ts │ │ ├── documentsGetSummary.ts │ │ ├── documentsList.ts │ │ ├── documentsPatchMetadata.ts │ │ ├── documentsUpdateDocumentFromUrl.ts │ │ ├── documentsUpdateFile.ts │ │ ├── documentsUpdateRaw.ts │ │ ├── entitiesCreateInstruction.ts │ │ ├── entitiesDelete.ts │ │ ├── entitiesListByDocument.ts │ │ ├── entitiesListByInstruction.ts │ │ ├── entitiesListInstructions.ts │ │ ├── entitiesUpdateInstruction.ts │ │ ├── partitionsCreate.ts │ │ ├── partitionsDelete.ts │ │ ├── partitionsGet.ts │ │ ├── partitionsList.ts │ │ ├── partitionsSetLimits.ts │ │ └── retrievalsRetrieve.ts ├── models │ ├── components │ │ ├── audiomodalitydata.ts │ │ ├── connection.ts │ │ ├── connectionbase.ts │ │ ├── connectionlimitparams.ts │ │ ├── connectionlist.ts │ │ ├── connectionstats.ts │ │ ├── connectorsource.ts │ │ ├── connectorsourcetypeinfo.ts │ │ ├── createdocumentfromurlparams.ts │ │ ├── createdocumentparams.ts │ │ ├── createdocumentrawparams.ts │ │ ├── createinstructionparams.ts │ │ ├── createpartitionparams.ts │ │ ├── deleteconnectionpayload.ts │ │ ├── document.ts │ │ ├── documentchunk.ts │ │ ├── documentchunkdetail.ts │ │ ├── documentchunklist.ts │ │ ├── documentdelete.ts │ │ ├── documentfileupdate.ts │ │ ├── documentget.ts │ │ ├── documentlist.ts │ │ ├── documentmetadataupdate.ts │ │ ├── documentrawupdate.ts │ │ ├── documentsummary.ts │ │ ├── documenturlupdate.ts │ │ ├── documentwithcontent.ts │ │ ├── entity.ts │ │ ├── entitylist.ts │ │ ├── index.ts │ │ ├── instruction.ts │ │ ├── link.ts │ │ ├── listconnectorsourcetypeinfo.ts │ │ ├── mediamodeparam.ts │ │ ├── oauthurlcreate.ts │ │ ├── oauthurlresponse.ts │ │ ├── pagination.ts │ │ ├── partition.ts │ │ ├── partitiondetail.ts │ │ ├── partitionlimitparams.ts │ │ ├── partitionlimits.ts │ │ ├── partitionlist.ts │ │ ├── partitionstats.ts │ │ ├── patchdocumentmetadataparams.ts │ │ ├── responseok.ts │ │ ├── retrieval.ts │ │ ├── retrieveparams.ts │ │ ├── scoredchunk.ts │ │ ├── security.ts │ │ ├── setconnectionenabledpayload.ts │ │ ├── updatedocumentfileparams.ts │ │ ├── updatedocumentfromurlparams.ts │ │ ├── updatedocumentrawparams.ts │ │ ├── updateinstructionparams.ts │ │ ├── validationerror.ts │ │ ├── videomodalitydata.ts │ │ └── wordtimestamp.ts │ ├── errors │ │ ├── errormessage.ts │ │ ├── httpclienterrors.ts │ │ ├── httpvalidationerror.ts │ │ ├── index.ts │ │ ├── sdkerror.ts │ │ └── sdkvalidationerror.ts │ └── operations │ │ ├── deleteconnectionconnectionsconnectioniddeletepost.ts │ │ ├── deletedocument.ts │ │ ├── deleteinstruction.ts │ │ ├── deletepartitionpartitionspartitioniddelete.ts │ │ ├── getconnectionconnectionsconnectionidget.ts │ │ ├── getconnectionstatsconnectionsconnectionidstatsget.ts │ │ ├── getdocument.ts │ │ ├── getdocumentchunk.ts │ │ ├── getdocumentchunkcontent.ts │ │ ├── getdocumentchunks.ts │ │ ├── getdocumentcontent.ts │ │ ├── getdocumentsource.ts │ │ ├── getdocumentsummary.ts │ │ ├── getpartitionpartitionspartitionidget.ts │ │ ├── index.ts │ │ ├── listconnectionsconnectionsget.ts │ │ ├── listdocuments.ts │ │ ├── listentitiesbydocument.ts │ │ ├── listentitiesbyinstruction.ts │ │ ├── listpartitionspartitionsget.ts │ │ ├── patchdocumentmetadata.ts │ │ ├── setconnectionenabledconnectionsconnectionidenabledput.ts │ │ ├── setconnectionlimitsconnectionsconnectionidlimitput.ts │ │ ├── setpartitionlimitspartitionspartitionidlimitsput.ts │ │ ├── syncconnection.ts │ │ ├── updateconnectionconnectionsconnectionidput.ts │ │ ├── updatedocumentfile.ts │ │ ├── updatedocumentfromurl.ts │ │ ├── updatedocumentraw.ts │ │ └── updateinstruction.ts ├── sdk │ ├── connections.ts │ ├── documents.ts │ ├── entities.ts │ ├── index.ts │ ├── partitions.ts │ ├── retrievals.ts │ └── sdk.ts └── types │ ├── async.ts │ ├── blobs.ts │ ├── constdatetime.ts │ ├── enums.ts │ ├── fp.ts │ ├── index.ts │ ├── operations.ts │ ├── rfcdate.ts │ └── streams.ts └── tsconfig.json /.devcontainer/README.md: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 | 7 | > **Remember to shutdown a GitHub Codespace when it is not in use!** 8 | 9 | # Dev Containers Quick Start 10 | 11 | The default location for usage snippets is the `samples` directory. 12 | 13 | ## Running a Usage Sample 14 | 15 | A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below. 16 | 17 | ``` 18 | ts-node root.ts 19 | ``` 20 | 21 | ## Generating Additional Usage Samples 22 | 23 | The speakeasy CLI allows you to generate more usage snippets. Here's how: 24 | 25 | - To generate a sample for a specific operation by providing an operation ID, use: 26 | 27 | ``` 28 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l typescript -i {INPUT_OPERATION_ID} -o ./samples 29 | ``` 30 | 31 | - To generate samples for an entire namespace (like a tag or group name), use: 32 | 33 | ``` 34 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l typescript -n {INPUT_TAG_NAME} -o ./samples 35 | ``` 36 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/images/tree/main/src/typescript-node 3 | { 4 | "name": "TypeScript", 5 | "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", 6 | // Features to add to the dev container. More info: https://containers.dev/features. 7 | // "features": {}, 8 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 9 | // "forwardPorts": [], 10 | // Use 'postCreateCommand' to run commands after the container is created. 11 | "postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh", 12 | "customizations": { 13 | "vscode": { 14 | "extensions": [ 15 | "ms-vscode.vscode-typescript-tslint-plugin", 16 | "esbenp.prettier-vscode", 17 | "github.vscode-pull-request-github" 18 | ], 19 | "settings": { 20 | "files.eol": "\n", 21 | "editor.formatOnSave": true, 22 | "typescript.tsc.autoDetect": "on", 23 | "typescript.updateImportsOnFileMove.enabled": "always", 24 | "typescript.preferences.importModuleSpecifier": "relative", 25 | "[typescript]": { 26 | "editor.codeActionsOnSave": { 27 | "source.organizeImports": true 28 | } 29 | }, 30 | "[typescriptreact]": { 31 | "editor.codeActionsOnSave": { 32 | "source.organizeImports": true 33 | } 34 | } 35 | } 36 | }, 37 | "codespaces": { 38 | "openFiles": [ 39 | ".devcontainer/README.md" 40 | ] 41 | } 42 | } 43 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 44 | // "remoteUser": "root" 45 | } 46 | -------------------------------------------------------------------------------- /.devcontainer/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install the speakeasy CLI 4 | curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh 5 | 6 | # Setup samples directory 7 | rmdir samples || true 8 | mkdir samples 9 | 10 | npm install 11 | npm install -g ts-node 12 | npm link 13 | npm link ragie 14 | TS_CONFIG_CONTENT=$(cat < samples/tsconfig.json 28 | 29 | # Generate starter usage sample with speakeasy 30 | speakeasy generate usage -s https://api.ragie.ai/openapi.json -l typescript -o samples/root.ts -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # This allows generated code to be indexed correctly 2 | *.ts linguist-generated=false -------------------------------------------------------------------------------- /.github/workflows/sdk_generation.yaml: -------------------------------------------------------------------------------- 1 | name: Generate 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | workflow_dispatch: 9 | inputs: 10 | force: 11 | description: Force generation of SDKs 12 | type: boolean 13 | default: false 14 | set_version: 15 | description: optionally set a specific SDK version 16 | type: string 17 | schedule: 18 | - cron: 0 0 * * * 19 | jobs: 20 | generate: 21 | uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 22 | with: 23 | force: ${{ github.event.inputs.force }} 24 | mode: pr 25 | set_version: ${{ github.event.inputs.set_version }} 26 | speakeasy_version: latest 27 | secrets: 28 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 29 | npm_token: ${{ secrets.NPM_TOKEN }} 30 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 31 | -------------------------------------------------------------------------------- /.github/workflows/sdk_publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | push: 9 | branches: 10 | - main 11 | paths: 12 | - RELEASES.md 13 | - '*/RELEASES.md' 14 | jobs: 15 | publish: 16 | uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 17 | secrets: 18 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 19 | npm_token: ${{ secrets.NPM_TOKEN }} 20 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.speakeasy/temp/ 2 | **/.speakeasy/logs/ 3 | .speakeasy/temp/ 4 | .DS_Store 5 | /mcp-server 6 | /bin 7 | /.eslintcache 8 | /.speakeasy/reports 9 | /react-query 10 | /funcs 11 | /core.* 12 | /__tests__ 13 | /models 14 | /models/errors 15 | /types 16 | /node_modules 17 | /lib 18 | /sdk 19 | /hooks 20 | /index.* 21 | /cjs 22 | /esm 23 | /dist 24 | /.tsbuildinfo 25 | /.tshy 26 | /.tshy-* 27 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !/FUNCTIONS.md 3 | !/RUNTIMES.md 4 | !/REACT_QUERY.md 5 | !/**/*.ts 6 | !/**/*.js 7 | !/**/*.mjs 8 | !/**/*.json 9 | !/**/*.map 10 | 11 | /eslint.config.mjs 12 | /cjs 13 | /.tshy 14 | /.tshy-* 15 | /__tests__ 16 | -------------------------------------------------------------------------------- /.speakeasy/gen.yaml: -------------------------------------------------------------------------------- 1 | configVersion: 2.0.0 2 | generation: 3 | devContainers: 4 | enabled: true 5 | schemaPath: https://api.ragie.ai/openapi.json 6 | sdkClassName: Ragie 7 | maintainOpenAPIOrder: true 8 | usageSnippets: 9 | optionalPropertyRendering: withExample 10 | useClassNamesForArrayFields: true 11 | fixes: 12 | nameResolutionDec2023: true 13 | nameResolutionFeb2025: false 14 | parameterOrderingFeb2024: true 15 | requestResponseComponentNamesFeb2024: true 16 | securityFeb2025: false 17 | sharedErrorComponentsApr2025: false 18 | auth: 19 | oAuth2ClientCredentialsEnabled: false 20 | oAuth2PasswordEnabled: false 21 | typescript: 22 | version: 1.9.0 23 | additionalDependencies: 24 | dependencies: {} 25 | devDependencies: {} 26 | peerDependencies: {} 27 | additionalPackageJSON: {} 28 | author: Speakeasy 29 | clientServerStatusCodesAsErrors: true 30 | defaultErrorName: SDKError 31 | enableCustomCodeRegions: false 32 | enableMCPServer: true 33 | enableReactQuery: false 34 | enumFormat: union 35 | flattenGlobalSecurity: true 36 | flatteningOrder: body-first 37 | imports: 38 | option: openapi 39 | paths: 40 | callbacks: models/callbacks 41 | errors: models/errors 42 | operations: models/operations 43 | shared: models/components 44 | webhooks: models/webhooks 45 | inputModelSuffix: input 46 | jsonpath: legacy 47 | maxMethodParams: 0 48 | methodArguments: infer-optional-args 49 | moduleFormat: commonjs 50 | outputModelSuffix: output 51 | packageName: ragie 52 | responseFormat: flat 53 | templateVersion: v2 54 | useIndexModules: true 55 | -------------------------------------------------------------------------------- /.speakeasy/workflow.lock: -------------------------------------------------------------------------------- 1 | speakeasyVersion: 1.546.1 2 | sources: 3 | local: 4 | sourceNamespace: local 5 | sourceRevisionDigest: sha256:2a24058a1165507629ac601dcf654236367d325400cd8bf25d71635266b164dc 6 | sourceBlobDigest: sha256:94d9bc45794caabdeb08dc4d73ad5f18fabe58538f46bf2b80cc9f872fa9cc1a 7 | tags: 8 | - latest 9 | ragie.ai_spec: 10 | sourceNamespace: ragie-ai-spec 11 | sourceRevisionDigest: sha256:10a0e07c612b57962ee039df1d8369436ef07e9241a35cc4bf85721f740240e0 12 | sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17 13 | tags: 14 | - latest 15 | - speakeasy-sdk-regen-1745626915 16 | - 1.0.0 17 | targets: 18 | ragie: 19 | source: ragie.ai_spec 20 | sourceNamespace: ragie-ai-spec 21 | sourceRevisionDigest: sha256:10a0e07c612b57962ee039df1d8369436ef07e9241a35cc4bf85721f740240e0 22 | sourceBlobDigest: sha256:fe68f5434abcfad6ee42c75a174de0c68a315c9085c972e996f3791ec0940d17 23 | codeSamplesNamespace: ragie-ai-spec-typescript-code-samples 24 | codeSamplesRevisionDigest: sha256:7c9e0f4b7031eeaccb3f2da7bc3f48a5852b91dd86f45966e6b703dc4f2a681f 25 | workflow: 26 | workflowVersion: 1.0.0 27 | speakeasyVersion: latest 28 | sources: 29 | local: 30 | inputs: 31 | - location: http://localhost:8000/openapi.json 32 | registry: 33 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/local 34 | ragie.ai_spec: 35 | inputs: 36 | - location: https://api.ragie.ai/openapi.json 37 | registry: 38 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-ai-spec 39 | targets: 40 | ragie: 41 | target: typescript 42 | source: ragie.ai_spec 43 | publish: 44 | npm: 45 | token: $npm_token 46 | codeSamples: 47 | registry: 48 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-ai-spec-typescript-code-samples 49 | blocking: false 50 | -------------------------------------------------------------------------------- /.speakeasy/workflow.yaml: -------------------------------------------------------------------------------- 1 | workflowVersion: 1.0.0 2 | speakeasyVersion: latest 3 | sources: 4 | local: 5 | inputs: 6 | - location: http://localhost:8000/openapi.json 7 | registry: 8 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/local 9 | ragie.ai_spec: 10 | inputs: 11 | - location: https://api.ragie.ai/openapi.json 12 | registry: 13 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-ai-spec 14 | targets: 15 | ragie: 16 | target: typescript 17 | source: ragie.ai_spec 18 | publish: 19 | npm: 20 | token: $npm_token 21 | codeSamples: 22 | registry: 23 | location: registry.speakeasyapi.dev/ragie-ai/ragie-ai/ragie-ai-spec-typescript-code-samples 24 | blocking: false 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to This Repository 2 | 3 | Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. 4 | 5 | ## How to Report Issues 6 | 7 | If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: 8 | 9 | - A clear and descriptive title 10 | - Steps to reproduce the issue 11 | - Expected and actual behavior 12 | - Any relevant logs, screenshots, or error messages 13 | - Information about your environment (e.g., operating system, software versions) 14 | - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed 15 | 16 | ## Issue Triage and Upstream Fixes 17 | 18 | We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. 19 | 20 | ## Contact 21 | 22 | If you have any questions or need further assistance, please feel free to reach out by opening an issue. 23 | 24 | Thank you for your understanding and cooperation! 25 | 26 | The Maintainers 27 | -------------------------------------------------------------------------------- /RUNTIMES.md: -------------------------------------------------------------------------------- 1 | # Supported JavaScript runtimes 2 | 3 | This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features: 4 | 5 | * [Web Fetch API][web-fetch] 6 | * [Web Streams API][web-streams] and in particular `ReadableStream` 7 | * [Async iterables][async-iter] using `Symbol.asyncIterator` 8 | 9 | [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API 10 | [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API 11 | [async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols 12 | 13 | Runtime environments that are explicitly supported are: 14 | 15 | - Evergreen browsers which include: Chrome, Safari, Edge, Firefox 16 | - Node.js active and maintenance LTS releases 17 | - Currently, this is v18 and v20 18 | - Bun v1 and above 19 | - Deno v1.39 20 | - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming]) 21 | 22 | [deno-file-streaming]: https://github.com/denoland/deno/issues/11018 23 | 24 | ## Recommended TypeScript compiler options 25 | 26 | The following `tsconfig.json` options are recommended for projects using this 27 | SDK in order to get static type support for features like async iterables, 28 | streams and `fetch`-related APIs ([`for await...of`][for-await-of], 29 | [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and 30 | so on): 31 | 32 | [for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of 33 | [abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal 34 | [request]: https://developer.mozilla.org/en-US/docs/Web/API/Request 35 | [response]: https://developer.mozilla.org/en-US/docs/Web/API/Response 36 | 37 | ```jsonc 38 | { 39 | "compilerOptions": { 40 | "target": "es2020", // or higher 41 | "lib": ["es2020", "dom", "dom.iterable"], 42 | } 43 | } 44 | ``` 45 | 46 | While `target` can be set to older ECMAScript versions, it may result in extra, 47 | unnecessary compatibility code being generated if you are not targeting old 48 | runtimes. -------------------------------------------------------------------------------- /USAGE.md: -------------------------------------------------------------------------------- 1 | 2 | ```typescript 3 | import { openAsBlob } from "node:fs"; 4 | import { Ragie } from "ragie"; 5 | 6 | const ragie = new Ragie({ 7 | auth: "", 8 | }); 9 | 10 | async function run() { 11 | const result = await ragie.documents.create({ 12 | file: await openAsBlob("example.file"), 13 | }); 14 | 15 | // Handle the result 16 | console.log(result); 17 | } 18 | 19 | run(); 20 | 21 | ``` 22 | -------------------------------------------------------------------------------- /docs/lib/utils/retryconfig.md: -------------------------------------------------------------------------------- 1 | # RetryConfig 2 | 3 | Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. 4 | 5 | ## Fields 6 | 7 | | Name | Type | Description | Example | 8 | | ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | 9 | | `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | 10 | | `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | 11 | | `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | 12 | 13 | ## BackoffStrategy 14 | 15 | The backoff strategy allows retrying a request with an exponential backoff between each retry. 16 | 17 | ### Fields 18 | 19 | | Name | Type | Description | Example | 20 | | ------------------ | ------------ | ----------------------------------------- | -------- | 21 | | `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | 22 | | `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | 23 | | `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | 24 | | `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | -------------------------------------------------------------------------------- /docs/models/components/audiomodalitydata.md: -------------------------------------------------------------------------------- 1 | # AudioModalityData 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AudioModalityData } from "ragie/models/components"; 7 | 8 | let value: AudioModalityData = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | 15 | | `type` | *string* | :heavy_minus_sign: | N/A | 16 | | `wordTimestamps` | [components.WordTimestamp](../../models/components/wordtimestamp.md)[] | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/connectionbasemetadata.md: -------------------------------------------------------------------------------- 1 | # ConnectionBaseMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/connectionlist.md: -------------------------------------------------------------------------------- 1 | # ConnectionList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConnectionList } from "ragie/models/components"; 7 | 8 | let value: ConnectionList = { 9 | pagination: { 10 | totalCount: 599899, 11 | }, 12 | connections: [ 13 | { 14 | id: "fb791042-b3f3-4dfc-9309-281da8af8929", 15 | createdAt: new Date("2023-03-29T00:56:47.996Z"), 16 | updatedAt: new Date("2025-12-08T11:39:54.430Z"), 17 | metadata: { 18 | "key": "", 19 | }, 20 | type: "", 21 | name: "", 22 | source: "", 23 | enabled: false, 24 | disabledBySystemReason: "authentication_failed", 25 | pageLimit: 18787, 26 | disabledBySystem: false, 27 | }, 28 | ], 29 | }; 30 | ``` 31 | 32 | ## Fields 33 | 34 | | Field | Type | Required | Description | 35 | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | 36 | | `pagination` | [components.Pagination](../../models/components/pagination.md) | :heavy_check_mark: | N/A | 37 | | `connections` | [components.Connection](../../models/components/connection.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/connectionmetadata.md: -------------------------------------------------------------------------------- 1 | # ConnectionMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/connectionstats.md: -------------------------------------------------------------------------------- 1 | # ConnectionStats 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConnectionStats } from "ragie/models/components"; 7 | 8 | let value: ConnectionStats = { 9 | documentCount: 658067, 10 | pageCount: 6297.95, 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ------------------ | ------------------ | ------------------ | ------------------ | 18 | | `documentCount` | *number* | :heavy_check_mark: | N/A | 19 | | `pageCount` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/connectorsource.md: -------------------------------------------------------------------------------- 1 | # ConnectorSource 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConnectorSource } from "ragie/models/components"; 7 | 8 | let value: ConnectorSource = "zendesk"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "backblaze" | "confluence" | "dropbox" | "freshdesk" | "onedrive" | "google_drive" | "gmail" | "intercom" | "notion" | "salesforce" | "sharepoint" | "jira" | "slack" | "s3" | "gcs" | "hubspot" | "zendesk" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/createdocumentfromurlparamsmetadata.md: -------------------------------------------------------------------------------- 1 | # CreateDocumentFromUrlParamsMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/createdocumentfromurlparamsmode.md: -------------------------------------------------------------------------------- 1 | # CreateDocumentFromUrlParamsMode 2 | 3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true } 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.Mode1` 9 | 10 | ```typescript 11 | const value: components.Mode1 = "hi_res"; 12 | ``` 13 | 14 | ### `components.MediaModeParam` 15 | 16 | ```typescript 17 | const value: components.MediaModeParam = {}; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/createdocumentrawparamsmetadata.md: -------------------------------------------------------------------------------- 1 | # CreateDocumentRawParamsMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/createinstructionparamsscope.md: -------------------------------------------------------------------------------- 1 | # CreateInstructionParamsScope 2 | 3 | The scope of the instruction. Determines whether the instruction is applied to the entire document or to each chunk of the document. Options are `'document'` or `'chunk'`. Generally `'document'` should be used when analyzing the full document is desired, such as when generating a summary or determining sentiment, and `'chunk'` should be used when a fine grained search over a document is desired. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { CreateInstructionParamsScope } from "ragie/models/components"; 9 | 10 | let value: CreateInstructionParamsScope = "document"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "document" | "chunk" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/createpartitionparams.md: -------------------------------------------------------------------------------- 1 | # CreatePartitionParams 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CreatePartitionParams } from "ragie/models/components"; 7 | 8 | let value: CreatePartitionParams = { 9 | name: "", 10 | pagesHostedLimitMonthly: 1000, 11 | pagesProcessedLimitMonthly: 1000, 12 | pagesHostedLimitMax: 1000, 13 | pagesProcessedLimitMax: 1000, 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | Example | 20 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 21 | | `name` | *string* | :heavy_check_mark: | N/A | | 22 | | `pagesHostedLimitMonthly` | *number* | :heavy_minus_sign: | N/A | 1000 | 23 | | `pagesProcessedLimitMonthly` | *number* | :heavy_minus_sign: | N/A | 1000 | 24 | | `pagesHostedLimitMax` | *number* | :heavy_minus_sign: | N/A | 1000 | 25 | | `pagesProcessedLimitMax` | *number* | :heavy_minus_sign: | N/A | 1000 | -------------------------------------------------------------------------------- /docs/models/components/data.md: -------------------------------------------------------------------------------- 1 | # Data 2 | 3 | Document data in a text or JSON format. 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `{ [k: string]: any }` 15 | 16 | ```typescript 17 | const value: { [k: string]: any } = { 18 | "key": "", 19 | }; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/deleteconnectionpayload.md: -------------------------------------------------------------------------------- 1 | # DeleteConnectionPayload 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DeleteConnectionPayload } from "ragie/models/components"; 7 | 8 | let value: DeleteConnectionPayload = { 9 | keepFiles: false, 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `keepFiles` | *boolean* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/disabledbysystemreason.md: -------------------------------------------------------------------------------- 1 | # DisabledBySystemReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DisabledBySystemReason } from "ragie/models/components"; 7 | 8 | let value: DisabledBySystemReason = "connection_over_total_page_limit"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "connection_over_total_page_limit" | "authentication_failed" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/documentchunklist.md: -------------------------------------------------------------------------------- 1 | # DocumentChunkList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentChunkList } from "ragie/models/components"; 7 | 8 | let value: DocumentChunkList = { 9 | pagination: { 10 | totalCount: 889122, 11 | }, 12 | chunks: [ 13 | { 14 | id: "16094143-d9d4-4094-a6e2-2a0629bb470c", 15 | text: "", 16 | links: { 17 | "key": { 18 | href: "", 19 | type: "", 20 | }, 21 | }, 22 | }, 23 | ], 24 | }; 25 | ``` 26 | 27 | ## Fields 28 | 29 | | Field | Type | Required | Description | 30 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | 31 | | `pagination` | [components.Pagination](../../models/components/pagination.md) | :heavy_check_mark: | N/A | 32 | | `chunks` | [components.DocumentChunk](../../models/components/documentchunk.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentdelete.md: -------------------------------------------------------------------------------- 1 | # DocumentDelete 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentDelete } from "ragie/models/components"; 7 | 8 | let value: DocumentDelete = { 9 | status: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `status` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentfileupdate.md: -------------------------------------------------------------------------------- 1 | # DocumentFileUpdate 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentFileUpdate } from "ragie/models/components"; 7 | 8 | let value: DocumentFileUpdate = { 9 | status: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `status` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentgetmetadata.md: -------------------------------------------------------------------------------- 1 | # DocumentGetMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/documentlist.md: -------------------------------------------------------------------------------- 1 | # DocumentList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentList } from "ragie/models/components"; 7 | 8 | let value: DocumentList = { 9 | pagination: { 10 | totalCount: 878808, 11 | }, 12 | documents: [ 13 | { 14 | status: "", 15 | id: "c9fa669e-2e04-4b1b-aee1-aae2e77822dd", 16 | createdAt: new Date("2023-01-16T04:16:13.143Z"), 17 | updatedAt: new Date("2024-12-22T21:06:26.072Z"), 18 | name: "", 19 | metadata: { 20 | "key": "", 21 | }, 22 | partition: "", 23 | }, 24 | ], 25 | }; 26 | ``` 27 | 28 | ## Fields 29 | 30 | | Field | Type | Required | Description | 31 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 32 | | `pagination` | [components.Pagination](../../models/components/pagination.md) | :heavy_check_mark: | N/A | 33 | | `documents` | [components.Document](../../models/components/document.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentmetadata.md: -------------------------------------------------------------------------------- 1 | # DocumentMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/documentmetadataupdatemetadata.md: -------------------------------------------------------------------------------- 1 | # DocumentMetadataUpdateMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/documentrawupdate.md: -------------------------------------------------------------------------------- 1 | # DocumentRawUpdate 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentRawUpdate } from "ragie/models/components"; 7 | 8 | let value: DocumentRawUpdate = { 9 | status: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `status` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentsummary.md: -------------------------------------------------------------------------------- 1 | # DocumentSummary 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentSummary } from "ragie/models/components"; 7 | 8 | let value: DocumentSummary = { 9 | documentId: "", 10 | summary: "", 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ------------------ | ------------------ | ------------------ | ------------------ | 18 | | `documentId` | *string* | :heavy_check_mark: | N/A | 19 | | `summary` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documenturlupdate.md: -------------------------------------------------------------------------------- 1 | # DocumentUrlUpdate 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentUrlUpdate } from "ragie/models/components"; 7 | 8 | let value: DocumentUrlUpdate = { 9 | status: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `status` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/documentwithcontentmetadata.md: -------------------------------------------------------------------------------- 1 | # DocumentWithContentMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/entitylist.md: -------------------------------------------------------------------------------- 1 | # EntityList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { EntityList } from "ragie/models/components"; 7 | 8 | let value: EntityList = { 9 | pagination: { 10 | totalCount: 927373, 11 | }, 12 | entities: [ 13 | { 14 | id: "9682a0a9-93a7-42ba-ba7e-e2648f9987e0", 15 | createdAt: new Date("2025-10-24T05:40:52.360Z"), 16 | updatedAt: new Date("2023-05-16T15:47:57.920Z"), 17 | instructionId: "4ca3f57e-3635-43b7-b234-1a7d61a60b75", 18 | documentId: "14c44960-afe8-438b-9693-ca254f118f78", 19 | data: { 20 | "key": "", 21 | }, 22 | }, 23 | ], 24 | }; 25 | ``` 26 | 27 | ## Fields 28 | 29 | | Field | Type | Required | Description | 30 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 31 | | `pagination` | [components.Pagination](../../models/components/pagination.md) | :heavy_check_mark: | N/A | 32 | | `entities` | [components.Entity](../../models/components/entity.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/filet.md: -------------------------------------------------------------------------------- 1 | # FileT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FileT } from "ragie/models/components"; 7 | 8 | // No examples available for this model 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 15 | | `fileName` | *string* | :heavy_check_mark: | N/A | 16 | | `content` | *ReadableStream* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/link.md: -------------------------------------------------------------------------------- 1 | # Link 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Link } from "ragie/models/components"; 7 | 8 | let value: Link = { 9 | href: "", 10 | type: "", 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ------------------ | ------------------ | ------------------ | ------------------ | 18 | | `href` | *string* | :heavy_check_mark: | N/A | 19 | | `type` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/listconnectorsourcetypeinfo.md: -------------------------------------------------------------------------------- 1 | # ListConnectorSourceTypeInfo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListConnectorSourceTypeInfo } from "ragie/models/components"; 7 | 8 | let value: ListConnectorSourceTypeInfo = { 9 | connectors: [ 10 | { 11 | sourceType: "slack", 12 | displayName: "Malcolm_Maggio", 13 | iconUrl: "https://true-legging.info", 14 | docsUrl: "https://rectangular-best-seller.info", 15 | }, 16 | ], 17 | }; 18 | ``` 19 | 20 | ## Fields 21 | 22 | | Field | Type | Required | Description | 23 | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | 24 | | `connectors` | [components.ConnectorSourceTypeInfo](../../models/components/connectorsourcetypeinfo.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/loc.md: -------------------------------------------------------------------------------- 1 | # Loc 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/mediamodeparam.md: -------------------------------------------------------------------------------- 1 | # MediaModeParam 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MediaModeParam } from "ragie/models/components"; 7 | 8 | let value: MediaModeParam = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | 15 | | `static` | [components.Static](../../models/components/static.md) | :heavy_minus_sign: | N/A | 16 | | `audio` | *boolean* | :heavy_minus_sign: | N/A | 17 | | `video` | [components.Video](../../models/components/video.md) | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/metadata.md: -------------------------------------------------------------------------------- 1 | # Metadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 1284.03; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/modalitydata.md: -------------------------------------------------------------------------------- 1 | # ModalityData 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AudioModalityData` 7 | 8 | ```typescript 9 | const value: components.AudioModalityData = {}; 10 | ``` 11 | 12 | ### `components.VideoModalityData` 13 | 14 | ```typescript 15 | const value: components.VideoModalityData = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/mode.md: -------------------------------------------------------------------------------- 1 | # Mode 2 | 3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true } 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.One` 9 | 10 | ```typescript 11 | const value: components.One = "fast"; 12 | ``` 13 | 14 | ### `components.Two` 15 | 16 | ```typescript 17 | const value: components.Two = {}; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/mode1.md: -------------------------------------------------------------------------------- 1 | # Mode1 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Mode1 } from "ragie/models/components"; 7 | 8 | let value: Mode1 = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/modestatic.md: -------------------------------------------------------------------------------- 1 | # ModeStatic 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModeStatic } from "ragie/models/components"; 7 | 8 | let value: ModeStatic = "fast"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/modevideo.md: -------------------------------------------------------------------------------- 1 | # ModeVideo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModeVideo } from "ragie/models/components"; 7 | 8 | let value: ModeVideo = "audio_only"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "audio_only" | "video_only" | "audio_video" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/oauthurlcreatemetadata.md: -------------------------------------------------------------------------------- 1 | # OAuthUrlCreateMetadata 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 128403; 16 | ``` 17 | 18 | ### `boolean` 19 | 20 | ```typescript 21 | const value: boolean = false; 22 | ``` 23 | 24 | ### `string[]` 25 | 26 | ```typescript 27 | const value: string[] = [ 28 | "", 29 | ]; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /docs/models/components/oauthurlcreatemode.md: -------------------------------------------------------------------------------- 1 | # OAuthUrlCreateMode 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.OAuthUrlCreateMode1` 7 | 8 | ```typescript 9 | const value: components.OAuthUrlCreateMode1 = "fast"; 10 | ``` 11 | 12 | ### `components.MediaModeParam` 13 | 14 | ```typescript 15 | const value: components.MediaModeParam = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/oauthurlcreatemode1.md: -------------------------------------------------------------------------------- 1 | # OAuthUrlCreateMode1 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { OAuthUrlCreateMode1 } from "ragie/models/components"; 7 | 8 | let value: OAuthUrlCreateMode1 = "fast"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/oauthurlresponse.md: -------------------------------------------------------------------------------- 1 | # OAuthUrlResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { OAuthUrlResponse } from "ragie/models/components"; 7 | 8 | let value: OAuthUrlResponse = { 9 | url: "https://perky-carnival.org/", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `url` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/one.md: -------------------------------------------------------------------------------- 1 | # One 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.One1` 7 | 8 | ```typescript 9 | const value: components.One1 = "fast"; 10 | ``` 11 | 12 | ### `components.One2` 13 | 14 | ```typescript 15 | const value: components.One2 = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/one1.md: -------------------------------------------------------------------------------- 1 | # One1 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { One1 } from "ragie/models/components"; 7 | 8 | let value: One1 = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/one2.md: -------------------------------------------------------------------------------- 1 | # One2 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { One2 } from "ragie/models/components"; 7 | 8 | let value: One2 = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ----------- | ----------- | ----------- | ----------- | -------------------------------------------------------------------------------- /docs/models/components/pagination.md: -------------------------------------------------------------------------------- 1 | # Pagination 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Pagination } from "ragie/models/components"; 7 | 8 | let value: Pagination = { 9 | totalCount: 271635, 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `nextCursor` | *string* | :heavy_minus_sign: | N/A | 18 | | `totalCount` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/partitionlimitparams.md: -------------------------------------------------------------------------------- 1 | # PartitionLimitParams 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { PartitionLimitParams } from "ragie/models/components"; 7 | 8 | let value: PartitionLimitParams = { 9 | pagesHostedLimitMonthly: 1000, 10 | pagesProcessedLimitMonthly: 1000, 11 | pagesHostedLimitMax: 1000, 12 | pagesProcessedLimitMax: 1000, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | Example | 19 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 20 | | `pagesHostedLimitMonthly` | *number* | :heavy_minus_sign: | N/A | 1000 | 21 | | `pagesProcessedLimitMonthly` | *number* | :heavy_minus_sign: | N/A | 1000 | 22 | | `pagesHostedLimitMax` | *number* | :heavy_minus_sign: | N/A | 1000 | 23 | | `pagesProcessedLimitMax` | *number* | :heavy_minus_sign: | N/A | 1000 | -------------------------------------------------------------------------------- /docs/models/components/partitionlimits.md: -------------------------------------------------------------------------------- 1 | # PartitionLimits 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { PartitionLimits } from "ragie/models/components"; 7 | 8 | let value: PartitionLimits = { 9 | pagesProcessedLimitMonthly: 1991.46, 10 | pagesHostedLimitMonthly: 6786.29, 11 | pagesProcessedLimitMax: 4990.39, 12 | pagesHostedLimitMax: 7658.31, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 20 | | `pagesProcessedLimitMonthly` | *number* | :heavy_check_mark: | N/A | 21 | | `pagesHostedLimitMonthly` | *number* | :heavy_check_mark: | N/A | 22 | | `pagesProcessedLimitMax` | *number* | :heavy_check_mark: | N/A | 23 | | `pagesHostedLimitMax` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/partitionlist.md: -------------------------------------------------------------------------------- 1 | # PartitionList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { PartitionList } from "ragie/models/components"; 7 | 8 | let value: PartitionList = { 9 | pagination: { 10 | totalCount: 254218, 11 | }, 12 | partitions: [ 13 | { 14 | name: "", 15 | isDefault: false, 16 | limitExceededAt: new Date("2025-09-12T10:48:16.840Z"), 17 | limits: { 18 | pagesProcessedLimitMonthly: 860.13, 19 | pagesHostedLimitMonthly: 3094.41, 20 | pagesProcessedLimitMax: 7283.47, 21 | pagesHostedLimitMax: 3512.28, 22 | }, 23 | }, 24 | ], 25 | }; 26 | ``` 27 | 28 | ## Fields 29 | 30 | | Field | Type | Required | Description | 31 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 32 | | `pagination` | [components.Pagination](../../models/components/pagination.md) | :heavy_check_mark: | N/A | 33 | | `partitions` | [components.Partition](../../models/components/partition.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/partitionstats.md: -------------------------------------------------------------------------------- 1 | # PartitionStats 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { PartitionStats } from "ragie/models/components"; 7 | 8 | let value: PartitionStats = { 9 | pagesProcessedMonthly: 5829.46, 10 | pagesHostedMonthly: 2760.31, 11 | pagesProcessedTotal: 7590.51, 12 | pagesHostedTotal: 7180.51, 13 | documentCount: 261694, 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ----------------------- | ----------------------- | ----------------------- | ----------------------- | 21 | | `pagesProcessedMonthly` | *number* | :heavy_check_mark: | N/A | 22 | | `pagesHostedMonthly` | *number* | :heavy_check_mark: | N/A | 23 | | `pagesProcessedTotal` | *number* | :heavy_check_mark: | N/A | 24 | | `pagesHostedTotal` | *number* | :heavy_check_mark: | N/A | 25 | | `documentCount` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/partitionstrategy.md: -------------------------------------------------------------------------------- 1 | # PartitionStrategy 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.PartitionStrategy1` 7 | 8 | ```typescript 9 | const value: components.PartitionStrategy1 = "hi_res"; 10 | ``` 11 | 12 | ### `components.MediaModeParam` 13 | 14 | ```typescript 15 | const value: components.MediaModeParam = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/partitionstrategy1.md: -------------------------------------------------------------------------------- 1 | # PartitionStrategy1 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { PartitionStrategy1 } from "ragie/models/components"; 7 | 8 | let value: PartitionStrategy1 = "fast"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/reason.md: -------------------------------------------------------------------------------- 1 | # Reason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Reason } from "ragie/models/components"; 7 | 8 | let value: Reason = "authentication_failed"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "connection_over_total_page_limit" | "authentication_failed" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/responseok.md: -------------------------------------------------------------------------------- 1 | # ResponseOK 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ResponseOK } from "ragie/models/components"; 7 | 8 | let value: ResponseOK = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `message` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/retrieval.md: -------------------------------------------------------------------------------- 1 | # Retrieval 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Retrieval } from "ragie/models/components"; 7 | 8 | let value: Retrieval = { 9 | scoredChunks: [ 10 | { 11 | text: "", 12 | score: 2691.35, 13 | id: "", 14 | index: 522812, 15 | documentId: "", 16 | documentName: "", 17 | documentMetadata: { 18 | "key": "", 19 | }, 20 | links: { 21 | "key": { 22 | href: "", 23 | type: "", 24 | }, 25 | }, 26 | }, 27 | ], 28 | }; 29 | ``` 30 | 31 | ## Fields 32 | 33 | | Field | Type | Required | Description | 34 | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | 35 | | `scoredChunks` | [components.ScoredChunk](../../models/components/scoredchunk.md)[] | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/scope.md: -------------------------------------------------------------------------------- 1 | # Scope 2 | 3 | The scope of the instruction. Determines whether the instruction is applied to the entire document or to each chunk of the document. Options are `'document'` or `'chunk'`. Generally `'document'` should be used when analyzing the full document is desired, such as when generating a summary or determining sentiment, and `'chunk'` should be used when a fine grained search over a document is desired. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { Scope } from "ragie/models/components"; 9 | 10 | let value: Scope = "document"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "document" | "chunk" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Security } from "ragie/models/components"; 7 | 8 | let value: Security = { 9 | auth: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `auth` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/setconnectionenabledpayload.md: -------------------------------------------------------------------------------- 1 | # SetConnectionEnabledPayload 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SetConnectionEnabledPayload } from "ragie/models/components"; 7 | 8 | let value: SetConnectionEnabledPayload = { 9 | enabled: false, 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | 17 | | `enabled` | *boolean* | :heavy_check_mark: | N/A | 18 | | `reason` | [components.Reason](../../models/components/reason.md) | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/source.md: -------------------------------------------------------------------------------- 1 | # Source 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `string[]` 13 | 14 | ```typescript 15 | const value: string[] = [ 16 | "", 17 | ]; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/static.md: -------------------------------------------------------------------------------- 1 | # Static 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Static } from "ragie/models/components"; 7 | 8 | let value: Static = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/theme.md: -------------------------------------------------------------------------------- 1 | # Theme 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Theme } from "ragie/models/components"; 7 | 8 | let value: Theme = "light"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "light" | "dark" | "system" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/two.md: -------------------------------------------------------------------------------- 1 | # Two 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Two } from "ragie/models/components"; 7 | 8 | let value: Two = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 15 | | `static` | [components.ModeStatic](../../models/components/modestatic.md) | :heavy_minus_sign: | N/A | 16 | | `audio` | *boolean* | :heavy_minus_sign: | N/A | 17 | | `video` | [components.ModeVideo](../../models/components/modevideo.md) | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparams11.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParams11 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFileParams11 } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentFileParams11 = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparams12.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParams12 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFileParams12 } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentFileParams12 = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ----------- | ----------- | ----------- | ----------- | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparamsfile.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParamsFile 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFileParamsFile } from "ragie/models/components"; 7 | 8 | // No examples available for this model 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 15 | | `fileName` | *string* | :heavy_check_mark: | N/A | 16 | | `content` | *ReadableStream* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparamsmode.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParamsMode 2 | 3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true } 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.UpdateDocumentFileParamsMode1` 9 | 10 | ```typescript 11 | const value: components.UpdateDocumentFileParamsMode1 = "hi_res"; 12 | ``` 13 | 14 | ### `components.Mode2` 15 | 16 | ```typescript 17 | const value: components.Mode2 = {}; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparamsmode1.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParamsMode1 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.UpdateDocumentFileParams11` 7 | 8 | ```typescript 9 | const value: components.UpdateDocumentFileParams11 = "hi_res"; 10 | ``` 11 | 12 | ### `components.UpdateDocumentFileParams12` 13 | 14 | ```typescript 15 | const value: components.UpdateDocumentFileParams12 = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparamsmodestatic.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParamsModeStatic 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFileParamsModeStatic } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentFileParamsModeStatic = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfileparamsmodevideo.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFileParamsModeVideo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFileParamsModeVideo } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentFileParamsModeVideo = "video_only"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "audio_only" | "video_only" | "audio_video" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfromurlparamsmode.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFromUrlParamsMode 2 | 3 | Partition strategy for the document. Different strategies exist for textual, audio and video file types and you can set the strategy you want for each file type, or just for textual types. For textual documents the options are `'hi_res'` or `'fast'`. When set to `'hi_res'`, images and tables will be extracted from the document. `'fast'` will only extract text. `'fast'` may be up to 20x faster than `'hi_res'`. `hi_res` is only applicable for Word documents, PDFs, Images, and PowerPoints. Images will always be processed in `hi_res`. If `hi_res` is set for an unsupported document type, it will be processed and billed in `fast` mode. For audio files, the options are true or false. True if you want to process audio, false otherwise. For video files, the options are `'audio_only'`, `'video_only'`, `'audio_video'`. `'audio_only'` will extract just the audio part of the video. `'video_only'` will similarly just extract the video part, ignoring audio. `'audio_video'` will extract both audio and video. When you specify audio or video stategies, the format must be a JSON object. In this case, textual documents are denoted by the key "static". If you omit a key, that document type won't be processd. See examples below. Examples Textual documents only "fast" Video documents only { "video": "audio_video" } Specify multiple document types { "static": "hi_res", "audio": true, "video": "video_only" } Specify only textual or audio document types { "static": "fast", "audio": true } 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.UpdateDocumentFromUrlParamsMode1` 9 | 10 | ```typescript 11 | const value: components.UpdateDocumentFromUrlParamsMode1 = "fast"; 12 | ``` 13 | 14 | ### `components.MediaModeParam` 15 | 16 | ```typescript 17 | const value: components.MediaModeParam = {}; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentfromurlparamsmode1.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentFromUrlParamsMode1 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentFromUrlParamsMode1 } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentFromUrlParamsMode1 = "hi_res"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "hi_res" | "fast" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/updatedocumentrawparams.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentRawParams 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateDocumentRawParams } from "ragie/models/components"; 7 | 8 | let value: UpdateDocumentRawParams = { 9 | data: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | 17 | | `data` | *components.UpdateDocumentRawParamsData* | :heavy_check_mark: | Document data in a text or JSON format. | -------------------------------------------------------------------------------- /docs/models/components/updatedocumentrawparamsdata.md: -------------------------------------------------------------------------------- 1 | # UpdateDocumentRawParamsData 2 | 3 | Document data in a text or JSON format. 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `{ [k: string]: any }` 15 | 16 | ```typescript 17 | const value: { [k: string]: any } = { 18 | "key": "", 19 | }; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/validationerror.md: -------------------------------------------------------------------------------- 1 | # ValidationError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ValidationError } from "ragie/models/components"; 7 | 8 | let value: ValidationError = { 9 | loc: [ 10 | 598752, 11 | ], 12 | msg: "", 13 | type: "", 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ------------------ | ------------------ | ------------------ | ------------------ | 21 | | `loc` | *components.Loc*[] | :heavy_check_mark: | N/A | 22 | | `msg` | *string* | :heavy_check_mark: | N/A | 23 | | `type` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/video.md: -------------------------------------------------------------------------------- 1 | # Video 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Video } from "ragie/models/components"; 7 | 8 | let value: Video = "video_only"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "audio_only" | "video_only" | "audio_video" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/videomodalitydata.md: -------------------------------------------------------------------------------- 1 | # VideoModalityData 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { VideoModalityData } from "ragie/models/components"; 7 | 8 | let value: VideoModalityData = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | 15 | | `type` | *string* | :heavy_minus_sign: | N/A | 16 | | `wordTimestamps` | [components.WordTimestamp](../../models/components/wordtimestamp.md)[] | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/wordtimestamp.md: -------------------------------------------------------------------------------- 1 | # WordTimestamp 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { WordTimestamp } from "ragie/models/components"; 7 | 8 | let value: WordTimestamp = { 9 | startTime: 4971.3, 10 | endTime: 627.33, 11 | word: "", 12 | probability: 9994.21, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | ------------------ | ------------------ | ------------------ | ------------------ | 20 | | `startTime` | *number* | :heavy_check_mark: | N/A | 21 | | `endTime` | *number* | :heavy_check_mark: | N/A | 22 | | `word` | *string* | :heavy_check_mark: | N/A | 23 | | `probability` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/errors/errormessage.md: -------------------------------------------------------------------------------- 1 | # ErrorMessage 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ErrorMessage } from "ragie/models/errors"; 7 | 8 | // No examples available for this model 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `detail` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/errors/httpvalidationerror.md: -------------------------------------------------------------------------------- 1 | # HTTPValidationError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { HTTPValidationError } from "ragie/models/errors"; 7 | 8 | // No examples available for this model 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | 15 | | `detail` | [components.ValidationError](../../models/components/validationerror.md)[] | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/deleteconnectionconnectionsconnectioniddeletepostrequest.md: -------------------------------------------------------------------------------- 1 | # DeleteConnectionConnectionsConnectionIdDeletePostRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DeleteConnectionConnectionsConnectionIdDeletePostRequest } from "ragie/models/operations"; 7 | 8 | let value: DeleteConnectionConnectionsConnectionIdDeletePostRequest = { 9 | connectionId: "b3d2511b-a01f-4a2c-908e-9d95aa4e35c2", 10 | deleteConnectionPayload: { 11 | keepFiles: false, 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | 20 | | `connectionId` | *string* | :heavy_check_mark: | N/A | 21 | | `deleteConnectionPayload` | [components.DeleteConnectionPayload](../../models/components/deleteconnectionpayload.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/deleteinstructionrequest.md: -------------------------------------------------------------------------------- 1 | # DeleteInstructionRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DeleteInstructionRequest } from "ragie/models/operations"; 7 | 8 | let value: DeleteInstructionRequest = { 9 | instructionId: "00000000-0000-0000-0000-000000000000", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | Example | 16 | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | 17 | | `instructionId` | *string* | :heavy_check_mark: | The ID of the instruction. | 00000000-0000-0000-0000-000000000000 | -------------------------------------------------------------------------------- /docs/models/operations/deletepartitionpartitionspartitioniddeleterequest.md: -------------------------------------------------------------------------------- 1 | # DeletePartitionPartitionsPartitionIdDeleteRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DeletePartitionPartitionsPartitionIdDeleteRequest } from "ragie/models/operations"; 7 | 8 | let value: DeletePartitionPartitionsPartitionIdDeleteRequest = { 9 | partitionId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `partitionId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/getconnectionconnectionsconnectionidgetrequest.md: -------------------------------------------------------------------------------- 1 | # GetConnectionConnectionsConnectionIdGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { GetConnectionConnectionsConnectionIdGetRequest } from "ragie/models/operations"; 7 | 8 | let value: GetConnectionConnectionsConnectionIdGetRequest = { 9 | connectionId: "7bbab277-aa2e-4070-ae35-1e5cd3553079", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `connectionId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/getconnectionstatsconnectionsconnectionidstatsgetrequest.md: -------------------------------------------------------------------------------- 1 | # GetConnectionStatsConnectionsConnectionIdStatsGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { GetConnectionStatsConnectionsConnectionIdStatsGetRequest } from "ragie/models/operations"; 7 | 8 | let value: GetConnectionStatsConnectionsConnectionIdStatsGetRequest = { 9 | connectionId: "48fa4bb1-4a75-4abf-967d-4b7061aae0de", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `connectionId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/getpartitionpartitionspartitionidgetrequest.md: -------------------------------------------------------------------------------- 1 | # GetPartitionPartitionsPartitionIdGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { GetPartitionPartitionsPartitionIdGetRequest } from "ragie/models/operations"; 7 | 8 | let value: GetPartitionPartitionsPartitionIdGetRequest = { 9 | partitionId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `partitionId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/listconnectionsconnectionsgetresponse.md: -------------------------------------------------------------------------------- 1 | # ListConnectionsConnectionsGetResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListConnectionsConnectionsGetResponse } from "ragie/models/operations"; 7 | 8 | let value: ListConnectionsConnectionsGetResponse = { 9 | result: { 10 | pagination: { 11 | totalCount: 658333, 12 | }, 13 | connections: [ 14 | { 15 | id: "0da65304-8062-4f5f-bd38-89810c29b7bb", 16 | createdAt: new Date("2025-10-07T02:32:19.524Z"), 17 | updatedAt: new Date("2025-10-17T19:42:48.819Z"), 18 | metadata: { 19 | "key": [ 20 | "", 21 | ], 22 | }, 23 | type: "", 24 | name: "", 25 | source: [ 26 | "", 27 | ], 28 | enabled: false, 29 | disabledBySystemReason: "connection_over_total_page_limit", 30 | pageLimit: 212717, 31 | disabledBySystem: false, 32 | }, 33 | ], 34 | }, 35 | }; 36 | ``` 37 | 38 | ## Fields 39 | 40 | | Field | Type | Required | Description | 41 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | 42 | | `result` | [components.ConnectionList](../../models/components/connectionlist.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/listdocumentsresponse.md: -------------------------------------------------------------------------------- 1 | # ListDocumentsResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListDocumentsResponse } from "ragie/models/operations"; 7 | 8 | let value: ListDocumentsResponse = { 9 | result: { 10 | pagination: { 11 | totalCount: 18197, 12 | }, 13 | documents: [ 14 | { 15 | status: "", 16 | id: "08ad32d2-d65d-47f3-bdf4-475a654a2355", 17 | createdAt: new Date("2024-06-20T22:49:52.888Z"), 18 | updatedAt: new Date("2025-05-02T15:35:12.818Z"), 19 | name: "", 20 | metadata: { 21 | "key": 704761, 22 | }, 23 | partition: "", 24 | }, 25 | ], 26 | }, 27 | }; 28 | ``` 29 | 30 | ## Fields 31 | 32 | | Field | Type | Required | Description | 33 | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | 34 | | `result` | [components.DocumentList](../../models/components/documentlist.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/listentitiesbydocumentresponse.md: -------------------------------------------------------------------------------- 1 | # ListEntitiesByDocumentResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListEntitiesByDocumentResponse } from "ragie/models/operations"; 7 | 8 | let value: ListEntitiesByDocumentResponse = { 9 | result: { 10 | pagination: { 11 | totalCount: 940486, 12 | }, 13 | entities: [ 14 | { 15 | id: "312a36a6-c78d-4732-b38f-b3ebb49e8869", 16 | createdAt: new Date("2025-05-04T00:00:17.371Z"), 17 | updatedAt: new Date("2024-03-15T19:18:06.815Z"), 18 | instructionId: "434bac73-ded0-4eb1-ba6b-5afa62f2ff77", 19 | documentId: "369de787-229b-49cd-9262-10c37455135f", 20 | data: { 21 | "key": "", 22 | }, 23 | }, 24 | ], 25 | }, 26 | }; 27 | ``` 28 | 29 | ## Fields 30 | 31 | | Field | Type | Required | Description | 32 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 33 | | `result` | [components.EntityList](../../models/components/entitylist.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/listentitiesbyinstructionresponse.md: -------------------------------------------------------------------------------- 1 | # ListEntitiesByInstructionResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListEntitiesByInstructionResponse } from "ragie/models/operations"; 7 | 8 | let value: ListEntitiesByInstructionResponse = { 9 | result: { 10 | pagination: { 11 | totalCount: 233838, 12 | }, 13 | entities: [ 14 | { 15 | id: "ae1a36f0-847a-44c6-bc6b-19ca28d7aebe", 16 | createdAt: new Date("2025-04-29T12:57:19.878Z"), 17 | updatedAt: new Date("2023-04-05T09:07:39.016Z"), 18 | instructionId: "7542d908-3587-4d52-abb1-020a0ce7a5ae", 19 | documentId: "4a0ba44f-161d-4901-a310-cbfcec37173c", 20 | data: { 21 | "key": "", 22 | }, 23 | }, 24 | ], 25 | }, 26 | }; 27 | ``` 28 | 29 | ## Fields 30 | 31 | | Field | Type | Required | Description | 32 | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | 33 | | `result` | [components.EntityList](../../models/components/entitylist.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/listpartitionspartitionsgetrequest.md: -------------------------------------------------------------------------------- 1 | # ListPartitionsPartitionsGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListPartitionsPartitionsGetRequest } from "ragie/models/operations"; 7 | 8 | let value: ListPartitionsPartitionsGetRequest = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | 15 | | `cursor` | *string* | :heavy_minus_sign: | An opaque cursor for pagination | 16 | | `pageSize` | *number* | :heavy_minus_sign: | The number of items per page (must be greater than 0 and less than or equal to 100) | -------------------------------------------------------------------------------- /docs/models/operations/listpartitionspartitionsgetresponse.md: -------------------------------------------------------------------------------- 1 | # ListPartitionsPartitionsGetResponse 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ListPartitionsPartitionsGetResponse } from "ragie/models/operations"; 7 | 8 | let value: ListPartitionsPartitionsGetResponse = { 9 | result: { 10 | pagination: { 11 | totalCount: 736695, 12 | }, 13 | partitions: [ 14 | { 15 | name: "", 16 | isDefault: false, 17 | limitExceededAt: new Date("2023-11-24T08:25:22.454Z"), 18 | limits: { 19 | pagesProcessedLimitMonthly: 3745.4, 20 | pagesHostedLimitMonthly: 8199.74, 21 | pagesProcessedLimitMax: 5185.83, 22 | pagesHostedLimitMax: 7443.46, 23 | }, 24 | }, 25 | ], 26 | }, 27 | }; 28 | ``` 29 | 30 | ## Fields 31 | 32 | | Field | Type | Required | Description | 33 | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | 34 | | `result` | [components.PartitionList](../../models/components/partitionlist.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/mediatype.md: -------------------------------------------------------------------------------- 1 | # MediaType 2 | 3 | The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the chunk's document type. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { MediaType } from "ragie/models/operations"; 9 | 10 | let value: MediaType = "video/mp4"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "text/plain" | "audio/mpeg" | "video/mp4" 17 | ``` -------------------------------------------------------------------------------- /docs/models/operations/one.md: -------------------------------------------------------------------------------- 1 | # One 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { One } from "ragie/models/operations"; 7 | 8 | let value: One = "audio/mpeg"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "text/plain" | "audio/mpeg" | "video/mp4" 15 | ``` -------------------------------------------------------------------------------- /docs/models/operations/queryparammediatype.md: -------------------------------------------------------------------------------- 1 | # QueryParamMediaType 2 | 3 | The desired media type of the content to return described as a mime type. An error will be returned if the requested media type is not supported for the document's type. 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `operations.One` 9 | 10 | ```typescript 11 | const value: operations.One = "video/mp4"; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = "video/mp4"; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/operations/setconnectionenabledconnectionsconnectionidenabledputrequest.md: -------------------------------------------------------------------------------- 1 | # SetConnectionEnabledConnectionsConnectionIdEnabledPutRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SetConnectionEnabledConnectionsConnectionIdEnabledPutRequest } from "ragie/models/operations"; 7 | 8 | let value: SetConnectionEnabledConnectionsConnectionIdEnabledPutRequest = { 9 | connectionId: "608db777-52fa-4e85-883c-349b059581ac", 10 | setConnectionEnabledPayload: { 11 | enabled: false, 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | 20 | | `connectionId` | *string* | :heavy_check_mark: | N/A | 21 | | `setConnectionEnabledPayload` | [components.SetConnectionEnabledPayload](../../models/components/setconnectionenabledpayload.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/setconnectionlimitsconnectionsconnectionidlimitputrequest.md: -------------------------------------------------------------------------------- 1 | # SetConnectionLimitsConnectionsConnectionIdLimitPutRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SetConnectionLimitsConnectionsConnectionIdLimitPutRequest } from "ragie/models/operations"; 7 | 8 | let value: SetConnectionLimitsConnectionsConnectionIdLimitPutRequest = { 9 | connectionId: "26427fc7-2a2d-42b3-a483-674b62671d6d", 10 | connectionLimitParams: { 11 | pageLimit: 1000, 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | 20 | | `connectionId` | *string* | :heavy_check_mark: | N/A | 21 | | `connectionLimitParams` | [components.ConnectionLimitParams](../../models/components/connectionlimitparams.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/setpartitionlimitspartitionspartitionidlimitsputrequest.md: -------------------------------------------------------------------------------- 1 | # SetPartitionLimitsPartitionsPartitionIdLimitsPutRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SetPartitionLimitsPartitionsPartitionIdLimitsPutRequest } from "ragie/models/operations"; 7 | 8 | let value: SetPartitionLimitsPartitionsPartitionIdLimitsPutRequest = { 9 | partitionId: "", 10 | partitionLimitParams: { 11 | pagesHostedLimitMonthly: 1000, 12 | pagesProcessedLimitMonthly: 1000, 13 | pagesHostedLimitMax: 1000, 14 | pagesProcessedLimitMax: 1000, 15 | }, 16 | }; 17 | ``` 18 | 19 | ## Fields 20 | 21 | | Field | Type | Required | Description | 22 | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | 23 | | `partitionId` | *string* | :heavy_check_mark: | N/A | 24 | | `partitionLimitParams` | [components.PartitionLimitParams](../../models/components/partitionlimitparams.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/syncconnectionrequest.md: -------------------------------------------------------------------------------- 1 | # SyncConnectionRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SyncConnectionRequest } from "ragie/models/operations"; 7 | 8 | let value: SyncConnectionRequest = { 9 | connectionId: "1240c90d-12c1-457f-9175-a4b66a4aecff", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `connectionId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/updateconnectionconnectionsconnectionidputrequest.md: -------------------------------------------------------------------------------- 1 | # UpdateConnectionConnectionsConnectionIdPutRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateConnectionConnectionsConnectionIdPutRequest } from "ragie/models/operations"; 7 | 8 | let value: UpdateConnectionConnectionsConnectionIdPutRequest = { 9 | connectionId: "c6c4a87b-2bc6-40c5-b7ff-1975c5731415", 10 | connectionBase: { 11 | partitionStrategy: "hi_res", 12 | pageLimit: 1000, 13 | }, 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | 21 | | `connectionId` | *string* | :heavy_check_mark: | N/A | 22 | | `connectionBase` | [components.ConnectionBase](../../models/components/connectionbase.md) | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/updateinstructionrequest.md: -------------------------------------------------------------------------------- 1 | # UpdateInstructionRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateInstructionRequest } from "ragie/models/operations"; 7 | 8 | let value: UpdateInstructionRequest = { 9 | instructionId: "00000000-0000-0000-0000-000000000000", 10 | updateInstructionParams: { 11 | active: true, 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | Example | 19 | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | 20 | | `instructionId` | *string* | :heavy_check_mark: | The ID of the instruction. | 00000000-0000-0000-0000-000000000000 | 21 | | `updateInstructionParams` | [components.UpdateInstructionParams](../../models/components/updateinstructionparams.md) | :heavy_check_mark: | N/A | | -------------------------------------------------------------------------------- /docs/sdks/ragie/README.md: -------------------------------------------------------------------------------- 1 | # Ragie SDK 2 | 3 | ## Overview 4 | 5 | ### Available Operations 6 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | 5 | /** @type {import('eslint').Linter.Config[]} */ 6 | export default [ 7 | { files: ["**/*.{js,mjs,cjs,ts}"] }, 8 | { languageOptions: { globals: globals.browser } }, 9 | pluginJs.configs.recommended, 10 | ...tseslint.configs.recommended, 11 | { 12 | rules: { 13 | "no-constant-condition": "off", 14 | "no-useless-escape": "off", 15 | // Handled by typescript compiler 16 | "@typescript-eslint/no-unused-vars": "off", 17 | "@typescript-eslint/no-explicit-any": "off", 18 | "@typescript-eslint/no-empty-object-type": "off", 19 | "@typescript-eslint/no-namespace": "off", 20 | }, 21 | }, 22 | ]; 23 | -------------------------------------------------------------------------------- /jsr.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "name": "ragie", 5 | "version": "1.9.0", 6 | "exports": { 7 | ".": "./src/index.ts", 8 | "./models/errors": "./src/models/errors/index.ts", 9 | "./models/components": "./src/models/components/index.ts", 10 | "./models/operations": "./src/models/operations/index.ts", 11 | "./lib/config": "./src/lib/config.ts", 12 | "./lib/http": "./src/lib/http.ts", 13 | "./lib/retries": "./src/lib/retries.ts", 14 | "./lib/sdks": "./src/lib/sdks.ts", 15 | "./types": "./src/types/index.ts" 16 | }, 17 | "publish": { 18 | "include": [ 19 | "LICENSE", 20 | "README.md", 21 | "RUNTIMES.md", 22 | "USAGE.md", 23 | "jsr.json", 24 | "src/**/*.ts" 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ragie", 3 | "version": "1.9.0", 4 | "author": "Speakeasy", 5 | "bin": { 6 | "mcp": "bin/mcp-server.js" 7 | }, 8 | "main": "./index.js", 9 | "sideEffects": false, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ragieai/ragie-typescript.git" 13 | }, 14 | "scripts": { 15 | "lint": "eslint --cache --max-warnings=0 src", 16 | "build:mcp": "bun src/mcp-server/build.mts", 17 | "build": "npm run build:mcp && tsc", 18 | "prepublishOnly": "npm run build" 19 | }, 20 | "peerDependencies": { 21 | "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", 22 | "zod": ">= 3" 23 | }, 24 | "peerDependenciesMeta": { 25 | "@modelcontextprotocol/sdk": {"optional":true} 26 | }, 27 | "devDependencies": { 28 | "@eslint/js": "^9.19.0", 29 | "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0", 30 | "@stricli/core": "^1.1.1", 31 | "@types/express": "^4.17.21", 32 | "bun": "^1.2.2", 33 | "bun-types": "^1.2.2", 34 | "eslint": "^9.19.0", 35 | "express": "^4.21.2", 36 | "globals": "^15.14.0", 37 | "typescript": "^5.4.5", 38 | "typescript-eslint": "^8.22.0", 39 | "zod": "^3.23.4" 40 | }, 41 | "dependencies": { 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/core.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "./lib/sdks.js"; 6 | 7 | /** 8 | * A minimal client to use when calling standalone SDK functions. Typically, an 9 | * instance of this class would be instantiated once at the start of an 10 | * application and passed around through some dependency injection mechanism to 11 | * parts of an application that need to make SDK calls. 12 | */ 13 | export class RagieCore extends ClientSDK {} 14 | -------------------------------------------------------------------------------- /src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./hooks.js"; 6 | export * from "./types.js"; 7 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./lib/config.js"; 6 | export * as files from "./lib/files.js"; 7 | export * from "./sdk/sdk.js"; 8 | -------------------------------------------------------------------------------- /src/lib/base64.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export function bytesToBase64(u8arr: Uint8Array): string { 8 | return btoa(String.fromCodePoint(...u8arr)); 9 | } 10 | 11 | export function bytesFromBase64(encoded: string): Uint8Array { 12 | return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); 13 | } 14 | 15 | export function stringToBytes(str: string): Uint8Array { 16 | return new TextEncoder().encode(str); 17 | } 18 | 19 | export function stringFromBytes(u8arr: Uint8Array): string { 20 | return new TextDecoder().decode(u8arr); 21 | } 22 | 23 | export function stringToBase64(str: string): string { 24 | return bytesToBase64(stringToBytes(str)); 25 | } 26 | 27 | export function stringFromBase64(b64str: string): string { 28 | return stringFromBytes(bytesFromBase64(b64str)); 29 | } 30 | 31 | export const zodOutbound = z 32 | .instanceof(Uint8Array) 33 | .or(z.string().transform(stringToBytes)); 34 | 35 | export const zodInbound = z 36 | .instanceof(Uint8Array) 37 | .or(z.string().transform(bytesFromBase64)); 38 | -------------------------------------------------------------------------------- /src/lib/config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { HTTPClient } from "./http.js"; 6 | import { Logger } from "./logger.js"; 7 | import { RetryConfig } from "./retries.js"; 8 | import { Params, pathToFunc } from "./url.js"; 9 | 10 | /** 11 | * Contains the list of servers available to the SDK 12 | */ 13 | export const ServerList = [ 14 | "https://api.ragie.ai", 15 | ] as const; 16 | 17 | export type SDKOptions = { 18 | auth?: string | (() => Promise) | undefined; 19 | 20 | httpClient?: HTTPClient; 21 | /** 22 | * Allows overriding the default server used by the SDK 23 | */ 24 | serverIdx?: number | undefined; 25 | /** 26 | * Allows overriding the default server URL used by the SDK 27 | */ 28 | serverURL?: string | undefined; 29 | /** 30 | * Allows overriding the default retry config used by the SDK 31 | */ 32 | retryConfig?: RetryConfig; 33 | timeoutMs?: number; 34 | debugLogger?: Logger; 35 | }; 36 | 37 | export function serverURLFromOptions(options: SDKOptions): URL | null { 38 | let serverURL = options.serverURL; 39 | 40 | const params: Params = {}; 41 | 42 | if (!serverURL) { 43 | const serverIdx = options.serverIdx ?? 0; 44 | if (serverIdx < 0 || serverIdx >= ServerList.length) { 45 | throw new Error(`Invalid server index ${serverIdx}`); 46 | } 47 | serverURL = ServerList[serverIdx] || ""; 48 | } 49 | 50 | const u = pathToFunc(serverURL)(params); 51 | return new URL(u); 52 | } 53 | 54 | export const SDK_METADATA = { 55 | language: "typescript", 56 | openapiDocVersion: "1.0.0", 57 | sdkVersion: "1.9.0", 58 | genVersion: "2.604.2", 59 | userAgent: "speakeasy-sdk/typescript 1.9.0 2.604.2 1.0.0 ragie", 60 | } as const; 61 | -------------------------------------------------------------------------------- /src/lib/dlv.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | /* 6 | MIT License 7 | 8 | Copyright (c) 2024 Jason Miller (http://jasonformat.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | this software and associated documentation files (the "Software"), to deal in 12 | the Software without restriction, including without limitation the rights to 13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | the Software, and to permit persons to whom the Software is furnished to do so, 15 | subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | /** 29 | * @param obj The object to walk 30 | * @param key The key path to walk the object with 31 | * @param def A default value to return if the result is undefined 32 | * 33 | * @example 34 | * dlv(obj, "a.b.c.d") 35 | * @example 36 | * dlv(object, ["a", "b", "c", "d"]) 37 | * @example 38 | * dlv(object, "foo.bar.baz", "Hello, default value!") 39 | */ 40 | export function dlv( 41 | obj: any, 42 | key: string | string[], 43 | def?: T, 44 | p?: number, 45 | undef?: never, 46 | ): T | undefined { 47 | key = Array.isArray(key) ? key : key.split("."); 48 | for (p = 0; p < key.length; p++) { 49 | const k = key[p]; 50 | obj = k != null && obj ? obj[k] : undef; 51 | } 52 | return obj === undef ? def : obj; 53 | } 54 | -------------------------------------------------------------------------------- /src/lib/files.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | /** 6 | * Consumes a stream and returns a concatenated array buffer. Useful in 7 | * situations where we need to read the whole file because it forms part of a 8 | * larger payload containing other fields, and we can't modify the underlying 9 | * request structure. 10 | */ 11 | export async function readableStreamToArrayBuffer( 12 | readable: ReadableStream, 13 | ): Promise { 14 | const reader = readable.getReader(); 15 | const chunks: Uint8Array[] = []; 16 | 17 | let totalLength = 0; 18 | let done = false; 19 | 20 | while (!done) { 21 | const { value, done: doneReading } = await reader.read(); 22 | 23 | if (doneReading) { 24 | done = true; 25 | } else { 26 | chunks.push(value); 27 | totalLength += value.length; 28 | } 29 | } 30 | 31 | const concatenatedChunks = new Uint8Array(totalLength); 32 | let offset = 0; 33 | 34 | for (const chunk of chunks) { 35 | concatenatedChunks.set(chunk, offset); 36 | offset += chunk.length; 37 | } 38 | 39 | return concatenatedChunks.buffer as ArrayBuffer; 40 | } 41 | -------------------------------------------------------------------------------- /src/lib/is-plain-object.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | /* 6 | MIT License 7 | 8 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | this software and associated documentation files (the "Software"), to deal in 12 | the Software without restriction, including without limitation the rights to 13 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | the Software, and to permit persons to whom the Software is furnished to do so, 15 | subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | // Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js 29 | 30 | export function isPlainObject(value: unknown): value is object { 31 | if (typeof value !== "object" || value === null) { 32 | return false; 33 | } 34 | 35 | const prototype = Object.getPrototypeOf(value); 36 | return ( 37 | (prototype === null || 38 | prototype === Object.prototype || 39 | Object.getPrototypeOf(prototype) === null) && 40 | !(Symbol.toStringTag in value) && 41 | !(Symbol.iterator in value) 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /src/lib/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export interface Logger { 6 | group(label?: string): void; 7 | groupEnd(): void; 8 | log(message: any, ...args: any[]): void; 9 | } 10 | -------------------------------------------------------------------------------- /src/lib/url.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | const hasOwn = Object.prototype.hasOwnProperty; 6 | 7 | export type Params = Partial>; 8 | 9 | export function pathToFunc( 10 | pathPattern: string, 11 | options?: { charEncoding?: "percent" | "none" }, 12 | ): (params?: Params) => string { 13 | const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; 14 | 15 | return function buildURLPath(params: Record = {}): string { 16 | return pathPattern.replace(paramRE, function (_, placeholder) { 17 | if (!hasOwn.call(params, placeholder)) { 18 | throw new Error(`Parameter '${placeholder}' is required`); 19 | } 20 | 21 | const value = params[placeholder]; 22 | if (typeof value !== "string" && typeof value !== "number") { 23 | throw new Error( 24 | `Parameter '${placeholder}' must be a string or number`, 25 | ); 26 | } 27 | 28 | return options?.charEncoding === "percent" 29 | ? encodeURIComponent(`${value}`) 30 | : `${value}`; 31 | }); 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /src/mcp-server/build.mts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { build } from "bun"; 4 | 5 | const entrypoint = "./src/mcp-server/mcp-server.ts"; 6 | 7 | await build({ 8 | entrypoints: [entrypoint], 9 | outdir: "./bin", 10 | sourcemap: "linked", 11 | target: "node", 12 | format: "esm", 13 | minify: false, 14 | throw: true, 15 | banner: "#!/usr/bin/env node", 16 | }); 17 | -------------------------------------------------------------------------------- /src/mcp-server/cli.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { CommandContext, StricliProcess } from "@stricli/core"; 6 | 7 | export interface LocalContext extends CommandContext { 8 | readonly process: StricliProcess; 9 | } 10 | 11 | export function buildContext(process: NodeJS.Process): LocalContext { 12 | return { process: process as StricliProcess }; 13 | } 14 | -------------------------------------------------------------------------------- /src/mcp-server/console-logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export const consoleLoggerLevels = [ 6 | "debug", 7 | "warning", 8 | "info", 9 | "error", 10 | ] as const; 11 | 12 | export type ConsoleLoggerLevel = (typeof consoleLoggerLevels)[number]; 13 | 14 | export type ConsoleLogger = { 15 | [key in ConsoleLoggerLevel]: ( 16 | message: string, 17 | data?: Record, 18 | ) => void; 19 | }; 20 | 21 | export function createConsoleLogger(level: ConsoleLoggerLevel): ConsoleLogger { 22 | const min = consoleLoggerLevels.indexOf(level); 23 | const noop = () => {}; 24 | 25 | const logger: ConsoleLogger = { 26 | debug: noop, 27 | warning: noop, 28 | info: noop, 29 | error: noop, 30 | }; 31 | 32 | return consoleLoggerLevels.reduce((logger, level, i) => { 33 | if (i < min) { 34 | return logger; 35 | } 36 | 37 | logger[level] = log.bind(null, level); 38 | 39 | return logger; 40 | }, logger); 41 | } 42 | 43 | function log( 44 | level: ConsoleLoggerLevel, 45 | message: string, 46 | data?: Record, 47 | ) { 48 | let line = ""; 49 | const allData = [{ msg: message, l: level }, data]; 50 | 51 | for (const ctx of allData) { 52 | for (const [key, value] of Object.entries(ctx || {})) { 53 | if (value == null) { 54 | line += ` ${key}=<${value}>`; 55 | } else if (typeof value === "function") { 56 | line += ` ${key}=`; 57 | } else if (typeof value === "symbol") { 58 | line += ` ${key}=${value.toString()}`; 59 | } else if (typeof value === "string") { 60 | const v = value.search(/\s/g) >= 0 ? JSON.stringify(value) : value; 61 | line += ` ${key}=${v}`; 62 | } else if (typeof value !== "object") { 63 | line += ` ${key}=${value}`; 64 | } else { 65 | line += ` ${key}="${JSON.stringify(value)}"`; 66 | } 67 | } 68 | } 69 | 70 | console.error(line); 71 | } 72 | -------------------------------------------------------------------------------- /src/mcp-server/extensions.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ZodRawShape } from "zod"; 6 | import { PromptArgsRawShape, PromptDefinition } from "./prompts.js"; 7 | import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js"; 8 | import { ToolDefinition } from "./tools.js"; 9 | 10 | export type Register = { 11 | tool: (def: ToolDefinition) => void; 12 | resource: (def: ResourceDefinition) => void; 13 | resourceTemplate: (def: ResourceTemplateDefinition) => void; 14 | prompt: ( 15 | prompt: PromptDefinition, 16 | ) => void; 17 | }; 18 | -------------------------------------------------------------------------------- /src/mcp-server/mcp-server.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { buildApplication, buildRouteMap, run } from "@stricli/core"; 6 | import process from "node:process"; 7 | import { buildContext } from "./cli.js"; 8 | import { startCommand } from "./cli/start/command.js"; 9 | 10 | const routes = buildRouteMap({ 11 | routes: { 12 | start: startCommand, 13 | }, 14 | docs: { 15 | brief: "MCP server CLI", 16 | }, 17 | }); 18 | 19 | export const app = buildApplication(routes, { 20 | name: "mcp", 21 | versionInfo: { 22 | currentVersion: "1.9.0", 23 | }, 24 | }); 25 | 26 | run(app, process.argv.slice(2), buildContext(process)); 27 | -------------------------------------------------------------------------------- /src/mcp-server/scopes.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export const mcpScopes = [] as const; 6 | 7 | export type MCPScope = (typeof mcpScopes)[number]; 8 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsCreateOAuthRedirectUrl.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsCreateOAuthRedirectUrl } from "../../funcs/connectionsCreateOAuthRedirectUrl.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.OAuthUrlCreate$inboundSchema, 11 | }; 12 | 13 | export const tool$connectionsCreateOAuthRedirectUrl: ToolDefinition< 14 | typeof args 15 | > = { 16 | name: "connections-create-O-auth-redirect-url", 17 | description: `Create Oauth Redirect Url 18 | 19 | Creates a redirect url to redirect the user to when initializing an embedded connector.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await connectionsCreateOAuthRedirectUrl( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsDelete.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsDelete } from "../../funcs/connectionsDelete.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations 12 | .DeleteConnectionConnectionsConnectionIdDeletePostRequest$inboundSchema, 13 | }; 14 | 15 | export const tool$connectionsDelete: ToolDefinition = { 16 | name: "connections-delete", 17 | description: `Delete Connection 18 | 19 | Schedules a connection to be deleted. You can choose to keep the files from the connection or delete them all. If you keep the files, they will no longer be associated to the connection. Deleting can take some time, so you will still see files for a bit after this is called.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await connectionsDelete( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsGet.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsGet } from "../../funcs/connectionsGet.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations.GetConnectionConnectionsConnectionIdGetRequest$inboundSchema, 12 | }; 13 | 14 | export const tool$connectionsGet: ToolDefinition = { 15 | name: "connections-get", 16 | description: `Get Connection 17 | 18 | Get a connection.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await connectionsGet( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsGetStats.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsGetStats } from "../../funcs/connectionsGetStats.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations 12 | .GetConnectionStatsConnectionsConnectionIdStatsGetRequest$inboundSchema, 13 | }; 14 | 15 | export const tool$connectionsGetStats: ToolDefinition = { 16 | name: "connections-get-stats", 17 | description: `Get Connection Stats 18 | 19 | Lists connection stats: total documents active documents, total active pages.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await connectionsGetStats( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsList.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsList } from "../../funcs/connectionsList.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.ListConnectionsConnectionsGetRequest$inboundSchema 11 | .optional(), 12 | }; 13 | 14 | export const tool$connectionsList: ToolDefinition = { 15 | name: "connections-list", 16 | description: `List Connections 17 | 18 | List all connections sorted by created_at in descending order. Results are paginated with a max limit of 100. When more documents are available, a \`cursor\` will be provided. Use the \`cursor\` parameter to retrieve the subsequent page.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await connectionsList( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value.result; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsListConnectionSourceTypes.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsListConnectionSourceTypes } from "../../funcs/connectionsListConnectionSourceTypes.js"; 6 | import { formatResult, ToolDefinition } from "../tools.js"; 7 | 8 | export const tool$connectionsListConnectionSourceTypes: ToolDefinition = { 9 | name: "connections-list-connection-source-types", 10 | description: `List Connection Source Types 11 | 12 | List available connection source types like 'google_drive' and 'notion' along with their metadata`, 13 | tool: async (client, ctx) => { 14 | const [result, apiCall] = await connectionsListConnectionSourceTypes( 15 | client, 16 | { fetchOptions: { signal: ctx.signal } }, 17 | ).$inspect(); 18 | 19 | if (!result.ok) { 20 | return { 21 | content: [{ type: "text", text: result.error.message }], 22 | isError: true, 23 | }; 24 | } 25 | 26 | const value = result.value; 27 | 28 | return formatResult(value, apiCall); 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsSetEnabled.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsSetEnabled } from "../../funcs/connectionsSetEnabled.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations 12 | .SetConnectionEnabledConnectionsConnectionIdEnabledPutRequest$inboundSchema, 13 | }; 14 | 15 | export const tool$connectionsSetEnabled: ToolDefinition = { 16 | name: "connections-set-enabled", 17 | description: `Set Connection Enabled 18 | 19 | Enable or disable the connection. A disabled connection won't sync.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await connectionsSetEnabled( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsSetLimits.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsSetLimits } from "../../funcs/connectionsSetLimits.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations 12 | .SetConnectionLimitsConnectionsConnectionIdLimitPutRequest$inboundSchema, 13 | }; 14 | 15 | export const tool$connectionsSetLimits: ToolDefinition = { 16 | name: "connections-set-limits", 17 | description: `Set Connection Limits 18 | 19 | Sets limits on a connection. Limits can be set on the total number of pages a connection can sync. When the limit is reached, the connection will be disabled. Limit may be removed by setting it to \`null\`.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await connectionsSetLimits( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsSync.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsSync } from "../../funcs/connectionsSync.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.SyncConnectionRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$connectionsSync: ToolDefinition = { 14 | name: "connections-sync", 15 | description: `Sync Connection 16 | 17 | Schedules a connector to sync as soon as possible.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await connectionsSync( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/connectionsUpdate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { connectionsUpdate } from "../../funcs/connectionsUpdate.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations.UpdateConnectionConnectionsConnectionIdPutRequest$inboundSchema, 12 | }; 13 | 14 | export const tool$connectionsUpdate: ToolDefinition = { 15 | name: "connections-update", 16 | description: `Update Connection 17 | 18 | Updates a connections metadata or mode. These changes will be seen after the next sync.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await connectionsUpdate( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsCreate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsCreate } from "../../funcs/documentsCreate.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.CreateDocumentParams$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsCreate: ToolDefinition = { 14 | name: "documents-create", 15 | description: `Create Document 16 | 17 | On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [\`pending\`, \`partitioning\`, \`partitioned\`, \`refined\`, \`chunked\`, \`indexed\`, \`summary_indexed\`, \`keyword_indexed\`, \`ready\`, \`failed\`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in \`indexed\` state. However the summary will only be available once the state has changed to \`summary_indexed\` or \`ready\`.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsCreate( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsCreateDocumentFromUrl.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsCreateDocumentFromUrl } from "../../funcs/documentsCreateDocumentFromUrl.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.CreateDocumentFromUrlParams$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsCreateDocumentFromUrl: ToolDefinition = 14 | { 15 | name: "documents-create-document-from-url", 16 | description: `Create Document From Url 17 | 18 | Ingest a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [\`pending\`, \`partitioning\`, \`partitioned\`, \`refined\`, \`chunked\`, \`indexed\`, \`summary_indexed\`, \`keyword_indexed\`, \`ready\`, \`failed\`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in \`indexed\` state. However the summary will only be available once the state has changed to \`summary_indexed\` or \`ready\`.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await documentsCreateDocumentFromUrl( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsCreateRaw.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsCreateRaw } from "../../funcs/documentsCreateRaw.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.CreateDocumentRawParams$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsCreateRaw: ToolDefinition = { 14 | name: "documents-create-raw", 15 | description: `Create Document Raw 16 | 17 | Ingest a document as raw text. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [\`pending\`, \`partitioning\`, \`partitioned\`, \`refined\`, \`chunked\`, \`indexed\`, \`summary_indexed\`, \`keyword_indexed\`, \`ready\`, \`failed\`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in \`indexed\` state. However the summary will only be available once the state has changed to \`summary_indexed\` or \`ready\`.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsCreateRaw( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsDelete.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsDelete } from "../../funcs/documentsDelete.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.DeleteDocumentRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsDelete: ToolDefinition = { 14 | name: "documents-delete", 15 | description: `Delete Document`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await documentsDelete( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGet.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGet } from "../../funcs/documentsGet.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGet: ToolDefinition = { 14 | name: "documents-get", 15 | description: `Get Document`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await documentsGet( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetChunk.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetChunk } from "../../funcs/documentsGetChunk.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentChunkRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetChunk: ToolDefinition = { 14 | name: "documents-get-chunk", 15 | description: `Get Document Chunk 16 | 17 | Gets a document chunk by its document and chunk ID.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetChunk( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetChunkContent.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetChunkContent } from "../../funcs/documentsGetChunkContent.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentChunkContentRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetChunkContent: ToolDefinition = { 14 | name: "documents-get-chunk-content", 15 | description: `Get Document Chunk Content 16 | 17 | Returns the content of a document chunk in the requested format. Can be used to stream media of the content for audio/video documents.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetChunkContent( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetChunks.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetChunks } from "../../funcs/documentsGetChunks.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentChunksRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetChunks: ToolDefinition = { 14 | name: "documents-get-chunks", 15 | description: `Get Document Chunks 16 | 17 | List all document chunks sorted by index in ascending order. May be limited to a range of chunk indices with the \`start_index\` and \`end_index\` parameters. Documents created prior to 9/18/2024, which have not been updated since, have chunks which do not include an index and their index will be returned as -1. They will be sorted by their ID instead. Updating the document using the \`Update Document File\` or \`Update Document Raw\` endpoint will regenerate document chunks, including their index. Results are paginated with a max limit of 100. When more chunks are available, a \`cursor\` will be provided. Use the \`cursor\` parameter to retrieve the subsequent page.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetChunks( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetContent.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetContent } from "../../funcs/documentsGetContent.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentContentRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetContent: ToolDefinition = { 14 | name: "documents-get-content", 15 | description: `Get Document Content 16 | 17 | Get the content of a document. The \`media_type\` parameter can be used to request the content in a different format. When requesting as \`application/json\` additional metadata about the document will be included. If the original document contained content such as images or other non-textual media, this response will include a text description of that media instead of the original file data. Using mime types such as \`audio/mpeg\` or \`video/mp4\` will stream the file in a format that can be provided to an audio video player.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetContent( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetSource.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetSource } from "../../funcs/documentsGetSource.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentSourceRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetSource: ToolDefinition = { 14 | name: "documents-get-source", 15 | description: `Get Document Source 16 | 17 | Get the source file of a document. The source file is the original file that was uploaded to create the document. If the document was created from a URL, the source file will be the content of the URL. If the document was created by a connection, the source file will vary based on the type of the connection. For example, a Google Drive connection will return the file that was synced from the Google Drive, while a SalesForce connection would return a JSON file of the data synced from SalesForce.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetSource( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsGetSummary.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsGetSummary } from "../../funcs/documentsGetSummary.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetDocumentSummaryRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsGetSummary: ToolDefinition = { 14 | name: "documents-get-summary", 15 | description: `Get Document Summary 16 | 17 | Get a LLM generated summary of the document. The summary is created when the document is first created or updated. Documents of types ['xls', 'xlsx', 'csv', 'json'] are not supported for summarization. Documents greater than 1M in token length are not supported. This feature is in beta and may change in the future.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsGetSummary( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsList.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsList } from "../../funcs/documentsList.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.ListDocumentsRequest$inboundSchema.optional(), 11 | }; 12 | 13 | export const tool$documentsList: ToolDefinition = { 14 | name: "documents-list", 15 | description: `List Documents 16 | 17 | List all documents sorted by created_at in descending order. Results are paginated with a max limit of 100. When more documents are available, a \`cursor\` will be provided. Use the \`cursor\` parameter to retrieve the subsequent page.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await documentsList( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value.result; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsPatchMetadata.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsPatchMetadata } from "../../funcs/documentsPatchMetadata.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.PatchDocumentMetadataRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsPatchMetadata: ToolDefinition = { 14 | name: "documents-patch-metadata", 15 | description: `Patch Document Metadata`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await documentsPatchMetadata( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsUpdateDocumentFromUrl.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsUpdateDocumentFromUrl } from "../../funcs/documentsUpdateDocumentFromUrl.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.UpdateDocumentFromUrlRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsUpdateDocumentFromUrl: ToolDefinition = 14 | { 15 | name: "documents-update-document-from-url", 16 | description: `Update Document Url 17 | 18 | Updates a document from a publicly accessible URL. On ingest, the document goes through a series of steps before it is ready for retrieval. Each step is reflected in the status of the document which can be one of [\`pending\`, \`partitioning\`, \`partitioned\`, \`refined\`, \`chunked\`, \`indexed\`, \`summary_indexed\`, \`keyword_indexed\`, \`ready\`, \`failed\`]. The document is available for retrieval once it is in ready state. The summary index step can take a few seconds. You can optionally use the document for retrieval once it is in \`indexed\` state. However the summary will only be available once the state has changed to \`summary_indexed\` or \`ready\`.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await documentsUpdateDocumentFromUrl( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsUpdateFile.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsUpdateFile } from "../../funcs/documentsUpdateFile.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.UpdateDocumentFileRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsUpdateFile: ToolDefinition = { 14 | name: "documents-update-file", 15 | description: `Update Document File`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await documentsUpdateFile( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/documentsUpdateRaw.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { documentsUpdateRaw } from "../../funcs/documentsUpdateRaw.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.UpdateDocumentRawRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$documentsUpdateRaw: ToolDefinition = { 14 | name: "documents-update-raw", 15 | description: `Update Document Raw`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await documentsUpdateRaw( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesCreateInstruction.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesCreateInstruction } from "../../funcs/entitiesCreateInstruction.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.CreateInstructionParams$inboundSchema, 11 | }; 12 | 13 | export const tool$entitiesCreateInstruction: ToolDefinition = { 14 | name: "entities-create-instruction", 15 | description: `Create Instruction 16 | 17 | Create a new instruction. Instructions are applied to documents as they are created or updated. The results of the instruction are stored as structured data in the schema defined by the \`entity_schema\` parameter. The \`prompt\` parameter is a natural language instruction which will be applied to documents. This feature is in beta and may change in the future.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await entitiesCreateInstruction( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesDelete.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesDelete } from "../../funcs/entitiesDelete.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.DeleteInstructionRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$entitiesDelete: ToolDefinition = { 14 | name: "entities-delete", 15 | description: `Delete Instruction 16 | 17 | Delete an instruction. This will delete the instruction and all entities generated by it. This operation is irreversible.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await entitiesDelete( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesListByDocument.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesListByDocument } from "../../funcs/entitiesListByDocument.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.ListEntitiesByDocumentRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$entitiesListByDocument: ToolDefinition = { 14 | name: "entities-list-by-document", 15 | description: `Get Document Extracted Entities`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await entitiesListByDocument( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value.result; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesListByInstruction.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesListByInstruction } from "../../funcs/entitiesListByInstruction.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.ListEntitiesByInstructionRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$entitiesListByInstruction: ToolDefinition = { 14 | name: "entities-list-by-instruction", 15 | description: `Get Instruction Extracted Entities`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await entitiesListByInstruction( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value.result; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesListInstructions.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesListInstructions } from "../../funcs/entitiesListInstructions.js"; 6 | import { formatResult, ToolDefinition } from "../tools.js"; 7 | 8 | export const tool$entitiesListInstructions: ToolDefinition = { 9 | name: "entities-list-instructions", 10 | description: `List Instructions 11 | 12 | List all instructions.`, 13 | tool: async (client, ctx) => { 14 | const [result, apiCall] = await entitiesListInstructions( 15 | client, 16 | { fetchOptions: { signal: ctx.signal } }, 17 | ).$inspect(); 18 | 19 | if (!result.ok) { 20 | return { 21 | content: [{ type: "text", text: result.error.message }], 22 | isError: true, 23 | }; 24 | } 25 | 26 | const value = result.value; 27 | 28 | return formatResult(value, apiCall); 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /src/mcp-server/tools/entitiesUpdateInstruction.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { entitiesUpdateInstruction } from "../../funcs/entitiesUpdateInstruction.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.UpdateInstructionRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$entitiesUpdateInstruction: ToolDefinition = { 14 | name: "entities-update-instruction", 15 | description: `Update Instruction`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await entitiesUpdateInstruction( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/mcp-server/tools/partitionsCreate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { partitionsCreate } from "../../funcs/partitionsCreate.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.CreatePartitionParams$inboundSchema, 11 | }; 12 | 13 | export const tool$partitionsCreate: ToolDefinition = { 14 | name: "partitions-create", 15 | description: `Create Partition 16 | 17 | Create a new partition. Partitions are used to scope documents, connections, and instructions. Partitions must be lowercase alphanumeric and may only include the special characters \`_\` and \`-\`. A partition may also be created by creating a document in it. Limits for a partition may optionally be defined when creating.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await partitionsCreate( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/partitionsDelete.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { partitionsDelete } from "../../funcs/partitionsDelete.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations.DeletePartitionPartitionsPartitionIdDeleteRequest$inboundSchema, 12 | }; 13 | 14 | export const tool$partitionsDelete: ToolDefinition = { 15 | name: "partitions-delete", 16 | description: `Delete Partition 17 | 18 | Deletes a partition and all of its associated data. This includes connections, documents, and partition specific instructions. This operation is irreversible.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await partitionsDelete( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/partitionsGet.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { partitionsGet } from "../../funcs/partitionsGet.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.GetPartitionPartitionsPartitionIdGetRequest$inboundSchema, 11 | }; 12 | 13 | export const tool$partitionsGet: ToolDefinition = { 14 | name: "partitions-get", 15 | description: `Get Partition 16 | 17 | Get a partition by its ID. Includes usage information such as the number of documents and pages hosted and processed. The partition's limits are also included.`, 18 | args, 19 | tool: async (client, args, ctx) => { 20 | const [result, apiCall] = await partitionsGet( 21 | client, 22 | args.request, 23 | { fetchOptions: { signal: ctx.signal } }, 24 | ).$inspect(); 25 | 26 | if (!result.ok) { 27 | return { 28 | content: [{ type: "text", text: result.error.message }], 29 | isError: true, 30 | }; 31 | } 32 | 33 | const value = result.value; 34 | 35 | return formatResult(value, apiCall); 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /src/mcp-server/tools/partitionsList.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { partitionsList } from "../../funcs/partitionsList.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: operations.ListPartitionsPartitionsGetRequest$inboundSchema 11 | .optional(), 12 | }; 13 | 14 | export const tool$partitionsList: ToolDefinition = { 15 | name: "partitions-list", 16 | description: `List Partitions 17 | 18 | List all partitions sorted by name in ascending order. Results are paginated with a max limit of 100. When more partitions are available, a \`cursor\` will be provided. Use the \`cursor\` parameter to retrieve the subsequent page.`, 19 | args, 20 | tool: async (client, args, ctx) => { 21 | const [result, apiCall] = await partitionsList( 22 | client, 23 | args.request, 24 | { fetchOptions: { signal: ctx.signal } }, 25 | ).$inspect(); 26 | 27 | if (!result.ok) { 28 | return { 29 | content: [{ type: "text", text: result.error.message }], 30 | isError: true, 31 | }; 32 | } 33 | 34 | const value = result.value.result; 35 | 36 | return formatResult(value, apiCall); 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /src/mcp-server/tools/partitionsSetLimits.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { partitionsSetLimits } from "../../funcs/partitionsSetLimits.js"; 6 | import * as operations from "../../models/operations/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: 11 | operations 12 | .SetPartitionLimitsPartitionsPartitionIdLimitsPutRequest$inboundSchema, 13 | }; 14 | 15 | export const tool$partitionsSetLimits: ToolDefinition = { 16 | name: "partitions-set-limits", 17 | description: `Set Partition Limits 18 | 19 | Sets limits on a partition. Limits can be set on the total number of pages a partition can host and process. When the limit is reached, the partition will be disabled. A limit may be removed by setting it to \`null\`.`, 20 | args, 21 | tool: async (client, args, ctx) => { 22 | const [result, apiCall] = await partitionsSetLimits( 23 | client, 24 | args.request, 25 | { fetchOptions: { signal: ctx.signal } }, 26 | ).$inspect(); 27 | 28 | if (!result.ok) { 29 | return { 30 | content: [{ type: "text", text: result.error.message }], 31 | isError: true, 32 | }; 33 | } 34 | 35 | const value = result.value; 36 | 37 | return formatResult(value, apiCall); 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/mcp-server/tools/retrievalsRetrieve.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { retrievalsRetrieve } from "../../funcs/retrievalsRetrieve.js"; 6 | import * as components from "../../models/components/index.js"; 7 | import { formatResult, ToolDefinition } from "../tools.js"; 8 | 9 | const args = { 10 | request: components.RetrieveParams$inboundSchema, 11 | }; 12 | 13 | export const tool$retrievalsRetrieve: ToolDefinition = { 14 | name: "retrievals-retrieve", 15 | description: `Retrieve`, 16 | args, 17 | tool: async (client, args, ctx) => { 18 | const [result, apiCall] = await retrievalsRetrieve( 19 | client, 20 | args.request, 21 | { fetchOptions: { signal: ctx.signal } }, 22 | ).$inspect(); 23 | 24 | if (!result.ok) { 25 | return { 26 | content: [{ type: "text", text: result.error.message }], 27 | isError: true, 28 | }; 29 | } 30 | 31 | const value = result.value; 32 | 33 | return formatResult(value, apiCall); 34 | }, 35 | }; 36 | -------------------------------------------------------------------------------- /src/models/components/connectorsource.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { ClosedEnum } from "../../types/enums.js"; 7 | 8 | export const ConnectorSource = { 9 | Backblaze: "backblaze", 10 | Confluence: "confluence", 11 | Dropbox: "dropbox", 12 | Freshdesk: "freshdesk", 13 | Onedrive: "onedrive", 14 | GoogleDrive: "google_drive", 15 | Gmail: "gmail", 16 | Intercom: "intercom", 17 | Notion: "notion", 18 | Salesforce: "salesforce", 19 | Sharepoint: "sharepoint", 20 | Jira: "jira", 21 | Slack: "slack", 22 | S3: "s3", 23 | Gcs: "gcs", 24 | Hubspot: "hubspot", 25 | Zendesk: "zendesk", 26 | } as const; 27 | export type ConnectorSource = ClosedEnum; 28 | 29 | /** @internal */ 30 | export const ConnectorSource$inboundSchema: z.ZodNativeEnum< 31 | typeof ConnectorSource 32 | > = z.nativeEnum(ConnectorSource); 33 | 34 | /** @internal */ 35 | export const ConnectorSource$outboundSchema: z.ZodNativeEnum< 36 | typeof ConnectorSource 37 | > = ConnectorSource$inboundSchema; 38 | 39 | /** 40 | * @internal 41 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 42 | */ 43 | export namespace ConnectorSource$ { 44 | /** @deprecated use `ConnectorSource$inboundSchema` instead. */ 45 | export const inboundSchema = ConnectorSource$inboundSchema; 46 | /** @deprecated use `ConnectorSource$outboundSchema` instead. */ 47 | export const outboundSchema = ConnectorSource$outboundSchema; 48 | } 49 | -------------------------------------------------------------------------------- /src/models/components/documentdelete.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type DocumentDelete = { 11 | status: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const DocumentDelete$inboundSchema: z.ZodType< 16 | DocumentDelete, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | status: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type DocumentDelete$Outbound = { 25 | status: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const DocumentDelete$outboundSchema: z.ZodType< 30 | DocumentDelete$Outbound, 31 | z.ZodTypeDef, 32 | DocumentDelete 33 | > = z.object({ 34 | status: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace DocumentDelete$ { 42 | /** @deprecated use `DocumentDelete$inboundSchema` instead. */ 43 | export const inboundSchema = DocumentDelete$inboundSchema; 44 | /** @deprecated use `DocumentDelete$outboundSchema` instead. */ 45 | export const outboundSchema = DocumentDelete$outboundSchema; 46 | /** @deprecated use `DocumentDelete$Outbound` instead. */ 47 | export type Outbound = DocumentDelete$Outbound; 48 | } 49 | 50 | export function documentDeleteToJSON(documentDelete: DocumentDelete): string { 51 | return JSON.stringify(DocumentDelete$outboundSchema.parse(documentDelete)); 52 | } 53 | 54 | export function documentDeleteFromJSON( 55 | jsonString: string, 56 | ): SafeParseResult { 57 | return safeParse( 58 | jsonString, 59 | (x) => DocumentDelete$inboundSchema.parse(JSON.parse(x)), 60 | `Failed to parse 'DocumentDelete' from JSON`, 61 | ); 62 | } 63 | -------------------------------------------------------------------------------- /src/models/components/documentfileupdate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type DocumentFileUpdate = { 11 | status: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const DocumentFileUpdate$inboundSchema: z.ZodType< 16 | DocumentFileUpdate, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | status: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type DocumentFileUpdate$Outbound = { 25 | status: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const DocumentFileUpdate$outboundSchema: z.ZodType< 30 | DocumentFileUpdate$Outbound, 31 | z.ZodTypeDef, 32 | DocumentFileUpdate 33 | > = z.object({ 34 | status: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace DocumentFileUpdate$ { 42 | /** @deprecated use `DocumentFileUpdate$inboundSchema` instead. */ 43 | export const inboundSchema = DocumentFileUpdate$inboundSchema; 44 | /** @deprecated use `DocumentFileUpdate$outboundSchema` instead. */ 45 | export const outboundSchema = DocumentFileUpdate$outboundSchema; 46 | /** @deprecated use `DocumentFileUpdate$Outbound` instead. */ 47 | export type Outbound = DocumentFileUpdate$Outbound; 48 | } 49 | 50 | export function documentFileUpdateToJSON( 51 | documentFileUpdate: DocumentFileUpdate, 52 | ): string { 53 | return JSON.stringify( 54 | DocumentFileUpdate$outboundSchema.parse(documentFileUpdate), 55 | ); 56 | } 57 | 58 | export function documentFileUpdateFromJSON( 59 | jsonString: string, 60 | ): SafeParseResult { 61 | return safeParse( 62 | jsonString, 63 | (x) => DocumentFileUpdate$inboundSchema.parse(JSON.parse(x)), 64 | `Failed to parse 'DocumentFileUpdate' from JSON`, 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /src/models/components/documentrawupdate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type DocumentRawUpdate = { 11 | status: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const DocumentRawUpdate$inboundSchema: z.ZodType< 16 | DocumentRawUpdate, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | status: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type DocumentRawUpdate$Outbound = { 25 | status: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const DocumentRawUpdate$outboundSchema: z.ZodType< 30 | DocumentRawUpdate$Outbound, 31 | z.ZodTypeDef, 32 | DocumentRawUpdate 33 | > = z.object({ 34 | status: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace DocumentRawUpdate$ { 42 | /** @deprecated use `DocumentRawUpdate$inboundSchema` instead. */ 43 | export const inboundSchema = DocumentRawUpdate$inboundSchema; 44 | /** @deprecated use `DocumentRawUpdate$outboundSchema` instead. */ 45 | export const outboundSchema = DocumentRawUpdate$outboundSchema; 46 | /** @deprecated use `DocumentRawUpdate$Outbound` instead. */ 47 | export type Outbound = DocumentRawUpdate$Outbound; 48 | } 49 | 50 | export function documentRawUpdateToJSON( 51 | documentRawUpdate: DocumentRawUpdate, 52 | ): string { 53 | return JSON.stringify( 54 | DocumentRawUpdate$outboundSchema.parse(documentRawUpdate), 55 | ); 56 | } 57 | 58 | export function documentRawUpdateFromJSON( 59 | jsonString: string, 60 | ): SafeParseResult { 61 | return safeParse( 62 | jsonString, 63 | (x) => DocumentRawUpdate$inboundSchema.parse(JSON.parse(x)), 64 | `Failed to parse 'DocumentRawUpdate' from JSON`, 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /src/models/components/documenturlupdate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type DocumentUrlUpdate = { 11 | status: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const DocumentUrlUpdate$inboundSchema: z.ZodType< 16 | DocumentUrlUpdate, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | status: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type DocumentUrlUpdate$Outbound = { 25 | status: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const DocumentUrlUpdate$outboundSchema: z.ZodType< 30 | DocumentUrlUpdate$Outbound, 31 | z.ZodTypeDef, 32 | DocumentUrlUpdate 33 | > = z.object({ 34 | status: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace DocumentUrlUpdate$ { 42 | /** @deprecated use `DocumentUrlUpdate$inboundSchema` instead. */ 43 | export const inboundSchema = DocumentUrlUpdate$inboundSchema; 44 | /** @deprecated use `DocumentUrlUpdate$outboundSchema` instead. */ 45 | export const outboundSchema = DocumentUrlUpdate$outboundSchema; 46 | /** @deprecated use `DocumentUrlUpdate$Outbound` instead. */ 47 | export type Outbound = DocumentUrlUpdate$Outbound; 48 | } 49 | 50 | export function documentUrlUpdateToJSON( 51 | documentUrlUpdate: DocumentUrlUpdate, 52 | ): string { 53 | return JSON.stringify( 54 | DocumentUrlUpdate$outboundSchema.parse(documentUrlUpdate), 55 | ); 56 | } 57 | 58 | export function documentUrlUpdateFromJSON( 59 | jsonString: string, 60 | ): SafeParseResult { 61 | return safeParse( 62 | jsonString, 63 | (x) => DocumentUrlUpdate$inboundSchema.parse(JSON.parse(x)), 64 | `Failed to parse 'DocumentUrlUpdate' from JSON`, 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /src/models/components/link.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type Link = { 11 | href: string; 12 | type: string; 13 | }; 14 | 15 | /** @internal */ 16 | export const Link$inboundSchema: z.ZodType = z 17 | .object({ 18 | href: z.string(), 19 | type: z.string(), 20 | }); 21 | 22 | /** @internal */ 23 | export type Link$Outbound = { 24 | href: string; 25 | type: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const Link$outboundSchema: z.ZodType = 30 | z.object({ 31 | href: z.string(), 32 | type: z.string(), 33 | }); 34 | 35 | /** 36 | * @internal 37 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 38 | */ 39 | export namespace Link$ { 40 | /** @deprecated use `Link$inboundSchema` instead. */ 41 | export const inboundSchema = Link$inboundSchema; 42 | /** @deprecated use `Link$outboundSchema` instead. */ 43 | export const outboundSchema = Link$outboundSchema; 44 | /** @deprecated use `Link$Outbound` instead. */ 45 | export type Outbound = Link$Outbound; 46 | } 47 | 48 | export function linkToJSON(link: Link): string { 49 | return JSON.stringify(Link$outboundSchema.parse(link)); 50 | } 51 | 52 | export function linkFromJSON( 53 | jsonString: string, 54 | ): SafeParseResult { 55 | return safeParse( 56 | jsonString, 57 | (x) => Link$inboundSchema.parse(JSON.parse(x)), 58 | `Failed to parse 'Link' from JSON`, 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /src/models/components/oauthurlresponse.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type OAuthUrlResponse = { 11 | url: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const OAuthUrlResponse$inboundSchema: z.ZodType< 16 | OAuthUrlResponse, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | url: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type OAuthUrlResponse$Outbound = { 25 | url: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const OAuthUrlResponse$outboundSchema: z.ZodType< 30 | OAuthUrlResponse$Outbound, 31 | z.ZodTypeDef, 32 | OAuthUrlResponse 33 | > = z.object({ 34 | url: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace OAuthUrlResponse$ { 42 | /** @deprecated use `OAuthUrlResponse$inboundSchema` instead. */ 43 | export const inboundSchema = OAuthUrlResponse$inboundSchema; 44 | /** @deprecated use `OAuthUrlResponse$outboundSchema` instead. */ 45 | export const outboundSchema = OAuthUrlResponse$outboundSchema; 46 | /** @deprecated use `OAuthUrlResponse$Outbound` instead. */ 47 | export type Outbound = OAuthUrlResponse$Outbound; 48 | } 49 | 50 | export function oAuthUrlResponseToJSON( 51 | oAuthUrlResponse: OAuthUrlResponse, 52 | ): string { 53 | return JSON.stringify( 54 | OAuthUrlResponse$outboundSchema.parse(oAuthUrlResponse), 55 | ); 56 | } 57 | 58 | export function oAuthUrlResponseFromJSON( 59 | jsonString: string, 60 | ): SafeParseResult { 61 | return safeParse( 62 | jsonString, 63 | (x) => OAuthUrlResponse$inboundSchema.parse(JSON.parse(x)), 64 | `Failed to parse 'OAuthUrlResponse' from JSON`, 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /src/models/components/responseok.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type ResponseOK = { 11 | message?: string | undefined; 12 | }; 13 | 14 | /** @internal */ 15 | export const ResponseOK$inboundSchema: z.ZodType< 16 | ResponseOK, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | message: z.string().default("ok"), 21 | }); 22 | 23 | /** @internal */ 24 | export type ResponseOK$Outbound = { 25 | message: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const ResponseOK$outboundSchema: z.ZodType< 30 | ResponseOK$Outbound, 31 | z.ZodTypeDef, 32 | ResponseOK 33 | > = z.object({ 34 | message: z.string().default("ok"), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace ResponseOK$ { 42 | /** @deprecated use `ResponseOK$inboundSchema` instead. */ 43 | export const inboundSchema = ResponseOK$inboundSchema; 44 | /** @deprecated use `ResponseOK$outboundSchema` instead. */ 45 | export const outboundSchema = ResponseOK$outboundSchema; 46 | /** @deprecated use `ResponseOK$Outbound` instead. */ 47 | export type Outbound = ResponseOK$Outbound; 48 | } 49 | 50 | export function responseOKToJSON(responseOK: ResponseOK): string { 51 | return JSON.stringify(ResponseOK$outboundSchema.parse(responseOK)); 52 | } 53 | 54 | export function responseOKFromJSON( 55 | jsonString: string, 56 | ): SafeParseResult { 57 | return safeParse( 58 | jsonString, 59 | (x) => ResponseOK$inboundSchema.parse(JSON.parse(x)), 60 | `Failed to parse 'ResponseOK' from JSON`, 61 | ); 62 | } 63 | -------------------------------------------------------------------------------- /src/models/components/security.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | import { safeParse } from "../../lib/schemas.js"; 7 | import { Result as SafeParseResult } from "../../types/fp.js"; 8 | import { SDKValidationError } from "../errors/sdkvalidationerror.js"; 9 | 10 | export type Security = { 11 | auth: string; 12 | }; 13 | 14 | /** @internal */ 15 | export const Security$inboundSchema: z.ZodType< 16 | Security, 17 | z.ZodTypeDef, 18 | unknown 19 | > = z.object({ 20 | auth: z.string(), 21 | }); 22 | 23 | /** @internal */ 24 | export type Security$Outbound = { 25 | auth: string; 26 | }; 27 | 28 | /** @internal */ 29 | export const Security$outboundSchema: z.ZodType< 30 | Security$Outbound, 31 | z.ZodTypeDef, 32 | Security 33 | > = z.object({ 34 | auth: z.string(), 35 | }); 36 | 37 | /** 38 | * @internal 39 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 40 | */ 41 | export namespace Security$ { 42 | /** @deprecated use `Security$inboundSchema` instead. */ 43 | export const inboundSchema = Security$inboundSchema; 44 | /** @deprecated use `Security$outboundSchema` instead. */ 45 | export const outboundSchema = Security$outboundSchema; 46 | /** @deprecated use `Security$Outbound` instead. */ 47 | export type Outbound = Security$Outbound; 48 | } 49 | 50 | export function securityToJSON(security: Security): string { 51 | return JSON.stringify(Security$outboundSchema.parse(security)); 52 | } 53 | 54 | export function securityFromJSON( 55 | jsonString: string, 56 | ): SafeParseResult { 57 | return safeParse( 58 | jsonString, 59 | (x) => Security$inboundSchema.parse(JSON.parse(x)), 60 | `Failed to parse 'Security' from JSON`, 61 | ); 62 | } 63 | -------------------------------------------------------------------------------- /src/models/errors/errormessage.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export type ErrorMessageData = { 8 | detail: string; 9 | }; 10 | 11 | export class ErrorMessage extends Error { 12 | detail: string; 13 | 14 | /** The original data that was passed to this error instance. */ 15 | data$: ErrorMessageData; 16 | 17 | constructor(err: ErrorMessageData) { 18 | const message = "message" in err && typeof err.message === "string" 19 | ? err.message 20 | : `API error occurred: ${JSON.stringify(err)}`; 21 | super(message); 22 | this.data$ = err; 23 | 24 | this.detail = err.detail; 25 | 26 | this.name = "ErrorMessage"; 27 | } 28 | } 29 | 30 | /** @internal */ 31 | export const ErrorMessage$inboundSchema: z.ZodType< 32 | ErrorMessage, 33 | z.ZodTypeDef, 34 | unknown 35 | > = z.object({ 36 | detail: z.string(), 37 | }) 38 | .transform((v) => { 39 | return new ErrorMessage(v); 40 | }); 41 | 42 | /** @internal */ 43 | export type ErrorMessage$Outbound = { 44 | detail: string; 45 | }; 46 | 47 | /** @internal */ 48 | export const ErrorMessage$outboundSchema: z.ZodType< 49 | ErrorMessage$Outbound, 50 | z.ZodTypeDef, 51 | ErrorMessage 52 | > = z.instanceof(ErrorMessage) 53 | .transform(v => v.data$) 54 | .pipe(z.object({ 55 | detail: z.string(), 56 | })); 57 | 58 | /** 59 | * @internal 60 | * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. 61 | */ 62 | export namespace ErrorMessage$ { 63 | /** @deprecated use `ErrorMessage$inboundSchema` instead. */ 64 | export const inboundSchema = ErrorMessage$inboundSchema; 65 | /** @deprecated use `ErrorMessage$outboundSchema` instead. */ 66 | export const outboundSchema = ErrorMessage$outboundSchema; 67 | /** @deprecated use `ErrorMessage$Outbound` instead. */ 68 | export type Outbound = ErrorMessage$Outbound; 69 | } 70 | -------------------------------------------------------------------------------- /src/models/errors/httpclienterrors.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | /** 6 | * Base class for all HTTP errors. 7 | */ 8 | export class HTTPClientError extends Error { 9 | /** The underlying cause of the error. */ 10 | override readonly cause: unknown; 11 | override name = "HTTPClientError"; 12 | constructor(message: string, opts?: { cause?: unknown }) { 13 | let msg = message; 14 | if (opts?.cause) { 15 | msg += `: ${opts.cause}`; 16 | } 17 | 18 | super(msg, opts); 19 | // In older runtimes, the cause field would not have been assigned through 20 | // the super() call. 21 | if (typeof this.cause === "undefined") { 22 | this.cause = opts?.cause; 23 | } 24 | } 25 | } 26 | 27 | /** 28 | * An error to capture unrecognised or unexpected errors when making HTTP calls. 29 | */ 30 | export class UnexpectedClientError extends HTTPClientError { 31 | override name = "UnexpectedClientError"; 32 | } 33 | 34 | /** 35 | * An error that is raised when any inputs used to create a request are invalid. 36 | */ 37 | export class InvalidRequestError extends HTTPClientError { 38 | override name = "InvalidRequestError"; 39 | } 40 | 41 | /** 42 | * An error that is raised when a HTTP request was aborted by the client error. 43 | */ 44 | export class RequestAbortedError extends HTTPClientError { 45 | override readonly name = "RequestAbortedError"; 46 | } 47 | 48 | /** 49 | * An error that is raised when a HTTP request timed out due to an AbortSignal 50 | * signal timeout. 51 | */ 52 | export class RequestTimeoutError extends HTTPClientError { 53 | override readonly name = "RequestTimeoutError"; 54 | } 55 | 56 | /** 57 | * An error that is raised when a HTTP client is unable to make a request to 58 | * a server. 59 | */ 60 | export class ConnectionError extends HTTPClientError { 61 | override readonly name = "ConnectionError"; 62 | } 63 | -------------------------------------------------------------------------------- /src/models/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./errormessage.js"; 6 | export * from "./httpclienterrors.js"; 7 | export * from "./httpvalidationerror.js"; 8 | export * from "./sdkerror.js"; 9 | export * from "./sdkvalidationerror.js"; 10 | -------------------------------------------------------------------------------- /src/models/errors/sdkerror.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export class SDKError extends Error { 6 | public readonly statusCode: number; 7 | public readonly contentType: string; 8 | 9 | constructor( 10 | message: string, 11 | public readonly rawResponse: Response, 12 | public readonly body: string = "", 13 | ) { 14 | const statusCode = rawResponse.status; 15 | const contentType = rawResponse.headers.get("content-type") || ""; 16 | const bodyString = body.length > 0 ? `\n${body}` : ""; 17 | 18 | super( 19 | `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, 20 | ); 21 | 22 | this.statusCode = statusCode; 23 | this.contentType = contentType; 24 | 25 | this.name = "SDKError"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/models/operations/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./deleteconnectionconnectionsconnectioniddeletepost.js"; 6 | export * from "./deletedocument.js"; 7 | export * from "./deleteinstruction.js"; 8 | export * from "./deletepartitionpartitionspartitioniddelete.js"; 9 | export * from "./getconnectionconnectionsconnectionidget.js"; 10 | export * from "./getconnectionstatsconnectionsconnectionidstatsget.js"; 11 | export * from "./getdocument.js"; 12 | export * from "./getdocumentchunk.js"; 13 | export * from "./getdocumentchunkcontent.js"; 14 | export * from "./getdocumentchunks.js"; 15 | export * from "./getdocumentcontent.js"; 16 | export * from "./getdocumentsource.js"; 17 | export * from "./getdocumentsummary.js"; 18 | export * from "./getpartitionpartitionspartitionidget.js"; 19 | export * from "./listconnectionsconnectionsget.js"; 20 | export * from "./listdocuments.js"; 21 | export * from "./listentitiesbydocument.js"; 22 | export * from "./listentitiesbyinstruction.js"; 23 | export * from "./listpartitionspartitionsget.js"; 24 | export * from "./patchdocumentmetadata.js"; 25 | export * from "./setconnectionenabledconnectionsconnectionidenabledput.js"; 26 | export * from "./setconnectionlimitsconnectionsconnectionidlimitput.js"; 27 | export * from "./setpartitionlimitspartitionspartitionidlimitsput.js"; 28 | export * from "./syncconnection.js"; 29 | export * from "./updateconnectionconnectionsconnectionidput.js"; 30 | export * from "./updatedocumentfile.js"; 31 | export * from "./updatedocumentfromurl.js"; 32 | export * from "./updatedocumentraw.js"; 33 | export * from "./updateinstruction.js"; 34 | -------------------------------------------------------------------------------- /src/sdk/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./sdk.js"; 6 | -------------------------------------------------------------------------------- /src/sdk/retrievals.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { retrievalsRetrieve } from "../funcs/retrievalsRetrieve.js"; 6 | import { ClientSDK, RequestOptions } from "../lib/sdks.js"; 7 | import * as components from "../models/components/index.js"; 8 | import { unwrapAsync } from "../types/fp.js"; 9 | 10 | export class Retrievals extends ClientSDK { 11 | /** 12 | * Retrieve 13 | */ 14 | async retrieve( 15 | request: components.RetrieveParams, 16 | options?: RequestOptions, 17 | ): Promise { 18 | return unwrapAsync(retrievalsRetrieve( 19 | this, 20 | request, 21 | options, 22 | )); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/sdk/sdk.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "../lib/sdks.js"; 6 | import { Connections } from "./connections.js"; 7 | import { Documents } from "./documents.js"; 8 | import { Entities } from "./entities.js"; 9 | import { Partitions } from "./partitions.js"; 10 | import { Retrievals } from "./retrievals.js"; 11 | 12 | export class Ragie extends ClientSDK { 13 | private _documents?: Documents; 14 | get documents(): Documents { 15 | return (this._documents ??= new Documents(this._options)); 16 | } 17 | 18 | private _retrievals?: Retrievals; 19 | get retrievals(): Retrievals { 20 | return (this._retrievals ??= new Retrievals(this._options)); 21 | } 22 | 23 | private _entities?: Entities; 24 | get entities(): Entities { 25 | return (this._entities ??= new Entities(this._options)); 26 | } 27 | 28 | private _connections?: Connections; 29 | get connections(): Connections { 30 | return (this._connections ??= new Connections(this._options)); 31 | } 32 | 33 | private _partitions?: Partitions; 34 | get partitions(): Partitions { 35 | return (this._partitions ??= new Partitions(this._options)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/types/async.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export type APICall = 6 | | { 7 | status: "complete"; 8 | request: Request; 9 | response: Response; 10 | } 11 | | { 12 | status: "request-error"; 13 | request: Request; 14 | response?: undefined; 15 | } 16 | | { 17 | status: "invalid"; 18 | request?: undefined; 19 | response?: undefined; 20 | }; 21 | 22 | export class APIPromise implements Promise { 23 | readonly #promise: Promise<[T, APICall]>; 24 | readonly #unwrapped: Promise; 25 | 26 | readonly [Symbol.toStringTag] = "APIPromise"; 27 | 28 | constructor(p: [T, APICall] | Promise<[T, APICall]>) { 29 | this.#promise = p instanceof Promise ? p : Promise.resolve(p); 30 | this.#unwrapped = 31 | p instanceof Promise 32 | ? this.#promise.then(([value]) => value) 33 | : Promise.resolve(p[0]); 34 | } 35 | 36 | then( 37 | onfulfilled?: 38 | | ((value: T) => TResult1 | PromiseLike) 39 | | null 40 | | undefined, 41 | onrejected?: 42 | | ((reason: any) => TResult2 | PromiseLike) 43 | | null 44 | | undefined, 45 | ): Promise { 46 | return this.#promise.then( 47 | onfulfilled ? ([value]) => onfulfilled(value) : void 0, 48 | onrejected, 49 | ); 50 | } 51 | 52 | catch( 53 | onrejected?: 54 | | ((reason: any) => TResult | PromiseLike) 55 | | null 56 | | undefined, 57 | ): Promise { 58 | return this.#unwrapped.catch(onrejected); 59 | } 60 | 61 | finally(onfinally?: (() => void) | null | undefined): Promise { 62 | return this.#unwrapped.finally(onfinally); 63 | } 64 | 65 | $inspect(): Promise<[T, APICall]> { 66 | return this.#promise; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/types/blobs.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export const blobLikeSchema: z.ZodType = 8 | z.custom(isBlobLike, { 9 | message: "expected a Blob, File or Blob-like object", 10 | fatal: true, 11 | }); 12 | 13 | export function isBlobLike(val: unknown): val is Blob { 14 | if (val instanceof Blob) { 15 | return true; 16 | } 17 | 18 | if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { 19 | return false; 20 | } 21 | 22 | const name = val[Symbol.toStringTag]; 23 | if (typeof name !== "string") { 24 | return false; 25 | } 26 | if (name !== "Blob" && name !== "File") { 27 | return false; 28 | } 29 | 30 | return "stream" in val && typeof val.stream === "function"; 31 | } 32 | -------------------------------------------------------------------------------- /src/types/constdatetime.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export function constDateTime( 8 | val: string, 9 | ): z.ZodType { 10 | return z.custom((v) => { 11 | return ( 12 | typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() 13 | ); 14 | }, `Value must be equivelant to ${val}`); 15 | } 16 | -------------------------------------------------------------------------------- /src/types/enums.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | declare const __brand: unique symbol; 6 | export type Unrecognized = T & { [__brand]: "unrecognized" }; 7 | 8 | export function catchUnrecognizedEnum(value: T): Unrecognized { 9 | return value as Unrecognized; 10 | } 11 | 12 | type Prettify = { [K in keyof T]: T[K] } & {}; 13 | export type ClosedEnum = T[keyof T]; 14 | export type OpenEnum = 15 | | Prettify 16 | | Unrecognized; 17 | -------------------------------------------------------------------------------- /src/types/fp.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | /** 6 | * A monad that captures the result of a function call or an error if it was not 7 | * successful. Railway programming, enabled by this type, can be a nicer 8 | * alternative to traditional exception throwing because it allows functions to 9 | * declare all _known_ errors with static types and then check for them 10 | * exhaustively in application code. Thrown exception have a type of `unknown` 11 | * and break out of regular control flow of programs making them harder to 12 | * inspect and more verbose work with due to try-catch blocks. 13 | */ 14 | export type Result = 15 | | { ok: true; value: T; error?: never } 16 | | { ok: false; value?: never; error: E }; 17 | 18 | export function OK(value: V): Result { 19 | return { ok: true, value }; 20 | } 21 | 22 | export function ERR(error: E): Result { 23 | return { ok: false, error }; 24 | } 25 | 26 | /** 27 | * unwrap is a convenience function for extracting a value from a result or 28 | * throwing if there was an error. 29 | */ 30 | export function unwrap(r: Result): T { 31 | if (!r.ok) { 32 | throw r.error; 33 | } 34 | return r.value; 35 | } 36 | 37 | /** 38 | * unwrapAsync is a convenience function for resolving a value from a Promise 39 | * of a result or rejecting if an error occurred. 40 | */ 41 | export async function unwrapAsync( 42 | pr: Promise>, 43 | ): Promise { 44 | const r = await pr; 45 | if (!r.ok) { 46 | throw r.error; 47 | } 48 | 49 | return r.value; 50 | } 51 | -------------------------------------------------------------------------------- /src/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export { blobLikeSchema, isBlobLike } from "./blobs.js"; 6 | export { catchUnrecognizedEnum } from "./enums.js"; 7 | export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; 8 | export type { Result } from "./fp.js"; 9 | export type { PageIterator, Paginator } from "./operations.js"; 10 | export { createPageIterator } from "./operations.js"; 11 | export { RFCDate } from "./rfcdate.js"; 12 | -------------------------------------------------------------------------------- /src/types/rfcdate.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | const dateRE = /^\d{4}-\d{2}-\d{2}$/; 6 | 7 | export class RFCDate { 8 | private serialized: string; 9 | 10 | /** 11 | * Creates a new RFCDate instance using today's date. 12 | */ 13 | static today(): RFCDate { 14 | return new RFCDate(new Date()); 15 | } 16 | 17 | /** 18 | * Creates a new RFCDate instance using the provided input. 19 | * If a string is used then in must be in the format YYYY-MM-DD. 20 | * 21 | * @param date A Date object or a date string in YYYY-MM-DD format 22 | * @example 23 | * new RFCDate("2022-01-01") 24 | * @example 25 | * new RFCDate(new Date()) 26 | */ 27 | constructor(date: Date | string) { 28 | if (typeof date === "string" && !dateRE.test(date)) { 29 | throw new RangeError( 30 | "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, 31 | ); 32 | } 33 | 34 | const value = new Date(date); 35 | if (isNaN(+value)) { 36 | throw new RangeError("RFCDate: invalid date provided: " + date); 37 | } 38 | 39 | this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); 40 | if (!dateRE.test(this.serialized)) { 41 | throw new TypeError( 42 | `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, 43 | ); 44 | } 45 | } 46 | 47 | toJSON(): string { 48 | return this.toString(); 49 | } 50 | 51 | toString(): string { 52 | return this.serialized; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/types/streams.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export function isReadableStream( 6 | val: unknown, 7 | ): val is ReadableStream { 8 | if (typeof val !== "object" || val === null) { 9 | return false; 10 | } 11 | 12 | // Check for the presence of methods specific to ReadableStream 13 | const stream = val as ReadableStream; 14 | 15 | // ReadableStream has methods like getReader, cancel, and tee 16 | return ( 17 | typeof stream.getReader === "function" && 18 | typeof stream.cancel === "function" && 19 | typeof stream.tee === "function" 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "incremental": true, 4 | "tsBuildInfoFile": ".tsbuildinfo", 5 | "target": "ES2020", 6 | "lib": ["ES2022", "DOM", "DOM.Iterable"], 7 | "jsx": "react-jsx", 8 | 9 | "module": "Node16", 10 | "moduleResolution": "Node16", 11 | 12 | "allowJs": true, 13 | 14 | "declaration": true, 15 | "declarationMap": true, 16 | "sourceMap": true, 17 | "outDir": ".", 18 | 19 | 20 | // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json 21 | "strict": true, 22 | "allowUnusedLabels": false, 23 | "allowUnreachableCode": false, 24 | "exactOptionalPropertyTypes": true, 25 | "useUnknownInCatchVariables": true, 26 | "noFallthroughCasesInSwitch": true, 27 | "noImplicitOverride": true, 28 | "noImplicitReturns": true, 29 | "noPropertyAccessFromIndexSignature": true, 30 | "noUncheckedIndexedAccess": true, 31 | "noUnusedLocals": true, 32 | "noUnusedParameters": true, 33 | "isolatedModules": true, 34 | "checkJs": true, 35 | "esModuleInterop": true, 36 | "skipLibCheck": true, 37 | "forceConsistentCasingInFileNames": true 38 | }, 39 | "include": ["src"], 40 | "exclude": ["node_modules"] 41 | } 42 | --------------------------------------------------------------------------------